felis / USB_Host_Shield_2.0

Revision 2.0 of USB Host Library for Arduino.
https://chome.nerpa.tech
1.79k stars 779 forks source link

Elagoo Arduino UNO R3 Waiting for Device... #813

Open Es0ter1ck opened 4 months ago

Es0ter1ck commented 4 months ago

I have an Arduino UNO R3 from Elagoo

and purchased this Host Shield https://www.amazon.com/Shield-Arduino-Support-Google-Android/dp/B0CKSZ81CS/ref=sr_1_1?crid=3VZ6BXT3RCI29&dib=eyJ2IjoiMSJ9.ShK4RulJmdNYyfxWDz_a0YQFLY2INYhXkB-UkJnNkoVQqzqIP89CDnn4wesQxOhbUOMXdBLLhPiCzyEjgVBnqFMrcEcS6HuEklEevlf1is0q5mFqC7r7X5niBVQqJSy_mroWW-T-JVNMB3_uNkwoxiXOVJ8ePt_0kr1c1f8ZPiO4wjT4FgpNU9fZn3QvmSLtWIM3LeruG52VFC-DHqKjVe9-mrYHYg66sJ1JmAUI_y4.Nrz-zfG_AQ3l2H1owTHktDz6hXAUeTI8ex_GA194FeU&dib_tag=se&keywords=USB+Host+Shield+for+Arduino&qid=1715629500&sprefix=usb+host+shield+for+arduino%2Caps%2C123&sr=8-1

My Problem: When running board_qc the Serial Monitor stays on Waiting for Device... forever never recognizing the device

What I have tried: I have soldered the 3.3V and 5V input and the 5V for the VBUS power this allows the board_qc to show Die revision 03 with my plugged in keybaord

I switched and tried 3V instead for the VBUS and that doesnt run past Die revision 00

Please help!

This is the current outout of the serial monitor:

Circuits At Home 2011 USB Host Shield Quality Control Routine Reading REVISION register... Die revision 03 SPI long test. Transfers 1MB of data. Each dot is 64K................ SPI long test passed GPIO test. Connect GPIN0 to GPOUT7, GPIN1 to GPOUT6, and so on Test failed. Value written: 00 Value read: FF Press any key to continue... GPIO test passed. PLL test. 100 chip resets will be performed Resetting oscillator

100 Resets.

Checking USB device communication.

Waiting for device...

Wanted to mention I am brand spanking new to this hobby and am teaching myself so I am a little confused on some things. Appreciate any help!

xxxajk commented 4 months ago

plug in any kind of usb device to complete the test.

Es0ter1ck commented 4 months ago

plug in any kind of usb device to complete the test.

thank you for the response. The issue is that the keyboard is connected, I have tested with a bluetooth dongle as well

jacobsoftwares commented 4 months ago

"I have soldered the 3.3V and 5V input" - either 3.3v or 5v not both, power the board via VIN For power to USB via VBUS unsolder both 3.3 and 5v.

Es0ter1ck commented 4 months ago

"I have soldered the 3.3V and 5V input" - either 3.3v or 5v not both, power the board via VIN For power to USB via VBUS unsolder both 3.3 and 5v.

IMG_2537

Attached is a close up of my host shield. Thank you for your reply!

Sorry but maybe I am a bit confused you mean to unsolder the blue circle joints? Is the 5V join being soldered to power the VBUS ok?

jacobsoftwares commented 4 months ago

It looks like you are not connected with arduino. Try this

Screenshot 2024-05-24 at 6 53 41 AM

If VIN doesnot work (as it is not connected to arduino) connect directly to 5v

"Blue circle" - already board would have continuity i guess.. please desolder those and check with multimeter. Your error suggests device is not powered. Check for power on the USB. Most HID devices like keyboard requires 5v via USB.

As it is not connected via arduino board, check for GND, 5V connectivity in all the places marked as GND, 5v respectively..

Es0ter1ck commented 4 months ago

With the current setup as shown I get 5V reading with the multimeter in the green circle VBUS, and 3.9V in the 3.3V joint and 5V in the 5V joint in blue circle

The keyboard is lighting up so when connecting to the host shield it is powering it using the power connected to the Arduino so that seems to work.

How would I make sure VIN is working? it should be in this case as mentioned above right?

jacobsoftwares commented 4 months ago

Then please recheck for MISO, MOSI, GND connections.

Screenshot 2024-05-24 at 7 18 43 AM
jacobsoftwares commented 4 months ago

solder these

Screenshot 2024-05-24 at 7 21 43 AM
Es0ter1ck commented 4 months ago

you mean check the power? of those

jacobsoftwares commented 4 months ago

SCK, INT, MISO, MOSI, GND should be connected with the microcontroller for the board to work

Es0ter1ck commented 4 months ago

Again thank you so much for the help. I have soldered the SS and the INT and checked they receive power, they do.

I then read the pins you mentioned before and labled those readings.

Doing this though its still stuck on Waiting for Device...

IMG_2544

jacobsoftwares commented 4 months ago

desolder on SS, but keep the INT soldered and try

Es0ter1ck commented 4 months ago

Do the 0V on the right matter?

jacobsoftwares commented 4 months ago
Screenshot 2024-05-24 at 9 07 37 AM

and try again..

Sorry: typo DESOLDER this

jacobsoftwares commented 4 months ago

Upload basic KeyboardSerial example and try

jacobsoftwares commented 4 months ago

Have you installed USB HOST SHEILD library? It is required for the board to work.

After the library is installed upload this code to arduino and try `#include

include

USB Usb; HIDUniversal Hid(&Usb);

class KbdRptParser : public KeyboardReportParser { protected: void OnKeyDown (uint8_t mod, uint8_t key); void OnKeyPressed(uint8_t key); }; void KbdRptParser::OnKeyDown(uint8_t mod, uint8_t key) { uint8_t c = OemToAscii(mod, key); if (c) OnKeyPressed(c); } void KbdRptParser::OnKeyPressed(uint8_t key) { Serial.print(char(key)); };

KbdRptParser Uni;

void setup() { // Open Hardware Serial Serial.begin(115200); while (!Serial) {}

if (Usb.Init() == -1){} delay( 1500 );

if (!Hid.SetReportParser(0, &Uni)) { ErrorMessage(PSTR("SetReportParser"), 1 ); }

}

void loop() { // put your main code here, to run repeatedly: Usb.Task();

}`

Es0ter1ck commented 4 months ago

I have the library as the board_qc compiles without error. The USB host shield should be recognized using the board_qc sketch but its not, so when I uploaded the above code, no input was received,

jacobsoftwares commented 4 months ago

I am using the sketch which I shared with USB HOST SHIELD library.. I had no problems.. Did you try the sketch I shared? Did it compile?

Try soldering SS pin back and repeat with my sketch... Desolder both SS and INT and try..

Found a link http://domoticx.com/arduino-shield-usb-2-0-host-shield/ translate to your language and see this works for you.

Es0ter1ck commented 4 months ago

Yes I did try to run your sketch you provided. It does compile with no issues, and I uploaded it into my Arduino without issue. I then try to connect the Keyboard into the USB Host shield but nothing was being shown in the Serial Monitor.

When I first began we know that SS and INT were not soldered and it didn't work I tried both SS and INT soldered - still nothing Then desoldered SS and left INT - nothing

I have limited USB devices to check but so far my Bluetooth dongle, USB keyboards and mice are doing the same thing reaching up to Waiting for Device... then staying there.

I might just have a defective board but I was hoping this wasn't the case and wanted to try everything I could, its also confusing sense the USB host shield is recognizing when I remove and insert a new USB device as the results of the qc_board change.

I feel like im so close!

Es0ter1ck commented 4 months ago

Below is a picture of the current setup, the code in the terminal is the code that was on the site that you had linked to.

IMG_2545

The black cord is for the keyboard, and the red is connected to the PC and the Arduino. The Keyboard lights up so its receiving some type of power, but not enough to transmit data? The terminal shows start, but no input from the Cyberpower pc is recognized.

Es0ter1ck commented 4 months ago

Noob question but I know there is spark fun USB host shields and circuits at home, I ordered this from Amazon but is this board using the Circuits at home design or something? The website for circuits at home is down and I cant order it from them. I ask this because I keep reading solutions of connecting pin D7 to RST pin with a jumper wire but that was for sparkfun boards mentioned in this page.

:https://forum.arduino.cc/t/sparkfun-usb-host-shield-working-with-oleg-usb-host-shield-2-0/73034/20

I don't know if this applies to my board aswell.

jacobsoftwares commented 4 months ago

Jumper is for sparkfun boards… send the pic of Arduino uno…

Compile sketch boardqc with debugging on.. so you will get detailed report via serial

jacobsoftwares commented 4 months ago

Does you USB devices require its drivers to be installed manually on the desktop? If you have installed their drivers manually then they might not work as desired.

jacobsoftwares commented 4 months ago

Try with USB mouse

Es0ter1ck commented 4 months ago

Jumper is for sparkfun boards… send the pic of Arduino uno…

Compile sketch boardqc with debugging on.. so you will get detailed report via serial

IMG_2547

Im not 100% what you mean by the drivers but when connected the devices I never had to manually download drivers or anything like that.

I tried with mouse, to no avail :(

I will most likely purchase the official Arduino Uno R3 board, and another USB host shield or two and will report back the results

I just wanted to avoid that if I could.

jacobsoftwares commented 4 months ago

the board is ok..

I have connected ATPMEGA328p with USB HOST shield on breadboard itself... So that should not be an issue. If you have the right microcontroller then there shouldn't be a problem..

Have you tried boardqc with debugging on?

Es0ter1ck commented 4 months ago

Yes I have, to make sure I did it correctly this is what I did

I went to Documents->Arduino->Libraries->USB Host 2.0->Settings.h->ENABLE_UHS_DEBUGGING 1

But I don't see anything different in the Serial monitor is it somewhere else

jacobsoftwares commented 4 months ago

I am sorry Arduino Uno board doesnot have debugging... I am working on ESP32 which has debugging feature... I was thinking Uno also has the same.. Sorry for misdirection.. I am actually out of ideas!

Es0ter1ck commented 4 months ago

No worries, thank you so much for all of your help. There was this link that was given from the official Arduino forum and I was wondering if it makes more sense to you than me and if it could potentially be a solution: https://forum.arduino.cc/t/usb-host-shield-not-working-wrong-smd-chip-populated/1180071

We shared the issue of having near 4V for the 3.3V input pin