(Created page with "You've undoubtedly heard of the particular iPad at this point and also most likely grasp several folks which include 1. But yet just what is it, precisely, and why will need t...")
 
m (Using the Microchip IEEE 802.15.4 Radio on the BeagleBone Black)
 
(13 intermediate revisions by one user not shown)
Line 1: Line 1:
You've undoubtedly heard of the particular iPad at this point and also most likely grasp several folks which include 1. But yet just what is it, precisely, and why will need to you get you? Is actually it seriously worth the particular cost?
+
 
The particular iPad plus smart software happen to be becoming favored terms nowadays however in case you don't recognize precisely what they do originally the particular popularity of them will probably be completely lost on you. Well, your needs may well only be surprised at just how much easier they will create your existence with simply just a few clicks of a button.  
+
== Using the Microchip IEEE 802.15.4 Radio on the BeagleBone Black ==
Inside brief, the actual iPad itself is a bigger version of the particular iPod. Think of it because a larger iPod that us could store a pictures, music, files, as well as ebooks on. Or alternatively, when you'd like to be able to take it a step further, consider it in order to be a thinner, lighter laptop computer system. We come with the actual ability that would send e-mails, watch movies, create documents, plus access loads of apps on a device that's big enough in order to show lots of details nevertheless little enough to be advantageous to carry around.  
+
 
Should you have an iPod connector then you could attach your individual iPad to be able to a external keyboard, upload pictures from your own iPod, and even route videos to be able to your own HD TV. As soon as us charge it, you can certainly include 10 hours of incorporate, which is 3 times the actual amount which a little bit of laptops offer buyers. Which means anyone no longer include that would worry with regards to being entertained on long-haul flights.  
+
Beagle Bone Black with a Sure Electronics GP-GC500:<BR>
With the smart software, you could certainly come with availability that would nearly each and every application imaginable most notably GPS and in addition us can certainly edit plus create documents, currently have a calendar plus organizational assistant at hand, and in addition connect that would the internet even whenever anyone don't come with access in order to WiFi.  
+
http://wiki.beyondlogic.org/i/BeagleBoneBlack_MRF24J40.png
Whilst generally there usually are other devices out there which will certainly allow anyone that would do all the of these elements separately, the actual iPad is unique because it enables buyers that would perform all the of these actions throughout merely 1 device. The actual convenience is only among the things which sets it apart.  
+
 
