Using the Serial Terminal Program, with the same port, I can send data to the micro and
it works as expected. But, when attempting to use a Python script and pyserial module, no data is
transmitted to the micro. This verified using a scope on the micro's receive data RS-232 line. Using the
Serial Teminal Program, the micro displays the correct information and also is observed at the receive data line as just mentioned.
I can not figure out what else must be done to allow data to be transmitted using the python script.
The script is based on example(s) from different online searches and the pyserial web site.
I am using Ubuntu 12.04 and python 2.73.
I also attached the code in the GEDIT format that runs the python script just in case the snippet embedded is a problem.Code:#!/usr/bin/bin/env/ python import serial import os ser = serial.Serial('/dev/ttyUSB0',9600, timeout =1) ser.open() print ser.portstr # check which port was really used #### ser.portstr prints /dev/ttyUSB0 #### s="1234\n" #Note: neither ser.write sends data to module. ser.write("1234\n") # write a string ser.close() # close port """ Note: I have a miro based external hardware module that displays numerical data received at the external device serial port. It test excellent using a serial term program. I would have thought this would be a simple write ?
Bookmarks