Hello.
I have a temperature sensor that sends info over Lora to TTN. Everything works fine here.
I have been able to get this data to my own server, by using MQTT and node red. everything works fine here as well.
But now I also want to display this data (just one temperature), on a webpage that we host (from one.com). This is a webpage uses something called “web builder” (not wordpress).
This is where I run into problems, and desperately need helps!
I am a HW-guy, so I have made all the HW, so now when it comes to these hig level language am I quite lost.
To the web page can’t I use MQTT (no support from there side there), so I’m “stuck” on using theirs “code-box”, which is a text-box where I can type in some sort of code. I been told that JavaScript will work.
But how to I fetch the data from TTN?
I have tried to enable “Storage Integration” and get data by the GET-command, But I can’t get that to work.
To be able to test things, I have started to use node red and try to use JavaScript to get the info, but I only get the {“code”:12,“message”:“Not Implemented”} back.
I have function there with this code:
msg.method = “post”;
msg.url = “https://eu1.cloud.thethings.network/api/v3/as/applications/xxx/devices/eui-xxx/packages/storage/uplink_message”;
msg.payload = `-X ‘GET’ \
-H ‘Accept: text/event-stream’ \
-d ‘limit=10’ \
-d ‘after=2022-05-01T00:00:00Z’ \
-H ‘content-type: application/json’ \
-H ‘Authorization: Bearer NNSXS.xxx’ `;
msg.headers = null;
msg.cookies = null;
return msg;
Then this is sent to a HTTP-request.
But as I mention above, doesn’t it work (get back code 12).
Any suggestions on how I should solve this problem?
I thought it wouldn’t be that difficult to display one small message on a web-page.
Can also mention that I have search in the forum, documentation and google for a couple of days, without solve it. Usually my stubbornness helps my solve it in a while, but now google starts to run out on pages…