Issue with sending data fast over serial and lora

Hello. I have an issue sending data over my project. What i do is, compute some data using an arduino mega, then send these data to my lora transmitter module (lora32ua), receive them to my lora receiver (lora32ua) connected to my laptop and finally print them on my serial monitor. I had no problem reading the data succesfully at my monitor until i sent more data every loop. Then after a while the chatacters were getting distorted. After some time even the loop broke and had a mind of his own printing garbage. I thought that was happening because i didn't give enough time for each buffer to be trasmitted but even after i added delays, the problem continued. Any help will be much appreciated. I really need it.

I attach the codes on the post because they dont fit. It is a big code so focus only to the data i send to Serial2 which is lora32ua trasmitter.

gps_compass_ziegler_method.ino (15.4 KB)

lora_transmitter.ino (3.65 KB)

lora_receiver.ino (3.2 KB)

test2.txt (44.3 KB)

It sounds like you are giving your receiver more data then it can adsorb. Try slowing it down a bit, maybe taking a bit more time between data transmissions.

You need to do the numbers.

How much data are you trying to get from the Mega to the laptop and how often are you sending it ?

Then work out how fast you have the LoRa device configured for, it could be anywhere between 18bps and 37500bps, the difference might be important.

What handshaking have you implemented, as in what happens when you try to transmit but the receiver is still busy ?

Hello and thank you for your time and your replies. Sorry for my late reply, iam working and i didnt have time for my project. So to the point. If it is possible i want to send many buffers in one loop of arduino. If you see my first sketch, i send many times one after another in one loop with baudrate 9600. I just add delay(100) when i use my 32 byte buffer to send the next one. Then when these buffers reach the transmitter, it uses the rf95 library to transmit them. It uses the lora modulation with the settings 868.0MHz, 23dBm transmit power, Bandwidth = 125 kHz, Cr = 4/5, Sf = 128chips/symbol, CRC on. Then the receiver receives these buffers and sends them to my serial monitor with 9600 baudrate.

Increase the LoRa bandwidth to 500khz.

Does that make the problem better or worse ?

And cut the transmitter power, you dont need the max power, which is actually 20dBm, unless you are going for many km or range. If the devices are close, then be nice to them and cut the power to 10dBm, or less.

1 Like

interesting i used rf95.setModemConfig(RH_RF95::Bw500Cr45Sf128); to switch to a faster bw for shorter range and lowered the power to 13 dBm as you said and it works pretty good.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.