RIOT-Makers / wpan-raspbian

Tools for a WPAN enabled Raspbian

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some questions about 6LoWPAN support on RPi

zmingshi opened this issue · comments

Hi,
I have some RPi-2-Bs, and I'm trying to enable the 6LoWPAN support using at86rf233. Based on Wiki page here, it says the file /boot/overlays/at86rf233-overlay.dtb could be found, but I cannot find it in my RPi. My raspbian is installed by NOOBS (v1.9.2). Why? and I'll have to do similar things like that with chip MRF24J40MA?

Also, the kernel version for my RPi is v4.4.11, what do you mean by the saying "Otherwise building your own Linux Kernel for the Pi is fully optional for Pi 1 and 2"? and why you have to build a custom Kernel v4.7.y for RPi3? For my RPi kernel, if I want to use the kernel v4.7.y, I'll should follow the guide given on new linux kernel configuration, right?

Thank you!

Hi @zmingshi,

I personally never used the NOOBS distro, I always flashed default Raspbian. The latter ships with the overlay for the Atmel at86rf233 found on the OpenLabs transceiver to the RasPi, so you can just activate in /boot/config.txt as described in the guide. If you have a MRF24j40MA transceiver you have to create the overlay yourself, because it is not shipped with Raspbian by default, and afterwards activate it in /boot/config.txt, too. You only have to activate one overlay, depending on the transceiver board you own - not both, this would likely result in a config clash for the SPI bus. Ah, and the overlay is named /boot/overlays/at86rf233.dtbo not .dtb, my fault.

Regarding the Kernel: for the new RasPi 3B you must compile a Kernel v4.7.y yourself, otherwise the transceiver is not working correctly, though it initialized and visible in after boot. For Pi 2B I haven't heard about any issues like that, but I did not test it personally. So if you say its not working, try to build a newer Kernel. This should work for any Pi version, even for Pi 1 B/B+ - but as stated in the guide, its optional for those.

Hi @smlng ,
Can I create a device by myself? As I have neither of the two device mentioned, I have some CC2500 transceiver. How can I modify the .dts file?

Hi @smlng ,
Thanks for you kind help, I really see at86rf233.dtbo in my Pi.
I also see you have made the change for at86rf233 overlay in guide page, but maybe you made a mistake, in the page I see "or /boot/overlays/at86rf233-overlay.dtbo", I think it should be "/boot/overlays/at86rf233.dtbo".

@zmingshi you are right the name is wrong, I'll correct. Thx!

@SoonSYJ, I'm not aware of any CC2500 directly compatible with the Pi. Do you have pointer to the device, i.e., data sheet and/or where to buy? That would be great to know!

What I used was a TI CC2531emk USB dongle, but as far as I know there is no nice driver for those. But you can do monitoring, that is sniff 802.15.4 traffic, with it, therefore I used some Python code ccsniffpiper.

@zmingshi did you get the transceiver working on your Pi 2B with Raspbian default Kernel (v.4.4) or do you build a custom Kernel (v4.7)?

@smlng , the transceiver seems not work with default kernel (v4.4) for me. For two Pis, I tried to configure wpan0 interface with wpan tool (same pan_id, same channel, different short_addr), and also configured lowpan0 interface, but both ping and wpan-ping were failed. So, I think maybe the kernel doesn't work.
Currently, I plan to try new kernel (v4.7), but the git clone process is slow, I'm waiting...
Maybe I can try to download zip file , right?

@zmingshi I don't know how large the ZIP file is?! If you use the git command in my guide you will only check out the 4.7.y branch and its latest (single) commit - I think this is as small as it gets.

Anyway, thanks for letting me know that PI 2B has also issue with default Kernel 4.4 - I'll verify that myself (I think I have a Pi2 myself somewhere around here 😄 ) and update my guide accordingly.

@smlng Ok, if you have different issues with PI 2B, or similar issue but could solve it to make the kernel v4.4 work, please let me know, thank you!

@zmingshi I finally got hands on my Pi 2B again and started testing - with surprising results.

  1. I started with an older Raspbian Image from early 2016 with Kernel 4.1.19+ , which worked to ping another Pi with the same transceiver.
  2. Afterwards I upgrade Raspbian (sudo apt update && sudo apt upgrade) bringing the system to Kernel v4.4.13+. Though the device/transceiver was still visible to the system, e.g., ifconfig showed wpan0 and lowpan0, but my pings never got any reply.
  3. I plugged in my SD-Card with a self-build Kernel 4.7.y - aaaand success: everything is working again.

TD;DR: old Raspbian with Kernel 4.1.19 works, current with v4.4.13 does not, self-build Kernel 4.7.y works! Conclusion: don't use latest default Raspbian, either an older release with Kernel 4.1 or compile one yourself.

So long, and thanks for all the fish ...

😁, cheers

@smlng, Yeah, I have tested with kernel 4.7.y yesterday, it really works as you said. I also have two RPi-1B, currently, they are using kernel 4.1 (I have used for some time), and they are working well now.

Also, I want to confirm with you that, for RPi-2B, the default spi-max-frequency for at86rf233 is 3000000, right? I check the at86rf233-overlay.dts in kernel v4.7.y, and it is 3000000, thank you!
Have a nice weekend!

@zmingshi: thx for reporting back and good to know that everything is working now for you. Btw. yes SPI frequency is 3 MHz by default in the Kernel, though explicitly setting in /boo/config.txt is not required at the moment, it doesn't hurt to do so anyway - just in case it may be different in some other Kernel version.

So it seems, I can close this issue?

@smlng, Ok, please close it. Thank you for your kind help!

You're welcome - and thanks again for testing on Pi 2B!

ACK and close