Skip to main content
12-Amethyst
October 31, 2015

Delivering Arduino Collected Data to ThingWorx using MQTT

  • October 31, 2015
  • 10 replies
  • 9495 views

ThingWorx provides multiple ways to deliver your data to the server. You can choose from the C based EMS to your own C application that uses the C SDK as well as SDKs for many popular languages but what can you do if the device you want to collect data on is so small that it need a very lightweight data delivery method. Normally you would consider using the REST web service interface and writing your own custom client to post your data by there is an alternative, MQTT. MQTT is a lightweight protocol that can be used from an Arduino with an Ethernet Shield that can stream real time data directly to ThingWorx by installing the MQTT Marketplace Extension on your server.

To learn more about how this kind of solution worked, I created this slide deck while building a hardware example:

DeliveringArduinoDataToThingworx.pdf

Hopefully, it can help others out who want to create this kind of solution as well.

10 replies

14-Alexandrite
March 12, 2016

Hi Bill, does it work to send data to Arduino too or only to get data from it?

Cheers

Ewerton

5-Regular Member
March 15, 2016

See: Arduino Client for MQTT

See: Arduino | MQTT

It appears you need certain Ethernet or WiFi Shields to accomplish the needed connection to the broker.

billrei12-AmethystAuthor
12-Amethyst
March 15, 2016

You can both pushing and subscribe to MQTT topics using the Arduino MQTT library.

billrei12-AmethystAuthor
12-Amethyst
March 15, 2016

Yes. A standard Arduino does not have any network support. You would need to have an ethernet shield to do this particular example.

14-Alexandrite
March 15, 2016

Thanks Bill/Bruce.. I will pass this info on and see if we move fwd .

1-Visitor
June 5, 2017

Great,What if i need to send using GPRS modem

1-Visitor
June 20, 2017

Can anyone provide his Arduino Libraries used for this Project? I have a Problem with "SRAM" and I can not fix it...

5-Regular Member
June 21, 2017

Arduino MQTT Library for SIM800 GSM Modem | Random Codes - Elementz Tech Blog

talks about an MQTT library for use with the SIM800.

1-Visitor
November 14, 2017

Hi Bill, what possible changes would have to be made if I want to do it with arduino wireless shield.

5-Regular Member
November 14, 2017

The big difference between an ethernet shield and a wifi shield is in how you connect. Wifi connections are much more complex than wired ethernet. You have to configure the SSID and likely, a WPA2 passphrase in order to make the connection. See whatever tutorials are supplied for your shield (there are several different ones available). Several of them use a serial connection to store the configuration on the board using programs on your PC to drive the process (for those of you who ever used a dialup modem, they use the same basic AT command approach that was used to configure the modem's behavior to configure the wifi module). See Arduino - ArduinoWiFiShield for details about how to use the Arduino wifi shield. It has code samples that show code-based connection to the network.