Connection via AT Commands


I’m having difficulty getting the nuts and bolts of the connection to work for sending the connection message. The BYOT documentation isn’t giving the detailed info for making a connection manually at the command level. It only references pre built libraries for everything but a command control modem. I can establish a connection to the socket:


Then I try and send a POST command to connect to the application. I get nothing, then it times out.

POST / “{userName:”""“cd853e90-75ed-11e7-b0bc-87cd67a1f8c7"”"“password:”""“37400ec5e771e809922bc3ee6f805e0d3839ff9d”"""}"

Nothing happens. I check my thing in the dashboard and it doesn’t ever acknowledge the connection. Nor do I ever recieve the connection ACK message.

Am I not sending enough data elements?
Is there a list of required elements?
Is there an example of someone doing it with a AT command connection?


Are you trying to send an HTTP POST command? That will not work because the BYOT connection uses MQTT, not HTTP. To get it to work you’d need to create a TCP connection and then send and handle the appropriate MQTT messages to establish MQTT communication.

To do this with the MQTT libraries we have you would need to provide your own networking implementation as mentioned here for the C library:

And here for the C++ library:

Basically it would require replacing the example Linux code for creating a TCP connection and reading and writing data with your own implementation using AT commands.

If you’d rather implement it all using AT commands that would require more work to support the MQTT protocol. I found this repo that seems to use AT commands for MQTT with a SIM800. Perhaps that would be helpful:

And here is a repo that seems to use AT commands with a couple different MQTT libraries.

This example seems to use PubSubClient for MQTT:

And here is one that uses Paho MQTT client, which is the basis for the Cayenne libraries so it may be helpful as a guide if you plan to try and implement networking using the Cayenne libraries as mentioned in the documentation links above.


A different low level serial ‘AT command’ level ?
I have had some success using the ttyAMA0 / ttyS0 off the GPIO port of Raspberry Pi + pyserial + splitcsv in a few lines of python.
~ Andrew