Trouble opening a serial port on a Transport WR41

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.

hi

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

   fw = open("asy/00", "w")
   fw.write(message)
   fw.flush()
   fw.close()

regards

1 Like

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.