lopy to raspberry pi serial communication issues
-
I have some issues with serial communication a raspberry pi 3, i ll post my codes. If anyone can help me, i would be very grateful! Thanks
this is how it looks what i send
and on raspberry
and the result
-
Imho you problem originates in the use of "read(20)". You could try to send b'33.5|xxxxx|xxx|xxx \n' or after writing r on the lopy you add a uart1.write(chr(13)).
On the Raspi you read rec with rec=ser.readline().
So if one or more chars go missing you don't lose your intended string formatting for the other data.
-
@crumble thanks, i tried...no difference
-
@robert-hh it s disable
-
@crumble It looks as if /dev/ttyAMA0 is also used by bluetooth. You could try to disable it.
-
@crumble This does not seem to be a frequency or baud rate issue. In that case a lot of other characters would show up. It looks more like two processes fighting for input from the same device. So the posters script only get part of that.
-
core fequency has to be set as well:
[https://www.raspberrypi.org/forums/viewtopic.php?t=213499](Link Adresse)
[https://tech.scargill.net/raspberry-pi-3-serial/](Link Adresse)
-
Have you:
TX <-> RX
RX <-> TX
gnd <-> gnd
-
@crumble I deactivate wifi from /boot/config.txt but the output is still in the same manner
-
Have you switch off WiFi functionality of the Pi3?
Once upon a time the Pi3 had trouble to run serial and WiFi at the same time. I don't know if they were able to fix it by software in the past 2.5 years.
-
@robert-hh in last reply is the output with 9600 baud
-
@MusteDaniel it is not the order which changed, there are characters missing. What happens if you reduce the speed to 9600 baud.
-
@robert-hh I modified how you said, but the output is still in the same format
even if i use strings like '123' or like in photos, the order change anyway
-
@MusteDaniel You set uart1 to 115200 baud, but the Serial of the pi to 9600 baud. Since still the printout show proper characters, this is not the primary problem. What happens if you remove the sleep call in the pi?