Skip to content
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

two USB HOST working on same ESP32 #476

Open
fotosettore opened this issue Jul 12, 2019 · 11 comments
Open

two USB HOST working on same ESP32 #476

fotosettore opened this issue Jul 12, 2019 · 11 comments

Comments

@fotosettore
Copy link

hi
i'm using a ESP32.
i'd like to install two USB HOST device on the same esp32 --> https://i.ebayimg.com/images/g/UUQAAOSwFyhaF6Pj/s-l1600.jpg

I saw that, as default, usbh_midi refers to VSPI (18,19,23,5)
what i must do to use HSPI (14,12,13,15) also (in case it were possible to make them work together), or better more add another SS to use two usb host on same line (VSPI or HSPI) ?

here the code that works fine on VSPI with only one usb host shield

#include <usbh_midi.h>
USB Usb;
USBH_MIDI  Midi(&Usb);

//****
void setup() 
{
  Serial.begin(115200);
  if (Usb.Init() == -1) 
  {
    Serial.println("USB did not start.");
    while(1);
  }  
  else
  {
    Serial.println("Started USB :-)");
  }

/*
 ---> here i'd need to start another usb host  (ex.  usb_2) 
*/
}

i think i must refer to USB_MIDI_converter_multi.ino but i did not understand how to connect the pin SS of second usb host.
I have been looking for an example for two days but found nothing.

many thanks for help

@gdsports
Copy link
Contributor

Maybe use a USB hub for more than USB MIDI devices. But you may need the fixes in PR #414 for hubs to work.

@fotosettore
Copy link
Author

fotosettore commented Jul 13, 2019

thanks for your reply
i made all modifications but i'm not skilled to understand what kind of code i must add in my sketch to obtain the second usb host.
may you help me with a very simple example ?
thanks

@fotosettore
Copy link
Author

no info, no help ?

@xxxajk
Copy link
Contributor

xxxajk commented Jul 22, 2019 via email

@fotosettore
Copy link
Author

fotosettore commented Jul 22, 2019

thanks ... i will wait and i will try to understand better
it should be very simple. we'd must change the SS pin
for example in the UsbCore.h i try to change this line

#elif defined(ESP8266) typedef MAX3421e<P2, P5> MAX3421E; // ESP8266 boards //P4=D2 P0=D3 P2=D4

and it works fine if i change first P
but i must to define two P, one for first host and another for second one.
i don't understand how to set two SS ...

@xxxajk
Copy link
Contributor

xxxajk commented Jul 22, 2019

Just wait for UHS3 to do this, as you won't have to worry so much on what to do.
I'll try to get to it this weekend... No promises though, I am quite busy.

@fotosettore
Copy link
Author

really really many thanks ...

@CodeOhms
Copy link

If this has not been implemented when I get two shields in a month, I will try to help get this done.

@fotosettore
Copy link
Author

hi everyone ...
no news about this problem ?

@fotosettore
Copy link
Author

i think i have no hope for this issue :-(

@fusionstream
Copy link

fusionstream commented May 2, 2020

Duplicate the library and change the pins as you have already done. Use the "different" library to control the other host. Alternatively, use a usb hub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants