RPi Serial Troubleshooting Guide

First

*Important* Make sure that you have disabled the console and completed the steps as described in the Serial Preparation section. If not you cannot use the serial pins on the RPi as they are used by the system.

Using Python

The Raspberry Pi has different quirks from Windows and so here is a guide to getting the serial devices working. There is a test program that you can run; down load sv3test here:

wget http://pin1.org/download/py/sv3.py
wget http://pin1.org/download/py/sv3test.py

NOTE: There have been a few versions of SV3 so make sure that the directory you are loading it into has not already got an old copy of SV3 as the above wget will download the program but rename it and so you will not be using the latest version. In other words delete any copies of sv3.py before the above 'wget'

Connect the SV3 device serial. If it is a relay or motor device then leave these disconnected, then do the following:

python sv3test.py

The above will connect with the device and give some instructions if a connection is not made. The test program assumes that the port is /dev/ttyAMA0

Using minicom

This is a last resort as minicom will introduce its own querks such as hardware handshaking that may effect how it works, but at leas with this program if the above failes you will be able to connect TX to RX and cgeck the RPi serial communication.

First you will need a simple terminal so install and run minicom:

sudo apt-get install minicom
minicom -b 9600 -D /dev/ttyAMA0

With the device connected press return a few times and if it is an SV3 device (BV4111, BV4112, BV212) the each time you press return you will get a '*'

Minicom.jpg

If you don't get this then disconnect the device completely and connect in the following order, GND,+3,3V,TX and RX (TX and RX from the RPi point of view). In other words on the SV3 device connect pin 5, pin 3, pin 2 and then pin 1. This 'finicky' behaviour is due to the automatic Baud rate mechanism that works a teat on other devices. Although having said that the Python serial interface seems to handle it well.

Once communication is established then fix the Baud rate by typing into minicom:

dW4,3<ent>

"d" is device address so check with data sheet
This will fix the Baud rate at 9600 and so will not need three CR at start up and the connection sequence will not be a problem. Sheet the data sheet for other Baud rate values, currently 3 is 9600.