Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Multimeter USB output

185 views
Skip to first unread message

Joe

unread,
Aug 27, 2016, 3:35:23β€―PM8/27/16
to
Hi,

I'm using Python 3.5.1 with PyUSB 1.0 under Win 10 (64). We try to read
the USB output of a DMM 'UT61B'.

import usb.core
import usb.util
import usb.backend.libusb1

def Gosub():
dev = usb.core.find(idVendor=0x1a86, idProduct=0xe008) # Digital
Multimeter UT61B
if dev == None:
print ('Multimeter not found')
else:
print ('Multimeter was found')
dev.set_configuration()
cfg = dev.get_active_configuration()
intf = cfg[(0,0)]
ep = usb.util.find_descriptor(
intf,
custom_match = \
lambda e: \
usb.util.endpoint_direction(e.bEndpointAddress) == \
usb.util.ENDPOINT_IN)
if ep == None:
print ('ep is None')
else:
s = ep.read(64, 500)
print ('Len s: ' + len(s))

print ('Starting')
Gosub()
print ('Ready.-')

Result:

File "d:\work-d\PythonProgs\ut61b.py", line 27, in <module>
Gosub()
File "d:\work-d\PythonProgs\ut61b.py", line 23, in Gosub
s = ep.read(64, 500)
File "D:\Python3\Lib\site-packages\usb\core.py", line 402, in read
return self.device.read(self, size_or_buffer, timeout)
File "D:\Python3\Lib\site-packages\usb\core.py", line 988, in read
self.__get_timeout(timeout))
File "D:\Python3\Lib\site-packages\usb\backend\libusb1.py", line 851, in
intr_read
timeout)
File "D:\Python3\Lib\site-packages\usb\backend\libusb1.py", line 936, in
__read
_check(retval)
File "D:\Python3\Lib\site-packages\usb\backend\libusb1.py", line 595, in
_check
raise USBError(_strerror(ret), ret, _libusb_errno[ret])

usb.core.USBError: [Errno 10060] Operation timed out

What's wrong? How to fix?

Regards -- Joe

Terry Reedy

unread,
Aug 27, 2016, 6:45:33β€―PM8/27/16
to
I presume you saw
Starting
Multimeter was found

> File "d:\work-d\PythonProgs\ut61b.py", line 27, in <module>
> Gosub()
> File "d:\work-d\PythonProgs\ut61b.py", line 23, in Gosub
> s = ep.read(64, 500)
> File "D:\Python3\Lib\site-packages\usb\core.py", line 402, in read
> return self.device.read(self, size_or_buffer, timeout)
> File "D:\Python3\Lib\site-packages\usb\core.py", line 988, in read
> self.__get_timeout(timeout))
> File "D:\Python3\Lib\site-packages\usb\backend\libusb1.py", line 851, in
> intr_read
> timeout)
> File "D:\Python3\Lib\site-packages\usb\backend\libusb1.py", line 936, in
> __read
> _check(retval)
> File "D:\Python3\Lib\site-packages\usb\backend\libusb1.py", line 595, in
> _check
> raise USBError(_strerror(ret), ret, _libusb_errno[ret])
>
> usb.core.USBError: [Errno 10060] Operation timed out
>
> What's wrong? How to fix?

Read (again?) the doc for the interface for the device. Because reading
timed out, I suspect that it is waiting for a command for it to send
something.

--
Terry Jan Reedy

Joe

unread,
Aug 28, 2016, 5:13:39β€―AM8/28/16
to
Yes, I saw this:

Starting
Multimeter was found

The UT61B has two interfaces, a RS232C interface and this usb interface.
The RS232 interface works well with PySerial. It continously transmits 2
.. 3 Pakets per second with 14 Bytes each. This happens unsolicited
without any command as long as the RS232C/USB button on the DMM is active.

So I assumed the USB interface also doesn't need any command and also
transmit this stream of 2 to 3 Pakets per second. But unfortunately I
don't have any doc for the USB interface for this device.

To the accompanying software of the UT61B there is a ready windos app
which shows and logs the output of the UT61B. This app can be switched
between RS232C and USB; both work.

I asked the manufacturer (Uni-T in Shenzen) for additional info and are
now waiting for an answer.

Assumed the USB interface sends this 2 to 3 pakets per second
unsolicited - should the code shown work? Is this ok:


>> lambda e: \
>> usb.util.endpoint_direction(e.bEndpointAddress) == \
>> usb.util.ENDPOINT_IN)

I am in doubt: Is usb.util.ENDPOINT_IN really correct?

Thanx - Joe

Terry Reedy

unread,
Aug 28, 2016, 6:32:23β€―AM8/28/16
to
I do not know as I have not used the usb package.

--
Terry Jan Reedy

Joe

unread,
Aug 29, 2016, 4:54:36β€―AM8/29/16
to
Am 28.08.2016 um 17:22 schrieb Dennis Lee Bieber:
> If you can read spaghetti coded C, you might want to study
> https://sourceforge.net/projects/ut61/

Interesting, but... The last time I did something with c, it was with
BDS-C under CM/M. Somebody remenbering this no-fp compiler from the dark
age before PC und Linux?

Joe

unread,
Aug 29, 2016, 4:56:42β€―AM8/29/16
to
Am 29.08.2016 um 10:54 schrieb Joe:
> it was with BDS-C under CM/M.

under CP/M, of course.

Rob Gaddi

unread,
Aug 29, 2016, 1:20:06β€―PM8/29/16
to
Joe wrote:

> The UT61B has two interfaces, a RS232C interface and this usb interface.
> The RS232 interface works well with PySerial. It continously transmits 2
> .. 3 Pakets per second with 14 Bytes each. This happens unsolicited
> without any command as long as the RS232C/USB button on the DMM is active.
>

From someone who does a LOT of code to talk to DMMs, scopes, counters,
etc? Word of advice. You're done. Declare victory and move on.

You've got it working on one interface. The other is even less well
documented and requires doing deep-down stuff against libusb because
there's no actual kernel driver, and you've got a Chinese manufacturer
of a low-end device being of little to no help so now you're trying to
reverse engineer the protocol from bad code without even the help of a
packet sniffer. This is the sort of rabbit hole that weeks manage to
fall into with nothing to show for them.

If this is an exercise in learning to work with libusb then have at.
But if what you actually need from this is to talk to the meter? You're
talking to it already. Take the win and walk.

--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com

Email address domain is currently out of order. See above to fix.

Larry Hudson

unread,
Aug 30, 2016, 12:21:25β€―AM8/30/16
to
On 08/29/2016 01:54 AM, Joe wrote:
[snip...]
> Interesting, but... The last time I did something with c, it was with BDS-C under CM/M. Somebody
> remenbering this no-fp compiler from the dark age before PC und Linux?

I remember it well. It's what I used to initially learn C. I'm a completely self-taught, hobby
programmer. Been around since the MITS Altair. How many remember that beast??

