I am testing my ability to measure and display temperature using LoRaWAN. I have a Seeed Grove-Wio-E5 demo board that is presently sending temperature as a 4-byte float encoded as a hex string through my gateway and into TTN/Sandbox. I can see the correct JSON at my registered device in TTN. I now want to plot temperature vs time. I expect to create a free test account at some web service, create a simple plot display there, and to somehow send my temperature to this service where it will appear on my plot. I’m a bonehead! Can someone please suggest a tutorial which shows an example of this data flow? I’ll get us started… an example of recasting my 4 byte hex into float within TTN and thereafter sending…??
Thanks in advance!
Mike
You might be doing the right thing but this sounds so wrong. Are you using the AT firmware and do you mean you translate the bytes of the float to hex equivalent to feed it to the module?
Btw, temperatures rarely need float. Two byte integer with the temperature multiplied by 10 to have one decimal should by sufficient. Gives you a range of about -300.0 to 300,0 degrees.
I expect you’ll need to do some homework yourself. Tutorials get outdated pretty fast due to changes at the web services (interface pricing structure, limits on ‘free’ accounts,)
I would start by checking the integration page on TTN and check the sites to see if there is one that meets you needs. That might require you to change the temperature data format for correct processing as different services require different things.
Hi Jac, thanks for reply.
Thanks for TTN integration page advice. I’m looking there now.
Yes inaccurate temperature can be expressed in fewer than 4 bytes and LoRaWAN is all about low data rate. I’m just exploring now, so I accepted the goal of plotting floating point temperature. Partial success! I can encode IEEE 754 32 bit float, send, and decode to ASCII at TTN. Now I seek to understand how to move my float from TTN to some cloud plot of temperature vs arrival time.
I paid for a udemy course “lora-lorawan-internet-of-things” (absolutely first rate by the way) where in Section 11 there is an example of “MING” (Mosquito, influxdb, node-red, Grafana) stack that, when cobbled together, can hopefully attain my plotting goal. So I’ve found my requested tutorial and I hope it works. Any other suggestions are welcome!
Thanks for the reply!
Mike
Make sure it is a floating point at influx level otherwise Grafana won’t be able to plot a graph. (Hard earned knowledge) Best way is to decode not to ascii but to a float at TTN.
Thanks for advice. By “ASCII” I mean that I don’t know what I’m doing. I use a TTN uplink formatter to transform uplink 4 bytes into I guess a JavaScript float type. But anyway I see in JSON at my endpoint, activity, the “oxygen” (I lied and used “temperature” for simplicity since temperature is the common starting measurement) value of 8.576… which is identical to the float value I sent (encoded as a ASCII string of 4 hex) at my Seeed Grove-Wio-5 development board. See below.
Thanks for the influx warning. Someday I may know what this warning means. Right now my goal is receiving my oxygen value into NodeRed operating on my desktop PC with a next goal of the same but with NodeRed operating on some cloud location such as AWS. AWS will be completely new territory :(.
Thanks!
Mike
“uplink_message”: {
“session_key_id”: “AY6Ky5+zpKQ4Q4PFdATF4g==”,
“f_port”: 8,
“f_cnt”: 8,
“frm_payload”: “QQk6IQ==”,
“decoded_payload”: {
“oxygen”: 8.576691627502441
}
Please don’t, context is everything when answering technical questions and it just gets so confusing when people suddenly drop in some extra or altered detail. For temperature 1dp is usually enough, but now we know why you need more dp’s.
As for ASCII, it sounds / looks like you are sending the float as 4 bytes as a binary hex array as opposed to sending a string of 8.576
which would take five bytes. But hard to tell as we can’t see your code from here and I suspect you are being modest about what you know & can do. Are you using the LoRa-E5 as an AT modem or coding STM32WL?
Before you tackle AWS, you’ll feel so much better getting your dashboard up & running. Then you can have something that works whilst you figure out the total gorilla of running Node-RED on big iron!
Q: Are you using the LoRa-E5 as an AT modem or coding STM32WL?
A: I am using AT commands with the Seeed Studio board. For example the float 8.287055 is sent by sending the string AT+MSGHEX=“410497C7” by UART to the Seeed board. On the TTN side I have a short Custom Javascript Formatter which essentially typecasts the 4-byte array back to 8.287055.
So I have proved I can send a float via LoRaWAN and Seeed Grove-Wio-5 development board with LoRa-E5 module.
Towards my plotting goal, I can use the TTN MQTT integration with NodeRed (running on my localhost) to move my float 8.287055 into NodeRed via a NodeRed -mqtt in- block. This works. Another step along the way.
On to influxdb… I have a NodeRed palette member -influxdb out- so I’m ready to move measurements from NodeRed out to influxdb.
I’m still a bonehead and rather than try to install influxdb onto my localhost (Windows 10), and rather than mess with scary AWS, I found a influxdb server at the influxdb web site where I created a free account. Almost there almost there… I made a token. In Node-RED I must set up the -influxdb out- block with the URL for the influxdb server, and the token. I have the token.
I don’t know the URL for the influxdb server. The influxdb web interface where I see my account is at URL: InfluxDB. Maybe this is the URL?
But URL https://us-east-1-1.aws.cloud2.influxdata.com:8086 does not work. Neither does http://us-east-1-1.aws.cloud2.influxdata.com:8086.
I’m on the correct track since I see API statements in on-line documents like
post "https://us-east-1-1.aws.cloud2.influxdata.com/api/v2/write?bucket=BUCKET_NAME&precision=s"
where I see the same https://us-east-1-1.aws.cloud2.influxdata.com.
So I've crashed for now. Maybe tomorrow I'll get the bear.
Thanks for your reply!
Mike
News… I found video on YouTube " [
Linking Node Red to InfluxDB Cloud which describes the process.
It works.
Turns out that the proper information is presented by the influxdb GUI by selecting the organization, and then settings.
On to graphing…
After the last couple of posts, please consider moving on to Discourse 101: How do I format my forum post? [HowTo]
Yes, I agree, my posts were inelegant. I’ll polish further posts. Thanks for referring me to How do I format my forum post! And thanks for replies to my posts. Very good to have a little help once in a while.
Mike