Skip to content

BlackstoneEngineering/mbed-os-example-treasuredata-rest

Repository files navigation

Introduction

This example demonstrates how to use the Treasure Data REST API to send data from mbed OS to Treasure Data. In this example we will grab device information on the CPU, Heap, Stack and System information and forward it on to treasure data to log.

Pre-Requisites

  • Treasure Data Account
  • Treasure Data REST API Key
  • Mbed OS Account

How to use

  1. Copy / Paste your Treasure Data API key into the mbed_app.json file
  2. If using Wifi copy / paste the SSID / Password into the mbed_app.json file
  3. Create Database in your Treasure Data account called test_database for the program to send data to
  4. Compile and Run code on board (mbed compile --target auto --toolchain GCC_ARM --flash --sterm) (or (compile it in the online compiler)[http://os.mbed.com/compiler?import=https://github.com/BlackstoneEngineering/mbed-os-example-treasuredata-rest])
  5. View data in Treasure Data (it will take 3-5 minutes to appear)

What does this look like?

How to send data from Mbed OS to Treasure Data with HTTPS

What if i'm not using Wifi? Or a different Wifi?

Thats awesome! In this program we are using the ism43362 wifi on the ST IOT01A board, but if you have a different board just swap out the network driver and change the config setting in the mbed_app.json file and you're good to go! All the NSAPI IP based drivers are compatible, so it works with Wifi, Ethernet, Cellular, ...etc.

How is this working?

See the readme on the Treasure Data REST API Library.

Troubleshooting

SSL Failure

If over time the SSL cert expires you will need to replace the cert in treasuredata-sslcert.h. You can do this by running openssl s_client -connect in.treasuredata.com:443 -showcerts and replacing the cert with the lat one in the chain that is displayed.

HTTP failures

Try a different access point, double check you changed your Treasure Data API keys and the SSID / Password for the wifi are set correctly in mbed_app.json.

Liscense

Apache 2.0

About

Example Application for Mbed OS using the Treasure Data REST API library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages