chegewara/esp32-usbip-poc

Help

Opened this issue · 6 comments

I'm using an ESP32-S3 chip. I want to use it from USB/IP. I have another USB device that would give me a DHCP address for my ESP32-S3 chip. I want to send a simple UDP packet across USB/IP to the other device. All my codebase for my project is in Arduino. If it wasn't for that I'd try using the esp-idf. Looking around the internet you seem to be one of the most knowledgeable people on this subject. Some where you mentioned any help would be appreciated. If you could point me in the right direction with also pitfalls I'm up against, it would be appreciated. I'm happy to share my code changes and contribute.

sorry, for my noob questions :

  1. Is it possible to connect USB form UPS over the WIFI to Linux server ?
  2. How to use this to write it in ESP32-S3 chip ?

Hi
im not most knowledgeable person, just i am sharing my knowledge. This project is harder than i thought and i failed to implement it correctly (some devices are working and other dont).
Since there is also not much interest in the topic i decided to not go deeper and leave it as is.

Hi im not most knowledgeable person, just i am sharing my knowledge. This project is harder than i thought and i failed to implement it correctly (some devices are working and other dont). Since there is also not much interest in the topic i decided to not go deeper and leave it as is.

Yes, it should be possible to connect UPS and should be easy.
Just flash this project to esp32-s3, connect over wifi to home network, then connect usb/ip protocol on linux machine to esp32 and that should be all.

Thank you for your answer chegewara.
Because i am a real noob in that area ( esp32 ),
is there a some manual how to build and flash this project ?