(And yes -- as you already corrected yourself -- that's CP/M not CM/M.)

--
-=- Larry -=-

Paul Rubin

unread,
Aug 30, 2016, 12:24:46β€―AM8/30/16
to
Larry Hudson <org...@yahoo.com> writes:
>> with BDS-C under CP/M. Somebody remenbering this no-fp compiler from
>> the dark age before PC und Linux?
> I remember it well. It's what I used to initially learn C.

Source code is online here:

http://www.bdsoft.com/resources/bdsc.html

I've looked at it a little. I don't know if I ever might have had it in
me to write big chunks of asm code like that. Wow!

Joe

unread,
Aug 30, 2016, 3:01:30β€―AM8/30/16
to
Great surprise. Very interesting this link. Thank you, Paul.

D'Arcy J.M. Cain

unread,
Aug 30, 2016, 7:10:20β€―AM8/30/16
to
On Mon, 29 Aug 2016 21:21:05 -0700
Larry Hudson via Python-list <pytho...@python.org> wrote:
> I remember it well. It's what I used to initially learn C. I'm a
> completely self-taught, hobby programmer. Been around since the MITS
> Altair. How many remember that beast??

Remember it and still have it in the basement.

--
D'Arcy J.M. Cain
System Administrator, Vex.Net
http://www.Vex.Net/ IM:da...@Vex.Net
VoIP: sip:da...@Vex.Net

Joe

unread,
Aug 30, 2016, 9:56:22β€―AM8/30/16
to
Am 30.08.2016 um 13:01 schrieb D'Arcy J.M. Cain:
> On Mon, 29 Aug 2016 21:21:05 -0700
> Larry Hudson via Python-list <pytho...@python.org> wrote:
>> I remember it well. It's what I used to initially learn C. I'm a
>> completely self-taught, hobby programmer. Been around since the MITS
>> Altair. How many remember that beast??
>
> Remember it and still have it in the basement.
>
I read a lot about the Altair in Byte in those days, but never had a
chance to touch it. Wasn't it horrible expensive?

D'Arcy J.M. Cain

unread,
Aug 30, 2016, 11:52:35β€―AM8/30/16
to
I can't remember what is was going for but I bought mine used for
$1,000. It had a number of add-ons including a keyboard and floppy
drives. The power supply was also beefed up.

It also had a replacement bezel. It seems that the original Altair's
silk screened front panel was crappy and rubbed off easily. Some
company sold one but it says "Cycloid" instead of "Altair" on it.

Joe

unread,
Aug 30, 2016, 2:52:08β€―PM8/30/16
to
Am 30.08.2016 um 17:52 schrieb D'Arcy J.M. Cain:
> On Tue, 30 Aug 2016 15:56:07 +0200
> Joe <te...@joepgen.com> wrote:
>> Am 30.08.2016 um 13:01 schrieb D'Arcy J.M. Cain:
>>> On Mon, 29 Aug 2016 21:21:05 -0700
>>> Larry Hudson via Python-list <pytho...@python.org> wrote:
>>>> I remember it well. It's what I used to initially learn C. I'm a
>>>> completely self-taught, hobby programmer. Been around since the
>>>> MITS Altair. How many remember that beast??
>>>
>>> Remember it and still have it in the basement.
>>>
>> I read a lot about the Altair in Byte in those days, but never had a
>> chance to touch it. Wasn't it horrible expensive?
>
> I can't remember what is was going for but I bought mine used for
> $1,000. It had a number of add-ons including a keyboard and floppy
> drives. The power supply was also beefed up.
>
> It also had a replacement bezel. It seems that the original Altair's
> silk screened front panel was crappy and rubbed off easily. Some
> company sold one but it says "Cycloid" instead of "Altair" on it.
>

I think the first BASIC Interpreter ever sold by Gates & Friend was for
this machine? How did you use your floppy drives on this machine
(Open-Write-Close)?

D'Arcy J.M. Cain

unread,
Aug 30, 2016, 3:48:52β€―PM8/30/16
to
On Tue, 30 Aug 2016 20:51:54 +0200
Joe <te...@joepgen.com> wrote:
> I think the first BASIC Interpreter ever sold by Gates & Friend was
> for this machine? How did you use your floppy drives on this machine
> (Open-Write-Close)?

The floppy drive came with an operating system called MDOS - Micropolis
Disk Operating System. Once you loaded it by selecting the ROM address
on the front panel, setting the PC and hitting RUN it took over. There
was a bit of configuration, handled through the switches, that had to
be done and then any further changes were done to the image in memory
and saved to disk.

When I finally upgraded to a whopping 64K of RAM (with a Morrow S-100
memory board) I had to blank out the section where the disk controller
sat in memory.

Larry Hudson

unread,
Aug 30, 2016, 3:52:26β€―PM8/30/16
to
On 08/30/2016 04:01 AM, D'Arcy J.M. Cain wrote:
> On Mon, 29 Aug 2016 21:21:05 -0700
> Larry Hudson via Python-list <pytho...@python.org> wrote:
>> I remember it well. It's what I used to initially learn C. I'm a
>> completely self-taught, hobby programmer. Been around since the MITS
>> Altair. How many remember that beast??
>
> Remember it and still have it in the basement.
>

Mine is stuffed into the back of a closet. :-)

