KevinOConnor / ut61_serial

Tool to read serial output from a UNI-T UT61x digital multimeter
GNU General Public License v3.0
5 stars 1 forks source link

Error: "io.UnsupportedOperation: fileno" on Windows 10 #1

Open jpnielsen opened 3 years ago

jpnielsen commented 3 years ago

I appreciate your effort, I would like to use your UNI-T software to perform calibration of my analog synthesisers. I'm not a very good programmer, so it's nice when someone has made some software allready - perhaps i can expand it with Open Sound Control myself - ultimately, I need the voltage readout from the multimeter in VCV Rack.

I get the error below, when I run "read_dmm.py" on windows 10. I have a UNI-T 61E - It works with the UNI-T software

Python 3.9.7, pyserial 3.5

./read_dmm.py COM1

Traceback (most recent call last): File "C:\msys64\home\jpn99\projects\ut61_serial\read_dmm.py", line 116, in main() File "C:\msys64\home\jpn99\projects\ut61_serial\read_dmm.py", line 113, in main dmm.readserial() File "C:\msys64\home\jpn99\projects\ut61_serial\read_dmm.py", line 75, in readserial res = select.select([infile], [], [], 2.0) io.UnsupportedOperation: fileno

jpnielsen commented 3 years ago

https://docs.python.org/3/library/select.html

The "2 sec timoute wait until the infile is readable", "select.select" function seems to give the error.

"File objects on Windows are not acceptable, but sockets are. On Windows, the underlying select() function is provided by the WinSock library, and does not handle file descriptors that don’t originate from WinSock."

so far no luck writing a replacement

KevinOConnor commented 3 years ago

Ah, never tried it on Windows so I'm not sure. You could try removing the select and converting to a 100ms sleep followed by a check for infile.inWaiting()..

-Kevin

jpnielsen commented 3 years ago

And I moved to linux, to find this error:

python3 read_dmm.py /dev/ttyS1

Traceback (most recent call last):
  File "/home/jpn/ut61_serial/read_dmm.py", line 116, in <module> main()
  File "/home/jpn/ut61_serial/read_dmm.py", line 113, in main dmm.readserial()
  File "/home/jpn/ut61_serial/read_dmm.py", line 88, in readserial data = leftover + d
TypeError: can only concatenate str (not "bytes") to str

Originally made in python2 i'm guessing. I will owe you many thanks, if you will update it to Python3.

jpnielsen commented 3 years ago

I just found another way,

sigrok-cli --driver=uni-t-ut61e-ser:conn=/dev/ttyS1 -O analog --continuous

P1: 0.0 mV DC AUTO
P1: -0.2 mV DC AUTO
P1: -0.2 mV DC AUTO

https://sigrok.org/wiki/UNI-T_UT61E