/ 6LoWPAN

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

Warning

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:
toplogy_6lowpan
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

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

6lowpan_mqtt_sn_recompiling
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:

broker_subscribe

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

Subscribe to @aignacio's