Home/Support/Support Forum/Trouble opening a serial port on a Transport WR41
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Trouble opening a serial port on a Transport WR41

0 votes
I am running a very simple Python script in an attempt to communicate with a device connected to serial port 0:
import os serfd = os.open("/com/0", os.O_RDWR | os.O_NONBLOCK)

For some reason, the Python interpreter cannot resolve os.open:
AttributeError: 'module' object has no attribute 'open'

Any ideas what I could be missing?

python.zip is intact as shipped.

The -v option shows that python.zip/os.pyc is loaded.
asked Jan 26, 2015 in Digi TransPort by jrussell New to the Community (1 point)

Please log in or register to answer this question.

1 Answer

+1 vote

here is a simple piece of code that will open asy 0 and pass a message

fw = open("asy/00", "w")

answered Jan 27, 2015 by James.Wilson Veteran of the Digi Community (1,227 points)
Thanks for the reply. That worked. Wonder why the Digi Transport python distribution doesn't support the os.open!? Given something like: n = fw.write(message), when would n = None? I can't seem to confirm that message was written to my device.