Can cooja connect to mosquitto server in ubuntu?

707 Views Asked by At

I am new to contiki os and i am trying out mqtt in contiki os. But i had problem connecting my mote in cooja simulator to my mosquitto server on my ubuntu desktop. So is it possible to do that? I am trying to use IPv4 for this and my example for mqtt come from https://github.com/esar/contiki-mqtt

Thank you

1

There are 1 best solutions below

5
On

Yes, it is possible.

You need a RPL border router node with SLIP (Serial Line IP) enabled (I have never simulated physical Ethernet port in a node on Cooja).

In your RPL border router, open the "Serial Socket (Server)" and in the Linux console, run tunslip6 to connect the RPL tree into your local network.

This is a tutorial: http://anrg.usc.edu/contiki/index.php/RPL_Border_Router

After the tunslip6 is running, there's no difference from running the nodes physically, it's the same setup.

Now your nodes will be able to find your mosquitto server in the static IPv6 address you've configured. I remember to be using "aaaa::1". To be sure the network is up, ping6 your RPL border router.

ps: If it is a production application, you might not want to use MQTT. Nor TCP or packet segmentation scale well in the RPL, also MQTT can have fat payloads. Go UDP with CoAP or MQTT-SN.