It was still working when I stored it, but I don't think I could remember how to bring it up
again. As I recall, you had to set the starting memory address via the front-panel switches β€”
but the details have long since evaporated from my memory. :-(

--
-=- Larry -=-

mm0fmf

unread,
Aug 30, 2016, 4:02:02β€―PM8/30/16
to
Yes. It was a long time ago when I used BDS-C on initially Apple II +
Microsoft CP/M card. Then on other Z80 CP/M systems. I also was
introduced to the editor MINCE (Mince is not complete Emacs) which was
compiled with BDS-C. 33 years ago and it seems like yesterday!

Larry Hudson

unread,
Aug 30, 2016, 4:27:17β€―PM8/30/16
to
On 08/30/2016 11:51 AM, Joe wrote:
> Am 30.08.2016 um 17:52 schrieb D'Arcy J.M. Cain:
>> On Tue, 30 Aug 2016 15:56:07 +0200
>> Joe <te...@joepgen.com> wrote:
>>> Am 30.08.2016 um 13:01 schrieb D'Arcy J.M. Cain:
>>>> On Mon, 29 Aug 2016 21:21:05 -0700
>>>> Larry Hudson via Python-list <pytho...@python.org> wrote:
>>>>> I remember it well. It's what I used to initially learn C. I'm a
>>>>> completely self-taught, hobby programmer. Been around since the
>>>>> MITS Altair. How many remember that beast??
>>>>
>>>> Remember it and still have it in the basement.
>>>>
>>> I read a lot about the Altair in Byte in those days, but never had a
>>> chance to touch it. Wasn't it horrible expensive?
>>

I don't think so. The figure I have in my (very fallible) mind is $300 (or maybe $600) for my
original Altair with 1K RAM and no peripherals.

>> I can't remember what is was going for but I bought mine used for
>> $1,000. It had a number of add-ons including a keyboard and floppy
>> drives. The power supply was also beefed up.
>>
>> It also had a replacement bezel. It seems that the original Altair's
>> silk screened front panel was crappy and rubbed off easily. Some
>> company sold one but it says "Cycloid" instead of "Altair" on it.
>>
>
> I think the first BASIC Interpreter ever sold by Gates & Friend was for this machine? How did
> you use your floppy drives on this machine (Open-Write-Close)?
>

('Friend' is Paul Allan.)

My first floppy was from Northstar Computers. It used the first 5ΒΌ drive made (by Shugart). It
came with it's own DOS and BASIC -- somewhat incompatible with Gates' Altair BASIC, but very
usable. (Anyway, Altair BASIC did not handle disks β€” at least the original version did not.)

The Northstar DOS was somewhat weird due to where it was located in memory. The bottom 8K of
RAM was free, the next 2K was the DOS (that's right a complete Disk-Operating-System in 2K of
memory!). The rest of available memory above that was also free. The BASIC was also loaded in
this memory above the DOS.

Trivia: (and perhaps wrong) β€” The original name of Northstar Computers was Kentucky Fried
Computers.

--
-=- Larry -=-

Christopher Reimer

unread,
Aug 30, 2016, 5:55:04β€―PM8/30/16
to
Paper tape reader. The first time I came across a paper tape reader when I visited the university as a teenager in 1984. A CNC machine read the paper tape to drill six holes in a piece of metal.

Chris R.

Sivan Greenberg

unread,
Aug 30, 2016, 5:57:08β€―PM8/30/16
to
I had a Spectra Video, and I do remember fondly for allowing to experiment
with fractal and all sorts of programming in BASIC.

I recently watched the Steve Jobs movie and it was nice seeing how Apple
was promoting that stage of early personal computers.



On Tue, Aug 30, 2016 at 6:52 PM, D'Arcy J.M. Cain <da...@vex.net> wrote:

> On Tue, 30 Aug 2016 15:56:07 +0200
> Joe <te...@joepgen.com> wrote:
> I can't remember what is was going for but I bought mine used for
> $1,000. It had a number of add-ons including a keyboard and floppy
> drives. The power supply was also beefed up.
>
> It also had a replacement bezel. It seems that the original Altair's
> silk screened front panel was crappy and rubbed off easily. Some
> company sold one but it says "Cycloid" instead of "Altair" on it.
>
> --
> D'Arcy J.M. Cain
> System Administrator, Vex.Net
> http://www.Vex.Net/ IM:da...@Vex.Net
> VoIP: sip:da...@Vex.Net
> --
> https://mail.python.org/mailman/listinfo/python-list
>



--
Sivan Greenberg
Co founder & CTO
Vitakka Consulting

Grant Edwards

unread,
Aug 30, 2016, 6:03:16β€―PM8/30/16
to
On 2016-08-30, Christopher Reimer <christoph...@icloud.com> wrote:

> Paper tape reader. The first time I came across a paper tape reader
> when I visited the university as a teenager in 1984. A CNC machine
> read the paper tape to drill six holes in a piece of metal.

The file containing the list of coordinates generated by a CAD program
for holes in a circuit board is still often referred to as a "drill
tape".

--
Grant Edwards grant.b.edwards Yow! Now that I have my
at "APPLE", I comprehend COST
gmail.com ACCOUNTING!!

Larry Hudson

unread,
Aug 30, 2016, 10:36:22β€―PM8/30/16
to
On 08/29/2016 09:24 PM, Paul Rubin wrote:
> Larry Hudson <org...@yahoo.com> writes:
>>> with BDS-C under CP/M. Somebody remenbering this no-fp compiler from
>>> the dark age before PC und Linux?
>> I remember it well. It's what I used to initially learn C.
>
> Source code is online here:
>
> http://www.bdsoft.com/resources/bdsc.html
>
[...]

I remember reading a magazine interview with Leor Zolman (the author of BDS-C) where he
mentioned what the BDS stood for... He said is was his nickname in college: Brain Dead.

Actually "Brain Dead Software" it was not! It was really quite good, and rather widely used at
the time.

--
-=- Larry -=-

Paul Rubin

unread,
Aug 31, 2016, 12:29:03β€―AM8/31/16
to
Larry Hudson <org...@yahoo.com> writes:
> Actually "Brain Dead Software" it was not!

Brain Damage Software, apparently: https://en.wikipedia.org/wiki/BDS_C

Gregory Ewing

unread,
Sep 1, 2016, 3:00:09β€―AM9/1/16
to
Christopher Reimer wrote:

> The first time I came across a paper tape reader when I
> visited the university as a teenager in 1984. A CNC machine read the paper
> tape to drill six holes in a piece of metal.

I think that would have just been called NC (Numerical
Control). CNC (Computer Numerical Control) is where
a computer drives the machine directly.

--
Greg

Gregory Ewing

unread,
Sep 1, 2016, 3:06:52β€―AM9/1/16
to
Grant Edwards wrote:

> The file containing the list of coordinates generated by a CAD program
> for holes in a circuit board is still often referred to as a "drill
> tape".

Yep, and we talk about "core" memory, use a "tape archive"
program to produce compressed files, and have "drives"
with no moving parts. Terminological fossils abound!

(When I first heard the term "core" used to refer to
RAM, I thought it just meant that it was a central part
of the machine... until I realised it was actually
talking about those little magnetic doughnuts!)

(And I suppose a "core dump" is what would happen if
any of the fragile little wires broke...)

--
Greg
0 new messages