HTTP integration with node-RED

Can anyone point me to a tutorial or an example on how to use LoRaServer HTTP integration with node-RED?
I would like to use node-RED to receive, process and return messages from/to my devices.
Thanks in advance.

I found this with a quick google: https://cookbook.nodered.org/http/ :slight_smile:

Hi @abreups!

I dont know if you have tried, but I strong recommend to you connect over MQTT broker. It is much better and you can view the data at the time it is sent over the server without make refreshes.

Best Regards!

@brocaar, thank you. I found some node-red docs too, but as I am new to both node-red and the loraserver, I am a bit lost on how to connect both…

@RogerioCassares, thanks. As I am really new to all of these, how do I make it work? I know the concept of mqtt, how to post and how to subscribe to a topic on the command line, but how do I use both the loraserver interface and another end to get the messages? If anyone knows a step-by-step tutorial it would be really helpful.

This is what I tried to do so far:

  1. when my end-device transmits a message I can see it at the ‘Live LoRaWAN frame logs’.

  2. I created an HTTP Integration and for Uplink data URL I put http://localhost:1880/test.
    2.1. localhost = loraserver and node-red are running in the same AWS instance.
    2.2. /test is where I intend to read from in node-red.
    2.3. port 1880 is where I access node-red’s IDE and where I expect it to receive the messages (I assume this is how it should be done).

  3. I created this node-red flow:
    [{"id":"7d80677e.103cb","type":"http in","z":"1f78bd24.536513","name":"","url":"/test","method":"post","upload":false,"swaggerDoc":"","x":150,"y":160,"wires":[["e234fe5a.994c58"]]},{"id":"e234fe5a.994c58","type":"debug","z":"1f78bd24.536513","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":320,"y":180,"wires":[]}]
    (which is basically an http node reading /POST from /test and a debug node).

  4. when my end-node sends a message, it gets to the gateway but nothing is seen in node-red.

Any clues?

I made a second test in order to try to figure out how to use HTTP integration:

  1. I created a simple node.js/express.js app that listens to POST requests to /test
  2. I put it to run and then I issue the following command from a completely different machine:

curl http://<ip address>:3000/test

  1. I see the log in my node/express app that it receives the request.
  2. When I configure Integrations…Endpoints…Uplink data URL with the same URL (http://<ip address>:3000/test) and my device sends messages that show up in the gateway’s Live LoRaWAN frame logs screen, nothing reaches my node/express app.

Any help would be appreciated.

For future reference: what solved my problem was to disable the frame counter validation (while creating a device), as I have to reboot my device several times for testing purposes.

2 Likes

Hello sir. I am facing the same issue. I have created my HTTP end point in node red but i am not receiving any data from the chirpstack application server by setting the url as http://localhost:1880/test. I have also disable frame validation as you suggested. I have tested http integration with end point post.bin and it works fine . I have used curl comand to test my HTTP end point and it also works fine. So the main issue is that i am not receiving http post json data on my end point created in node-red from chirpstack application server running locally on my PC. Thank you

You can subscribe to the application or to the device through MQTT, NodeRED has MQTT in and MQTT out nodes. Maybe this work for you. Here an example
image
This mqtt node is connected to the Application ID 3, it will see information of each node registered in this application and the output it will be a parsed Json object(in the format you can see in the Device DATA tab, already decoded but in base64 format)
Here you can see the topics you can subscribe, to get data:
image
Hope it works for you.

1 Like

I really appreciate your coment on my post.Thank you. I have already implemented mqtt with node red and its was working fine.But I have also find the solution for implementing http end node. I just change the url in http integration to http://192.168.197.131:1880/test (ip address of my pc find using ifconfig ) instead of http://localhost:1880/test. May be it help others

Hi, are you able to share details of how you got the data into Node-Red? Trying to the same but without luck so far.
Thanks in advance

https://cookbook.nodered.org/http/post-json-data-to-a-flow
maybe it helps you.