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.

MQTT example for local Mosquito broker

Other Parts Discussed in Thread: CC2650

Hi,

I would like to run MQTT example from cc26xx-web-demo using local Mosquitto on my RPi, but no luck so far

My Mosquitto on RPi is working

root@raspberrypi:~# mosquitto_pub -h localhost -t "all" -m "hey"


root@raspberrypi:~# mosquitto_sub -h localhost -t "#"
hey

I am running 6lbr and have the IPv6 address from ifconfig:


          inet6 addr: bbbb::101/64 Scope:Global
          inet6 addr: fe80::880d:43d2:b0ee:b09f/64 Scope:Link

Pointed the node to the brokers IPv6 address (bbbb::101 ) by accessing the MQTT config page (web page) on the node. Is this OK or should I change it in a code?

Testing it both from command line and Node-Red, but no luck so far

root@raspberrypi:~# mosquitto_sub -h aaaa:212:4b00:69f:d58f -t "#"
Unable to connect (Lookup error.).
root@raspberrypi:~#

(aaaa:212:4b00:69f:d58f - is IPv6 address of my node (sensortag CC2650))

Jan

  • more info ...
    if I connect without specifying the address like this:
    root@raspberrypi:/www/CoAPwebserver_28_11_2016# mosquitto_sub -t "#"

    I get the response:
    {"d":{"myName":"TI CC2650 SensorTag","Seq #":2,"Uptime (sec)":24,"Def Route":"fe80::212:4b00:79e:2b85","RSSI (dBm)":-56,"Battery Temp (C)":25,"Battery Volt (mV)":3320,"Air Pressure (hPa)":1011.10,"Air Temp (C)":24.87,"Object Temp (C)":16.375,"Ambient Temp (C)":25.000,"Light (lux)":332.16,"HDC Humidity (%RH)":0.00,"HDC Temp (C)":-40.00,"Acc X (G)":-0.01,"Acc Y (G)":0.68,"Acc Z (G)":0.69,"Gyro X (deg per sec)":-250.13,"Gyro Y (deg per sec)":35.36,"Gyro Z (deg per sec)":86.83}}

    only one mote can be connected at a time:
    {"d":{"myName":"TI CC2650 SensorTag","Seq #":10,"Uptime (sec)":62,"Def Route":"fe80::212:4b00:79e:2b85","RSSI (dBm)":-40,"Battery Temp (C)":25,"Battery Volt (mV)":3292,"ADC DIO23 (mV)":3241,"Air Pressure (hPa)":1011.29,"Air Temp (C)":27.12,"Object Temp (C)":16.656,"Ambient Temp (C)":26.437,"Light (lux)":791.68,"HDC Humidity (%RH)":56.28,"HDC Temp (C)":26.62,"Acc X (G)":-0.04,"Acc Y (G)":-0.47,"Acc Z (G)":0.94,"Gyro X (deg per sec)":-1.35,"Gyro Y (deg per sec)":-1.82,"Gyro Z (deg per sec)":1.70}}
    {"d":{"myName":"TI CC2650 SensorTag","Seq #":1,"Uptime (sec)":18,"Def Route":"fe80::212:4b00:79e:2b85","RSSI (dBm)":-56,"Battery Temp (C)":25,"Battery Volt (mV)":3320,"Air Pressure (hPa)":1011.10,"Air Temp (C)":24.87,"Object Temp (C)":27.343,"Ambient Temp (C)":24.718,"Light (lux)":332.16,"HDC Humidity (%RH)":0.00,"HDC Temp (C)":-40.00,"Acc X (G)":-0.01,"Acc Y (G)":0.68,"Acc Z (G)":0.69,"Gyro X (deg per sec)":-250.13,"Gyro Y (deg per sec)":35.36,"Gyro Z (deg per sec)":86.83}}

    mosquitto_sub -h XXXX -t "#"

    Can anyone help me to solve the problem:
    what address should I put instead of XXXX in a command above to talk to particular node?

    trying:
    root@raspberrypi:/# mosquitto_sub -h aaaa::212:4b00:11a7:7600 -t "#"
    Error: Connection refused

    trying:
    root@raspberrypi:/# mosquitto_sub -h aaaa::212:4b00:11a7:7600:1883 -t "#"
    Error: Network is unreachable

    trying:
    root@raspberrypi:/# mosquitto_sub -t "#"
    {"d":{"myName":"TI CC2650 SensorTag","Seq #":34,"Uptime (sec)":177,"Def Route":"fe80::212:4b00:79e:2b85","RSSI (dBm)":-45,"Battery Temp (C)":29,"Battery Volt (mV)":3292,"ADC DIO23 (mV)":3237,"Air Pressure (hPa)":1011.08,"Air Temp (C)":30.75,"Object Temp (C)":19.968,"Ambient Temp (C)":29.718,"Light (lux)":778.24,"HDC Humidity (%RH)":46.58,"HDC Temp (C)":29.94,"Acc X (G)":0.09,"Acc Y (G)":-0.23,"Acc Z (G)":1.02,"Gyro X (deg per sec)":-1.51,"Gyro Y (deg per sec)":-2.91,"Gyro Z (deg per sec)":2.05}}


    But I need to select a particular mote, not just any.

    Much appreciate your help as I'm stuck at the moment.

    Cheers,

    Jan