horchi / linux-p4d

Deamon which fetch sensor data of the 'Lambdatronic s3200' and store to a MySQL database
GNU General Public License v2.0
49 stars 22 forks source link

Works with ttyUSB0 but not ttyAMA0 #17

Closed faxm0dem closed 2 years ago

faxm0dem commented 3 years ago

Hi,

I've been using your p4d for years now using a pl2303 USB to serial adapter. p4d is awesome, thanks a bunch again.

I've got a problem that's been bugging me for a long time: I cant' get the Pi's UART to work with p4d. I'm using a MAX232 to level shift the signals from the P4. It works as I tested it with a PC's DB9 port. However, when I use it on the P4 I get nothing at all:

Nov 27 17:54:32 raspberrypi p4d[3102]: Opening '/dev/ttyAMA0' succeeded!
Nov 27 17:54:32 raspberrypi p4d[3102]: Checking state ...
Nov 27 17:54:34 raspberrypi p4d[3102]: Read word failed, aborting
Nov 27 17:54:34 raspberrypi p4d[3102]: Closing io device
Nov 27 17:54:34 raspberrypi p4d[3102]: Error reading serial interface, reopen now!

Here's the device's settings:

# stty -F /dev/ttyAMA0 -a
speed 57600 baud; rows 0; columns 0; line = 0;
intr = <undef>; quit = <undef>; erase = <undef>; kill = <undef>; eof = <undef>; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = <undef>;
stop = <undef>; susp = <undef>; rprnt = <undef>; werase = <undef>; lnext = <undef>; discard = <undef>; min = 0; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke -flusho -extproc

Any help would be greatly appreciated

horchi commented 2 years ago

possibly at the wrong COM port of the heater? The correct /dev/tty device selected? Error in the cabling ?