Home › Forums › The libraries hosted on the site › EByte LoRa e220 UART devices LLCC68 › Master-Slave like modbus on E220 lib
Tagged: lora, master-slave, modbus
- This topic has 6 replies, 2 voices, and was last updated 2 years, 10 months ago by
Ivan.
-
AuthorPosts
-
-
12 July 2022 at 18:10 #21832
I´m newbee with this module but I intend to implement a Master-Slave protocol using E220 lib, something like modbus but I don´t know if it´s possible.
Thanks everybody. -
12 July 2022 at 20:36 #21833
Hi Ivan,
I think you can use the fixed transmission like in the examples in this article.If you give our some details we can try to be more specific.
And if you are Italian remember that the articles are also in Italian.
Bye Renzo
-
12 July 2022 at 23:15 #21835
Ciao Renzo,
Sono di origine italiana, più precisamente di Genova, ma sono nata in Brasile.
I´ll see the article but will give more details:
a) I thought the broadcast mode was just sending from the master to all (or some) slaves. I need two-way communication between master and slaves, with master asking the slaves if there is anything to send in a pooling.
b) If a slave has data to send, it sends and ends with ack/nack. And master pooling proceeds with the next slave.
Basically that’s it, it’s not hard to make a physical RS-485 network but doing it on lora, I’m a little lost.
Thanks for your patience
Ivan Assaritti
-
-
13 July 2022 at 07:50 #21841
Hi Ivan,
do you know what kind of data (and the quantity) you must manage?LoRa has the possibility to send a structured packet or a simple string, so as needed we can create a reliable and efficient transmission protocol, better than modbus which is widely used but has physical limitations.
Bye Renzo
-
13 July 2022 at 17:43 #21865
Hi Renzo.
Our application with more details:
1. Neither the master nor the slaves sleep as they will be powered all the time by the eletricity network
2. Each time a slave has something to send to the master, the set of information does not exceed 8 bytes, but it can be divided into more than one transmission, if necessary, without problem.
3. As soon as the master receives data from a slave, it stops pooling and will process the slave’s operation, only resuming pooling after this processing, which can take up to 1 minute or more.
4. For security reasons, it is mandatory to have CRC and encryption in each communication.
5. The network will always be formed by a master and up to 8 slaves, typically from 2 to 5.
6. We already tried to use an arduino with an RFM95W radio and the lora.h library, changing the LoRaDuplex example but we lost a lot of packages, so we are going to the E220.
I believe is this.
Thanks
Ivan
-
14 July 2022 at 08:14 #21874
Hi Ivan,
now we have sufficient information.
First of all here I add a table comparison of EByte devicesE32 E22 E220 Chip sx1276-sx1278 sx1262-sx1268 LLCC68 Range 3Km - 8Km 5km - 11km 5Km - 10Km Repeater No repeater Repeater No repeater Remote conf No Yes No Power consumption Best Good Very Good Sleep 4μA Sleep 496μA Sleep 6μA Transmission and receiving have similar power consumption. Message size bytes 58 240 200 Buffer size bytes 512 (ok) 1000 (good) 400 Max air data rate (bps) 19.2k 62.5k 62.5k Encryption One standard Configurable Configurable crypt Price Less expensive More expensive Less expensive
1. Neither the master nor the slaves sleep as they will be powered all the time by the eletricity network
If you want we can add after the WOR.
2. Each time a slave has something to send to the master, the set of information does not exceed 8 bytes, but it can be divided into more than one transmission, if necessary, without a problem.
If you select e22 or e220 the packet size is sufficient to send all the data.
3. As soon as the master receives data from a slave, it stops pooling and will process the slave’s operation, only resuming pooling after this processing, which can take up to 1 minute or more.
For this problem, we can adopt various solutions.
- The master tells the various clients when it is available for reception, and polls all clients in rotation.
-
IF the sending frequency is quite low the buffer of the device It’s sufficient.
If you select an e220 you have available 400bytes of buffer and if you set the packet size at 32bytes the LoRa device can store 12 packet without the intervention of the microcontroller.
An e22 can store about 31 packet of data in his buffer (1000bytes). - If you have a high sending frequency you can build a gateway with a microcontroller and put all the packets to a push server and another (or more than one) microcontroller to process the packet.
4. For security reasons, it is mandatory to have CRC and encryption in each communication.
E22 and E220 have configurable and transparent encryption.
You can develop CRC but remember these devices monitor the ambient noise and with a reduction of air data rate, It’s improbably that they lost packet.5. The network will always be formed by a master and up to 8 slaves, typically from 2 to 5.
These devices support hundreds of devices.
Tell me if these informations are sufficient.
Bye Renzo -
14 July 2022 at 19:09 #21879
Hi Renzo,
I believe with your information we can produce an introductory code and test it here.
If the code works, I’ll share it here for everyone’s knowledge.
If it doesn’t work and we can’t figure out why, I’ll call you again 🙂
Thank you very much for your attention!
Ho visto che sei di Perugia.
È una bellissima regione per la sua natura e la sua storia.
Congratulazioni!Ivan
-
-
AuthorPosts
- You must be logged in to reply to this topic.