-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thread migrated from Lilygo github #1
Comments
Thank you for all that info. |
Here's another useful link: nik |
Hi nikthefix.
|
@momosh13 The USB_Host_Shield DOES support a hub in the pipeline so it looks like it would make be a better choice in your case. ////////////////////// Try to connect a external power supply to the Arduino - this solves the problem in most cases. Upon reflection, In many ways the combination of ESP32-S3 + USB Host Shield is a more flexible setup as it means that you can still use the native ESP USB for MSC, CDC, Midi, Mouse/keyboard emulation etc - features which would be stolen by the ESP USB HOST mode if used. One typical use case would be an HID keyboard re-mapper which takes the keyboard input and translates the keycodes before resending them using the ESP as a keyboard emulator. Or perhaps a QWERTY to Midi controller. You couldn't do this with a single ESP32-S3 unless you implemented an additional 'soft / bitbanged' USB device. Very slow. nik |
The device is this https://decimator.com/Products/MultiViewers/DMON-16S%20MultiViewer/DMON-16S.html here you have |
@momosh13 You have the PC control software but I assume you want to delegate that control to an MCU. Am I right? If you have a datasheet of USB descriptors then please post them here. If the project warrants it you can invest in USB Sniffer hardware which will allow you to intercept and monitor the USB traffic between device and PC transparently. Not cheap but very forensic - and vital if there's a lot of handshaking between host and device - in the absence of datasheets. If you were doing a lot of work like this then it would be a good investment. But the best course of action right now is to get ESP32-S3 + USB HOST shield working with a USB keyboard and printing off to the Arduino serial monitor (and flashing the caps lock, scroll lock, num lock leds - it's a good test). Until that's working to your satisfaction then there's no point in venturing into unknown territory with your device. Let me know what you think. nik |
It will work with ESP32-S3 but the TinyUSB library doesn't have the huge range of device support that the USB HOST shield 2.0 library offers. Still, it could be a useful diagnostic tool and is in active development. nik |
Hi |
Ah OK, I don't have that board myself but I've read about it and looked at Paul's code. Connect your device and make a note of the the Report Descriptor size and any other device specific attributes displayed. From here on you're dealing with a black box as you have no documented protocol. Is there any open source software available designed to communicate with this device? If so then you can simply look at the code to extract the protocol. I could help with that. If not then I'm afraid you're up against the 'intellectual property' brick wall. It's understandable that device manufacturers sometimes need to keep their devices 'closed' as the support software is often at least half the product. What are you trying to achieve? Is it possible that the packaged software allows for scripting? nik |
Thank you again. https://github.com/Stuart-Burton/DeciMate?tab=readme-ov-file This guy, is doing it, I think, but on Raspberry Pi, and there is a example code for it, maybe you can get some thing out of these, to make Arduino code. so i can test it. |
One more thing. 5 x windows 1b 00 a0 24 08 16 0a d7 ff ff 00 00 00 00 09 00 00 03 00 17 00 02 03 53 00 00 00 00 40 00 40 48 48 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 08 48 08 08 48 08 00 40 00 08 48 08 00 40 00 08 48 08 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 08 48 08 00 40 00 00 40 00 00 40 48 6 x windows 1b 00 60 5a 43 1c 0a d7 ff ff 00 00 00 00 09 00 00 03 00 17 00 02 03 53 00 00 00 00 40 00 40 48 48 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 08 48 08 08 48 08 00 40 00 08 48 08 00 40 00 08 48 08 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 08 48 08 00 40 00 08 48 08 00 40 48 7 x windows 1b 00 20 4a 36 18 0a d7 ff ff 00 00 00 00 09 00 00 03 00 17 00 02 03 53 00 00 00 00 40 00 40 48 48 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 08 48 08 08 48 08 00 40 00 08 48 08 00 40 00 08 48 08 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 08 48 08 08 48 08 00 40 00 00 40 48 if you lock at this hex's , there is a similarity between them, maybe this will give you little idea about the protocol? My goal / dream is to do this switching with Arduino, that's it, noting more than that. |
So possibly Stuart-Burton's project has the info you need. If it's designed to work with your specific device then then codes you need will be in there. Give me a while to look over his files. |
Hi nik |
Hello again. Do you have a RPi to test Stuart's code? For ESP32-S3 RNDIS support code can be found here: I'll see if I can find a more Arduino friendly example. BTW there are other usb-network standards: Check the Decimator docs to see which one is employed. nik |
Hi, All this time, I was trying to do something about this, but I realized, 0 chance for me to do this, so you think, you can do simply code for esp32 or teensy boards, so I can some how start / try to sending commands to Decimator? |
Hi momosh. Yes, like I mentioned above, unless you have access to the product specific protocols it's almost impossible to engineer a custom controller. You made it clear that the manufacturer wouldn't share the information - which is fair as they need to protect their IP. A hardware based USB (man-in-the-middle) protocol analyser is the only way I can see to reverse engineer the comms. Unfortunately I have neither an analyser nor the Decimator product so It's not something I could do either. But if you wish to persevere then Stuart's project above looks like the viable route. Get it up and running on the RPi and it may be possible to port some of the functionality to a microcontroller. |
Thread migrated from Lilygo github....
momosh13 commented yesterday •
Hi nikthefix
If you're still in this forum, I have a question for you, if I may?
I don't know anybody, who my help me, but you:)
I'm working on this project many months and almost no progress, I'm trying to send HEX command from Arduino / USB Host to USB device to control some functions. I tried it, Teensy 4.1 with https://github.com/PaulStoffregen/USBHost_t36 library, and Arduino USB Host Shield 2.0 with https://github.com/felis/USB_Host_Shield_2.0 library, no luck.
I need to send this HEX
1b 00 a0 24 08 16 0a d7 ff ff 00 00 00 00 09 00 00 03 00 17 00 02 03 53 00 00 00 00 40 00 40 48 48 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 08 48 08 08 48 08 00 40 00 08 48 08 00 40 00 08 48 08 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 08 48 08 00 40 00 00 40 00 00 40 48
to (Vendor Specific) USB Device. I got the HEX, by sniffing communication between Windows control software and the device, with Wireshark.
Please, maybe you can help me again.
Thank you
@nikthefix
nikthefix commented 15 hours ago •
@momosh13
I have some of these USB host boards so I can look into it with you. Which board are you using?
There is the Uno shield and the smaller design from here:
https://circuitsathome.com/usb-host-shield-for-arduino-pro-mini/
There are cheap clones of the 'mini' circuits at home design version which are slightly different in the power delivery department. A small hardware mod is necessary to bring the clones in-line with the original. Details can be found here:
https://geekhack.org/index.php?topic=80421.0
What does the vendor specific device enumerate as in your computer device manager?
Does it use a custom USB driver or is it class compliant?
I have the host shield working fine with the CDC USB of my laser cutter GRBL controller, and I've had it working well with keyboard / mouse and also FTDI.
These host boards are usually limited to driving only devices catered for in the libraries - CDC, keyboard, joystick, MSD etc.
For custom devices (non-class compliant) you may have to write your own driver. But the Arduino lib you mention does have many device profiles - not all standard class compliant - so it's possible you could adapt one of these profiles.
I suspect that your device is USB-HID generic. If so then that's a good thing.
I suggest initially testing your hardware by trying the USB Keyboard profile - just to make sure that the 500ma power requirements are met, or at least sufficient to drive your device (assuming it's bus powered).
The ESP32-S3 can also act as host natively - bypassing the need for SPI comms.
https://github.com/tanakamasayuki/EspUsbHost
I've been using this solution myself and it's neat as it uses no extra hardware. You just need a dev board with 2 usb ports and a wire jumper to bridge 5v to the host port and a USB OTG cable.
nik
@momosh13
momosh13 commented 3 hours ago
Thank you for reply
I have two hardwere otions and i have no problem connecting to my device and read the info from it, the device is USB-HID.
i have teensy 4.1 board, please see the picture
IMG_3169
and with https://github.com/PaulStoffregen/USBHost_t36 library, example HIDDeviceInfo
the serial monitor giving me this
T4 1 info
then i have Arduino USB Host Shield 2.0 with theensy 4.0, please see the picture
IMG_3173
whit this one, https://github.com/felis/USB_Host_Shield_2.0 library, exsample USB_desc, i'm geting this
T4 0 info
So, my problem is, i don't now how to send the HEX command to my device, i have no idea.
About the HEX in the previous post.
in the Wireshark, i see this
#1
2
3
4
5
6
7
8
9
10
11
@momosh13
momosh13 commented 1 hour ago
I just got one of this to, if you thing, this will make it easier
51LRBUCGc+L AC_SL1050
@nikthefix
nikthefix commented 27 minutes ago •
@momosh13
OK all that info really helps.
First I'd try the Teensy setup and run the example:
https://github.com/PaulStoffregen/USBHost_t36/tree/master/examples/RawHID/RawHIDtoUSBHostRawHID
Copy the VID and PID from your HIDDeviceInfo dump into the example sketch and start experimenting with Report Descriptors from there.
Here's a useful tool for Windows which will allow you to test data strings to confirm functionality:
https://www.researchgate.net/figure/HID-terminal-program-used-to-send-commands-to-micro-controller_fig11_268323254
I think it's important to establish working HID comms between PC and Device using the HID terminal before migrating to the MCU as it'll probably save a lot of time in the end.
You'll probably also need vendor specific documentation for your device Report Descriptor format. This is not revealed in the HIDDeviceInfo dump so it's guesswork unless it's class compliant or you have documentation.
However, you can reverse engineer it by looking closely at the HID terminal I/O while messing around.
Can I ask what the HID device product is?
Also, all things being equal, do you need your final project to use Teensy or are you hoping to use ESP?
We should move this chat as it's not a Lilygo topic. I'll add a repo on my github (https://github.com/nikthefix). Let's carry on there.
nik
The text was updated successfully, but these errors were encountered: