0

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

  • 1
    What device are you using? (vendor and model). Can you post the complete AT log of your attempt? (commands and answers. In case the problem occurs sending MQTT message, write the dump of the message you send, the response you would expect and the one you actually receive. All these stuff is required to narrow the question to a specific problem; otherwise it is unclear and/or too broad. – Roberto Caboni Aug 13 '20 at 07:19
  • 1
    As a general piece of advice, I suggest you set up your application having the complete control of your mqtt server (meaning that you are able to configure it, to see its internal logs and even to sniff its traffic with Wireshark). – Roberto Caboni Aug 13 '20 at 07:21
  • Hi! Thanks for answering. The device I'm using is Nimbelink's Skywire Nano development kit, which uses a modem based on the nrf9160, as a side note, Nimbelink added the socket dials to the list of AT Commands. 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 Those are the commands after the connection had been confirmed. We don't expect an answer, we just expect to get the data to the server. – Jonathan Ortega Lobo Aug 13 '20 at 13:09

0 Answers0