-
Notifications
You must be signed in to change notification settings - Fork 28
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
USB hub function on ESP32-S3 running ESPHOME #2982
Comments
It needs a lot more than that. The USB device will need a (software) driver on the Pico, and that will depend on what the device is. Why a Pico? There is code for an ESP32-S3 that will operate in USB host mode driving serial ports, but again it depends on what the device is. |
Clyde Stubbs skrev den 2024-12-08 10:02:
It needs a lot more than that. The USB device will need a (software)
driver on the Pico, and that will depend on what the device is. Why a
Pico? There is code for an ESP32-S3 that will operate in USB host mode
driving serial ports, but again it depends on what the device is.
--
Reply to this email directly, view it on GitHub [1], or unsubscribe
[2].
You are receiving this because you authored the thread.Message ID:
***@***.***>
Thanks Clyde,
firstly, the USB connected slave is a rather dumb one which works out of
the box with USB connections on Raspberry 3 and 4 ( which I have tried
successfully).
Secondly, the stupid modbus implementation on the slave requires some
unconventional functions to read certain holding registers. In fact, it
requires dummy writing with fc 0x06 to read the registers, and such
cannot easily be accomplished on the standard modbus implementaion in
HA.
What I am trying to ascertain is if the custom function for modbus in
ESPHOME can get me the desired result - but that requires an ESP device
to have USB host (hub) functionality, hence the Pico.
Now I however realises that the host function need to be activated by
code, which is missing for the RP2040 boards in ESPHOME.
Can you confirm that activating the host function on an ESP32-S3 board
is available in ESPHOME? and whether it is a parameter to be set in the
.yaml configuration file for that board.
Thank you for you help here.
/Robert
Links:
------
[1]
#2982 (comment)
[2]
https://github.com/notifications/unsubscribe-auth/A3QF6VXCPW5LXKFY6OZSJZT2EQDMHAVCNFSM6AAAAABTHAJ5O6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRVGU2DQMRWGY
|
Why are you making it hard? Just take two gpios and connect them ta rs485 transceiver. |
Hi Roman,
yes, I could tear down the slave unit to uncover the RS485 bus, but cas
is that it is an enclosed unit provided by the heat pump maker with only
one USB-B port available. This is why I would rather just do everything
using the available port on the unit.
Roman Priesol skrev den 2024-12-08 11:14:
Why are you making it hard? Just take two gpios and connect them ta
rs485 transceiver.
--
Reply to this email directly, view it on GitHub [1], or unsubscribe
[2].
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
RS485 wasn't mentioned in the original request so I assume it's not involved.
There is currently no USB host support merged into ESPHome for any board, and it's not as simple as "activating the host function". As I said before the device needs a a driver to talk to it over USB. It seems that there is a Linux driver since it works on a Pi, but a Pico is not a Pi and doesn't run Linux. I do have code I wrote that works as an ESPHome external component and enables an ESP32-S3 to drive a USB serial adapter but without knowing what device you are using I can't tell you if it will work. I am using it to talk modbus via a 4 port USB-RS485 VCP vendor specific adapter. It also works with USB CDC (ACM) devices. |
modbus is a protocol working on top of the rs485 physical layer, but it is still uart. So if uart over usb host works, and you have such adapter, then we got a solution :) |
Hi Clyde,
thanks again. The slave is a vendor developed black box. It is something
developed some time back in 2014 and runs a serial connection via a
"Virtual Com port" on the USB. The Comp port settings are:
9600 baud
8 bit word
1 stop bit
No parity
No hardware flow control
So it seems rather basic and your mentioned component might work out of
the box.
/Robert
Clyde Stubbs skrev den 2024-12-08 11:39:
RS485 wasn't mentioned in the original request so I assume it's not
involved.
> Can you confirm that activating the host function on an ESP32-S3 board
> is available in ESPHOME?
There is currently no USB host support merged into ESPHome for any
board, and it's not as simple as "activating the host function". As I
said before the device needs a a driver to talk to it over USB. It
seems that there is a Linux driver since it works on a Pi, but a Pico
is not a Pi and doesn't run Linux.
I do have code I wrote that works as an external component and enables
an ESP32-S3 to drive a USB serial adapter but without knowing what
device you are using I can't tell you if it will work. I am using it to
talk modbus via a 4 port USB-RS485 VCP vendor specific adapter. It also
works with USB CDC (ACM) devices.
--
Reply to this email directly, view it on GitHub [1], or unsubscribe
[2].
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Modbus is a request/reply protocol that is implemented on a wide variety of transports - RS485 is common, but it is also used over RS232, UDP, USB and other transports that have nothing to do with RS485. |
Hi Clyde. Let's not spend more time on the rs485 discussion as this is entirely related to getting the usb host function working to enable the VCP connection to the slave. Thanks again |
What's the VID and PID of the USB device? |
Hi ClydeI did a debug with the USBview application from Microsoft, and that did not even recognize the device. it did trigger the hub and ports to show, but still stated nothing was connected. Question is if it is possible for such device to function without pid and vid?Or, is it because Windows needs special driver here?It does work out of the box with a Rasbperry Pi 4 attached. Sent from my iPhoneOn 9 Dec 2024, at 21.49, Clyde Stubbs ***@***.***> wrote:
What's the VID and PID of the USB device?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Windows: Assuming your device is connected to the computer, go to "Device manager", find your device, right click on it, select "Properties", go to "Details" tab, select "Hardware IDs" from the drop-down, and you will find an entry of a form:
which are correspondingly vendor and product IDs. On Linux: Run the following command from your terminal:
You will see pairs VID:PID near the names of all of the USB devices connected... |
So on Linux the E.g.
The first two of those are hubs, device 003 is a PL2303 USB-serial adapter. Oh I see Robi beat me to it :-) |
Hi Clyde
Sorry for the image - I could not copy from the terminal window.
The RPI4 is on an Argon box with SSD attached via the USB bridge.
Suspect the Bus1, Device4 is the one, but will try tonight to unplug the
VCP connection to wee which one disappears.
Clyde Stubbs skrev den 2024-12-10 10:52:
> It does work out of the box with a Rasbperry Pi 4 attached
So on Linux the lsusb command will list attached devices with their
VID/PID.
E.g.
➜ ~ lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 002: ID 1a40:0101
Bus 001 Device 003: ID 067b:2303
The first two of those are hubs, device 003 is a PL2303 USB-serial
adapter.
--
Reply to this email directly, view it on GitHub [1], or unsubscribe
[2].
You are receiving this because you commented.Message ID:
***@***.***>
Links:
------
[1]
#2982 (comment)
[2]
https://github.com/notifications/unsubscribe-auth/A3QF6VT7PKI6XA7MPILUPKT2E22UNAVCNFSM6AAAAABTHAJ5O6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZRGA2DQMBYGM
--=_d1a513c92bfd005e5ca2bc41824b3dc8
Content-Type: multipart/related;
boundary="=_1f7f652e55229025fdf52e47ecc21572"
--=_1f7f652e55229025fdf52e47ecc21572
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3DUTF-8" /></head><body style=3D'font-size: 12pt; font-family: Verdana,Gen=
eva,sans-serif'>
<p>Hi Clyde</p>
<p><img ***@***.***" /></p>
<p><br /></p>
<p>Sorry for the image - I could not copy from the terminal window.</p>
<p>The RPI4 is on an Argon box with SSD attached via the USB bridge. Suspec=
t the Bus1, Device4 is the one, but will try tonight to unplug the VCP conn=
ection to wee which one disappears.</p>
<p><br /></p>
<p><br /></p>
<p id=3D"reply-intro">Clyde Stubbs skrev den 2024-12-10 10:52:</p>
<blockquote type=3D"cite" style=3D"padding: 0 0.4em; border-left: #1010ff 2=
px solid; margin: 0">
<div id=3D"replybody1">
<p><br /></p>
<blockquote type=3D"cite" style=3D"padding: 0 0.4em; border-left: #1010ff 2=
px solid; margin: 0">
<p dir=3D"auto">It does work out of the box with a Rasbperry Pi 4 attached<=
/p>
</blockquote>
<p dir=3D"auto">So on Linux the <code class=3D"v1notranslate">lsusb</code> =
command will list attached devices with their VID/PID.</p>
<p dir=3D"auto">E.g.</p>
<pre class=3D"v1notranslate"><code class=3D"v1notranslate">=E2=9E=9C ~ lsu=
sb
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 002: ID 1a40:0101
Bus 001 Device 003: ID 067b:2303
</code></pre>
<p dir=3D"auto">The first two of those are hubs, device 003 is a PL2303 USB=
-serial adapter.</p>
<p style=3D"font-size: small; -webkit-text-size-adjust: none; color: #666;"=
—<br />Reply to this email directly, <a href=3D"https://github.com/e=
sphome/feature-requests/issues/2982#issuecomment-2531048083" target=3D"_bla=
nk" rel=3D"noopener noreferrer">view it on GitHub</a>, or <a href=3D"https:=
//github.com/notifications/unsubscribe-auth/A3QF6VT7PKI6XA7MPILUPKT2E22UNAV=
CNFSM6AAAAABTHAJ5O6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZRGA2DQMBYGM=
" target=3D"_blank" rel=3D"noopener noreferrer">unsubscribe</a>.<br />You a=
re receiving this because you commented.<img src=3D"https://github.com/noti=
fications/beacon/A3QF6VX4HAOHEIUJD7PMUEL2E22UNA5CNFSM6AAAAABTHAJ5O6WGG33NNV=
SW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUW3S5JG.gif" width=3D"1=
" height=3D"1" /><span style=3D"color: transparent; font-size: 0; display: =
none; visibility: hidden; overflow: hidden; opacity: 0; width: 0px; height:=
0px; max-width: 0; max-height: 0; mso-hide: all;">Message ID: <span><es=
phome/feature-requests/issues/2982/2531048083</span><span>@</span><span>git=
hub</span><span>.</span><span>com></span></span></p>
</div>
</blockquote>
<p><br /></p>
</body></html>
…--=_1f7f652e55229025fdf52e47ecc21572
Content-Transfer-Encoding: base64
Content-ID: ***@***.***>
Content-Type: image/png;
name=18bef7a1.png
Content-Disposition: inline;
filename=18bef7a1.png;
size=9692
iVBORw0KGgoAAAANSUhEUgAAAVkAAABzCAYAAAAysnE/AAAgAElEQVR4Xu1dLVBcW5ddn2imBkQi
ggEBAgTUVDBEgEgEGPLVgHhP0CKdmgIBghYhohFEgADxOqJbgGhqJh3RiESAIAZEIkCEETwBggio
Gl7NVH9VQ0QjGjGz71/37dv3Z5/bt4HAbvVe2Peec9beZ91z9vlZf/s/+sH2Oz8/x9///nf7P/n+
9z//6w/0D1zbbGL4n3/vwX9dsF8hhjeNQOd/41/+7X/xT/Zy/6sD//kfj266JlKeIHDvEfhboyR7
7xGSBgoCgoAg0AACQrINgCePCgKCgCAQhICQbBBC8ndBQBAQBBpAQEi2AfDkUUFAEBAEghAQkg1C
6B7//elMBgsv2lE6zmN6+cs9bqk0TRC4PQSEZG8P+1su+Snm1hYw/FirxikK8XfYvuUaSfF3AIHx
JYqFXpwW4ninEBBP59awQM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OrtIgvdqY9eLfRSy69g7v67gaYy+ThFKEtyXdBgua8Qk1Ei2
mZLgZs7TTZfOUVeuRDbpZVNO9rGLhHwIkrXla6OIg/DxUnV67HkKa7MDlJddIVVbtbTBrZGsSIIb
U6gVmkLZXSaS4BqRFuslmXtmkFmmbTTFXZI434CSJHilr/w6I9nmSoKbxNd6DOdqubU31Ro8cSWy
PUnW8tvFDuJvP7I/VVz/Rm3nWcHBOazNa9snbplkRRKcG0MiCe6FFFfqm2tXWw6PZG9zC9dNSYJb
+4cv9zM0MjtAa88IpmYSGO40dhtYJMuVyLbSBWc7KVosPNffUdltROuWZ1tzWNislXn1w5nr36jt
3OKya3CSsJlAb1sJ3zPTeH/A7eeGXcMjWdfiRBI8wAsiCe4JEFPqG1w7rpqpc7Sr/b+bVDW3f0Vw
4ivUQgu3vebiUq3yOq2iH52jbaAXxQLlgfUdDTyJbD815xopdy7OXP9GbeeDXyh/RE2yIgleO/X3
7o8iCe7LVS6SzGeHBSxkHdvAOXZc0rFVKJItXGFJ9gYlwTvG3uDNb8+gb2stXeBodwPp41Fk6FRB
lWTpbwyJ7CeDr5CYfIb+9kdoqxxs0M78e9/tEYgzx7+a36K0c5MOLx7RgYp1bP7pkA5nfnBDj2SZ
7xczQUAQEAQeNAJCsg/a/dJ4QUAQaDYCQrLNRljeLwgIAg8agf8HmJlvPCdJkPUAAAAASUVORK5C
YII=
--=_1f7f652e55229025fdf52e47ecc21572--
--=_d1a513c92bfd005e5ca2bc41824b3dc8--
|
@ruteclrp no image can be seen, you should probably use the Github web UI to communicate within the issue, not your e-mail client, which also apparently spams your posts with random html code. |
Sorry guys, my webmail client. Here it is with slave disconnected: Here it is with slave connected: So the slave is: ID 0483:5740 /Robert |
See https://the-sz.com/products/usbid/index.php?v=0x0483&p=0x5740&n= It's just a Virtual COM Port by STMicroelectronics |
Yes, I know, it is a VCP on the modbus master display controller of a heat pump. It acts as a slave via the VCP to allow a modbus master to read its registers. That works with a direct connection to the RPI4 running my HA. However, as the modbus implementation on the controller is unconventional, I am trying to have an ESPHOME device to do the modbus master function - using the custom function procedure to access the unconventional holding registers. /Robert |
Well, you might just be in luck - the STM32 VCP appears to be a vanilla CDC-ACM port, which is supported. Try this:
You can use You will ideally need an S3 board that has two USB connectors, one for UART0 and one for the USB interface - use UART0 in the logger config and flash via the UART port leaving the USB port free for your device. Alternatively flash and log via WiFi. |
Thanks Clyde, much appreciated. sorry for being a bit slow here, by I am really a newbie to ESPs and lower level fiddling with micro processors. |
Also, tried to compile and got this error: |
Thanks. Learning all the time. now, it fails when compiling the usb_uart component with: src/esphome/components/usb_uart/USBUartComponent.cpp: In member function 'void esphome::usb_uart::USBUartComponent::start_output(esphome::usb_uart::USBUartChannel*)': Suspect this is related to my earlier question on setting gpio for this uart? This is my .yaml file:
|
You can't specify them, they are fixed by the hardware. And don't use Arduino. Like I said above you will preferably use a board with two USB connectors, and select UART0 for logging. |
Thanks Clyde, |
No, that was my fault, I made a change but obviously didn't properly test it. In the external component source line, replace |
I just updated the repository, so the original should now work, if the external component is refreshed. |
Hi Clyde. Now got my hands on some ESP32-S3 boards. Just rather confused. I can build a simple installation with the Arduino framework which nicely connects to my wifi. When I change the framework setting to esp-idf in the .yaml file and install it nothing happens. It will not connect. Also, I cannot read the log via USB when on the idf framework. What is it that I do not understand here??? |
Best place for general support for ESPHome is on Discord: https://discord.com/channels/429907082951524364/429907082955718657 |
Thumbs up. Found the missing pieces to get the board running under the idf framework - now I am in business :-) both seems to use uart0 I would expect that the USB hub would use USBCDC If not, I guess setting the logger to baud_rate: 0 would disable the logger and allow the coexistence on uart0? Just not sure what you had espected to happen with the hub component I included in the build /Robert |
Do you see anything in the log when you plug in the USB device? Is the board providing 5V to the USB port? |
The log says: [13:56:41][C][logger:185]: Logger: [13:56:41][C][modbus:165]: Modbus: [13:56:56][V][modbus_controller:232]: Updating modbus component [13:57:29][V][esp-idf:000]: E (53276) HUB: Root port reset failed [13:57:29][W][component:237]: Component usb_host took a long time for an operation (313 ms). Since the last attempt I removed the uart assignment for the logger to uart0. Now the logger defaults to USB_SERIAL_JTAG Still, the USB host component seems not to work as intended. You asked if the board provided 5V to the uab port. How would I check that easiest? |
Found an anomaly. The stop bits were not set, and should default to 1. However the validation check of the configuration file showed that stop bits were 0. The spec for the VCP is: I have now set the stop bits to 1 in the conf, and recompiles. The log now says: stop bits seems wrong here! But, the log continues: [14:25:36][D][usb_host:027]: Event flags 2X So, now the slave is recognised. But, why is the channel not initialised? |
Just found your other support thread with #2944 (comment) My board is the same - also have that soldering point on the back. Suspect that the issue is the missing 5 V to the USB port. Still, the stop bits issue persist and suspect it is set in your component rather than with parameter in config? can see that when I state the "stop_bits: 1" in config it is ignored and the validation returns "stop_bits: '1'" Anyway, will solder the usb-otg connection on the board tomorrow and see how it goes. |
Some observations.
Thanks for your great assistance. Robert |
OK, had a look at you code and looks like your default stop_bits are set to 1, even when the validation says 0? Maybe it is all because there is not a mbc_master_create_serial function being invoked? |
No, that's part of the ESP-IDF modbus implementation and is not used by ESPHome. Stop bits aren't even used by a virtual CDC_ACM device so that's just cosmetic. The "channel not initialised" error is odd, since the device is clearly being connected, but there should be more log entries related to it. Attach your YAML, and turn on verbose logging for usb_uart - that will dump the device descriptor. |
Here is the YAML file for the board. When you say "turn on verbose logging for usb_uart" do you mean, verbose level under logger, and debug under usb_uart? |
OK, here is the log with the descriptor after I plugged the slave in. |
No it doesn't, and it can't anyway - UART0 is a completely different peripheral, built into the ESP, "UART Channel 0" is what your USB device is meant to implement.
yes. Though you already have that, but you have not set the logger uart to UART0. Uncomment the And here is the problem:
The STM is evidently not implementing the CDC-ACM spec. The verbose logging will dump the descriptors which will shed some light on it once you get the logging working properly. |
Clive, you have to help me here with something which may be obvious, just not to me. |
You either need a board with two USB connectors, one for the built-in USB and one for UART0 via an on-board interface chip, or you need a separate USB-serial adapter to wire to your board's UART pins. |
I just updated the external component so that the USB config dump will work over WiFi, so that might make things easier. |
My board is a 2 port board. However, connecting to either of those ports when the board is running does not allow access the to log. Somehow uart0 is not routed the the usb-uart bridge. Not specifying the hardware_uart routes the logger to JTAG which is available. Anyway, will try to dump the log via wifi now you have made the update to the component. Reverting. |
Here is the extended log of the usb connection. I repeated plugging in the device a few times. I hope this makes sense to you. |
I just pushed a commit that should make it more flexible about identifying devices that resemble CDC-ACM but don't actually match the spec, which is what your device looks like. |
Hi Clyde Happy to report that we are in business. Had to remove the dummy receiver but expect that is as intended. |
Awesome! |
Describe the problem you have/What new integration you would like
I need an ESPHOME device to connect to a modbus slave via USB. This requires the board to have USB hub functionality. The Raspberry Pico W can do this, but requires the code to set dr_mode=host.this is not yet implemented by in esphome for RP2040 boards.
Please describe your use case for this integration and alternatives you've tried:
ability to set dp_mode to host for the USB connection on the board
Additional context
The text was updated successfully, but these errors were encountered: