Control IoT LoRa Node pHAT for Raspberry Pi through Node-RED?

Hello everybody

Do any of you have a IoT LoRa Node pHAT for Raspberry Pi?
How do you control it?

I would like to send data to it over NodeRed. Has anyone already done anything in this direction or would have an approach?

Why NodeRed:
I want to connect several sensors (temp and other states) to this Raspberry Pi using Zigbee and then correlate and send them via Node Red.

for other suggestions I am always interested in

I would also like to have some reading material to study. Found only few informations so far…

1 Like

the phrases to search for: RAK811 AT commands, node-red-node-serialport
In the description of the pHAT it’s stated the RAK811 is connected to RPi via TTL/Serial
What you need to figure out is:

  1. how to control RAK811 with serial console
  2. how to implement the basic operations (init, send, recv) in Node-Red. The node to handle serial port is called “node-red-node-serialport”

And don’t forget to attach antenna before you start to experiment!!!

2 Likes

Thank you a lot! I will try to do this soon, without these hints I think I would have looked forever :smiley:

1 Like

I’ve exactly the same setting. Did you get it to work?

This is a very well solved solution so you shouldn’t have concerns about it working - you just need to do the searches recommended above to gather the information.

1 Like

no, unfortunately it didn’t work for me, which is why I took a workaround using 4G. Did it work for you?

Or can someone give me more helpful tips?

Much like the original post in this thread, that’s not really a meaningful question.

We should start with the fact that TTN is really for reporting small amounts of information, not for “controlling” things.

If someone has such a reporting need compatible with the severe data rate / day and unreliability constraints of TTN, and has a node which fully and correctly implements LoRaWan via a sound and correct LoRaWan stack, there are options.

But queries lacking specifics of a fitting need are meaningless.

FWIW while there are exceptions generally speaking LoRaWan is not a fit for tasks where the node could/would include a pi.

My scenario:

I have several Zigbee sensors which all feed the data to a Raspberry Pi. I would like to transmit the average value and or alarms when a value is too high via Lora.

The calculation and many more conditions I calculate everything in Node Red.

Also I would like to control a fan via a relay on this Raspberry, mostly it does this by itself (regarding the values from above) but it would be nice to be able to control it manually.

I am not really interested in active control and I think that this is very compatible with the conditions of TTN.

I can also directly access a python script via node red, but to directly access it via serial would be awesome of course.

1 Like

I have a very similar case. It didn’t work for me too, that’s why I also took a 4g router stick to solve my problem.

Next I stuck due to bad internet connection in the underground. Therefore I had to install a external antenna for my 4g router.

All that effort only because i didn’t get the pHAT running with node red.

As a final step I will spend some money on Fiverr to get this project working the way I want it.

this is the same point with my project.
currently two wifi extenders and a separate 4G modem.

I would rather set up another 4G Lora Gateway and cover the area for everyone. Than to fool around with the 4G here.

Let me know if you do, I would also contribute financially here.

Look up the TTN fair use policy.

Will the data from all of your sensors joined together for radio transmission fit in packet sizes / intervals allowed under that policy? Because you only have one radio, as far as TTN policies (not to mention radio regulations) are concerned, it’s one device and only gets one allowance, not many.

Also I would like to control a fan via a relay on this Raspberry, mostly it does this by itself (regarding the values from above) but it would be nice to be able to control it manually.

You’d basically only be able to queue a request which would be sent down in response the next time the node sends one of its uplinks.

This would fit in my case, as I said I only want to transmit the average value, as well as alarms if necessary. This would be perfectly in line with TTN’s fair use policy.
This is maybe two uplinks a day with a small payload like the average temperature of all sensors.

With the new TTN V3 it is possible to run a class C node, which is always on receive I would like to solve it like this. If this is at all possible with this node, otherwise I would take a second node for this operation.

Seems like you’re well on your way to researching the things you’d need to consider; which implies you’re also capable of figuring out how to do it.

I have a question regarding the Raspberry Pi LoRa Node pHAT… After reading every tutorial I tried the example scripts and tried connecting to TTN over the shell - but:

pi@raspberrypi:~ $ rak811v3 --debug join
DEBUG:rak811.serial:Serial initialized
DEBUG:rak811.serial:Sending: >at+join\r\n<
DEBUG:rak811.serial:Received: >ERROR: 99<
RAK811 response error 99: LoRa join failed

Whenever I change to:

pi@raspberrypi:~ $ rak811v3 -v set-config lora:join_mode:1
Configuration done
pi@raspberrypi:~ $ rak811v3 --debug join
DEBUG:rak811.serial:Serial initialized
DEBUG:rak811.serial:Sending: >at+join\r\n<
DEBUG:rak811.serial:Received: >OK Join Success<

it seems to work - but NO data is collected within TTN and I don’t get any response. Any ideas please? :slight_smile:

You actually need to send some data - all you’ve done is ask for some session keys from the network server.

I did! „Message sent“ but nothing within TTN

Where does it say that in your log above?

pi@raspberrypi:~ $ rak811v3 --debug -v send ‘Hello’
DEBUG:rak811.serial:Serial initialized
DEBUG:rak811.serial:Sending: >at+send=lora:1:48656c6c6f\r\n<
DEBUG:rak811.serial:Received: >OK <
DEBUG:rak811.rak811_v3:No downlink
Message sent.
No downlink available.

Just to be clear, “no downlink” is normal - you’d have to ask the console to send something to the device.

  • What gateway do you have?
  • Looking on the gateway at its activity log, does it hear the transmission?
  • Does anything appear on the TTN gateway console?
  • Which version of TTN are you set up on?
  • How far apart is the Pi & the gateway?

To progress I’ll need answers to all of the above please.

Hmm… now I am confused. I have this device a Raspberry Pi LoRa Node pHAT and I thought that’s to be used as gateway, isn’t it?

Nothing on the TTN Gateway console…