python - Raspberry pi3 Serial communication not working -


i have call monitoring system on raspberry pi. working fine on raspberry pi 2. pi3 not transmitting data on serial port. simple program

import serial port=serial.serial("/dev/ttyama0",baudrate=10417,timeout=.05) address=1 port.write(chr(address)) 

it not receive data. there may configuration problem. edited /boot/cmdline.txt file

sudo nano /boot/cmdline.txt 

removed console=ttyserial1,115200 kgdboc=ttyserial1,115200.

but didn't /etc/inittab file comment out t0:23:respawn:/sbin/getty -l ttyama0 115200 vt100

sudo nano /boot/config.txt 

added @ last of page

dtoverlay=pi3-disable-bt enable_uart=1 

to disable bluetooth modem

sudo systemctl disable hciuart     

what configuration have more receive data serial port??

assuming did usual set serial port, had working on pi2 before, case raspberry pi 3 has changed things around bit, ttyama0 refers serial port connected bluetooth. old serial port called ttys0. if have rpi3, everywhere see "ttyama0" below, should read "ttys0".

so......

import serial port=serial.serial("/dev/ttys0",baudrate=10417,timeout=.05) address=1 port.write(chr(address)) 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -