An Arduino wrapper to @sdima1357's usb_soft_host esp-idf example

ESP32 USB Soft Host library for Arduino IDE

This is mainly a wrapper around the excellent work of Dmitry Samsonov (@sdima1357) with esp32_usb_soft_host

Some parts of the code (e.g. the timer group isr calls) have been regressed to fit esp-idf 3.3 needs.

esp32 USB-LS is a pure software implementation of USB host thru general IO pins.

It supports up to 4 HID devices simultaneously.

Works on ESP32-Wroom and Wrover as long as the pins aren't shared (beware of the psram pins!), untested yet on S2, can't compile on C3.

[] []

Owner
tobozo
I'm the Bozo ෴ bit in your Bogon. DIY IoT/WoT tinkerer, JS/PHP freestack dev, C/C++ novice and tech lover
tobozo
Comments
  • Is it possible to translate the device to another?

    Is it possible to translate the device to another?

    to keep it simple, let's say i have a mouse but i won't to fool my computer into thinking it as a keyboard(sorry for a lame example), is that possible??

    The real world application can be, sometimes we don't have the exact device on the place to test. We can get the device's usb info, duplicate it and use or the test the software temporarily!!

    Is this possible somehow?!

  • Won't compile

    Won't compile

    I couldn't get the example code to compile without removing all the "inline" tags (on the function declarations). Do these serve a purpose that will cause problems later down the road, or are they safe to remove?

  • Can't compile

    Can't compile "fatal error: hal/cpu_hal.h: No such file or directory"

    Feeling kinda dumb, but I'm getting this error trying to compile the usb_test.ino. There is no such file in this library, but the "usb_host.c" is referencing it. What am I missing? This is the exact error message: "/home/user/Arduino/libraries/ESP32-USB-Soft-Host-main/src/usb_host.c:18:25: fatal error: hal/cpu_hal.h: No such file or directory compilation terminated."

  • Connection issue

    Connection issue

    Hello.

    I want to ask for schematic.

    Do you put +5V on USB connector, and connect D+/D- directly to ESP32 pis (without voltage level shifter)?

    I have tried connect some devices to ESP32 thru cheap 5V<->3.3V level shifter and have no success. Keyboard and one mouse with long cable (~1.4m) is not recognized, and another mouse with shorter cable (~0.8m) is unstable recognized .

    Unfortunately i'm not sure about ESP32's pins 5V toolerance and i affraid to burn out microcontroller.

    Thanks for your time.

  • invalid conversion from 'int' to 'timer_autoreload_t'

    invalid conversion from 'int' to 'timer_autoreload_t'

    small conversion problem

    instead config.auto_reload = 1 better config.auto_reload = (timer_autoreload_t) 1;

    suggestion: https://github.com/tobozo/ESP32-USB-Soft-Host/pull/2

  • Can it forward the data somehow?

    Can it forward the data somehow?

    This may be a duplicate question. I am trying to identify from your git repo if it is possible to read the usb device details(which it does) and then also forward the data as it is to computer? i.e.: I connect a mouse to esp32(via usb) and then get the data coming from the mouse in esp and forward it serially to let's say my computer? or why not forward the data to computer via mqtt!?

    So in one line the question is "Can it send and receive the data from and to the usb device connected??"

  • support for wireless keyboards?

    support for wireless keyboards?

    the library successfully worked for wired keyboards but can we make it work out for wireless keyboards as well? i'm using logitech mk215 wireless keyboard and it's not working.

  • reference to wrong buffer

    reference to wrong buffer

    Copy paste problem :)

    https://github.com/tobozo/ESP32-USB-Soft-Host/blob/608ecc9e35d078155ab310e48c7b3651cf5cbe5c/src/usb_host.c#L1374

    instead of printCB( pcurrent->Resp0, pcurrent->R0Bytes ); must be: printCB( pcurrent->Resp1, pcurrent->R1Bytes );

    Descfription: In Resp0 response from ep0 (end point 0) In Resp1 response from ep1 (end point 1) Several HID devices have 2 end points . For example - combined mouse keyboard device

  • Serial USB adapter?

    Serial USB adapter?

    It is possible to connect a USB serial adapter like FTDI or CH340? I'm thinking of using this as a 3d printer server using USB and not the serial interface. Like a octoprint server.

  • Don't work USB_Test program

    Don't work USB_Test program

    Hello,

    We're testing with a keyboard connected to the ESP32-DevKit C-32E. But when I type on the keyboard, I don't see the keys. GPIO has DP connected to 16 and DM connected to 17, with the other pins disabled. Do you have any advice?

    [Env] ESP32-DevKit C-32E Arduino IDE 1.8.19 for windows

    [Log]

    ets Jul 29 2019 12:21:46
    
    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff0030,len:1184
    load:0x40078000,len:12812
    load:0x40080400,len:3032
    entry 0x400805e4
    USB Soft Host Test for Default Wroom
    USB#0 (pins 16 17) is OK!
    READ_BOTH_PINS = 0100
    READ_BOTH_PINS = 0000
    READ_BOTH_PINS = 0000
    READ_BOTH_PINS = 0000
    cpu freq = 160 MHz
    TIME_MULT = 77 
    D=   0 4800 bits in 1885.000000 uSec 2.546419 MHz  6 ticks in 2.356250 uS
    D= 127 4800 bits in 5720.000000 uSec 0.839161 MHz  6 ticks in 7.150000 uS
    D=  63 4800 bits in 3775.000000 uSec 1.271523 MHz  6 ticks in 4.718750 uS
    D=  31 4800 bits in 2802.000000 uSec 1.713062 MHz  6 ticks in 3.502500 uS
    D=  47 4800 bits in 3294.000000 uSec 1.457195 MHz  6 ticks in 4.117500 uS
    D=  39 4800 bits in 3042.000000 uSec 1.577909 MHz  6 ticks in 3.802500 uS
    D=  43 4800 bits in 3174.000000 uSec 1.512287 MHz  6 ticks in 3.967500 uS
    D=  45 4800 bits in 3223.000000 uSec 1.489296 MHz  6 ticks in 4.028750 uS
    D=  44 4800 bits in 3204.000000 uSec 1.498127 MHz  6 ticks in 4.005000 uS
    D=  43 4800 bits in 3168.000000 uSec 1.515152 MHz  6 ticks in 3.960000 uS
    TRANSMIT_TIME_DELAY = 46 time = 4.005000 error = 0.125003% 
    USB#1 is disabled by user configuration
    USB#2 is disabled by user configuration
    USB#3 is disabled by user configuration
    

    Thanks.

  • Trying to connect a QuickScan qd2430

    Trying to connect a QuickScan qd2430

    The Lib works fine with an apple mouse (desc.idVendor = 0x05acdesc.idProduct = 0x0304). I need to connect a USB QuickScan. Any idea? Any other usb scanner? Thankyou

  • ESP32-CAM Does not detect any USB device being attached

    ESP32-CAM Does not detect any USB device being attached

    I couldn't get "New device detected on USB" at all. I have an ESP32-CAM. Here's the pinout: https://i0.wp.com/randomnerdtutorials.com/wp-content/uploads/2020/03/ESP32-CAM-pinout-new.png?quality=100&strip=all&ssl=1

    I have tried with multiple PIN configurations and only for DP_P0 and DM_P0 which I believe means Data Plus USB0 and Data Minus USB0. Last one I tried is 13 and 12.

    I had a USB extension cable and removed data pins (green and white) coming from female (host) part and connected to GPIO pins of the board. Power cables (red and black) is connected normally so I can power the device via a USB port.

    What am I doing wrong? Do I need to share the power or at least ground between them or something?

