Two LoRa Socket
-
Hi, I'm making a project where I need to use two LoRa threads, the first one to send a message, and the second one will be always listening, the problem is that when I use this code:
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)On the second thread it gives me an error saying that the socket is busy.
Is there a way to create two LoRa Sockets and use them at the same time?
Thanks in advance -
From what I've read about the LoRa specification, you can only either Receive or Transmit ... but never do the same at the same time.
Maybe, try something like:
s_rx = socket.socket(socket.AF_LORA)
s_tr = socket.socket(socket.SOCK_RAW)and use s_rx when you want to Listen/Receive, ... and when you want to transmit/sends messages use s_tr ...
Since LoRa is for low-power ... it's not part of the Specification to use use a lot of power ...
But, I'll stand corrected :)
-
@ahelllycan Is there a specific reason you need two sockets? Just use the same socket for both. You can even set up a trigger to call a function when a frame is received.
-
@combaindeft I think your confusing functionality of the radios with sockets. Whilst the radio can't transmit at receive at the same time. That doesn't mean the socket can't.
-
@jcaron How can I set up a trigger to send a message?, my lopy is always listening a lot of messages so is always busy.
Thank you
-
@ahelllycan not sure what you mean by a trigger to send? You can receive a callback when a message has been received, but it’s up to you to decide when you want to send.
If your issue is that the channel is constantly busy, then you have a design issue...
-
@ahelllycan I think we would need to see code, or general overview of your process. At the moment we are guessing. But @jcaron is right. You should have a call back on message receive and you choose when to send messages based on other criteria. The rest of the time you will be sleeping or waiting.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login