This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

cc26xx-web-demo MQTT how to

Hi,

I need some help with setup of MQTT.

I have sensortagCC2650 as motes, running Contiki  cc26xx-web-demo with 6lbr edge router on RPi

and Mosquito broker running locally on RPi

I set Broker IP to ::1 (see the picture below) - is it correct?

The sensortag mote is trying to connect to the broker (see the terminal output on the picture below), but it doesn't happen.

What am I doing wrong? How to make the mote publish to the broker?

Jan

  • Hello again,

    I am able to connect now using local Mosquitto broker and transfer data to the network using Node-Red.

    If anyone is interested in Node-Red flow for that I can share it.

    The problem I have is to separate data published from more the one MQTT clients as MQTT operates on topics rather than IDs.

    Can anyone advice how to do it?

    Jan

  • Hello Jan,

    Apologies for the delay, please be patient as I notify our Contiki MQTT expert to address this issue.

    Regards,
    Ryan
  • Hi jan2809,

    Sorry for late answer,

    Feel free to share your Node-Red flow either way, would probably be appreciated by future readers.

    I'm not sure I understand your problem. Could you elaborate?
  • [{"id":"b7f59b4e.536","type":"mqtt in","z":"b7d812d4.181a7","name":"MQTT_demo","topic":"#","qos":"2","broker":"72734b46.faa50c","x":130,"y":280,"wires":[["f843bc6c.e03f5"]]},{"id":"69cbdbd.552cc24","type":"debug","z":"b7d812d4.181a7","name":"","active":false,"console":true,"complete":"payload","x":440,"y":240,"wires":[]},{"id":"f843bc6c.e03f5","type":"json","z":"b7d812d4.181a7","name":"","pretty":false,"x":270,"y":280,"wires":[["c01e6190.39fa98","69cbdbd.552cc24","1902d0a9.dc4f27","a868b788.4c1e58","41334ec.6a8b0b","7d634019.d29d1","5f3a3ff2.452728","f5f6caa4.e0f71","4771c10d.26436"]]},{"id":"308b347.15cb74c","type":"debug","z":"b7d812d4.181a7","name":"","active":true,"console":true,"complete":"payload","x":680,"y":240,"wires":[]},{"id":"c01e6190.39fa98","type":"function","z":"b7d812d4.181a7","name":"ADC DIO23 (mV)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"ADC DIO23 (mV)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":450,"y":280,"wires":[["308b347.15cb74c","ec35b17e.7b7d2"]]},{"id":"992aa7f0.eba36","type":"exec","z":"b7d812d4.181a7","command":"service 6lbr start && service 6lbr status","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"6lbr service","x":310,"y":60,"wires":[["9252026f.047e68"],[],[]]},{"id":"2157bebf.5f8ae2","type":"inject","z":"b7d812d4.181a7","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"x":150,"y":60,"wires":[["992aa7f0.eba36"]]},{"id":"9252026f.047e68","type":"debug","z":"b7d812d4.181a7","name":"","active":true,"console":true,"complete":"payload","x":500,"y":40,"wires":[]},{"id":"f714628.07f6ba","type":"exec","z":"b7d812d4.181a7","command":"sudo route -A inet6 add aaaa::/64 gw bbbb::100","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"add routes","x":310,"y":120,"wires":[["643604c4.0cfd14"],[],[]]},{"id":"67326de8.07b8e4","type":"inject","z":"b7d812d4.181a7","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"x":150,"y":120,"wires":[["f714628.07f6ba"]]},{"id":"643604c4.0cfd14","type":"debug","z":"b7d812d4.181a7","name":"","active":true,"console":true,"complete":"payload","x":500,"y":100,"wires":[]},{"id":"f19a3bd0.10d308","type":"exec","z":"b7d812d4.181a7","command":"sudo ip -6 addr add bbbb::101/64 dev tap0","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"add routes","x":310,"y":180,"wires":[["1712b58.902ac4b"],[],[]]},{"id":"ea83a65d.5fdb2","type":"inject","z":"b7d812d4.181a7","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"x":150,"y":180,"wires":[["f19a3bd0.10d308"]]},{"id":"1712b58.902ac4b","type":"debug","z":"b7d812d4.181a7","name":"","active":true,"console":true,"complete":"payload","x":500,"y":160,"wires":[]},{"id":"ec35b17e.7b7d2","type":"ui_chart","z":"b7d812d4.181a7","name":"ADC DIO23","group":"ac191a69.bf6448","order":0,"width":0,"height":0,"label":"ADC DIO23","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":670,"y":280,"wires":[[],[]]},{"id":"1902d0a9.dc4f27","type":"function","z":"b7d812d4.181a7","name":"HDC Humidity (%RH)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"HDC Humidity (%RH)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":460,"y":320,"wires":[["ef1a7577.cc555"]]},{"id":"ef1a7577.cc555","type":"ui_chart","z":"b7d812d4.181a7","name":"HDC Humidity","group":"ac191a69.bf6448","order":0,"width":0,"height":0,"label":"HDC Humidity","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":680,"y":320,"wires":[[],[]]},{"id":"a868b788.4c1e58","type":"function","z":"b7d812d4.181a7","name":"HDC Temp (C)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"HDC Temp (C)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":440,"y":360,"wires":[["f0353452.5fb12"]]},{"id":"f0353452.5fb12","type":"ui_chart","z":"b7d812d4.181a7","name":"HDC Temp","group":"ac191a69.bf6448","order":0,"width":0,"height":0,"label":"HDC Temp","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":670,"y":360,"wires":[[],[]]},{"id":"41334ec.6a8b0b","type":"function","z":"b7d812d4.181a7","name":"Air Pressure (hPa)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"Air Pressure (hPa)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":450,"y":400,"wires":[["fadb534d.a35ae8"]]},{"id":"fadb534d.a35ae8","type":"ui_chart","z":"b7d812d4.181a7","name":"Air Pressure","group":"ac191a69.bf6448","order":0,"width":0,"height":0,"label":"Air Pressure","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":670,"y":400,"wires":[[],[]]},{"id":"7d634019.d29d1","type":"function","z":"b7d812d4.181a7","name":"Light (lux)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"Light (lux)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":420,"y":440,"wires":[["d88c1e70.60f658"]]},{"id":"d88c1e70.60f658","type":"ui_chart","z":"b7d812d4.181a7","name":"Light","group":"ac191a69.bf6448","order":0,"width":0,"height":0,"label":"Light","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":630,"y":440,"wires":[[],[]]},{"id":"5f3a3ff2.452728","type":"function","z":"b7d812d4.181a7","name":"Uptime (sec)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"Uptime (sec)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":430,"y":520,"wires":[["50aa6692.75abc"]]},{"id":"50aa6692.75abc","type":"ui_numeric","z":"b7d812d4.181a7","name":"Uptime","label":"Uptime (sec)","group":"db70a2a3.05ae68","order":1,"width":0,"height":0,"passthru":true,"topic":"","format":"{{value}}","min":0,"max":10,"step":1,"x":600,"y":520,"wires":[[]]},{"id":"f5f6caa4.e0f71","type":"function","z":"b7d812d4.181a7","name":"RSSI (dBm)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"RSSI (dBm)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":430,"y":560,"wires":[["f107e717.b37fb8"]]},{"id":"f107e717.b37fb8","type":"ui_gauge","z":"b7d812d4.181a7","name":"RSSI (dBm)","group":"db70a2a3.05ae68","order":3,"width":0,"height":0,"gtype":"gage","title":"RSSI (dBm)","label":"units","format":"{{value}}","min":"-100","max":"0","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":620,"y":560,"wires":[]},{"id":"4771c10d.26436","type":"function","z":"b7d812d4.181a7","name":"Seq #","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"Seq #\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":410,"y":600,"wires":[["eac35d69.8454d8"]]},{"id":"eac35d69.8454d8","type":"ui_numeric","z":"b7d812d4.181a7","name":"Seq #","label":"Seq #","group":"db70a2a3.05ae68","order":2,"width":0,"height":0,"passthru":true,"topic":"","format":"{{value}}","min":0,"max":10,"step":1,"x":590,"y":600,"wires":[[]]},{"id":"72734b46.faa50c","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"ac191a69.bf6448","type":"ui_group","z":"","name":"Charts","tab":"63c23794.83c2f","disp":true,"width":"12"},{"id":"db70a2a3.05ae68","type":"ui_group","z":"","name":"Extra Info","tab":"63c23794.83c2f","disp":true,"width":"6"},{"id":"63c23794.83c2f","type":"ui_tab","z":"","name":"MQTT demo ","icon":"dashboard"}]

  • thanks, waiting for help
  • Sorry jan2809 for late replies.

    Could you please elaborate on what you are trying to achieve? What do you mean by separating data published from MQTT clients?
  • Hi Edward,

    MQTT is a publish-subscribe protocol, where publishers (Contiki motes in our example od CC26xx-web-demo) send informations to
    a broker and clients can subscribe to a topic. With the example CC26xx-web-demo I have the following problem:
    It is impossible (or I don't know how) for client/subscriber what is the mote ID sending messages on topic

    Jan
  • sorry for the typo, it should be ... It is impossible (or I don't know how) for client/subscriber to know what is the mote ID sending messages on topic
    as well I asked the question on Github asking for help, but sadly no reply so far
    looks like TI has stopped supporting Contiki ???
    github.com/.../2462
  • jan2809,

    I don't understand what you mean by mote ID. Can you clearify?

    Contiki-OS (what you are using) is no longer actively maintained by the community and supported by TI. Our main focus is Contiki-NG (Next Generation), which is both actively maintained by the community and supported by TI. I highly suggest to take a look.

    https://github.com/contiki-ng/contiki-ng 

  • I mean the mote IPv6 address or any other form of identification. I will have a look at Contki-NG again, but my previous experience

    wasn't encouraging - not compatible with old Contiki, difficult setup for edge route, no working examples for TI targets, etc.

    The documentation taken from old Contiki is inaccurate, often misleading or not updated 

  • Ok, so if I understand you correctly you are asking how any MQTT clients would be able to find and know the ip address of the MQTT broker of your Contiki network?
  • not the ip address of MQTT broker, but the ip address of  the publisher

  • So if you want a MQTT client to know the IP address of the publisher of a given topic, then the MQTT is not the correct protocol to use. The whole concept of MQTT is to decouple publishers and subscribers.

    If you still need the IP address, you could for instance embed the IP address in the content of the topic that is published by the publisher.
  • Imagine the Contiki network of N motes of of them publishing temperature sensor data to the broker.

    The subscriber to temperature topic receives a junk sum of data practically useles 

    The given example uses only a single mote, hardly a network and that is dissapointing.

    Anyhow, thanks for you time and effort.

    I click resoved only for a reason to improve your statistics.

    Cheers, Jan

  • I am try to connect to cc26xx-web-demo mqtt to my mosquitto server running locally on my Raspberry Pi. Can you elaborate the steps you made this work and what broker IP do you use?
  • Thanks for sharing the document. So, you don't run mosquitto on Raspberry Pi which running 6lbr, right?
  • I do run mosquitto and 6lbr on RPi, but as well some of our students run RPi VM (Virtual Machine) using VMware on desktop PC instead of real RPi, so the tutorial is for both options. Sorry it might be misleading
  • [{"id":"87a216ab.2dd9e8","type":"mqtt in","z":"a7880d9c.7ed6e8","name":"MQTT_demo","topic":"#","qos":"2","broker":"b1a91835.6d9088","x":121.19999694824219,"y":266,"wires":[["c1ca05a1.fe283"]]},{"id":"df85994b.08d908","type":"debug","z":"a7880d9c.7ed6e8","name":"","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","x":431.1999969482422,"y":226,"wires":[]},{"id":"c1ca05a1.fe283","type":"json","z":"a7880d9c.7ed6e8","name":"","pretty":false,"x":261.1999969482422,"y":266,"wires":[["a67506b0.0819e","df85994b.08d908","c85dcf38.e503e8","6cbe579d.19c5","40be40c4.f88f58","2827fa25.91961e","1161ab26.03aaad","9f6d2912.7cb4a8","39c23a4d.cb4266"]]},{"id":"b7691c20.f2fe38","type":"debug","z":"a7880d9c.7ed6e8","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","x":671.1999969482422,"y":226,"wires":[]},{"id":"a67506b0.0819e","type":"function","z":"a7880d9c.7ed6e8","name":"ADC DIO23 (mV)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"ADC DIO23 (mV)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":441.1999969482422,"y":266,"wires":[["b7691c20.f2fe38","fb3c0e4d.c1a7b"]]},{"id":"fbdf772b.82c1f","type":"exec","z":"a7880d9c.7ed6e8","command":"service 6lbr start && service 6lbr status","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"6lbr service","x":301.1999969482422,"y":46,"wires":[["7065a090.c17158"],[],[]]},{"id":"feb0a4c7.b8e758","type":"inject","z":"a7880d9c.7ed6e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"","x":141.1999969482422,"y":46,"wires":[["fbdf772b.82c1f"]]},{"id":"7065a090.c17158","type":"debug","z":"a7880d9c.7ed6e8","name":"","active":true,"tosidebar":true,"console":true,"complete":"payload","x":491.1999969482422,"y":26,"wires":[]},{"id":"d6b2ffb.7b0e6","type":"exec","z":"a7880d9c.7ed6e8","command":"sudo route -A inet6 add aaaa::/64 gw bbbb::100","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"add routes","x":301.1999969482422,"y":106,"wires":[["43de8b40.832a54"],[],[]]},{"id":"554a2b9a.3e13a4","type":"inject","z":"a7880d9c.7ed6e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"","x":141.1999969482422,"y":106,"wires":[["d6b2ffb.7b0e6"]]},{"id":"43de8b40.832a54","type":"debug","z":"a7880d9c.7ed6e8","name":"","active":true,"tosidebar":true,"console":true,"complete":"payload","x":491.1999969482422,"y":86,"wires":[]},{"id":"fb7c2ab7.8e2418","type":"exec","z":"a7880d9c.7ed6e8","command":"sudo ip -6 addr add bbbb::101/64 dev tap0","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"add routes","x":301.1999969482422,"y":166,"wires":[["6f0e439c.746a6c"],[],[]]},{"id":"158c9abd.44e7ed","type":"inject","z":"a7880d9c.7ed6e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"","x":141.1999969482422,"y":166,"wires":[["fb7c2ab7.8e2418"]]},{"id":"6f0e439c.746a6c","type":"debug","z":"a7880d9c.7ed6e8","name":"","active":true,"tosidebar":true,"console":true,"complete":"payload","x":491.1999969482422,"y":146,"wires":[]},{"id":"fb3c0e4d.c1a7b","type":"ui_chart","z":"a7880d9c.7ed6e8","name":"ADC DIO23","group":"50b6cfad.aa1d28","order":0,"width":0,"height":0,"label":"ADC DIO23","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":661.1999969482422,"y":266,"wires":[[],[]]},{"id":"c85dcf38.e503e8","type":"function","z":"a7880d9c.7ed6e8","name":"HDC Humidity (%RH)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"HDC Humidity (%RH)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":451.1999969482422,"y":306,"wires":[["971ac0be.41ecb"]]},{"id":"971ac0be.41ecb","type":"ui_chart","z":"a7880d9c.7ed6e8","name":"HDC Humidity","group":"50b6cfad.aa1d28","order":0,"width":0,"height":0,"label":"HDC Humidity","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":671.1999969482422,"y":306,"wires":[[],[]]},{"id":"6cbe579d.19c5","type":"function","z":"a7880d9c.7ed6e8","name":"HDC Temp (C)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"HDC Temp (C\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":431.1999969482422,"y":346,"wires":[["768dc66a.b48a3"]]},{"id":"768dc66a.b48a3","type":"ui_chart","z":"a7880d9c.7ed6e8","name":"HDC Temp","group":"50b6cfad.aa1d28","order":0,"width":0,"height":0,"label":"HDC Temp","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":661.1999969482422,"y":346,"wires":[[],[]]},{"id":"40be40c4.f88f58","type":"function","z":"a7880d9c.7ed6e8","name":"Air Pressure (hPa)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"Air Pressure (hPa)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":441.1999969482422,"y":386,"wires":[["1756ec22.62b1b4"]]},{"id":"1756ec22.62b1b4","type":"ui_chart","z":"a7880d9c.7ed6e8","name":"Air Pressure","group":"50b6cfad.aa1d28","order":0,"width":0,"height":0,"label":"Air Pressure","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":661.1999969482422,"y":386,"wires":[[],[]]},{"id":"2827fa25.91961e","type":"function","z":"a7880d9c.7ed6e8","name":"Light (lux)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"Light (lux)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":411.1999969482422,"y":426,"wires":[["6d6a5ff7.bf9bd"]]},{"id":"6d6a5ff7.bf9bd","type":"ui_chart","z":"a7880d9c.7ed6e8","name":"Light","group":"50b6cfad.aa1d28","order":0,"width":0,"height":0,"label":"Light","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":621.1999969482422,"y":426,"wires":[[],[]]},{"id":"1161ab26.03aaad","type":"function","z":"a7880d9c.7ed6e8","name":"Uptime (sec)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"Uptime (sec)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":421.1999969482422,"y":506,"wires":[["1cc23d51.4fcccb"]]},{"id":"9f6d2912.7cb4a8","type":"function","z":"a7880d9c.7ed6e8","name":"RSSI (dBm)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"RSSI (dBm)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":421.1999969482422,"y":546,"wires":[["acdafe89.0c9098"]]},{"id":"39c23a4d.cb4266","type":"function","z":"a7880d9c.7ed6e8","name":"Seq #","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"Seq #\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":401.1999969482422,"y":586,"wires":[["2ca67179.39eede"]]},{"id":"2ca67179.39eede","type":"ui_numeric","z":"a7880d9c.7ed6e8","name":"Seq #","label":"Seq #","group":"a5b8ba1f.edd738","order":2,"width":0,"height":0,"passthru":true,"topic":"","format":"{{value}}","min":0,"max":10,"step":1,"x":581.1999969482422,"y":586,"wires":[[]]},{"id":"1cc23d51.4fcccb","type":"ui_text","z":"a7880d9c.7ed6e8","group":"a5b8ba1f.edd738","order":0,"width":0,"height":0,"name":"uptime","label":"uptime","format":"{{msg.payload}}","layout":"row-spread","x":621.1999969482422,"y":506,"wires":[]},{"id":"acdafe89.0c9098","type":"ui_gauge","z":"a7880d9c.7ed6e8","name":"RSSI","group":"a5b8ba1f.edd738","order":0,"width":0,"height":0,"gtype":"gage","title":"RSSI","label":"units","format":"{{value}}","min":"-100","max":"0","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":621.1999969482422,"y":546,"wires":[]},{"id":"b1a91835.6d9088","type":"mqtt-broker","z":"","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"50b6cfad.aa1d28","type":"ui_group","z":"","name":"Graphs","tab":"28b17d03.fb69ca","disp":true,"width":"20"},{"id":"a5b8ba1f.edd738","type":"ui_group","z":"","name":"Extra Info","tab":"28b17d03.fb69ca","disp":true,"width":"6"},{"id":"28b17d03.fb69ca","type":"ui_tab","z":"","name":"MQTT Demo","icon":"dashboard","order":1}]

  • I tried to use bbbb::100 as broker IP but it doesn't work. I suppose my route is incorrect. The followings are ifconig output on my Raspberry Pi.

    pi@raspberrypi:~ $ ifconfig
    eth0 Link encap:Ethernet HWaddr b8:27:eb:ba:0c:46
    inet addr:10.15.8.194 Bcast:10.15.9.255 Mask:255.255.254.0
    inet6 addr: fe80::a64:a61b:4fbc:25d7/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:221224 errors:0 dropped:296 overruns:0 frame:0
    TX packets:12021 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:35579917 (33.9 MiB) TX bytes:1317288 (1.2 MiB)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:65536 Metric:1
    RX packets:332 errors:0 dropped:0 overruns:0 frame:0
    TX packets:332 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1
    RX bytes:20743 (20.2 KiB) TX bytes:20743 (20.2 KiB)

    The followings are my 6lbr.conf

    MODE=ROUTER

    RAW_ETH=1
    BRIDGE=0
    DEV_BRIDGE=br0
    DEV_TAP=tap0
    DEV_ETH=eth0
    RAW_ETH_FCS=0

    DEV_RADIO=/dev/ttyACM0
    BAUDRATE=115200

    NODE_CONFIG=/etc/6lbr/node_config.conf

    LOG_LEVEL=3


    Any suggestion to move forward?
  • Try to do "sudo ip -6 addr add bbbb::101/64 dev eth0" and can see "inet6 addr: bbbb::101/64 Scope:Global" on ifconfig output. But, it still doesn't work when I use bbbb::100 as broker IP.

    pi@raspberrypi:~ $ sudo ip -6 addr add bbbb::101/64 dev eth0
    pi@raspberrypi:~ $ ifconfig
    eth0 Link encap:Ethernet HWaddr b8:27:eb:ba:0c:46
    inet addr:10.15.8.194 Bcast:10.15.9.255 Mask:255.255.254.0
    inet6 addr: fe80::a64:a61b:4fbc:25d7/64 Scope:Link
    inet6 addr: bbbb::101/64 Scope:Global
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:236729 errors:0 dropped:296 overruns:0 frame:0
    TX packets:12236 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:37096580 (35.3 MiB) TX bytes:1349440 (1.2 MiB)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:65536 Metric:1
    RX packets:332 errors:0 dropped:0 overruns:0 frame:0
    TX packets:332 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1
    RX bytes:20743 (20.2 KiB) TX bytes:20743 (20.2 KiB)
  • yes, if you run the nodered flow I gave you it does it

    1)
    from TI processors.wiki.ti.com/.../Cc26xx_sw_examples
    Finalizing Setup

    6lbr (the Edge Router application) on BBB is running in router mode, i.e. the 6lowpan side will get prefix aaaa:: and the ethernet side will get prefix bbbb:: IPv6 routers send out RA/RS to all other hosts on the IPv6 networr. The configuration of your PC should get an IPv6 address with prefix bbbb::, but in order to do so it need to be configured the receive Router Advertisements (RA).

    Unless deactivated, 6LBR will send periodially a Router Advertisement (RA) messages on the Ethernet subnet containing the configured prefix and the route to access the WSN subnet.

    You have to activate the reception of this message on your host :

    On Linux, if your network interface is eth0 :
    sysctl -w net.ipv6.conf.eth0.accept_ra=1
    sysctl -w net.ipv6.conf.eth0.accept_ra_rt_info_max_plen=64
    These commands have to be run each time the interface is restarted; this can be automated depending on your Linux distribution by enabling IPv6 autoconfiguration in your Network Manager.

    2) The address bbbb::101 is the IPv6 address of our Mosquitto broker and is programmed into the motes
  • use bbbb::101 to flash into mote as broker IP address

    I am running 6lbr with a following configuration (see attached)

    6lbr and node red are running on RPi to avoid IPv6 to IPv4 translation

    #This file contains a default configuration for Raspberry PI platform using
    #a Telos SLIP Radio
    #The full list of parameters and their meaning can be found in 6lbr.conf.example

    MODE=ROUTER
    #MODE=SMART-BRIDGE
    #MODE=RPL-RELAY
    #MODE=FULL-TRANSPARENT-BRIDGE
    #MODE=NDP-ROUTER
    #MODE=6LR
    #MODE=RPL-ROOT

    #for outside RPi
    #RAW_ETH=1
    #for inside RPi
    RAW_ETH=0
    BRIDGE=0
    #DEV_BRIDGE=br0
    #CREATE_BRIDGE=0
    DEV_TAP=tap0
    #for WiFi
    #DEV_ETH=wlan0
    #for ethernet
    DEV_ETH=eth0
    RAW_ETH_FCS=0

    DEV_RADIO=/dev/ttyACM0
    BAUDRATE=115200

    NODE_CONFIG=/etc/6lbr/node_config.conf

    LOG_LEVEL=3 #INFO and above only

  • once again mqtt broker address you put into nvram of the mote is bbbb::101 (my apologies for the confusion)

    the routes are executed by nodered - see attached picture

    and I use the 6lbr.conf as attached previously

  • I tried using bbbb::101 as broker IP but it still doesn't connect. My 6lbr.conf is the same to yours.
  • [{"id":"d2b472e5.14b24","type":"mqtt in","z":"a7880d9c.7ed6e8","name":"MQTT_demo","topic":"#","qos":"2","broker":"4b9c740e.64815c","x":148.85714721679688,"y":288.57142639160156,"wires":[["ae9a8946.0356a8"]]},{"id":"508600fb.3b4f08","type":"debug","z":"a7880d9c.7ed6e8","name":"","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","x":458.8571472167969,"y":248.57142639160156,"wires":[]},{"id":"ae9a8946.0356a8","type":"json","z":"a7880d9c.7ed6e8","name":"","pretty":false,"x":288.8571472167969,"y":288.57142639160156,"wires":[["5b7578fb.720298","508600fb.3b4f08","13d13f4f.007b19","82fb20e1.2b333","d9462912.866f88","82dc9f1c.c816d8","b9c1bceb.12dc38","d00584bb.ba489","81301925.46118"]]},{"id":"e4e23bdc.ad6368","type":"debug","z":"a7880d9c.7ed6e8","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","x":698.8571472167969,"y":248.57142639160156,"wires":[]},{"id":"5b7578fb.720298","type":"function","z":"a7880d9c.7ed6e8","name":"ADC DIO23 (mV)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"ADC DIO23 (mV)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":468.8571472167969,"y":288.57142639160156,"wires":[["e4e23bdc.ad6368","820c0d52.b221c8"]]},{"id":"66f73541.6538c4","type":"exec","z":"a7880d9c.7ed6e8","command":"service 6lbr start && service 6lbr status","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"6lbr service","x":328.8571472167969,"y":68.57142639160156,"wires":[["8b314b6b.dfae48"],[],[]]},{"id":"8daceb6e.5546f8","type":"inject","z":"a7880d9c.7ed6e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"","x":168.85714721679688,"y":68.57142639160156,"wires":[["66f73541.6538c4"]]},{"id":"8b314b6b.dfae48","type":"debug","z":"a7880d9c.7ed6e8","name":"","active":true,"tosidebar":true,"console":true,"complete":"payload","x":518.8571472167969,"y":48.57142639160156,"wires":[]},{"id":"36c826e1.b0f48a","type":"exec","z":"a7880d9c.7ed6e8","command":"sudo route -A inet6 add aaaa::/64 gw bbbb::100","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"add routes","x":328.8571472167969,"y":128.57142639160156,"wires":[["dff9bc6d.ff7f"],[],[]]},{"id":"66c2acf6.9168fc","type":"inject","z":"a7880d9c.7ed6e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"","x":168.85714721679688,"y":128.57142639160156,"wires":[["36c826e1.b0f48a"]]},{"id":"dff9bc6d.ff7f","type":"debug","z":"a7880d9c.7ed6e8","name":"","active":true,"tosidebar":true,"console":true,"complete":"payload","x":518.8571472167969,"y":108.57142639160156,"wires":[]},{"id":"3da1e9fc.09ab0e","type":"exec","z":"a7880d9c.7ed6e8","command":"sudo ip -6 addr add bbbb::101/64 dev tap0","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"add routes","x":328.8571472167969,"y":188.57142639160156,"wires":[["e89db70e.72d5a"],[],[]]},{"id":"245f4488.a055a4","type":"inject","z":"a7880d9c.7ed6e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"","x":168.85714721679688,"y":188.57142639160156,"wires":[["3da1e9fc.09ab0e"]]},{"id":"e89db70e.72d5a","type":"debug","z":"a7880d9c.7ed6e8","name":"","active":true,"tosidebar":true,"console":true,"complete":"payload","x":518.8571472167969,"y":168.57142639160156,"wires":[]},{"id":"820c0d52.b221c8","type":"ui_chart","z":"a7880d9c.7ed6e8","name":"ADC DIO23","group":"7b596f03.dc9ae8","order":0,"width":0,"height":0,"label":"ADC DIO23","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":688.8571472167969,"y":288.57142639160156,"wires":[[],[]]},{"id":"13d13f4f.007b19","type":"function","z":"a7880d9c.7ed6e8","name":"HDC Humidity (%RH)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"HDC Humidity (%RH)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":478.8571472167969,"y":328.57142639160156,"wires":[["bbedacf5.d4304"]]},{"id":"bbedacf5.d4304","type":"ui_chart","z":"a7880d9c.7ed6e8","name":"HDC Humidity","group":"7b596f03.dc9ae8","order":0,"width":0,"height":0,"label":"HDC Humidity","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":698.8571472167969,"y":328.57142639160156,"wires":[[],[]]},{"id":"82fb20e1.2b333","type":"function","z":"a7880d9c.7ed6e8","name":"HDC Temp (C)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"HDC Temp (C\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":458.8571472167969,"y":368.57142639160156,"wires":[["49d811a7.4481"]]},{"id":"49d811a7.4481","type":"ui_chart","z":"a7880d9c.7ed6e8","name":"HDC Temp","group":"7b596f03.dc9ae8","order":0,"width":0,"height":0,"label":"HDC Temp","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":688.8571472167969,"y":368.57142639160156,"wires":[[],[]]},{"id":"d9462912.866f88","type":"function","z":"a7880d9c.7ed6e8","name":"Air Pressure (hPa)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"Air Pressure (hPa)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":468.8571472167969,"y":408.57142639160156,"wires":[["eec8d9cd.99ff28"]]},{"id":"eec8d9cd.99ff28","type":"ui_chart","z":"a7880d9c.7ed6e8","name":"Air Pressure","group":"7b596f03.dc9ae8","order":0,"width":0,"height":0,"label":"Air Pressure","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":688.8571472167969,"y":408.57142639160156,"wires":[[],[]]},{"id":"82dc9f1c.c816d8","type":"function","z":"a7880d9c.7ed6e8","name":"Light (lux)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"Light (lux)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":438.8571472167969,"y":448.57142639160156,"wires":[["ac94317f.ad59f"]]},{"id":"ac94317f.ad59f","type":"ui_chart","z":"a7880d9c.7ed6e8","name":"Light","group":"7b596f03.dc9ae8","order":0,"width":0,"height":0,"label":"Light","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":648.8571472167969,"y":448.57142639160156,"wires":[[],[]]},{"id":"b9c1bceb.12dc38","type":"function","z":"a7880d9c.7ed6e8","name":"Uptime (sec)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"Uptime (sec)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":448.8571472167969,"y":528.5714263916016,"wires":[["84bbe025.8b2af8"]]},{"id":"d00584bb.ba489","type":"function","z":"a7880d9c.7ed6e8","name":"RSSI (dBm)","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"RSSI (dBm)\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":448.8571472167969,"y":568.5714263916016,"wires":[["b5adca40.a47838"]]},{"id":"81301925.46118","type":"function","z":"a7880d9c.7ed6e8","name":"Seq #","func":"var msg1 = msg;\nmsg1.payload = msg.payload.d[\"Seq #\"];\nreturn msg1;\n","outputs":1,"noerr":0,"x":428.8571472167969,"y":608.5714263916016,"wires":[["53a3f68d.5d7cc"]]},{"id":"53a3f68d.5d7cc","type":"ui_numeric","z":"a7880d9c.7ed6e8","name":"Seq #","label":"Seq #","group":"3a640b7e.bbabb4","order":2,"width":0,"height":0,"passthru":true,"topic":"","format":"{{value}}","min":0,"max":10,"step":1,"x":608.8571472167969,"y":608.5714263916016,"wires":[[]]},{"id":"84bbe025.8b2af8","type":"ui_text","z":"a7880d9c.7ed6e8","group":"3a640b7e.bbabb4","order":0,"width":0,"height":0,"name":"uptime","label":"uptime","format":"{{msg.payload}}","layout":"row-spread","x":648.8571472167969,"y":528.5714263916016,"wires":[]},{"id":"b5adca40.a47838","type":"ui_gauge","z":"a7880d9c.7ed6e8","name":"RSSI","group":"3a640b7e.bbabb4","order":0,"width":0,"height":0,"gtype":"gage","title":"RSSI","label":"units","format":"{{value}}","min":"-100","max":"0","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":648.8571472167969,"y":568.5714263916016,"wires":[]},{"id":"4b9c740e.64815c","type":"mqtt-broker","z":"","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"7b596f03.dc9ae8","type":"ui_group","z":"","name":"Graphs","tab":"5019bea6.dca71","order":1,"disp":true,"width":"12"},{"id":"3a640b7e.bbabb4","type":"ui_group","z":"","name":"Extra_Info","tab":"5019bea6.dca71","order":2,"disp":true,"width":"8"},{"id":"5019bea6.dca71","type":"ui_tab","z":"","name":"MQTT_example","icon":"dashboard","order":1}]
    do you have Microsoft Remote Desktop on your PC?

    or

    Can you connect a monitor and keyboard/mouse to your RPi?

  • No, I don't have have Microsoft Remote Desktop on my PC. I can connect a monitor and keyboard/mouse to your RPi. But what's the purpose of this?
  • Microsoft Remote Desktop is free for both Windows 10 and Mac

    The purpose is to check if 6lbr is running and other things...

    When you connected to RPi GUI:

    - open terminal and run: service 6lbr start (and service-6lbr status)

    - open Chromium browser and enter address [bbbb::100]

    what do you see?

  • I am pretty sure my 6lbr is running. I can access to [bbbb::100] on my PC. Do I need to verify if I can access to [bbbb::100] from Raspberry Pi chromium browser?
  • Then you have a different 6lbr.config than me, I can access [bbbb::100] only from RPi, not from PC

    You probably need to run nodered from your PC (???)

    I run both 6lbr and nodered on RPi

    Do you have the MQTT/IBM Cloud setup as per picture below?

    What is the Green LED on the mote showing?

  • Thanks for your help. After I try to use 6lbr bridge mode, it works now. I will try to give a step-by-step guide on my blog later.
  • Good on you. I’m glad it works for you.
  • For your original question, I suppose you can add sender MAC address into publish message to make subscriber can know the message sender.