Take the 2-minute tour ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

I have used the pubsubclient library for Arduino for communicating with an MQTT broker in the past, however the library works only with Ethernet connecction. I need to use GSM in my application and am using the SIM900 at the moment. However, I cannot seem to find any library for MQTT communication using an Arduino as MQTT client and SIM900 as gateway. I found this to be surprising as there must surely be many instances where one would want to upload data from Arduino to a MQTT broker in a mobile scenario where cellular network is the only option (in place of Ethernet). So my questions are:

  1. Is it possible to use the Arduino as MQTT client and SIM900 as gateway for communicating with an MQTT broker? Are there any libraries for the same?
  2. What is the current standard way (gateway / communication protocol) of uploading some sensor data from Arduino to an internet server in a mobile scenario (i.e., where Ethernet is not an option)?
share|improve this question

2 Answers 2

  1. MQTT by definition is a TCP/IP protocol, so if you don't have a TCP/IP stack, then it is a no go.
  2. A common pattern/infrastructure in the IoT is to have your "things" connect to a hub of some kind (via BLE, XBee, or ... etc.) and then the hub will connect to the network and post the data. Another option would be to get a cellular device that provides a data connection (i.e. 2G/3G) and therefore a TCP/IP stack. It looks like the SIM900 only supports calls and texts, and as of this moment I am not aware of such a device that has libraries for Arduino.
share|improve this answer

The SIM900 allows creation of TCP sockets through an AT style command language, so this addresses point #1 of the previous comments concern.

This is only half the story though, you'll still need to learn how to create the requests, and handle the responses of the MQTT protocol using the SIM900's protocol.

There may be usable examples to start from in the ESP8266 community, as their style of TCP API looks similar to the SIM900.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.