-
Notifications
You must be signed in to change notification settings - Fork 792
ESP8266-Arduino support? #262
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
Comments
Planned for UHS 3.0 |
@xxxajk Okay great! Thanks for your reply! BTW I the HID stuff haven't been implemented yet, right? I didn't quite understand what's that means in the HID example. (This file: https://github.com/felis/UHS30/blob/master/libraries/UHS_host/UHS_HID/examples/USB_HOST_SHIELD/UHS_HID/UHS_HID.ino) Is it still has the same API as the old one, the UHS2.0? Regards, |
Correct, right now there is no HID. |
That said, I'll now post what I have in mind. HID-RAW interface driver, will be the root for all interfaces afterwards.
|
Oh yeah, please move the discussion to UHS30 :-) |
This commit: 0b3f4d9 should add support for the ESP8266. Currently it just uses pin 10 and 9 for SS and INT respectively: https://github.com/felis/USB_Host_Shield_2.0/blob/master/UsbCore.h#L43. Since I do not have much experience with the ESP8266 I just used the current default pins. @huming2207 you have a better proposal to what the default pins should be? |
@huming2207 please test the code in the following branch: https://github.com/felis/USB_Host_Shield_2.0/tree/ESP8266 and report back if it is working or not, as I don't have a physical board at hand. |
See: #263 |
@Lauszus I'm so sorry mate...I'm not at home now, so I cannot test the ESP8266 USB shield for you. But I've got a NodeMCU board (ESP12E module with CP2102 serial to UART converter) now on my hand, and the compilation did pass successfully anyway. There is a strange thing that I haven't connect the USB shield (and anything else) to my NodeMCU. It only prints the words "Start" and nothing follows on. If I don't have the USB shield board connected to Arduino, will it also prints "OSC did not start"? Here is the successful compile output:
Anyway thanks for your works and patches! Regards, |
Does it work? My 8266 doesn't have pins 9 and 10.... |
@Lauszus See hangouts chat please :-) |
@Lauszus I was just to start to use ESP8266 stuff these days. For the NodeMCU (ESP12/ESP12E modules) pinout, I guess it should be better if we can use the pinout defined by ESP8266-Arduino project themselves? See here: https://github.com/esp8266/Arduino/blob/master/variants/generic/common.h They've set the pins like this:
Maybe you should specify these stuff in the library? Jackson |
@xxxajk Some ESP modules removed some of the pins. For ESP12E they have those pins. |
Then we need a patch that can work on all of them, what pins do you suggest? |
Maybe we could use pin 15 for SS and pin 16 for INT? |
seems to be the standard. |
Yes all variants include common.h except the wifio variant: https://github.com/esp8266/Arduino/blob/master/variants/wifio/pins_arduino.h, so I might just make a specific check for that. |
It does not seem like it is supported anyway: https://github.com/esp8266/Arduino/blob/master/boards.txt. |
cool :-) |
Please see: 238c269. |
Note that we can not use the pins defined in common.h, but at least this has been fixed in newer version of the Arduino core: arduino/Arduino#4814. I will send a PR to the ESP8266 repository tomorrow. |
@Lauszus Got it, thanks mate. I'll test it later when I return back home. By the way, ESP8266/8285 platforms have a lot of variants. I'm not quite familiar with the C/C++ and those hardware communication stuff, but I guess you may need to find more details before you type your code. |
Yes I know, but all modules should have at least those pins: https://github.com/esp8266/Arduino/blob/master/variants/generic/common.h#L30 and https://github.com/esp8266/Arduino/blob/master/variants/generic/common.h#L34. If the SPI pins are not broken out, then there is much we can do anyway. |
Btw this commit: 231fb54 ensures that it will just use the pin defines in the future. |
@Lauszus Nice, thanks for your patches! |
You're welcome. Let me know when you have had time to test it ;) |
@Lauszus Yep but still have about 20+ days to go, so it will takes a while...sorry about that... |
No problem ;) |
Opened two PR's upstream as well: esp8266/Arduino#2639 and esp8266/Arduino#2640. |
@Lauszus 👍 Go get 'em :-) |
I guess the developers in ESP8266-Arduino project are busy coding for ESP32 platform? They seemed haven't check the pull request for several week... |
That is a possibility. |
If it's important, we can just call the ESP8266 SDK functions (the one that ESP8266-Arduino based on) instead. Here is the SDK v2.0.0 's reference: https://espressif.com/sites/default/files/documentation/2c-esp8266_non_os_sdk_api_reference_en.pdf |
I mean, instead of submitting patches to ESP8266-Arduino, we should call the platform SDK's functions. Sometimes it's even better if someone need this library (UHS2.0) in some non-Arduino ESP8266 projects. |
that causes code complexity, though, and UHS2.0 really isn't divided well enough so that things like this don't cause confusion. |
I agree in limiting it to the Arduino core for now. Anyway the code should work as is, I just sent those PR's, so it can be fixed in the future. |
Yep hope so. Espressif themselves and those fanboys won't give up ESP8266 too soon. |
@Lauszus Hello again, I've found an issue today, I suggest that we should use some other GPIOs for INT instead of GPIO16, some platforms will use this pin as "awake" pin and connect the pin to RESET pin to wake the ESP8266 itself from sleeping. By the way using GPIO0 and 2 probably is not a good idea. Users may use it as debug serial pin (GPIO2) and bootloader enter pin (GPIO0). |
@Lauszus Maybe GPIO 0 works, but I'm not sure, need to be evaluated later when I'm back. |
@Lauszus It was proved that GPIO16 WILL NOT work for attaching interrupt, see here: http://esp8266.github.io/Arduino/versions/2.3.0/doc/reference.html#digital-io They've mentioned that :
|
@huming2207 INT is not used as a interrupt anyway. It is simply polled. |
@Lauszus Ahh...okay...so is that means I've made a mistake that "INT" is not a interrupt pin? 😂 |
No, in this version of the USB Host Shield library it is not connected to an interrupt pin. However this is the case for 3.0. |
Okay got it... If I do not connect this pin, what will happens? Will it works? |
Pin 10 is polled in uhs1 and 2. So... you need it connected to some pin for On Nov 3, 2016 5:19 PM, "Jackson Ming Hu" [email protected] wrote:
|
Okay now I understand, thanks mates! Now I've just started making a PCB for my project. It's a module for converting USB keyboard to bluetooth via a special HC-05 bluetooth module. It uses ESP-12E module and I've reserved GPIO0 as INT pin for USB shield. So far I don't have much free time to start coding, but I've done a Eagle schematic and PCB project. See here for the schematic: Github - HyperaBt-Hardware |
Hello there,
I've got a compile error for targeting to ESP8266 boards using ESP8266 Arduino SDK (a.k.a ESPduino, see here: https://github.com/esp8266/Arduino)
Here are some information for my environment:
Arduino IDE: 1.6.11
Host OS: Mac OSX 10.12
USB Host Shield library version: 1.2.1
Target: ESP8266 NodeMCU 1.0 Board, 4MB Flash
...and here is the compilation log:
Hope you can fix this, thank you!
Regards,
Jackson
The text was updated successfully, but these errors were encountered: