Decoding node messages in ttn backend


(Toomany Secrets) #1

Trying to set up a node with a DS18B20 to mesure water temp. Does anybody have some code with Cayenne integration?

Or maybe some code to decode the bytes normally.

Cant find anything and this is way over my head.

This is what i have working and sending data to a gateway. I see the packets in the ttn app console.
Have no idea on how to decode them.
https://pastebin.com/vRqgCmwe


(Nidaros) #2

What does your TTN backend console look like?


(Toomany Secrets) #3

You mean the data?


(Nidaros) #4

Yes sir


(Toomany Secrets) #5

This is what i get in the payload 00863C. The temperature reading of the DS18B is 999 since i have no sensor connected at this time. I would like to atleast get that number in cayenne or the ttn app backend.


(Nidaros) #6

If you have no sensor connected then your data will make no sense.


(Nidaros) #7

However if you do have a sensor connected, atleast in my case. The data came in hex format, so a simple decoder or a copy-paste will do. I think programs like node-red do this automatically.


(Toomany Secrets) #8

Well that is what i need to do. I have no idea on how to make a decoder.


(Toomany Secrets) #9

Since the code is sending out the value 999 and i want to convert that to human readable on the ttn console.
Or much better to cayenne dashboard.


(Nidaros) #10

You should only decode valid outputs, for obvious reasons :stuck_out_tongue: I think martijn did a tutorial on this. You can search it on thethingsnetwork youtube channel


(Toomany Secrets) #11

Wow i have no idea on how to implement that for my current code.


(Nidaros) #12

Do you have a valid output? If so, can you send it?


(Toomany Secrets) #13

Maybe i could set it up to read a analog pin?


(Toomany Secrets) #14

Or set up a static value that looks like temperature?


(Nidaros) #15

Try to get it working using the temp sensor. Then report back on what type of output you are getting. If you get stuck you can take a look at my code.

https://pastebin.com/cbnvNbaX

This one uses an analog temperature sensor.


(Toomany Secrets) #16

Could you share the decoding for this?


(Nidaros) #17

There is none :wink: The raw payload goes to node-red.


(Toomany Secrets) #18

That is also a problem for me. I have nowhere to set up a node red server.


(Nidaros) #19

You can try this for 24hrs for free:https://fred.sensetecnic.com/

Try and see if it works. If it does you can always just setup a node-red server on an old pc or even a raspberry pi. My rpi serves as a node-red server but also as my lora gateway


(Toomany Secrets) #20

Ok made it so i get the payload on node red. But still its in bytes format.

In the console i get
11 Jul 09:21:39 - [info] [debug:test]
Buffer 00 86 3c

It did not convert it automaticly.