I want to connect old Dell Latitude D630 laptop with my Raspberry pi 2 via serial port. I have been following tutorial on this page and another here.
Unfortunately I can't transmit any data from raspberry to dell laptop. I have created a small python script which uses serial
module to listen to port every second and output the result. This script is started on Dell laptop. On my raspberry I am running another script that simply writes the keyboard input to serial port. I can see that something is transmitted because every time I type in a message and hit enter small orange light indicator blinks on my level shifter, and when running screen /dev/ttyAMA0 115200
it blinks with every keystroke I make, so something is going on. However the script on my dell laptop that runs in a loop reading its serial port /dev/ttyS0
reports nothing.
Here is the script used on Dell laptop:
#!/usr/bin/env python
import time
import serial
ser = serial.Serial(
port='/dev/ttyS0',
baudrate = 115200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=1
)
while 1:
print 'SERIAL PORT:', ser.readline()
time.spleep(1)
Raspberry pi script
#!/usr/bin/env python
import time
import serial
ser = serial.Serial(
port='/dev/ttyAMA0',
baudrate = 115200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=1
)
while 1:
message = input('>> ')
ser.write(message)
time.spleep(1)
With all connected and set up the first script outputs nothing when I am writing to port on raspberry pi.
Needless to say that I tried various things, like screen, minicom
-- the message is not transmitted from raspberry to dell although the light indicator is blinking.
Both user of Dell and Rasppi is in "dialout" group, rasp pi has its ttyAMA0 port open and working.
So, my question is -- what am I doing wrong? Maybe I should just write and read to the same port on the same machine? How do I transmit data then?
I am attaching photos of how the rasp pi is connected to the laptop: