Raspberry pi3: C ++ serial communication does not work properly (raspberry pi worked!)

I have a raspberry PI B + with a C ++ application capable of communicating with Arduino. I can read, write, work stably with a serial connection.

Now I bought Raspberry PI3 to have more features and integrated Wi-Fi. After a lot of time, I got the QT application again, but the serial connection did not work. I plugged in an Arduino IDE serial monitor and verified that it worked fine with RPI 1, and I saw all the messages sent via my protocol, so I'm sure I can analyze what I'm writing from Raspberry P3. Unfortunately, I get only strange characters: enter image description here I tried different speeds, for example, 115200 and 9600 (expected speed!), But the result is different, but not so.

I would like to report what I did in my raspberry P3: enter image description here I disabled the serial port for the console (as I understood it on the Internet) These parameters will automatically change the parameter: enter image description here

enable_uart=0

, , , , , "console over serial". ( ), bluetooth , 250 9600. enter image description here bluetooth : enter image description here , ... - . , QT ++: enter image description here "ttyS0" ( "serial1" ).

, , pi3, piB +, GPIO14 GPIO15. bluetooth, .

?

PINOUT PI3 PINOUT PI B +: enter image description here

PINOUT B +: enter image description here

: enter image description here , - , GPIO14 GPIO15 !

+4
1

- ! , , . , p3, .

1)

sudo apt-get update
sudo apt-get dist-upgrade

2) UART

sudo raspi-config

→ serial: enter image description here

. 1 enable_uart config.txt.

3) config.txt

sudo nano /boot/config.txt

, Bluetooth ( ) enter image description here

250, , , (#). "enable_uart = 1", raspi-config.

4) cmdline.txt

sudo /boot/cmdline.txt

enter image description here

, - :

.... console=serial0,115200 ....

5) serial0

enter image description here

6) DONE!

, - .

+1

Source: https://habr.com/ru/post/1650453/


All Articles