Several persons currently have had trouble with smaller gadgets throughout the past because the particular text was too little plus the particular small size which created it advantageous originally was the fairly thing hindering their usage of it. But unfortunately, today us could certainly send a emails without wearing out your thumbs and in addition even read a entire novel without straining your individual eyes.
+
Custom made cape:<BR>
The longer which they are out, the particular more inexpensive they become. Within fact, the majority of everyone can afford specific presently. Although a person could have been reluctant to purchase specific within the past, after using it for a few of days and also playing about with just about all of the actual functions, you'll wonder how us were able to be able to dwell without it.  
+
http://wiki.beyondlogic.org/i/BeagleBoneBlack_MRF24J40_IEEE802154_6LOWPAN_CAPE.jpg
[http://www.google.com iPad]
+
 
 +
To load support for the Microchip MRF24J40 execute the following:
 +
 
 +
<PRE>
 +
#echo BB-BONE-MRF24J40 > /sys/devices/bone_capemgr.8/slots
 +
</PRE>
 +
 
 +
This should result in the following kernel debug messages:
 +
 
 +
<PRE>
 +
[  883.483409] bone-capemgr bone_capemgr.8: part_number 'BB-BONE-MRF24J40', version 'N/A'
 +
[  883.483585] bone-capemgr bone_capemgr.8: slot #6: specific override
 +
[  883.483660] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 6
 +
[  883.483716] bone-capemgr bone_capemgr.8: slot #6: 'Bone-MRF24J40,00A0,Signal 11 Softwa,BB-BONE-MRF24J40'
 +
[  883.484028] bone-capemgr bone_capemgr.8: slot #6: Requesting firmware 'cape-bone-mrf24j40-00A0.dtbo' for board-name 'Bone-MRF24J40', version '00A0'
 +
[  883.484113] bone-capemgr bone_capemgr.8: slot #6: dtbo 'cape-bone-mrf24j40-00A0.dtbo' loaded; converting to live tree
 +
[  883.484629] bone-capemgr bone_capemgr.8: slot #6: #2 overlays
 +
[  883.594180] edma-dma-engine edma-dma-engine.0: allocated channel for 0:43
 +
[  883.594350] edma-dma-engine edma-dma-engine.0: allocated channel for 0:42
 +
[  883.595019] mrf24j40: probe(). IRQ: 205
 +
[  883.599630] bone-capemgr bone_capemgr.8: slot #6: Applied #2 overlays.
 +
</PRE>
 +
 
 +
=== Kernel Patch Typo - Incompatible with baseboard ===
 +
 
 +
The current kernel patches has a typo in the /kernel/firmware/capes/cape-bone-mrf24j40-00A0.dts that may cause the cape manager to report it is incompatible with the baseboard. i.e.:
 +
 
 +
<PRE>
 +
[  417.682368] bone-capemgr bone_capemgr.8: slot #8: Requesting firmware 'cape-bone-mrf24j40-00A0.dtbo' for board-name 'Bone-MRF24J40', version '00A0'
 +
[  417.682392] bone-capemgr bone_capemgr.8: slot #8: dtbo 'cape-bone-mrf24j40-00A0.dtbo' loaded; converting to live tree
 +
[  417.682595] bone-capemgr bone_capemgr.8: slot #8: Incompatible with baseboard for 'BB-BONE-MRF24J40'
 +
[  417.692228] bone-capemgr bone_capemgr.8: slot #8: Failed verification
 +
</PRE>
 +
 
 +
If this is the case, change the following line
 +
 
 +
<PRE>
 +
compatible = "ti,beaglebone", "ti-beaglebone-black";
 +
</PRE>
 +
 
 +
to  
 +
 
 +
<PRE>
 +
compatible = "ti,beaglebone", "ti,beaglebone-black";
 +
</PRE>
 +
 
 +
and rebuild.
 +
 
 +
=== Unable to get IRQ ===
 +
 
 +
Device Tree support is gradually getting more mature. Changes were made after version 3.8 of the kernel that may result with the MRF24J40 driver being unable to get an IRQ, similar to that below:
 +
 
 +
<PRE>
 +
[  46.261282] edma-dma-engine edma-dma-engine.0: allocated channel for 0:43
 +
[  46.261342] edma-dma-engine edma-dma-engine.0: allocated channel for 0:42
 +
[  46.261755] mrf24j40: probe(). IRQ: 0
 +
[  46.266992] mrf24j40 spi1.0: Unable to get IRQ
 +
[  46.277735] mrf24j40: probe of spi1.0 failed with error -22
 +
[  46.280241] bone-capemgr bone_capemgr.6: slot #7: Applied #2 overlays.
 +
</PRE>
 +
 
 +
If this is the case change the following lines in /kernel/firmware/capes/cape-bone-mrf24j40-00A0.dts from
 +
 
 +
<PRE>
 +
interrupt-parent = <&gpio2>;
 +
interrupts = <29>;
 +
</PRE>
 +
 
 +
to
 +
 
 +
<PRE>
 +
#interrupt-cells = <2>;
 +
interrupt-parent = <&gpio1>;
 +
interrupts = <29 0x8>;
 +
</PRE>
 +
 
 +
Rebuild and then copy the .dtbo to the /lib/firmware path on your root filesystem.
 +
 
 +
<PRE>
 +
dtc -O dtb -o BB-BONE-MRF24J40-00A0.dtbo -b o -@ cape-bone-mrf24j40-00A0.dts
 +
</PRE>
 +
 
 +
=== I/O Conflict with HDMI ===
 +
 
 +
The MRF24J40 shares I/O (P9.31) with the HDMI Interface. If you don't disable the HDMI interface on boot (or unload it - glup), the following error may result:
 +
 
 +
<PRE>
 +
[  23.701229] bone-capemgr bone_capemgr.8: slot #7: Requesting firmware 'cape-bone-mrf24j40-00A0.dtbo' for board-name 'Bone-MRF24J40', version '00A0'
 +
[  23.715092] bone-capemgr bone_capemgr.8: slot #7: dtbo 'cape-bone-mrf24j40-00A0.dtbo' loaded; converting to live tree
 +
[  23.726858] bone-capemgr bone_capemgr.8: slot #7: BB-BONE-MRF24J40 conflict P9.31 (#5:BB-BONELT-HDMI)
 +
[  23.736629] bone-capemgr bone_capemgr.8: slot #7: Failed verification
 +
</PRE>
 +
 
 +
To disable the HDMI interface, see the example at the bottom of [[BeagleBoneBlack_Cape_Manager|this page]].
 +
 
 +
=== Programming the EEPROM on your Cape ===
 +
 
 +
The CAT24C256 EEPROM on the cape can be programmed with [http://wiki.beyondlogic.org/downloads/MRF24J40eeprom.tar.gz this prebuilt binary]
 +
 
 +
Assuming both DIP switches are off (Address 0x57) program your EEPROM:
 +
<PRE>
 +
wget http://wiki.beyondlogic.org/downloads/MRF24J40eeprom.tar.gz
 +
tar -xzf MRF24J40eeprom.tar.gz
 +
cat MRF24J40.eeprom > /sys/bus/i2c/drivers/at24/3-0057/eeprom
 +
</PRE>
 +
 
 +
The above EEPROM file was created using Ken Keller's mkeeprom.c utility program found at [http://azkeller.com/blog/?p=62| Adventures in BeagleBone Cape EEPROMs]
 +
 
 +
== Testing your MRF24J40 Hardware ==
 +
 
 +
The easiest way of testing your MRF24J40 interface hardware is using izchat to send simple text messages between two 802.15.4 interfaces. Izchat is part of the [[Cross_Compiling_Linux-Zigbee_for_ARM|Linux Zigbee User Space Tools]]
 +
 
 +
Device 1:
 +
<PRE>
 +
# echo BB-BONE-MRF24J40 > /sys/devices/bone_capemgr.9/slots
 +
# iz add wpan-phy0
 +
Registered new device ('wpan0') on phy wpan-phy0
 +
# iz set wpan0 777 8001 11
 +
# ifconfig wpan0 up
 +
# izchat 777 8001 8002
 +
> hello
 +
how are you?
 +
</PRE>
 +
 
 +
Device 2:
 +
<PRE>
 +
# echo BB-BONE-MRF24J40 > /sys/devices/bone_capemgr.9/slots
 +
# iz add wpan-phy0
 +
Registered new device ('wpan0') on phy wpan-phy0
 +
# iz set wpan0 777 8002 11
 +
# ifconfig wpan0 up
 +
# izchat 777 8002 8001
 +
hello
 +
> how are you?
 +
</PRE>
 +
 
 +
=== 6LoWPAN ===
 +
 
 +
Once your hardware has been verified, you can set up 6LoWPAN (IPv6 over Low power Wireless Personal Area Networks).
 +
 
 +
On Device 1 run:
 +
<PRE>
 +
iz add wpan-phy0
 +
ip link set wpan0 address a0:0:0:0:0:0:0:1
 +
iz set wpan0 777 8001 11
 +
ifconfig wpan0 up
 +
ip link add link  wpan0 name lowpan0 type lowpan
 +
ip link set lowpan0 address a0:0:0:0:0:0:0:1
 +
ifconfig lowpan0 up
 +
</PRE>
 +
 
 +
Device 2:
 +
<PRE>
 +
iz add wpan-phy0
 +
ip link set wpan0 address a0:0:0:0:0:0:0:2
 +
iz set wpan0 777 8002 11
 +
ifconfig wpan0 up
 +
ip link add link wpan0 name lowpan0 type lowpan
 +
ip link set lowpan0 address a0:0:0:0:0:0:0:2
 +
ifconfig lowpan0 up
 +
</PRE>
 +
 
 +
Once stacks are set up on both hosts, you can ping each other. From Device 1:
 +
 
 +
<PRE>
 +
root@beaglebone:~# ping6 fe80::a200:0:0:2%lowpan0
 +
PING fe80::a200:0:0:2%lowpan0 (fe80::a200:0:0:2%lowpan0): 56 data bytes
 +
64 bytes from fe80::a200:0:0:2: seq=0 ttl=64 time=21.200 ms
 +
64 bytes from fe80::a200:0:0:2: seq=1 ttl=64 time=10.748 ms
 +
64 bytes from fe80::a200:0:0:2: seq=2 ttl=64 time=9.459 ms
 +
64 bytes from fe80::a200:0:0:2: seq=3 ttl=64 time=11.259 ms
 +
64 bytes from fe80::a200:0:0:2: seq=4 ttl=64 time=17.628 ms
 +
64 bytes from fe80::a200:0:0:2: seq=5 ttl=64 time=10.599 ms
 +
64 bytes from fe80::a200:0:0:2: seq=6 ttl=64 time=13.174 ms
 +
64 bytes from fe80::a200:0:0:2: seq=7 ttl=64 time=12.962 ms
 +
64 bytes from fe80::a200:0:0:2: seq=8 ttl=64 time=9.473 ms
 +
64 bytes from fe80::a200:0:0:2: seq=9 ttl=64 time=10.595 ms
 +
</PRE>

Latest revision as of 03:42, 22 June 2014

Using the Microchip IEEE 802.15.4 Radio on the BeagleBone Black

Beagle Bone Black with a Sure Electronics GP-GC500:
BeagleBoneBlack_MRF24J40.png

Custom made cape:
BeagleBoneBlack_MRF24J40_IEEE802154_6LOWPAN_CAPE.jpg

To load support for the Microchip MRF24J40 execute the following:

#echo BB-BONE-MRF24J40 > /sys/devices/bone_capemgr.8/slots

This should result in the following kernel debug messages:

[  883.483409] bone-capemgr bone_capemgr.8: part_number 'BB-BONE-MRF24J40', version 'N/A'
[  883.483585] bone-capemgr bone_capemgr.8: slot #6: specific override
[  883.483660] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 6
[  883.483716] bone-capemgr bone_capemgr.8: slot #6: 'Bone-MRF24J40,00A0,Signal 11 Softwa,BB-BONE-MRF24J40'
[  883.484028] bone-capemgr bone_capemgr.8: slot #6: Requesting firmware 'cape-bone-mrf24j40-00A0.dtbo' for board-name 'Bone-MRF24J40', version '00A0'
[  883.484113] bone-capemgr bone_capemgr.8: slot #6: dtbo 'cape-bone-mrf24j40-00A0.dtbo' loaded; converting to live tree
[  883.484629] bone-capemgr bone_capemgr.8: slot #6: #2 overlays
[  883.594180] edma-dma-engine edma-dma-engine.0: allocated channel for 0:43
[  883.594350] edma-dma-engine edma-dma-engine.0: allocated channel for 0:42
[  883.595019] mrf24j40: probe(). IRQ: 205
[  883.599630] bone-capemgr bone_capemgr.8: slot #6: Applied #2 overlays.

Kernel Patch Typo - Incompatible with baseboard

The current kernel patches has a typo in the /kernel/firmware/capes/cape-bone-mrf24j40-00A0.dts that may cause the cape manager to report it is incompatible with the baseboard. i.e.:

[  417.682368] bone-capemgr bone_capemgr.8: slot #8: Requesting firmware 'cape-bone-mrf24j40-00A0.dtbo' for board-name 'Bone-MRF24J40', version '00A0'
[  417.682392] bone-capemgr bone_capemgr.8: slot #8: dtbo 'cape-bone-mrf24j40-00A0.dtbo' loaded; converting to live tree
[  417.682595] bone-capemgr bone_capemgr.8: slot #8: Incompatible with baseboard for 'BB-BONE-MRF24J40'
[  417.692228] bone-capemgr bone_capemgr.8: slot #8: Failed verification 

If this is the case, change the following line

compatible = "ti,beaglebone", "ti-beaglebone-black";

to

compatible = "ti,beaglebone", "ti,beaglebone-black"; 

and rebuild.

Unable to get IRQ

Device Tree support is gradually getting more mature. Changes were made after version 3.8 of the kernel that may result with the MRF24J40 driver being unable to get an IRQ, similar to that below:

[   46.261282] edma-dma-engine edma-dma-engine.0: allocated channel for 0:43
[   46.261342] edma-dma-engine edma-dma-engine.0: allocated channel for 0:42
[   46.261755] mrf24j40: probe(). IRQ: 0
[   46.266992] mrf24j40 spi1.0: Unable to get IRQ
[   46.277735] mrf24j40: probe of spi1.0 failed with error -22
[   46.280241] bone-capemgr bone_capemgr.6: slot #7: Applied #2 overlays.

If this is the case change the following lines in /kernel/firmware/capes/cape-bone-mrf24j40-00A0.dts from

interrupt-parent = <&gpio2>;
interrupts = <29>;

to

#interrupt-cells = <2>;
interrupt-parent = <&gpio1>;
interrupts = <29 0x8>;

Rebuild and then copy the .dtbo to the /lib/firmware path on your root filesystem.

dtc -O dtb -o BB-BONE-MRF24J40-00A0.dtbo -b o -@ cape-bone-mrf24j40-00A0.dts

I/O Conflict with HDMI

The MRF24J40 shares I/O (P9.31) with the HDMI Interface. If you don't disable the HDMI interface on boot (or unload it - glup), the following error may result:

[   23.701229] bone-capemgr bone_capemgr.8: slot #7: Requesting firmware 'cape-bone-mrf24j40-00A0.dtbo' for board-name 'Bone-MRF24J40', version '00A0'
[   23.715092] bone-capemgr bone_capemgr.8: slot #7: dtbo 'cape-bone-mrf24j40-00A0.dtbo' loaded; converting to live tree
[   23.726858] bone-capemgr bone_capemgr.8: slot #7: BB-BONE-MRF24J40 conflict P9.31 (#5:BB-BONELT-HDMI)
[   23.736629] bone-capemgr bone_capemgr.8: slot #7: Failed verification

To disable the HDMI interface, see the example at the bottom of this page.

Programming the EEPROM on your Cape

The CAT24C256 EEPROM on the cape can be programmed with this prebuilt binary

Assuming both DIP switches are off (Address 0x57) program your EEPROM:

wget http://wiki.beyondlogic.org/downloads/MRF24J40eeprom.tar.gz
tar -xzf MRF24J40eeprom.tar.gz
cat MRF24J40.eeprom > /sys/bus/i2c/drivers/at24/3-0057/eeprom

The above EEPROM file was created using Ken Keller's mkeeprom.c utility program found at Adventures in BeagleBone Cape EEPROMs

Testing your MRF24J40 Hardware

The easiest way of testing your MRF24J40 interface hardware is using izchat to send simple text messages between two 802.15.4 interfaces. Izchat is part of the Linux Zigbee User Space Tools

Device 1:

# echo BB-BONE-MRF24J40 > /sys/devices/bone_capemgr.9/slots
# iz add wpan-phy0
Registered new device ('wpan0') on phy wpan-phy0
# iz set wpan0 777 8001 11
# ifconfig wpan0 up
# izchat 777 8001 8002
> hello
how are you?

Device 2:

# echo BB-BONE-MRF24J40 > /sys/devices/bone_capemgr.9/slots
# iz add wpan-phy0
Registered new device ('wpan0') on phy wpan-phy0
# iz set wpan0 777 8002 11
# ifconfig wpan0 up
# izchat 777 8002 8001
hello
> how are you?

6LoWPAN

Once your hardware has been verified, you can set up 6LoWPAN (IPv6 over Low power Wireless Personal Area Networks).

On Device 1 run:

iz add wpan-phy0
ip link set wpan0 address a0:0:0:0:0:0:0:1
iz set wpan0 777 8001 11
ifconfig wpan0 up
ip link add link  wpan0 name lowpan0 type lowpan
ip link set lowpan0 address a0:0:0:0:0:0:0:1
ifconfig lowpan0 up

Device 2:

iz add wpan-phy0
ip link set wpan0 address a0:0:0:0:0:0:0:2
iz set wpan0 777 8002 11
ifconfig wpan0 up
ip link add link wpan0 name lowpan0 type lowpan
ip link set lowpan0 address a0:0:0:0:0:0:0:2
ifconfig lowpan0 up

Once stacks are set up on both hosts, you can ping each other. From Device 1:

root@beaglebone:~# ping6 fe80::a200:0:0:2%lowpan0
PING fe80::a200:0:0:2%lowpan0 (fe80::a200:0:0:2%lowpan0): 56 data bytes
64 bytes from fe80::a200:0:0:2: seq=0 ttl=64 time=21.200 ms
64 bytes from fe80::a200:0:0:2: seq=1 ttl=64 time=10.748 ms
64 bytes from fe80::a200:0:0:2: seq=2 ttl=64 time=9.459 ms
64 bytes from fe80::a200:0:0:2: seq=3 ttl=64 time=11.259 ms
64 bytes from fe80::a200:0:0:2: seq=4 ttl=64 time=17.628 ms
64 bytes from fe80::a200:0:0:2: seq=5 ttl=64 time=10.599 ms
64 bytes from fe80::a200:0:0:2: seq=6 ttl=64 time=13.174 ms
64 bytes from fe80::a200:0:0:2: seq=7 ttl=64 time=12.962 ms
64 bytes from fe80::a200:0:0:2: seq=8 ttl=64 time=9.473 ms
64 bytes from fe80::a200:0:0:2: seq=9 ttl=64 time=10.595 ms