idf.py.exe, wrapper tool to invoke idf.py on Windows

IDF wrapper tool (idf.py.exe) This tools helps invoke idf.py in Windows CMD shell. In Windows CMD shell, python scripts can be executed directly (by t

Dec 13, 2021
This FreeRTOS example builds a simple Timer application for Linux using the ESP-IDF

Supported Targets Linux This FreeRTOS example builds a simple Timer application for Linux using the ESP-IDF. Build Source the IDF environment as usual

Apr 4, 2022
ESP32 S2 C++ host library compatible with arduino, esp-idf.

Info I would like to announce USB host library for esp32 S2 compatible with arduino, esp-idf and PIO (when pio will be updated to most recent esp-idf)

Jun 2, 2022
GFX Demo for the ESP-IDF
GFX Demo for the ESP-IDF

Display Drivers and Demo for GFX This is a Demo of GFX With Several Display Drivers This is not GFX itself, but it includes it. GFX Documentation is b

Sep 7, 2022
To simplify the development of ESP32 in ESP-IDF, Easyio provides a complete driver library

Easyio 开源驱动库 Easyio 是一款适配于ESP-IDF框架的开源驱动库,以支持ESP32的简便开发。目的是简化乐鑫ESP-IDF开发框架的使用难度。(真要方便的话,有现成的Arduino和Platform可以用,不过实在迫于工作要求,有的开源东西不让用,同时便于对接FAE,于是就有了 E

Sep 27, 2022
使用ESP-IDF、ESP-ADF、LVGL等库,基于ESP32S2实现简单的网络收音机和FM收音机功能。
使用ESP-IDF、ESP-ADF、LVGL等库,基于ESP32S2实现简单的网络收音机和FM收音机功能。

【电子森林项目】网络收音机/FM收音机 这个项目是报名《硬禾“暑期一起练”第3个平台 - 基于ESP32-S2模块的网络收音机和音频信号处理》所做的。 基本功能: 可以连接WiFi收听HLS协议的网络电台节目 收听空中的FM电台88MHz~108MHz OLED0.96寸显示 四个独立按键控制两种模

Aug 4, 2022
LVGL8 for ESP-IDF

X-UI LVGL8 for ESP-IDF 移植自X-TRACK项目的页面栈框架,新增支持异步通信的订阅发布数据中心 特点 使用C语言重构,方便继承复用 核心文件 ui_page_manager.h、ui_page_manager.c 实现页面栈、订阅发布数据中心 完整页面生命周期 MVC架构 数

Aug 5, 2022
Additional components for ESP-IDF, maintained by Espressif

Espressif IDF Extra Components This repository aims to store ESP-IDF extra components which have been seperated and uploaded into IDF Component Manage

Sep 10, 2022
Add tensilica esp32 cpu and a board to qemu and dump the rom to learn more about esp-idf

qemu_esp32 Add tensilica esp32 cpu and a board to qemu and dump the rom to learn more about esp-idf ESP32 in QEMU. This documents how to add an esp32

Sep 19, 2022
SX1276/77/78/79 Low Power Long Range Transceiver driver for esp-idf
SX1276/77/78/79 Low Power Long Range Transceiver driver for esp-idf

esp-idf-sx127x SX1276/77/78/79 Low Power Long Range Transceiver driver for esp-idf. I based on this. Changes from the original Added support for ESP32

Sep 5, 2022
WireGuard Implementation for ESP-IDF

esp_wireguard, WireGuard Implementation for ESP-IDF This is an implementation of the WireGuard® for ESP-IDF, based on WireGuard Implementation for lwI

Sep 21, 2022
SX1262//68 Low Power Long Range Transceiver driver for esp-idf
SX1262//68 Low Power Long Range Transceiver driver for esp-idf

esp-idf-sx126x SX1262//68 Low Power Long Range Transceiver driver for esp-idf. I ported from here. Ai-Thinker offers several LoRa modules. You can get

May 9, 2022
SI4432 ISM Transceiver driver for esp-idf
SI4432 ISM Transceiver driver for esp-idf

esp-idf-si4432 SI4432 ISM Transceiver driver for esp-idf. I refered this. Software requirements esp-idf v4.4 or later. This is because this version su

May 29, 2022
CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver driver for esp-idf
CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver driver for esp-idf

esp-idf-cc2500 CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver driver for esp-idf. I ported from this. 2.00mm pitch External Antena 1.27mm pitch PCB

May 29, 2022
Collection of additional Ethernet drivers for ESP-IDF

Collection of additional Ethernet drivers for ESP-IDF This repository aims to store additional Ethernet drivers which are not available directly in ES

Sep 19, 2022
ESP Insights is a remote diagnostics solution that allows users to remotely monitor the health of ESP devices in the field.
ESP Insights is a remote diagnostics solution that allows users to remotely monitor the health of ESP devices in the field.

ESP Insights is a remote diagnostics solution that allows users to remotely monitor the health of ESP devices in the field.

Sep 21, 2022
Internet of things created using arduino IoT cloud, consisting of esp and arduino boards

Internet of things created using arduino IoT cloud, consisting of esp and arduino boards. Goal of the project is to create a 3D printed RFID protected (with PIN) lock, including surveillance.

Sep 1, 2022
Example-application - Example out-of-tree application that is also a module

Zephyr Example Application This repository contains a Zephyr example application. The main purpose of this repository is to serve as a reference on ho

Sep 14, 2022
Arduino ve Esp ile oluşturulmuş mobil arama robotu projesi

Arduino-Mobil-Arama-Robotu Arduino ve Esp ile oluşturulmuş mobil arama robotu projesi Proje Adı: Mobil Arama Robotu Projenin Amacı 2x2 mt^2 lik bir al

May 12, 2022