-1

Hey I am trying to work with the serial port of my raspberry pi model 2B with a raspbian jesse OS. I have disabled the serial login shell over serial in the advanced options. I have enabled uart in the config.txt. However I am noticing that my dmseg command is not working, and I do not have access to ttySX ports or ttyUSB ttyAMA ports. Can someone explain this to me?

When I type dmseg | grep tty, it says dmseg: command not found.

If I cannot write serially to these ports is there a way I can add the missing ports, because when I look through the boot/cmdline.txt I see console = serial0, 115200 console = tty1. What are these consoles? I appreciate any help.

The program i am running is

import serial

port = serial.Serial("/dev/tty1", baudrate=115200, timeout=3.0)

while True:
    port.write("\r\nSay something:")
    rcv = port.read(10)
    port.write("\r\nYou sent:" + repr(rcv))
Zotto
  • 45
  • 1
  • 6

2 Answers2

0

The following is about the Pi3, but does explain about the serial ports How-do-i-make-serial-work-on-the-raspberry-pi3

If you are using a recent Raspbian the default serial port is /dev/serial0 - /dev/ttyAMA0 on older releases.

Milliways
  • 62,573
  • 32
  • 113
  • 225
0

Switching the port to dev/tty without any numbers for some reason allowed the code to function correctly. That was harder than I wanted it to be, thanks for the help though.

Zotto
  • 45
  • 1
  • 6