Comments (7)
Post your code and any serial console debug output.
from usb_host_library_samd.
#include <Arduino.h>
#include <usbhub.h>
USBHost usb;
void setup() {
Serial.begin(9600);
usb.Init();
}
void loop() {
usb.Task();
delay(1000);
}
Code that works.
Debug output:
-
USB_DETACHED_SUBSTATE_INITIALIZE
-
USB_ATTACHED_SUBSTATE_RESET_DEVICE
-
USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE
-
USB_ATTACHED_SUBSTATE_WAIT_SOF
-
USB_ATTACHED_SUBSTATE_WAIT_SOF
-
USB_STATE_RUNNING
#include <Arduino.h>
#include <usbhub.h>
#include <usbh_midi.h>
USBHost usb;
USBH_MIDI midiUsb(&usb);
void setup() {
Serial.begin(9600);
usb.Init();
}
void loop() {
usb.Task();
delay(1000);
}
Code that doesn't work.
I get USB_STATE_RUNNING randomly one time. (???)
Debug output:
-
USB_ATTACHED_SUBSTATE_RESET_DEVICE
-
USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE
-
USB_ATTACHED_SUBSTATE_WAIT_SOF
-
USB_STATE_CONFIGURING
Configuring: parent=0 Port=0
Vid=5766 Pid=351 DeviceClass=0
blindly attempt to configure
AttemptConfig: parent= 0 port=0
Inside AttemptConfig -> rcode=0
Inside AttemptConfig -> rcode=0
Inside AttemptConfig -> rcode=0
Inside AttemptConfig -> rcode=0
/!\ USBHost::Task : USB_STATE_CONFIGURING failed with code: 8
from usb_host_library_samd.
Look likes the problem is on AttemptConfig function.
Any idea?
from usb_host_library_samd.
What SAMD board are you using? If you are using an Uno, Mega, or Leonardo with a USB host shield, look in the https://github.com/felis/USB_Host_Shield_2.0.
I do not see how sketch 1 could work. Most SAMD boards have only 1 USB port which this library switches to USB host mode so serial console debug ouput does not come out on the same port. Serial console debug output must be sent to Serial1 or other Serial port.
By the way, remove the delay(1000) because it is not needed.
If the Zoom G3 is not MIDI class compliant it will not work.
There is one program in github that indicates the device is usable with the old USB Host Shield library so it may be MIDI class compliant. This uses the older USB host shield so does not work with this library.
https://github.com/vegos/ZoomG3_ArduinoMIDI/blob/master/ZoomG3_ArduinoMIDI.ino
from usb_host_library_samd.
I'm using arduino zero. So I can serial debug and use the USB Host application.
A lot of people make works the Zoom G3 with USB Host Shield.
Here randomly work. I think the problem is on AttemptConfig. For a unknown reason, the code stucks in there. Anything that I can try to change?
from usb_host_library_samd.
I don't know why, now it's working. Maybe a problem in my Zoom G3, or noise problem. I'm feeling stupid.
from usb_host_library_samd.
The Zero is a good board for USB host debugging since it has two USB ports. I am glad to hear it is working.
from usb_host_library_samd.
Related Issues (20)
- Capturing and transmitting arrow key presses (directional keys: up down left right) for Arduino USB Host
- Recvbuf needs to be aligned HOT 2
- USB Not starting on Adafruit QTPy w/USB-C->USB-A (3.0) Adapter HOT 3
- delay.h issue HOT 1
- USBH_MIDI : Failing to get device descriptor with some devices. HOT 1
- Disable USB Host mode
- incompatibility with Adafruit_SSD1306.h?
- feather m0 bluetooth le + 3.7v lipo run 3.3v mcu keeb?
- Using PTP to control camera never retrieves any data
- SparkFun SAMD51 MicroMod Not Showing Up on the COM Port After Example Sketch HOT 2
- delay.h not found HOT 1
- The data received with Arduino MKR 1010 is missing HOT 1
- Works on Nano 33 iOT but cannot compile for RP2040 connect
- Does this work with USBC boards?
- Seeeduino Xiao
- USB Host with a SAMD21: receiving and sending data issues HOT 8
- KeyboardController HOT 1
- MKR WiFi 1010 pairing issues HOT 1
- USB MIDI message loss, tips on how to diagnose? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from usb_host_library_samd.