So, I am sending data to RP1 B+ model through UART from a microcontroller. I am using minicom to collect data and log it in a .txt file. I am sending around ~800 kB of data and using a baud rate of 1.15 mbps. The problem I am facing is that it takes a bit more than 4 minutes to collect and log all the data.
I tried to do the same using RP3 B+ model and apparently it seems like both RP 3B+ and RP 1B+ have mini UART and the normal (higher throughput UART). But when I am sending data to RP 3B+ through microcontroller, it just takes ~13 seconds at 1.15 mbps baud rate (To clarify, on my RP 3B+, for UART communication, I am using ttyAMA0 on serial 0 and I disabled Bluetooth). And I have configured RP 1B+ in the same way, ttyAMA0 on serial 0, but I don't get the same results (I have attached image of my /dev folder on RP1 B+ model).
I performed the steps as mentioned in (and this is the only tutorial I found for RP 1B+) https://www.abelectronics.co.uk/kb/article/1035/serial-port-setup-in-raspberry-pi-os for RP1 B+. Further, I also disabled the Bluetooth. It still takes too much time . I am not sure what is the problem with my RP 1B+ model.
I tried logging the data in different file formats, but looks like that doesn't matter, it always takes around same time to collect and log all the data.
Can anybody suggest me how to tackle the issue? Thanks!
UPDATE: I wrote the below script. When running this in RP B+, it takes ~9 minutes to log the data and when running in RP 3B+, it takes 1.5 minutes for the same. Any suggestion on how can I reduce the "9 minute" time?
import time
import serial
ser = serial.Serial(
port='/dev/serial0',
baudrate = 1152000,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
)
text_file = open("1.txt", 'w')
while True:
if ser.inWaiting():
x=ser.readline()
text_file.write(x)
text_file.flush()
close the serial connection and text file
text_file.close()