login RPi via serial port

Since I have bought a product from adafruit, I need to know how to connect my RPi from PC via serial port.

Login via Serial port

By default, RPi can be login via serial port due to program getty is running configured in /etc/inittab

Bootup info

When RPi boots up, it would send boot info to serial port since the file /boot/cmdline.txt.

Disable serial port when boots up

  • add # character to the begining in file /etc/inittab
    #T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
  • remove all reference to ttyAMA0 in file /boot/cmdline.txt
    From
    dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
    To dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Reboot

sudo reboot

Test the serial port

  • stty -F /dev/ttyAMA0 9600
  • minicom -b 9600 -o -D /dev/ttyAMA0
  • python serial
    ser = serial.Serial("/dev/ttyAMA0",9600)
    ser.open()

Reference:

Raspberry Pi and the Serial Port
get terminal access to Pi over USB/serial cable
RPi_Serial_Connection
raspberry-pi-and-arduino-connected-serial-gpio
Raspberry Pi Serial Console With MAX3232CPE

转载于:https://my.oschina.net/l1z2g9/blog/162505

Remote Desktop Products USB for Remote Desktop Access local USB devices in remote Windows session. Sound over RDP Use local headsets and microphones in remote Windows session. Webcam for Remote Desktop Use local webcams in remote Windows session. Printer for Remote Desktop Use local printers in remote Windows session. Scanner for Remote Desktop Use local scanners in remote Windows session. USB Products USB over Network Share and access your USB devices over local network or Internet. USB Monitor Pro USB protocol capturing, decoding, displaying, filtering, errors detecting and much more what cannot be done by others. Virtual Serial Port Products Virtual Serial Port Kit Create virtual serial ports connected via a virtual null-modem cable. Network Serial Port Kit Share and access any serial devices or create virtual null-modem cables over a TCP/IP network or the Internet. Serial Port Redirector Redirect serial data from Virtual Serial Port to TCP/IP network. Serial Port Splitter Share dataflow of one serial port among several applications or join dataflow of several serial port devices to one application. Serial Port Mapper Map serial port to any other port name, swap existing serial ports. Virtual Modem Use Internet instead of direct phone calls to connect regular communications software. Serial Port Developer Components Serial Port Control Easy to use control intended for simplification serial port communication tasks in your projects. Virtual Serial Port Control Create and control virtual serial ports to which any serial communications software can connect.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值