Can cooja connect to mosquitto server in ubuntu? - c

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

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.

Related

Connecting to LEGO Spike using LEGO wireless protocol

I wanted to make a connection to LEGO Spike prime hub using LEGO wireless protocol through bluetooth.
I tried to run examples from github using c or go but its failed. I couldn't force Linux to receive frames. I tried to use go bluetooth package but still a message that profile is note available. The only way I could connect to Spike was rfcomm but I cant receive LEGO wireless protocol frames this way. Do you have aby suggestions what I should do?
Regards
Jack

ARM MBED CoAP example mot opening port

I have succesfully built the CoAP protocol example for ARM mbed (https://developer.mbed.org/teams/sandbox/code/coap-example/file/0681e205d0e9/) on a K64F board. It comes out of the box, except for the server name (coap.me) changed to an internal IP address.
I see that it runs correctly and connects to the network:
[EasyConnect] Using Ethernet
[EasyConnect] Connected to Network successfully
[EasyConnect] IP address 192.168.1.15
[EasyConnect] MAC address 0e:43:54:d9:7c:71
Connected to the network. Opening a socket...
Calculated message length: 11 bytes
Starting server
Sent 11 bytes to coap://192.168.1.10:5683
I have set a computer that can connect to it. It can ping correctly to the board and I see that the ARP is negotiating with the correct MAC address.
I have launched an NMAP test and I see that the port is closed:
PORT STATE SERVICE
5683/udp closed unknown
If I set a CoAP client in the computer (Copper) I see no connection in the terminal.
What I am missing?
Moving this to the answer section as well, in case someone else runs into this problem.
If you want to use an mbed OS 5 device as a UDP server, make sure to call .bind() on the socket.

Which VNCServer port to use to connect to home computer?

I want to connect to my home computer from the library via a VNCServer located on my home computer, but I'm pretty sure the library blocks the port 5900 and higher. Can I change the port which my vncserver listens to get around the blocked port? Which port probably would allow me to get around the library's port blocking? Is there anyway I can test which ports are open at the library?
The VNCServer is running on your home machine, it shouldn't matter what ports are blocked in the library. You are in the library(with your laptop?). The library blocking ports 5900+ only stops incoming connections (coming into the library) from using those ports not from you connecting to other device's port on that device's port number.
You can check from the library if your port/IP is visible using things like : http://www.canyouseeme.org/

tftp server client example for lpc1768

I am trying to work a TFTP client for transferring files in MMC/SD card to PC through Ethernet on LPC1768 controller. For TFTP, it needs two ports to be connected to TFTP server.
I am using TCP/IP stack which comes with LPC1768 webserver example. Is it possible to open two ports at a time.. I tried but its not working.
Is there any sample program or tutorial for TFTP client for microcontrollers which can work without OS?
or any alternative protocols?

How to get a TCP/IP packet over an serial connection (Bluetooth)

I'm developing an TCP/IP stack that will run on another device connected by bluetooth.
But I want to test against an working Stack. My testing scenario would be:
MY DEVICE TCP/IP STACK --------------BLUETOOTH ----------------- WINDOWS/MAC TCP/IP Stack.
Anyone have any idea how could I write IP packets over an Bluetooth connection on Linux/Windows or mac ??
One way is you could establish a ppp connection between the device and the PC over bluetooth first. For this you will need support for ppp on the device side. Once you are able to dial-up and establish a ppp connection, tcp/ip can be run over ppp.
These links may be useful (although they are specific to linux):
http://www.daybefore.net/bluetooth_ppp.html
http://www.rpgameplace.de/blog/index.php?/archives/19-Networking-over-Bluetooth-using-BlueZPPP.html

Resources