Unwanted serial input from Pi serial GPIO [solved - disable serial getty!]

Started by noch, September 15, 2016, 11:22:59 AM

noch

Hello,

Trying to get a simple gateway working with a raspberry 3.  I followed the directions and disbaled BT in boot/config.txt and disabled hciuart. 

When I run minicom or pyserial the moteino seems to be receiving a lot of serial input commands because it flashes the chip, prints device id, etc.  Basically, it appears to run through every input option and outputs the results over serial.  Like someone is bashing on the keyboard. 

Any ideas?  I have tried this on two images on seperate SD cards both on a Pi 2 and 3.  I get the same result.


Felix

What is some sample serial content you see?

Does this happen only with the Moteino attached?

noch

Yes, it is only when the Moteino is attached.

Felix

Did you disable the system shell/terminal getty attachment to the GPIO serial?
I think you can disable it with sudo raspi-config

If not, your sketch is probably getting lots and lots of input from the Pi, some of which repeatedly matches the input the sketch is expecting, which then gets spit back to the serial where you see it.

noch

#4
Looks like that was it, makes sense now.  Thanks!

Here is how I did it:

From http://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/

Disabling the Console

If you are using the serial port for anything other than the console you need to disable it. This will be slightly different depending on whether you are running a Raspberry Pi 3 or not.

For non Raspberry Pi 3 machines, remember it's /dev/ttyAMA0 that is linked to the getty (console) service. So you need to perform this command from a terminal window:

sudo systemctl stop [email protected]
sudo systemctl disable [email protected]

sudo systemctl stop [email protected]
sudo systemctl disable [email protected]

The "disable" will stop it loading in the future.

For Raspberry Pi 3's the command is similar but referencing /dev/ttyS0:

sudo systemctl stop [email protected]
sudo systemctl disable [email protected]

sudo systemctl stop [email protected]
sudo systemctl disable [email protected]

You also need to remove the console from the cmdline.txt. If you edit this with:
sudo nano /boot/cmdline.txt

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes root wait

remove the line: console=serial0,115200 and save and reboot for changes to take effect.