Set Pin high through LoRa
-
Dear all,
is there an easy way to set an output pin on the LoPy high/low remotely using LoRa? As far as I was told you can only receive a downlink after successful uplink transmission, which would mean that it is not feasible. But after reading the description of class C devices I am not sure anymore.
Can anyone help me with this one? Thanks in advance!
-
@jfs yes, shall be OK. Simply give it a try.
-
@jmarcelino @crumble
Thank you both for your answers. I understand that I would need a time-constrained and changing access key for a proper application, but first I would like to run some simple tests. So would be enough to hardcode an access key and test it like for example here:while True:
if s.recv(64) == b'HARDCODEDKEY123456789':
p_out.value(1)
time.sleep(5)
-
@crumble
Good point, thanks! Yes adding an identifier sequence of bytes is a good idea.Also if you want any security you'll need to do some encryption (and change keys to avoid replay attacks), raw LoRA unlike LoRaWAN does not do this.
-
@jmarcelino said in Set Pin high through LoRa:
@jfs
Yes just send a value that the other side then interprets as turning on or off.But this can be really dangerous. You will receive any LoRa message of your surrounding. Opening a door if the first byte is 0x01 may not be very smart ;) You have to find an envelope to distinguish your messages from others.
-
@jmarcelino
thanks a lot!
-
@jfs
Yes just send a value that the other side then interprets as turning on or off.Maybe the latest hackster LoRa example from @seb can also help as it uses LoRa to communicate and send the colour of the LED to set:
https://www.hackster.io/user83346052/lora-sensor-network-for-detecting-a-robot-1ae1f9
-
@jmarcelino
Thank you very much for your quick reply! I am quite new to LoRa so I would like to ask you another question. Using two LoPy would be a good enough solution for me. Can I use: https://docs.pycom.io/chapter/tutorials/lopy/lopy-lopy.html to send
p_out.value(1) or
p_out.value(0)
from one to the other device instead of the "ping" and "pong" from the example.
-
In LoRaWAN if you're using Class C you can receive at any time, but not many (public) networks support it also it's more power hungry because the radio
You can however use raw LoRa if you're just trying to do it point to point (e.g. from LoPy to LoPy)