henla464 / USB_Host_Shield_Library_2.0

Forked "USB Host Shield Library 2.0" with CP210x driver
15 stars 2 forks source link

Using libraries with BK Precision LCR Meter 879B #1

Open phavens opened 6 years ago

phavens commented 6 years ago

I see it has been some time since you forked this project and no one must use it too much since I don't see any other issues here. I hope you are not indifferent to my trouble. It amazes me that the other guys have never made their libraries so that they can talk to this family of IC's.

Initially I was ecstatic when I found your fork which included the CP210x interface. I was even more impressed when after some head scratching it actually communicated with a NodeMCU using the CP2102 IC. But when I connected to a BK Precision LCR Meter Model 879B which also requires Silicon Labs drivers, it acts like it is configured but it sends/receives nothing it seems. No errors that I can tell.

I am no expert on any of this USB mumbo-jumbo, so trying to find out why something spread out over 20 or 30 files doesn't work, is pretty discouraging.

I get some stuff like this from Wireshark when the meter is hooked up to the PC:

Device descriptor: Descriptor Length: 12 Descriptor type: 01 USB version: 0110 Device class: 00 Device Subclass: 00 Device Protocol: 00 Max.packet size: 40 Vendor ID: 10C4 Product ID: EA60 Revision ID: 0100 Mfg.string index: 01 Prod.string index: 02 Serial number index: 03 Number of conf.: 01

Configuration descriptor: Total length: 0020 Num.intf: 01 Conf.value: 01 Conf.string: 00 Attr.: 80 Max.pwr: 32

Interface descriptor: Intf.number: 00 Alt.: 00 Endpoints: 02 Intf. Class: FF Intf. Subclass: 00 Intf. Protocol: 00 Intf.string: 02

Endpoint descriptor: Endpoint address: 81 Attr.: 02 Max.pkt size: 0040 Polling interval: 00

Endpoint descriptor: Endpoint address: 01 Attr.: 02 Max.pkt size: 0040 Polling interval: 00

This is all I get when it starts up on an Arduino UNO connected to a NodeMCU:

Start CP210x Init Addr:01 NC:01 Conf.Val: 01 Iface Num: 8E Alt.Set: 80 Conf.Val: 01 Iface Num: 8E Alt.Set: 80 NumEP:03 Conf:01 CP210x configured Sending Freq *IDN?

This is what I get when it's connected to the meter:

Start CP210x Init Addr:01 NC:01 Conf.Val: 01 Iface Num: 6D Alt.Set: 80 Conf.Val: 01 Iface Num: 6D Alt.Set: 80 NumEP:03 Conf:01 CP210x configured Sending Freq

I will attach the Wireshark recordings here too. I don't really know what I'm looking at there either.

I hope you can help me.

Thank you,

phavens

NodeMCU_connect.zip

henla464 commented 6 years ago

Hello!

Unfortunately the USB stuff is mumbo-jumbo to me too! The only parts I added was the parts specific to CP210x, and that didn't require me to learn much USB related things. Or how this library works... It was also a couple of years ago that I stopped using it.

I looked at your attached logs, I also don't know what I am looking at. They look similar to each other...

My code that uses the library can be found here: https://github.com/henla464/WiRoc-Arduino/blob/master/SIStation.cpp and here: https://github.com/henla464/WiRoc-Arduino/blob/master/WiRoc-Arduino.ino

Maybe you can look and see if you do any initialization different? And is the settings for baudrate/databits etc correct?

phavens commented 6 years ago

Thank you Henrik,

I will look at your code. I thought it might be kind of a long shot and a while since you had thought about it maybe. But you obviously knew more than I do so I gave it a try. If I am able to get to the bottom of it, I will edit my complaint.

Thanks again,

Phyll Havens