Simulating temperature readings from Smartphone to Bluemix
Posted: 11:38, 16 Feb 2016
I want to send ( or simulate temperature readings ) from the smartphone to Bluemix.
Going thru the tutorial https://evothings.com/evothings-does-mqtt-with-bluemix/ and I found it is doing some publish.
How do I post a temperature in "json" format ?
The temperature will be something like 20, 24, 31, and so on.
Appreciate if you could help with a SAMPLE line.
=== Cut and Paste === from your app.js ===
setupCanvas () {
...
var msg = JSON.stringify({from: app.pos, to: {x:x, y:y}, color: app.color}) << == what would it be for temperature which is an integer.
app.publish(msg);
..
}
==X== Done Cut and paste ===X==
Going thru the tutorial https://evothings.com/evothings-does-mqtt-with-bluemix/ and I found it is doing some publish.
How do I post a temperature in "json" format ?
The temperature will be something like 20, 24, 31, and so on.
Appreciate if you could help with a SAMPLE line.
=== Cut and Paste === from your app.js ===
setupCanvas () {
...
var msg = JSON.stringify({from: app.pos, to: {x:x, y:y}, color: app.color}) << == what would it be for temperature which is an integer.
app.publish(msg);
..
}
==X== Done Cut and paste ===X==