https://github.com/takuti/mbed-os-example-treasure-data
Sending sensor data from Mbed OS to Treasure Data
https://github.com/takuti/mbed-os-example-treasure-data
iot mbed-os treasuredata
Last synced: 9 months ago
JSON representation
Sending sensor data from Mbed OS to Treasure Data
- Host: GitHub
- URL: https://github.com/takuti/mbed-os-example-treasure-data
- Owner: takuti
- License: apache-2.0
- Created: 2018-10-27T00:00:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-31T22:00:32.000Z (over 7 years ago)
- Last Synced: 2025-02-12T07:54:29.107Z (over 1 year ago)
- Topics: iot, mbed-os, treasuredata
- Language: C++
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Sending Sensor Data from Mbed OS to Treasure Data
===
This example is a modified version of [BlackstoneEngineering/mbed-os-example-treasuredata-rest](https://github.com/BlackstoneEngineering/mbed-os-example-treasuredata-rest).
## Running on [mbed-simulator](https://github.com/janjongboom/mbed-simulator)
Install the simulator with [mbed-cli](https://github.com/ARMmbed/mbed-cli) and [emsdk](https://github.com/juj/emsdk):
```sh
# ...
cd /path/to/emsdk
# Follow installation instructions...
source ./emsdk_env.sh
cd /path/to/mbed-simulator
npm install
```
Set target database name and your API key at the top of [main.cpp](./main.cpp):
```cpp
const char *td_database = "TARGET_DATABASE_NAME";
const char *td_table = "sensor_data";
const char *td_apikey = "YOUR_API_KEY";
```
Place this example under `mbed-simulator/demos/`, and build all demos:
```sh
mv /path/to/mbed-os-example-treasure-data demos/treasure-data
sh build-demos.sh
```
Update `mbed-simulator/viewer/simulator.html` so you can launch the Treasure Data demo on your web browser:
```diff
diff --git a/viewer/simulator.html b/viewer/simulator.html
index d52055a..1b46d30 100644
--- a/viewer/simulator.html
+++ b/viewer/simulator.html
@@ -47,6 +47,7 @@
Time over UDP
LoRaWAN
LoRaWAN (ABP)
+ Treasure Data
Load demo
```
Launch a web server:
```sh
cd /path/to/mbed-simulator
node server.js
```
Launch the demo at: http://localhost:7829/#treasure-data
See the database on the Treasure Data console: https://console.treasuredata.com