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.

LAUNCHXL-CC1350: Webdemo application in contiki is not able to connect to local MQTT Server

Part Number: LAUNCHXL-CC1350
Other Parts Discussed in Thread: CC1350

Hi,

We are trying to create a 6LoWPAN Mesh network using CC1350 Launchpads as End Devices and CC1350 Launchpad connected to BBB as Edge router. We are planning to send our sensor readings from End Device to server via MQTT Protocol. We created bin images for web demo (cmd = make TARGET=srf06-cc26xx BOARD=launchpad/cc1350 cc26xx-web-demo.bin) and slip radio (make TARGET=srf06-cc26xx BOARD=launchpad/cc1350 slip-radio.bin) and trying to connect with a local MQTT Server.

We changed the broker ip in the webpage (MQTT/IBM Cloud Config) but it is showing nothing in the webdemo debug port ie node or in the broker subscription.
PC ip is 192.168.1.113 so we tired with
0000:0000:0000:0000:0000:ffff:c0a8:0171 and
0064:ff9b:0000:0000:0000:ffff:c0a8:0171 as the broker ip and we tried the IPV6 Address of the PC.

Also we tried to access the IBM Quickstart tab in the webpage but only that tab is not working.

Sometimes we can see Default case: State=0xff in the Node debug port. Please let me know if we are missing something and what we need to do to get MQTT working.

Adding 1 more, We are not able to get the webpage [bbbb::100] if both IPV4 and IPV6 is enabled in Network settings of PC. We are able to get the webpage [bbbb::100] if we only enable IPV6 in network settings or connecting directly to PC. We are using IPV6 Router and ISP is IPV4.

Please let me know the issue.

Thanks
Rahul

  • If you connect cc26xx-web-demo to IBM quickstart, does it work?
  • No. We are not getting that page also. It seems like IBM quickstart is not getting. May be due to internet issue.
  • How can i trigger the IBM quickstart data sending via MQTT. Will it happen after a timeout?
  • If you setup 6lbr and connect cc26xx-web-demo using default FW, it should report data to IBM quickstart by default.
  • After some enabling and disabling of IPV4 in PC network setting i could able to see the page in IBM which says like this

  • Please let me know that how can we initiate the data transfer from the Node which is having webdemo code?
  • Do you setup NAT64 on 6lbr?
  • en we disable IPV4 and enable IPV6 in PC Network settings we are able to get the webpage [bbbb::100]. But when we enable both IPV4 and IPV6 we are not able to get the webpage after sometime. So i assume that when IPV4 is enabled we are not able to get the IPV6 webpage. So i enabled the IP64 in configuration page.

    So that we can access IPV4 IP and we are able to get the webpage. But the link for web and coap is missing.

    Please let me know your thoughts on this.

    Thanks

    Rahul

  • Yes. I assume if we are enabling IP64 in webpage so we dont need NAT64. Is that correct? Either way we have configured NAT64 also.
  • Do you set Peer router in 6lbr configuration page?
  • No.

    Please let me know what we need to configure.

    Thanks

  • You should input IPv6 address of your desktop as Peer router.
  • We have configured the peer router.

    But everything seems to be same. I assume after doing this we will be able to access webpage [bbbb::100] without changing network settings to IPV6 only. Is that what you are expecting after doing this step?

  • IPv6 address of your Peer router should be with fe80::... as prefix.
  • I tried that too, mine is starting with fdde:7b2d......
  • Please check the image

  • Try to also enableRFC6052 prefix and Static port mapping.
  • We tried that too.

    We are ok with getting webpage using IPV4 also but why we are not getting the web page with web and coap enabled in the sensor list.

    Please let me if this is the issue due to which we are not able to communicate to the MQTT server?

    Thanks

  • Try to run tcpdump on BBB to see if anything is sent out on port 1883

    tcpdump –X –v –i eth0 port 1883
  • Hi,

    tcpdump was not there and we are trying to install in BBB. While doing that we found when the 6lbr service is running it is not fetching any data if we execute apt-get update etc. After stopping the 6kbr service we can see the data is fetching when we execute the Linux commands.

    Anyway i will let you know the results soon.

    Thanks
    Rahul
  • Hi,

    Please check the result and let me know your thoughts,

    debian@beaglebone:~$ sudo tcpdump -X -v -i eth0 port 1883
    tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
    12:19:59.106751 IP6 (hlim 63, next-header TCP (6) payload length: 20) fd00::xx > fdde:xx.1883: Flags [R.], cksum 0x7e59 (correct), seq 100, ack 0, win 128, length 0
    0x0000: 6000 0000 0014 063f fd00 0000 0000 0000 `......?........
    0x0010: 0212 4b00 0e00 b501 fdde 7b2d 3976 0000 ..K.......{-9v..
    0x0020: 6084 48e0 e9d2 d264 0405 075b 0000 0064 `.H....d...[...d
    0x0030: 0000 0000 5014 0080 7e59 0000 ....P...~Y..

  • Hi,

    After sometime tcpdump will not show any data and at that time we can see the LED in the webdemo is glowing and showing
    Default case: State=0xff
    in the debug port.

    Please let me know your thoughts.

    Thanks
    Rahul
  • Actually we are running a mosquitto server in PC and trying to get the MQTT data from Nodes to PC. As per our understanding Mosquitto is running properly in windows as we can subscribe and publish data inside that and PC is listening all the data in 1883. But we couldnt find the data from Nodes in PC even though we can see some data in BBB after doing tcpdump.

    Please let me know your thoughts on this.

    Thanks
  • When you do tcpdump on 1883 port, I see there are some traffic on 1883 port which means CC26xx-web-demo actually sends MQTT messages. I suggest you to check your network settings.
  • Hi,

    "I suggest you to check your network settings."

    Please let me know in which part we need to correct this.  Is this in PC or BBB? and what needs to be changed exactly?

    Please check the following images of the MQTT server running on PC.

    MQTT Subscription on port 18883 on all topics,

    MQTT publishing to a particular topic, i tried publishing by giving IPV6 address also. In both cases i can see the messages in subscription 

    So is there any other method other than local server to test and see MQTT packets coming from Nodes?

    Thanks

    Rahul

  • I don't know which part goes wrong in your settings so I suggest you to try IBM QuickStart first.
  • Inorder to check with IBM QuickStart broker ip should be 0064:ff9b:0000:0000:0000:0000:b8ac:7cbd. Is this correct?
  • Hi,

    We are glad to inform you that we can see some data coming in IBM Server.

    Please let me know if this is the expected result in IBM server. As per our understanding in order to send data to our server we just need to change the broker IP. Is that correct?

    Thanks

    Rahul

     

  • Yes, it looks IBM QuickStart works on your environment. If your private Mosquitto server setup correctly, you only need to input correct broker ip.
  • Awesome.. Cheers... You are right..

    Thanks a lot for your valuable support and time.

    Actually we need to allow the connection for mosquitto in  the windows firewall advance security inbound rules.

    Now i can see the data coming from the node in my local MQTT server as well.

    Thanks for your quick and valuable response.

    Thanks

    Rahul

  • Hi,

    Now we have provided the local MQTT broker IPV6 address as the broker ip of node. But in this case if we enable the IPV4 also in PC we cannot see the data coming. To work with IPV4 enable in PC do we need to give the broker IP corresponding to ip of PC which is having IPV4 192.168.1.113. We assume that is 0000:0000:0000:0000:0000:ffff:c0a8:0171 or 0064:ff9b:0000:0000:0000:ffff:c0a8:0171? Which one will be correct?

    Also please let us know why we are not getting the webpage when both IPV4 and IPV6 is enabled? and also why the webpage and coap is not there for IPV4 webpage?
    Please let us know your thoughts.

    Thanks
    Rahul
  • 1. I suppose you should use ipconfig or ifconfig to get the IPv6 address of you local broker.
    2. what do you mean both IPV4 and IPV6 is enabled? Do you mean enable IP64 on 6lbr configure page?
  • Hi,

    Sorry for the delay in response.

    1. I suppose you should use ipconfig or ifconfig to get the IPv6 address of you local broker.
    Yes. Assume that if i am using IPV4 router or a PC which is enabled only IPV4 in its network settings. So in that case we were planning to take IPV4 address and convert that to IPV6. Is this correct?
    2. what do you mean both IPV4 and IPV6 is enabled? Do you mean enable IP64 on 6lbr configure page?
    No, If we are enabling both in PC network settings. If we enable both IPV4 and IPV6 in PC network settings and the Mosquitto broker is running on PC, then Nodes are not able to connect to the broker. If i enable IPV6 only in PC network settings then i can see the data coming from the Nodes. Why if both IPV4 and IPV6 is enabled in PC network settings we are not able to see the webpage as well as MQTT data.

    Log is as follows when i enable IPV4 and IPV6 in PC network settings,

    Publishing
    MQTT - Got mqtt_do_publish_mqtt_event!
    MQTT - Sending publish message! topic iot-2/evt/status/fmt/json topic_length 25
    MQTT - Buffer space is 512
    MQTT - Encoding length 197
    MQTT - Encode len digit '197' length '1'
    MQTT - Encode len digit '1' length '0'
    MQTT - remaining_length_bytes 2
    MQTT - (write_byte) buff_size: 512 write: '30'
    MQTT - (write_bytes) len: 2 write_pos: 2
    MQTT - (write_byte) buff_size: 509 write: '00'
    MQTT - (write_byte) buff_size: 508 write: '19'
    MQTT - (write_bytes) len: 25 write_pos: 25
    MQTT - (write_bytes) len: 170 write_pos: 170
    MQTT - (send_out_buffer) Space used in buffer: 200
    MQTT - Publish Enqueued
    MQTT - Got TCP_DATA_SENT
    MQTT - Got TCP_DATA_SENT
    MQTT - Got TCP_DATA_SENT
    MQTT - Got TCP_DATA_SENT
    MQTT - Got TCP_DATA_SENT
    MQTT - Got TCP_DATA_SENT
    MQTT - Got TCP_DATA_SENT
    MQTT - Call to mqtt_publish...
    MQTT - Accepted!
    APP - Publish!
    Publishing
    MQTT - Got mqtt_do_publish_mqtt_event!
    MQTT - Sending publish message! topic iot-2/evt/status/fmt/json topic_length 25
    MQTT - Buffer space is 512
    MQTT - Encoding length 197
    MQTT - Encode len digit '197' length '1'
    MQTT - Encode len digit '1' length '0'
    MQTT - remaining_length_bytes 2
    MQTT - (write_byte) buff_size: 512 write: '30'
    MQTT - (write_bytes) len: 2 write_pos: 2
    MQTT - (write_byte) buff_size: 509 write: '00'
    MQTT - (write_byte) buff_size: 508 write: '19'
    MQTT - (write_bytes) len: 25 write_pos: 25
    MQTT - (write_bytes) len: 170 write_pos: 170
    MQTT - (send_out_buffer) Space used in buffer: 200
    MQTT - Publish Enqueued
    MQTT - Got TCP_DATA_SENT
    MQTT - Got TCP_DATA_SENT
    MQTT - Got TCP_DATA_SENT
    MQTT - Got TCP_DATA_SENT
    Publishing... (MQTT state=9, q=0)
    Publishing... (MQTT state=9, q=0)
    Publishing... (MQTT state=9, q=0)
    Publishing... (MQTT state=9, q=0)

    Please let me know your thoughts on this.

    Thanks
    Rahul
  • I don't have experience doing what you are testing now. I can only suggest you to use Wireshark to check network traffic to see if you can find anything.
  • Hi,

    We are planning to implement Mosquitto MQTT Broker on the same BBB where 6Lbr is running and change the broker ip of Nodes to BBB IPV6 address.

    We tried this by removing the bridge configuration of 6LBR and made like this,

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

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

    DEV_RADIO=/dev/ttyACM0 #2.4GHz USB Dongle will enumerate like ACM0
    #DEV_RADIO=/dev/ttyUSB1 #SmartRF06EB+CC13xxEM will enumerate like USB1
    BAUDRATE=115200

    LOG_LEVEL=3

    But we are not able to see the Nodes connecting to MQTT Broker running on Gateway.

    Please let me know if the configuration is correct and your thoughts on this.

    We actually want to see the data coming from Nodes in BBB and process it.

    Thanks
    Rahul
  • Update,

    I can see the data coming when we we execute sudo tcpdump -i eth0 -v -X port 1883
    but we are not able to see the data in MQTT subscribe.

    We tried with local publish and subscribe and it is working,

    debian@beaglebone:~$ mosquitto
    1499344364: mosquitto version 1.4.8 (build date 2017-07-04 12:05:37+0000) starting
    1499344364: Using default config.
    1499344364: Opening ipv4 listen socket on port 1883.
    1499344364: Opening ipv6 listen socket on port 1883.
    1499344393: New connection from ::1 on port 1883.
    1499344393: New client connected from ::1 as mosqsub/1328-beaglebone (c1, k60).
    1499344421: New connection from ::1 on port 1883.
    1499344421: New client connected from ::1 as mosqpub/1342-beaglebone (c1, k60).
    1499344421: Client mosqpub/1342-beaglebone disconnected.

    Please let me know your thoughts.

    Thanks
    Rahul
  • Sorry that was our other nodes data. We are not seeing any data when we we execute sudo tcpdump -i eth0 -v -X port 1883.

    Please let me know your thoughts.
  • I don't have experience doing this. I suggest you to post an issue on 6lbr and Contiki Github.
  • Ok Sure.

    Thanks
    Rahul
  • Not really helpful this time but still hope someone from 6lbr/Contiki team can help you out.
  • No problem.. You have really helped us a lot to reach so far and we are extremely thankful for that..

    We will let u know once we have anything from 6lbr/contiki team.

    One update is there like after trying many things today we could see some mqtt data in tcpdump for sometime, but seems like only data is coming from nodes and no response is going from BBB even though we are able to connect to the BBB mqtt broker from another pc connected in same network. But mosquitto broker log is not showing anything when nodes trying to connect.

    Anyway we will post you the updates as we progress.

    Thanks

    Rahul

  • Hi,

    Cheers!!!

    Even though we didnt receive any response from contiki/6lbr git forums yet, we were trying many configurations and finally we are able to see the data in BBB local mosquitto broker.

    Please check the following configurations that worked for us,

    6lbr.config

    #This file contains a default configuration for BeagleBone 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

    RAW_ETH=0
    BRIDGE=1
    CREATE_BRIDGE=6LBR
    DEV_BRIDGE=br0
    DEV_TAP=tap0
    DEV_ETH=eth0
    ETH_JOIN_BRIDGE=1
    #RAW_ETH_FCS=1
    RAW_ETH_FCS=0

    DEV_RADIO=/dev/ttyACM0 #2.4GHz USB Dongle will enumerate like ACM0
    #DEV_RADIO=/dev/ttyUSB1 #SmartRF06EB+CC13xxEM will enumerate like USB1
    BAUDRATE=115200

    LOG_LEVEL=3

    interfaces

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    #auto br0
    #iface br0 inet dhcp
    auto eth0
    iface eth0 inet dhcp

    # Example to keep MAC address between reboots
    #hwaddress ether DE:AD:BE:EF:CA:FE

    # The secondary network interface
    #auto eth1
    #iface eth1 inet dhcp

    # WiFi Example
    #auto wlan0
    #iface wlan0 inet dhcp
    # wpa-ssid "essid"
    # wpa-psk "password"
    # Ethernet/RNDIS gadget (g_ether)
    # ... or on host side, usbnet and random hwaddr
    # Note on some boards, usb0 is automaticly setup with an init script
    iface usb0 inet static
    address 192.168.7.2
    netmask 255.255.255.0
    network 192.168.7.0
    gateway 192.168.7.1

    Along with this, we did the following

    1. we configured peer router as the IPV6 address of br0.
    2. Started MQTT broker in br0 IPV6 address.
    3. Configured broker ip of Nodes to the IPV6 address of br0

    Please note that some of those steps that we did may not be really relevant for its working, we are just posting all our configurations.

    Thanks

    Rahul

  • Great and Thanks for sharing these back!
  • Hi,

    We are having 1 doubt like if the ip of br0 interface is this bbbb : : x : xyz : xyza : xyz, how can we give this as a broker ip?
    Nodes are not working if we are giving like this. Is there any conversion of this ip to full ip address like fdde:7b2d:3976:0: x : xyz : xyza : xyz.

    This happens when we connect IPV4 router to BBB. Actually we are able to connect to IBM server with both IPV6 and IPV4 router. So we are planning to connect the nodes to BBB mqtt broker which is connected to IPV4 router. When it is connected to IPV4 router we are getting br0 interface ip like this bbbb : : x : xyz : xyza : xyz.

    Please let me know your thoughts.

    Thanks
    Rahul
  • Cheers!!!

    We could able to do that by giving the broker ip as bbbb:0:0:0: x : xyz : xyza : xyz instead of giving bbbb : : x : xyz : xyza : xyz

    Now we are able to connect to local MQTT broker on BBB with both IPV6 and IPV4 routers connected to BBB.

    Thanks
    Rahul