espressif / esp-dev-kits

Docs, Schematics, Factory Firmwares for ESP Development Kits
Other
346 stars 183 forks source link

Using the ESP32-S3-USB-Bridge in a wireless mode at a remote site behind a firewall (AEGHB-753) #99

Open ammaree opened 1 month ago

ammaree commented 1 month ago

Answers checklist.

General issue report

We would like to use this dev board to access remote target devices located at customer site and behind a firewall, across the internet. For this we believe ESP-NOW need to be replaced with a normal IP stack and the remote host device need to be configured to act as STA to the local Wifi at the customer site.

To make installation easier the remote device should also enable AP mode if it cannot connect to the local SSID. The remote host device should also be able to be powered from the target device via 5V or 3V3

To fulfil our remote diagnostic and support requirements we need to be able to access and control the remote target (RxD, TxD, EN and IO0) through the remote host, allowing us to monitor (UART) reset, read and write flash of the remote target.

This configuration working across the internet brings complications of firewalls (NAT config we can handle) and latency / propagation delays. It also requires some enhanced telnet support to control the RST and BOOT signals between the central site and the remote host to target connection.

At the central support site we would like to use standard Espressif tools in idf.py and esptool.py, both with the socket://remote.host:port addressing scheme:

Any reason why this functionality is not demonstrated in an example? Is there any reason why this is not (easily) possible to achieve, something we might be missing.

Ultimately we are looking for a reliable, higher performing version of ESP-Link focussed on ESP32xx target devices, but without the MQTT etc bells and whistles.

All advice appreciated.

ammaree commented 1 month ago

I am trying to build the usb_wireless_bridge example using ESP-IDF latest Master. the follow errors (and warnings) come up. [1038/1105] Building C object esp-idf/espressif__esp-now/CMakeFiles/__idf_espressif__esp-now.dir/src/debug/src/espnow_console.c.obj /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/debug/src/espnow_console.c: In function 'espnow_console_init': /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/debug/src/espnow_console.c:206:9: warning: 'esp_vfs_dev_uart_port_set_rx_line_endings' is deprecated: Please use uart_vfs_dev_port_set_rx_line_endings() instead [-Wdeprecated-declarations] 206 | esp_vfs_dev_uart_port_set_rx_line_endings(CONFIG_ESP_CONSOLE_UART_NUM, ESP_LINE_ENDINGS_CR); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/debug/src/espnow_console.c:21: /Users/andremaree/DevSpace/z-sdk/esp-idf-master/components/vfs/include/esp_vfs_dev.h:22:5: note: declared here 22 | int esp_vfs_dev_uart_port_set_rx_line_endings(int uart_num, esp_line_endings_t mode) __attribute__((deprecated("Please use uart_vfs_dev_port_set_rx_line_endings() instead"))); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/debug/src/espnow_console.c:208:9: warning: 'esp_vfs_dev_uart_port_set_tx_line_endings' is deprecated: Please use uart_vfs_dev_port_set_tx_line_endings() instead [-Wdeprecated-declarations] 208 | esp_vfs_dev_uart_port_set_tx_line_endings(CONFIG_ESP_CONSOLE_UART_NUM, ESP_LINE_ENDINGS_CRLF); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/andremaree/DevSpace/z-sdk/esp-idf-master/components/vfs/include/esp_vfs_dev.h:24:5: note: declared here 24 | int esp_vfs_dev_uart_port_set_tx_line_endings(int uart_num, esp_line_endings_t mode) __attribute__((deprecated("Please use uart_vfs_dev_port_set_tx_line_endings() instead"))); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/debug/src/espnow_console.c:230:9: warning: 'esp_vfs_dev_uart_use_driver' is deprecated: Please use uart_vfs_dev_use_driver() instead [-Wdeprecated-declarations] 230 | esp_vfs_dev_uart_use_driver(CONFIG_ESP_CONSOLE_UART_NUM); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/andremaree/DevSpace/z-sdk/esp-idf-master/components/vfs/include/esp_vfs_dev.h:20:6: note: declared here 20 | void esp_vfs_dev_uart_use_driver(int uart_num) __attribute__((deprecated("Please use uart_vfs_dev_use_driver() instead"))); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~

/Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c:34:5: error: expected specifier-qualifier-list before 'SLIST_ENTRY' 34 | SLIST_ENTRY(espnow_group_item) next; | ^~~~~~~~~~~ /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c:37:8: error: return type defaults to 'int' [-Werror=implicit-int] 37 | static SLIST_HEAD(group_item_list_, espnow_group_item) g_group_item_list; | ^~~~~~~~~~ /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c: In function 'SLIST_HEAD': /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c:37:56: error: expected declaration specifiers before 'g_group_item_list' 37 | static SLIST_HEAD(group_item_list_, espnow_group_item) g_group_item_list; | ^~~~~~~~~~~~~~~~~ /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c:40:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 40 | { | ^ /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c:63:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 63 | { | ^ /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c:78:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 78 | { | ^ /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c:90:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 90 | { | ^ /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c:106:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 106 | { | ^ /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c:37:8: error: type of 'group_item_list_' defaults to 'int' [-Werror=implicit-int] 37 | static SLIST_HEAD(group_item_list_, espnow_group_item) g_group_item_list; | ^~~~~~~~~~ /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c:37:8: error: type of 'espnow_group_item' defaults to 'int' [-Werror=implicit-int] /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c:116: error: expected '{' at end of input /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c: At top level: /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c:37:8: warning: 'SLIST_HEAD' defined but not used [-Wunused-function] 37 | static SLIST_HEAD(group_item_list_, espnow_group_item) g_group_item_list; | ^~~~~~~~~~ /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/src/espnow_group.c:30:20: warning: 'TAG' defined but not used [-Wunused-variable] 30 | static const char *TAG = "espnow_group"; | ^~~ cc1: some warnings being treated as errors [1059/1105] Building C object esp-idf/espressif__esp-now/CMakeFiles/__idf_espressif__esp-now.dir/src/debug/src/commands/cmd_iperf.c.obj /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/debug/src/commands/cmd_iperf.c: In function 'espnow_config_func': /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/debug/src/commands/cmd_iperf.c:113:9: warning: 'esp_wifi_config_espnow_rate' is deprecated: This API can be only used when rate is non-HE rate, please use esp_now_set_peer_rate_config if you want full support of the rate. [-Wdeprecated-declarations] 113 | ESP_ERROR_CHECK(esp_wifi_config_espnow_rate(ESP_IF_WIFI_STA, espnow_config_args.rate->ival[0])); | ^~~~~~~~~~~~~~~ In file included from /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/espnow/include/espnow.h:17, from /Users/andremaree/DevSpace/z-projects/usb_wireless_bridge/managed_components/espressif__esp-now/src/debug/src/commands/cmd_iperf.c:28: /Users/andremaree/DevSpace/z-sdk/esp-idf-master/components/esp_wifi/include/esp_now.h:270:11: note: declared here 270 | esp_err_t esp_wifi_config_espnow_rate(wifi_interface_t ifx, wifi_phy_rate_t rate) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ [1062/1105] Building C object esp-idf/espressif__tinyusb/CMakeFiles/__idf_espressif__tinyusb.dir/src/portable/espressif/esp32sx/dcd_esp32sx.c.obj

Any suggestions for trying to fix this?

Although the example does not support standard Wifi and thus won't operate at a remote site behind a firewall (with NAT) we are just trying to test the concept.

Thanks

ammaree commented 2 weeks ago

@igrr

A month later and noresponse from anybody. The current repo does not build with ESP-IDF master, comes up with 100's of errors.

Can we please get to a point ASAP where this can build with 5v3 or master, we would like to start a process to add normal IP support to access a device at a remote site.

Please !!!!

lijunru-hub commented 2 weeks ago

Sorry for the late reply. The public network debugging solution is quite interesting, and we already have clients who have developed remote debuggers based on the public network. However, we currently don't have the resources to dedicate to this feature, so you might need to experiment on your own. We will work on fixing the compilation issue as soon as possible. In the meantime, you can revert to the IDF version before release/v5.2 to ensure correct compilation.

ammaree commented 2 weeks ago

@lijunru-hub

Thanks for the response, sorry about nagging. In order for us to make a decision on possibly committing resources, can you help with some guidance.

A: https://github.com/espressif/esp-dev-kits/tree/master/esp32-s3-usb-bridge/examples/usb_wireless_bridge B: https://github.com/espressif/esp-usb-bridge

1: Why are there 2 different repos, both focussing on very much the same functionality 2: Of the 2 repos above, which of them is where Espressif will be devoting resources? 3: If your focus is specifically on the repo A above, any plans to consolidate the SWD and similar functionality from repo B? 4: Any timeframe for getting repo A (if that is where you will focus) to a successful compile state, with updated IDF and components?

Thank

lijunru-hub commented 2 weeks ago
  1. A is a wireless debugging solution based on an older version of B.
  2. More code maintenance will focus on B.
  3. SWD has limited relevance for the debugging needs focused on ESP32 in A.
  4. ASAP.
ammaree commented 2 weeks ago

Thanks for the response.

So if I understand correctly you will be focussing on A (usb_wireless_bridge) ASAP.

Any plans or ideas for adding normal IP type communication as alternative to or replacement for ESP-NOW?

lijunru-hub commented 2 weeks ago

It may be necessary for you to implement IP-based debugging on your own, but it is feasible, as some clients have already developed related products.

ammaree commented 1 week ago

@lijunru-hub Any progress on updating the usb_wireless_bridge example to compile using IDF v5.3 or later, preferably master?

We would like to get started working on the LWIP functionality but unable to do so with current state of the repo.

Thanks for your help

lijunru-hub commented 1 week ago

I'll look into it as soon as possible.