MQTT

Hello,

I am aiming to implement MQTT feature on my Arduino mega 2560 board connected to a GSM/GPRS module. I do not have an Ethernet shield or a Wifly shield. Is it possible to implement this feature with a GSM/GPRS module ? Where can i get the relevant library ?

Thank you.

Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.

Other thread deleted.

  • Moderator

I am extremely sorry for that. I am new to this forum. Will take care from next time.

Any suggestion guys ?

Hmm, I'm looking to do this too. MQTT seems a bit thin on examples.

Shame the only response was "use google" :frowning:

Evidently no-one here knows much about it. However Google has:

About 24,700 results (0.25 seconds)

How to use this forum

The OP might have provided a link to explain what MQTT is. Personally I haven't heard of it.

Ah OK, well for people (like me) who are interested but know nothing about it in detail, Message Queuing Telemetry Transport (MQTT) is a protocol defined by IBM that enables simple, low overhead messaging to be passed around a network and uses publish/subscribe principles for communication. It has been cited as an ideal method for low powered devices (such as arduino) or mobile devices to communicate with a service to get some state information or to publish a device's state. Twitter, Google and other trendy apps use this method already for pushing presence status to a device.

Jonathan Oxer (he of freetronics and SuperHouseTV fame) has indicated he thinks it is the way forward for federated home automation...

To the original poster: I have found the following resources to be interesting to Arduino projects

http://blog.m2m.io/post/30048662088/a-simple-example-arduino-mqtt-m2m-io

I hope that is of some help.

Of course for more information, you could use: http://lmgtfy.com/?q=mqtt

Very amusing, however see reply #4. :stuck_out_tongue:

As the "how to use this forum" link suggests, and I know not everyone reads it, if you are going to ask a question about "help with X" it helps to provide a link to X, rather than make people who are trying to help you do extra research to even get started.

I wrote an updated tutorial:
http://chrislarson.me/blog/using-mqtt-connect-arduino-internet-things

Arduino MQTT Library for SIM800 GSM Modem is available at ElementzTechBlog, ElementzGithubRepository

Functionalities:

Auto connect

  • Automatically connect to TCP and to MQTT server.

connect function

  • This function can be used to connect your client to MQTT broker.
  • Use only if you do not use Auto connect functionality.
  • Optionally you can use username, password, WILL topic and WILL
    Message.

OnConnect CallBack function

  • This call back function is called when MQTT connection is
    established.

  • You can call subscription and publish functions inside it (according to your need).

publish function

  • This function can be used to publish messages to different topics.

  • You can select QoS levels and RETAIN flag according to your need.

subscribe function

  • This function can be used to subscribe messages from different
    topics.

OnMessage CallBack function

  • This callback function is called when messages are received from
    subscribed topics

  • Topic, TopicLength, Message, MessageLength are the arguments of
    OnMessage callback function.

  • Inside this, you can write your custom code.

unsubscribe function

  • This function can be used to unsubscribe from a previously subscribed
    topic.

disconnect function

  • This function can be used to disconnect your client from MQTT broker.

Keep Alive

  • You can specify your KeepAlive duration while initializing.

  • Ping requests are sent and received automatically.

Subscribe Publish examples are also provided.