Hello Arduino forums!
I'm trying to setup my MKR WAN 1310 as a USB host to talk using serial to an oxygen concentrator (Link if it helps). The specific board is required as we're also using it for LoRaWAN communications. We also want to add as little additional circuitry as possible, so shield/ external boards are not preferred. For this, I plan on using the USB Host Library SAMD. To this end, I have 2 main problems.
- I can't seem to get the example KeyboardController working. For this test, I have:
- Powered the board with a 5V power supply through Vin
- Connected an FTDI usb to serial converter between my PC and the boards TX, RX, and GND pins
- Connected an OTG cable between the keyboard, and the arduino. (The keyboard works when plugged into PC's, and the OTG cable is new)
Upon powering up the board, I receive the following msg:
Keyboard Controller Program started
USB state changed: 0x0 -> 0x12
Detached, waiting for Device
After which, pressing buttons doesn't show anything on the serial monitor, nor does the keyboard have power. (caps and nums lock dont light up on press). I've tested multiple keyboards and OTG cables, all to no avail.
As a side note, I also tested this program with the concentrator just to see what would happen, and I got the following logs. This only happens with an older OTG cable, and only with the concentrator, all other test setups gave the message above. Not sure why...
Keyboard Controller Program started
USB state changed: 0x0 -> 0x20
Device Attached
USB state changed: 0x20 -> 0x30
Resetting Device
USB state changed: 0x30 -> 0x40
Reset complete
- Even if I do get this library working, I can't seem to find any way to communicate using serial over USB. There are a fair few example drivers to borrow from over at the libraries github, however I'm not too sure where to start.
I'm still relatively new to USB communications, so I'm hoping someone with a little more experience might be able to lend a hand!
Thanks,
Xavier