i finally flash one esp32-s3
my device is ESP32-S3WROOM1 N16R8 44Pin
i change only in main/tcp_server.c
line 240 : wifi_init_sta("esp32", "espressif");
i put there my SSID and password
but no luck.
i got boot loop :(
in console i get this :

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40375bac
--- 0x40375bac: esp_restart_noos at /home/user/apps/esp-idf-env/data/esp-idf/components/esp_system/port/soc/esp32s3/system_internal.c:160

SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2820,len:0x15d0
load:0x403c8700,len:0xd20
--- 0x403c8700: _stext at ??:?

load:0x403cb700,len:0x2f48
entry 0x403c8924
--- 0x403c8924: call_start_cpu0 at /home/user/apps/esp-idf-env/data/esp-idf/components/bootloader/subproject/main/bootloader_start.c:25

I (29) boot: ESP-IDF v5.5-dev-1050-gb5ac4fbdf9 2nd stage bootloader
I (29) boot: compile time Dec 29 2024 02:29:48
I (29) boot: Multicore bootloader
I (31) boot: chip revision: v0.2
I (34) boot: efuse block revision: v1.3
I (37) boot.esp32s3: Boot SPI Speed : 80MHz
I (41) boot.esp32s3: SPI Mode       : DIO
I (45) boot.esp32s3: SPI Flash Size : 2MB
I (49) boot: Enabling RNG early entropy source...
I (53) boot: Partition Table:
I (56) boot: ## Label            Usage          Type ST Offset   Length
I (62) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (69) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (75) boot:  2 factory          factory app      00 00 00010000 00100000
I (82) boot: End of partition table
I (85) esp_image: segment 0: paddr=00010020 vaddr=3c090020 size=1d104h (119044) map
I (113) esp_image: segment 1: paddr=0002d12c vaddr=3fc9a100 size=02eech ( 12012) load
I (116) esp_image: segment 2: paddr=00030020 vaddr=42000020 size=8e70ch (583436) map
I (220) esp_image: segment 3: paddr=000be734 vaddr=3fc9cfec size=01ac0h (  6848) load
I (222) esp_image: segment 4: paddr=000c01fc vaddr=40374000 size=160dch ( 90332) load
I (244) esp_image: segment 5: paddr=000d62e0 vaddr=600fe000 size=0001ch (    28) load
I (253) boot: Loaded app from partition at offset 0x10000
I (253) boot: Disabling RNG early entropy source...
I (263) cpu_start: Multicore app
I (272) cpu_start: Pro cpu start user code
I (272) cpu_start: cpu freq: 240000000 Hz
I (272) app_init: Application information:
I (272) app_init: Project name:     usb_host_arduino
I (277) app_init: App version:      9ef8639
I (281) app_init: Compile time:     Dec 29 2024 02:30:43
I (286) app_init: ELF file SHA256:  ba9aa403e...
I (290) app_init: ESP-IDF:          v5.5-dev-1050-gb5ac4fbdf9
I (295) efuse_init: Min chip rev:     v0.0
I (299) efuse_init: Max chip rev:     v0.99 
I (303) efuse_init: Chip rev:         v0.2
I (307) heap_init: Initializing. RAM available for dynamic allocation:
I (313) heap_init: At 3FCA3BB0 len 00045B60 (278 KiB): RAM
I (318) heap_init: At 3FCE9710 len 00005724 (21 KiB): RAM
I (324) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (329) heap_init: At 600FE01C len 00001FCC (7 KiB): RTCRAM
I (335) spi_flash: detected chip: boya
I (338) spi_flash: flash io: dio
W (341) spi_flash: Detected size(16384k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (353) sleep_gpio: Configure to isolate all GPIO pins in sleep state
I (359) sleep_gpio: Enable automatic switching of GPIO sleep configuration
I (366) main_task: Started on CPU0
I (385) main_task: Calling app_main()
create async task
ESP_ERROR_CHECK failed: esp_err_t 0x3007 (ESP_ERR_WIFI_CONN) at 0x4200bfbb
--- 0x4200bfbb: wifi_init_sta at /home/user/apps/esp-idf-env/data/esp32-usbip-poc/main/tcp_server.c:212 (discriminator 1)

file: "./main/tcp_server.c" line 212
func: wifi_init_sta
expression: esp_wifi_connect()

abort() was called at PC 0x4037cb4f on core 0
--- 0x4037cb4f: _esp_error_check_failed at /home/user/apps/esp-idf-env/data/esp-idf/components/esp_system/esp_err.c:49

Backtrace: 0x40375c6d:0x3fca8d40 0x4037cb59:0x3fca8d60 0x40384ce5:0x3fca8d80 0x4037cb4f:0x3fca8df0 0x4200bfbb:0x3fca8e20 0x4200c113:0x3fca8f10 0x4200c167:0x3fca8fd0 0x4200bbd6:0x3fca9000 0x4208dacb:0x3fca9020 0x4037d5f1:0x3fca9050
--- 0x40375c6d: panic_abort at /home/user/apps/esp-idf-env/data/esp-idf/components/esp_system/panic.c:454
0x4037cb59: esp_system_abort at /home/user/apps/esp-idf-env/data/esp-idf/components/esp_system/port/esp_system_chip.c:92
0x40384ce5: abort at /home/user/apps/esp-idf-env/data/esp-idf/components/newlib/src/abort.c:38
0x4037cb4f: _esp_error_check_failed at /home/user/apps/esp-idf-env/data/esp-idf/components/esp_system/esp_err.c:49
0x4200bfbb: wifi_init_sta at /home/user/apps/esp-idf-env/data/esp32-usbip-poc/main/tcp_server.c:212 (discriminator 1)
0x4200c113: wifi_init at /home/user/apps/esp-idf-env/data/esp32-usbip-poc/main/tcp_server.c:240
0x4200c167: start_server at /home/user/apps/esp-idf-env/data/esp32-usbip-poc/main/tcp_server.c:251
0x4200bbd6: app_main at /home/user/apps/esp-idf-env/data/esp32-usbip-poc/main/main.cpp:68
0x4208dacb: main_task at /home/user/apps/esp-idf-env/data/esp-idf/components/freertos/app_startup.c:208
0x4037d5f1: vPortTaskWrapper at /home/user/apps/esp-idf-env/data/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:139

ELF file SHA256: ba9aa403e

Rebooting..