I've been coding a AT client using ESP32 S2 as a host and Nimbelink's Skywire Nano (nrf9160) as a LTE Modem controlled by Serial AT Commands, the LTE module is responsive and is working well. The LTE modem has an internal TCP Stack, which we have used to send data to dweet.io through a HTTP POST with success, but we haven't been successful in doing the same sending data to a private MQTT server.
The LTE module uses a method called Socket Dials, these are AT commands that facilitate sending data to the web, it basically consist in these three commands:
- AT#SOCKET to activate the socket
- AT#TCPCONN to connect to an URL
Example:
at#xtcpconn=3,"node02.myqtthub.com",1883
- AT#TCPSEND which opens a > promt in which you enter whatever you are going to send
I'm not a communication protocols expert, so it has been a bit difficult finding the correct way to send the string since I haven't found similar examples using TCP sockets. I have tried sending mosquitto_pub strings withouy success and nimbelink only has an example using HTTP, I hope some one can help me with this or at least send me in the right direction.
at#xsocket=3,1,1 #XSOCKET: 3,6 OK at#xtcpconn=3,"node02.myqtthub.com",1883 #XTCPCONN: 1 OK at#xtcpsend=3
mosquitto_pub -h node02.myqtthub.com -i hub -u user -P 'password' -t topic -m "hello world"#XTCPSEND: 104
OK SOCK: 3,HUP
Edit: added the LTE log of the attempt