Raspberry Pi 3 and packet sniffing

Hi,

I know this doesn't have anything to do with RIOT in particular, but since I know some of you are using the radio in question I thought I'd ask here.

For testing I've been using a RPi 2 with Openlabs' 802.15.4 radio[1], which was relatively easy to get working with Wireshark. The Pi recently destroyed my SD card however, including all the config I'd done to set it up, so I figured I'd start from scratch with an RPi 3. I can't seem to get it working this time though, and I was just wondering if anyone else had managed to use the RPi 3 with this radio for packet sniffing? I can't think of any reason why it shouldn't work, but although the radio is detected properly and is able to be manipulated using 'iwpan', it never sees any packets (although I know the packets are being sent correctly, because I can sniff them with another RIOT node).

So, before I start blaming the hardware, I thought I'd ask - has anyone else managed to do this successfully on the RPi 3 with raspbian?

Cheers, Aaron

[1] http://openlabs.co/store/Raspberry-Pi-802.15.4-radio

Hey Aaron,

For testing I've been using a RPi 2 with Openlabs' 802.15.4 radio[1], which was relatively easy to get working with Wireshark. The Pi recently destroyed my SD card however, including all the config I'd done to set it up, so I figured I'd start from scratch with an RPi 3. I can't seem to get it working this time though, and I was just wondering if anyone else had managed to use the RPi 3 with this radio for packet sniffing? I can't think of any reason why it shouldn't work, but although the radio is detected properly and is able to be manipulated using 'iwpan', it never sees any packets (although I know the packets are being sent correctly, because I can sniff them with another RIOT node).

So, before I start blaming the hardware, I thought I'd ask - has anyone else managed to do this successfully on the RPi 3 with raspbian?

I personally use the RasPi as a border router and gateway with the openlabs transceiver. Unfortunately I haven't had the time to test with the new RasPi 3B, yet.

This would be bad news, if my favorite setup isn't working with Pi3 anymore. I just ordered a Pi3 myself and will start testing next week, I'll report back ASAP.

I assume you use latest Raspbian-Linux, with standard Kernel 4.4 and DTS overlay [1] or a custom (self-compiled) Linux-Kernel based on bluetooth-next (btn) branch?

Best,   Sebastian

Hey again,

I forgot the pointer to [1]: https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support#31-transceiver-specific-device-tree-overlays

Best,   Sebastian

Hi,

Hi,

I know this doesn't have anything to do with RIOT in particular, but since I know some of you are using the radio in question I thought I'd ask here.

For testing I've been using a RPi 2 with Openlabs' 802.15.4 radio[1], which was relatively easy to get working with Wireshark. The Pi recently destroyed my SD card however, including all the config I'd done to set it up, so I figured I'd start from scratch with an RPi 3. I can't seem to get it working this time though, and I was just wondering if anyone else had managed to use the RPi 3 with this radio for packet sniffing? I can't think of any reason why it shouldn't work, but although the radio is detected properly and is able to be manipulated using 'iwpan', it never sees any packets (although I know the packets are being sent correctly, because I can sniff them with another RIOT node).

Sounds like issue [0]. This patch was not sent back to stable since we don't have any stable strategy, sorry.

Anyway the most workaround for this issue is to change the channel/page when the wpan/monitor on the phy is "up" - then the phy doesn't go into sleep state.

On RPi1 I never had such issue, but the RPi2/RPi3 seems to be faster and then such race occur (Setting registers while sleeping - which does not work on at86rf2xx). :frowning:

- Alex

[0] at86rf230: increase sleep to off timings - kernel/git/bluetooth/bluetooth-next.git - Bluetooth kernel development tree

Hi Sebastian, Alexander,

Thanks for the feedback. I'm using the latest Raspbian which already has the relevant DTS overlay and kernel features available. Basically all I've done is add/uncomment the following lines in /boot/config.txt, and reboot:

dtoverlay=at86rf233 dtparam=spi=on

I then set up the monitor interface (after compiling wpan-tools) with:

sudo iwpan phy phy0 interface add monitor0 type monitor sudo ip link set monitor0 up sudo iwpan phy phy0 set channel 0 <channel_no>

This was sufficient on the RPi 2 for running wireshark against monitor0. I am getting some very strange behaviour now where maybe once every 5 or 6 reboots the radio suddenly starts producing garbage data whenever a packet is received, but rebooting results in the radio going silent again. I've tried different SPI speeds, different channels, different at86rf233 chips, even disabled the other two radios (bluetooth and 802.11) to eliminate possible sources of interference, but I'm left scratching my head. I wonder if my Pi is faulty, or if there is some fundamental difference between v2 and v3... it would be interesting to hear how you get on Sebastian!

Alex - since I'm doing the channel setting after bringing the monitor0 interface up, I shouldn't be affected by that bug right? Note that the automatically-created wpan0 interface never gets brought up.

Regards, Aaron

Hi Aaron,

you say you receive garbled packets? Sounds like an issue I also had, I fixed it by lowering SPI speed from the default 5 or 6 MHz to 3 MHz, however I thought the latter is now default anyway (@Alex?). I have to look it up, but may you can try some other values like 1 or 2 MHz?

So edit `/boot/config.txt` setting `dtoverlay=at86rf233,speed=1000000` and reboot.

Cheers,   Sebastian

Hi,

Yeah I tried a few different speeds with no luck - according to the docs the default is now 3 MHz anyway. If I could at least get garbled packets *consistently* this would be a step in the right direction, but the fact that it's sporadic makes debugging things rather difficult...

/Aaron

Hi,

Hi,

Yeah I tried a few different speeds with no luck - according to the docs the default is now 3 MHz anyway. If I could at least get garbled packets *consistently* this would be a step in the right direction, but the fact that it's sporadic makes debugging things rather difficult...

there was one guy @#linux-wpan channel which had similar issues on RPi2 or RPi3? and he fixed it by using the mainline kernel _NOT_ rpi kernel.

I never used myself the rpi kernel for RPi2 so I can't say if this is broken or not.

Maybe you have the chance to build a recent mainline kernel from kernel.org. I don't know the RPi3 support, fast googling result into [0], which seems to be available at "git://git.kraxel.org/linux bcm2837".

- Alex

[0] [PATCH 00/32] raspberry pi 3 patch series

Hi Aaron, Hi Alex,

first I can confirm that with latest default Raspbian and Kernel 4.4.* I saw nothing with wireshark, though the interface was up and running, no error in dmesg or anything.

However, I just compiled a Kernel v4.7.y following my guide in [1], and it works! I sniffed traffic between another RasPi (1 B+) and some RIOT nodes and was also able to ping the other RasPi.

@Aaron: Could you test/verify this using the newer Kernel, thanks!

Best   Sebastian

[1]: https://github.com/RIOT-Makers/wpan-raspbian/wiki/Create-a-generic-Raspbian-image-with-6LoWPAN-support#4-new-linux-kernels-for-the-pi

Hi Sebastian,

Nice! Great instructions btw - I can verify that after compiling and installing the more recent kernel for Raspbian I am successfully sniffing packets again. Thanks a lot for your help.

Regards, Aaron