[6LoWPAN] MQTT-SN and Contiki-OS / Part 2


This is a second part of this post, if you haven't seen the first part, just go and read before understand this. As I promise, this is the second part where I'll show how to deploy the MQTT-SN with a real example devices.

CC2650 Launchpad

I have designed a custom board that uses CC2650 as the main target in a 6LoWPAN network, but this board is a little complex to programming because I'm without my batteries, then for this reason I'll use the CC2650 launchpad.

This boards are very good to work because has all integrated (cc-converter, programmer, debug pins), you just connect to the computer and it's ready to start coding. To use this, or any kind of MCU with MQTT-SN API, you'll need the malloc function to preserve some initial memory for the stack functions that operates the FSM (Finite State Machine). The problem is that we don't have indicated in the linker script of CC26xx how much heap we have for this operation, so we need to indicate where to start and end space, so add this code into cc26xx.ld(cpu/cc26xx-cc13xx/) before the final brace:

   _heap = .; 
   _eheap = ORIGIN(SRAM) + LENGTH(SRAM); 

If you're not using CC26xx or CC13xx devices maybe this will not be a problem.

The topology that I'll use is this:
Once ready, just recompile the same code that've used in the first part of this tutorial for the Z1 as the main target:

make TARGET=srf06-cc26xx clean
make TARGET=srf06-cc26xx all
#After run the slip connection with this commands
sudo ./tunslip6 -s /dev/ttyACM0 aaaa::1/64

After generated the bin files, you can flash with TI Smart Flash Programmer or uniflash and test into the device. I made a video showing this setup working directly with my devices and the RSMB broker (the same used in the part 1).

When ready, I subscribed to my broker to see this:

If you have any troubles with the CC2650 programming with uniflash, try to download
this version web for Linux and install these dependencies:

sudo apt-get install libgtk2.0-0:i386 libcanberra-gtk0:i386 libdbus-glib-1-2:i386 libgconf-2-4:i386 liborbit-2-0:i386 libusb-0.1-4:i386 libgnomevfs2-0:i386 libice6:i386 libncurses5:i386 libsm6:i386 libxtst6:i386 libxt6:i386 libasound2:i386 libgcrypt11:i386 libudev0:i386 -y
ln -siT libudev.so.1 /lib/i386-linux-gnu/libudev.so.0

For more information about Linux dependencies check this website .

[6LoWPAN] MQTT-SN and Contiki-OS / Part 2
Share this

Subscribe to @aignacio's