1. Raspberry Limitation & How to solve it - zacharytomlinson/saspy GitHub Wiki
The Raspberry present some challenges when comes to UART and Serial connections. In the specific:
The mini UART is a secondary low throughput UART
intended to be used as a console. The mini Uart has the following features:
- 7 or 8 bit operation.
- 1 start and 1 stop bit.
- No parities.
- Break generation.
- 8 symbols deep FIFOs for receive and transmit.
- SW controlled RTS, SW readable CTS.
- Auto flow control with programmable FIFO level.
- 16550 like registers.
- Baudrate derived from system clock.
As per SAS documentation, for the connection, you need:
19.2 KBaud in a "wakeup" mode. The 11-bit data packet consists of one start bit, eight data bits, a ninth ‘wakeup’ bit, and one stop bit.
As you can see, you will never be able to connect successfully to a machine using ONLY the Raspberry. Here how to solve this pickle.
Solution 1
Use an RS-232 to TTL logic level converter. We tested the MAX3323
In case you decide to buy and use the MAX3323 remember to:
- Update your machine:
user@host> sudo apt-get update
user@host> sudo apt-get dist-upgrade
user@host> sudo apt-get clean
- Enable UART in config and disable bluetooth
echo "enable_uart=1" >> /boot/firmware/config.txt
echo "dtoverlay=disable-bt" >> /boot/firmware/config.txt
- Disable getty (serial agent for console login) ''' sudo systemctl stop [email protected] sudo systemctl disable [email protected] '''
- Ensure console is not set in cmdline.txt ''' sudo nano /boot/firmware/cmdline.txt ''' Remove "console=serial0,115200" from text if applicable
- Reboot for changes to take effect
sudo reboot
- Configure serial connection to "serial0" port in config.yml (If you are using the default tx and rx pins on pi (8,10))
connection:
serial_port: /dev/serial0
Solution 2
Buy and use an USB to serial adapter, we tested this one from Prolific and works like a charm and nothing has to be done on raspberry.