-
Notifications
You must be signed in to change notification settings - Fork 49
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
RNDIS support for the WiFi router example (AEGHB-126) #42
Comments
Can you post the console output of idf.py monitor? |
Below is the console output of the wifi router.
I have added the following to sdkconfig to support RNDIS.
I am guessing that we probably need to add a process like rndis_connect(). |
There are my suggestions:
See if any or the combination of these can help. |
Thank you for pointing this out. I was looking at WireShark and found DHCP Discovery (source is Windows) but. By the way, I am not sure how to do "Also, check if there is any response from ESP to the computer at all". I also tried some of steps 2 and 3. |
Can you manually configure the IP address of the interface on windows to 192.168.5.2 and see if 192.168.5.1 is ping-able? |
I had disappointed in a very rudimentary point. Thank you very much. Do you know what implementation or configuration is required to communicate between a Windows PC and a terminal connected to SoftAP, for example, 192.168.5.2 and 192.168.4.2? |
If manually assigned IP works, it means the DHCP did not work properly on your ESP. You can add the route to 192.168.4.0/24 through 192.168.5.1 on Windows to access the devices |
I'm trying, but I can't get an IP address assigned to RNDIS from ESP32's DHCP. I have the following steps 2 and 3 in bridge_common.c right after esp_bridge_create_usb_netif, does this seem to work? |
@bluestar714 You just need to upgrade your esp-idf version to 5.0, as version 4.4 does not support multiple DHCPS.
|
After changing to v5.0 of ESP-IDF, the IP address is assigned to the RNDIS device. We are currently having the following two issues
I'm sorry to keep repeating myself, but could you please give me a configuration or advice that would solve these problems |
The update for this part has not been synced to the lwip component yet. Please apply the following patch in the diff --git a/src/core/ipv4/ip4.c b/src/core/ipv4/ip4.c
index a5c3dd55..a6106c90 100644
--- a/src/core/ipv4/ip4.c
+++ b/src/core/ipv4/ip4.c
@@ -332,8 +332,10 @@ ip4_forward(struct pbuf *p, struct ip_hdr *iphdr, struct netif *inp)
#if ESP_LWIP
#if IP_NAPT
- if (ip_napt_forward(p, iphdr, inp, netif) != ERR_OK)
- return;
+ if (!netif->napt) {
+ if (ip_napt_forward(p, iphdr, inp, netif) != ERR_OK)
+ return;
+ }
#endif
#endif /* ESP_LWIP */ |
Thank you for the patch info.
|
Yes, it is possible to check communication using ICMP. I didn't find any "no response found" situation during my testing. Could it be an accidental phenomenon? |
Thanks for the reply. |
I have tried to reflect the latest master commit, but the event continues. If possible, could you please tell me the value of the sdkconfig you are using? Also, below is my sdkconfig and sdkconfig.defaults.esp32s3, are there any suspicious settings?
|
Have you tried using a Linux computer? TINYUSB_NET_ECM |
I created a linux (ubuntu 22.04) environment with a VM and tried it. The environment is as follows.
|
Without modifying any code in the bridge, the test works as follows 27 17.935125342 192.168.5.2 192.168.6.2 ICMP 98 Echo (ping) reply id=0x0007, seq=11/2816, ttl=63 (request in 26) |
Can 192.168.5.2 and 192.168.6.2 be successfully pinged in both directions? By the way, I am using esp-idf version release/v5.0, is it another version? |
Yes, you can add the following patch. release/v5.0 is OK. |
I have confirmed that the latest master has the patch! |
Not required, all dynamically assigned. |
Hmmm, I've tried a clean environment and tweaking sdkconfig, but it doesn't seem to return pings across subnets (both from 192.168.4.2 to 192.168.5.2 and from 192.168.5.2 to 192.168.4.2). I have a softap network that seems to be 192.168.4.x/24, and I am thinking of assigning an RNDIS netif to this, but is there any ESP-IDF spec issue? |
@bluestar714 Do you have multiple network interface on your host PC? i.e. multiple default gateways. If so, you have to either 1. route add the static route entry or 2. use DHCP option to pass the route to the host PC automatically. |
@wuyuanyi135 My Windows PC had multiple Network Adapters and multiple default gateways.
|
IIRC it is normal behavior if you couldn't access the gateway of the softAP. Does it work if you connect to the RNDIS gateway? i.e. 192.168.5.1. |
It is possible to connect (ping) to 192.168.5.1 from the RNDIS NIC (192.168.5.2). It is also possible to connect to 192.168.5.1 from a client (192.168.4.2) connected to SoftAP. |
The route should work if it was configured like this. Do you think the firewall is to blame? try disable it. Also, if memory serves, the PING didn't work for me when I was writing this library. try connect a phone or something else to the AP and run a http server, see if it connects. ICMP didnt work for me. |
Thank you very much.
I have concluded that for RNDIS connections, the ping does not go through (even if the firewall setting is turned off). I am planning to use OSC on a WiFi dongle and for this it seems to connect without any problem. (I could also do HTTP Request). Here is a summary of what I have done
|
Hello,
I am trying to create a bridge between USB-SoftAP and RNDIS. As far as I understand, the current iot-bridge does not support RNDIS. Can you provide some guidance or hints on how to achieve this?
So far, I have added RNDIS settings to the sdkconfig, and my Windows PC is able to recognize the ESP32S3 as an RNDIS device. However, an IP address is not being assigned.
I have heard that iot-bridge is already in a state where it can support RNDIS, as mentioned in the following issues. When can we expect these to be merged?
#29
espressif/esp-iot-solution#240
The text was updated successfully, but these errors were encountered: