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

Add ESP32 to board defs #315

Open
d1runberg opened this issue Nov 2, 2016 · 30 comments
Open

Add ESP32 to board defs #315

d1runberg opened this issue Nov 2, 2016 · 30 comments
Labels

Comments

@d1runberg
Copy link

@d1runberg d1runberg commented Nov 2, 2016

It would be awesome to add ESP32 to the board defs for standardfirmatawifi/ bluetooth! The GPIO capability is much better than the 8266

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented Nov 2, 2016

Do you have an ESP32 board? I don't and need someone to verify the defs if I add them.

@d1runberg
Copy link
Author

@d1runberg d1runberg commented Nov 2, 2016

Not yet, but I will probably have one in about a week ;)

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented Nov 2, 2016

Also I'm not sure if anyone has added Arduino support for it yet. Will need to wait until it's available in the Arduino Board Manager.

@d1runberg
Copy link
Author

@d1runberg d1runberg commented Nov 3, 2016

Here is the Arduino core...

https://learn.sparkfun.com/tutorials/esp32-thing-hookup-guide?_ga=1.116824388.33505106.1471290985#installing-the-esp32-arduino-core

Derek Runberg
Regional Education Developer
Sparkfun Electronics Inc.

Boulder, CO.
Cell: 971-344-2355
derek.runberg@sparkfun.com
http://www.sparkfun.com
http://learn.sparkfun.com

On Wed, Nov 2, 2016 at 1:50 PM, Jeff Hoefs notifications@github.com wrote:

Also I'm not sure if anyone has added Arduino support for it yet. Will
need to wait until it's available in the Arduino Board Manager.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#315 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AI0_VGuerB46dO7q2bnVY8Z4_thy69SHks5q6PeAgaJpZM4KnrgO
.

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented Nov 3, 2016

Thanks! Hadn't realized you worked at Sparkfun.

@d1runberg
Copy link
Author

@d1runberg d1runberg commented Nov 3, 2016

;)

Derek Runberg
Regional Education Developer
Sparkfun Electronics Inc.

Boulder, CO.
Cell: 971-344-2355
derek.runberg@sparkfun.com
http://www.sparkfun.com
http://learn.sparkfun.com

On Thu, Nov 3, 2016 at 4:40 PM, Jeff Hoefs notifications@github.com wrote:

Thanks! Hadn't realized you worked at Sparkfun.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#315 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AI0_VHZ3I3gZzmIdGkxtClc2XybEMPvQks5q6nDfgaJpZM4KnrgO
.

@deadprogram
Copy link

@deadprogram deadprogram commented Jan 13, 2017

Thank for working on this.

I see that the tools install themselves into the Arduino environment by following the Sparkfun site instructions. What, if anything, else needs to be done to run WiFi Firmata on the ESP32?

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented Jan 13, 2017

A lot needs to be done. An entry for the ESP32 is needed in Boards.h. An entry must also be added to wifiConfig.h and any pins that need to be ignored must be specified. Changes may need to be made to WiFiStream.h to handle any ESP32-specific behavior that is not 100% aligned with the Arduino Wi-Fi 101 library behavior, etc.

I recently picked up an ESP32 Thing board so I'll be adding this at some point in the coming weeks.

@deadprogram
Copy link

@deadprogram deadprogram commented May 17, 2017

Hi @soundanalogous anything happen on this, or anything I can do to help out with it?

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented May 17, 2017

I haven't had any time to work on it. Adding UART support would only take a few minutes, but adding Wi-Fi and BLE will take a lot longer. I don't even think the ESP32 Thing has an Arduino BLE library yet. It does have Wi-Fi though.

@deadprogram
Copy link

@deadprogram deadprogram commented May 17, 2017

Thanks for the reply @soundanalogous

If it is literally that easy, perhaps you could add the UART support, and then others like myself can work on adding WiFi support using https://github.com/espressif/arduino-esp32/tree/master/libraries/WiFi

It does appear that there is also now BLE support as well https://github.com/espressif/arduino-esp32/tree/master/libraries/SimpleBLE

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented May 17, 2017

That would be great if you want to take on Wi-Fi support! I'll see if I can find time to add basic support this weekend.

I've looked at SimpleBLE, but unfortunately it's not comprehensive enough. I'm hoping ESP32 support is added to the BLEPeripheral library at some point since that already works with Firmata.

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented May 20, 2017

I looked into this today. It turns out to be not so simple because the arduino-esp32 library does not yet support analogWrite or the Servo library which are both expected by StandardFirmata (and variants). I don't want to add an #ifdef to StandardFirmata just for this architecture either.

I could probably add the board to ConfigurableFirmata, but a user would have to know to exclude the analogWrite and Servo features in order to avoid compiler errors.

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented May 20, 2017

The esp32 HAL also redefines the standard INPUT and OUTPUT constants which is annoying. It's a relatively easy fix in Firmata however.

@deadprogram
Copy link

@deadprogram deadprogram commented May 21, 2017

Requiring a specific ConfigurableFirmata is not a problem for me personally, and certainly is an interim step until those other entrypoints are supported by arduino-esp. As long as it is documented, others will be able to avoid pitfalls with that.

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented May 22, 2017

This board is not proving to be very Firmata friendly. Turns out it spits out a large string of text on startup and upon establishing a new Serial connection:

⸮⸮⸮�⸮���⸮�⸮⸮⸮⸮⸮�⸮⸮�������������⸮���⸮��������⸮��������⸮�⸮⸮⸮�⸮⸮�⸮⸮��⸮�⸮⸮��⸮���⸮⸮�⸮�⸮⸮�⸮����⸮⸮�����⸮��⸮⸮⸮�⸮⸮⸮⸮⸮⸮⸮�⸮��⸮⸮⸮�⸮��⸮⸮⸮⸮��⸮⸮⸮⸮�⸮⸮�⸮⸮⸮⸮�⸮�⸮⸮⸮⸮�⸮��⸮���⸮⸮⸮⸮⸮⸮⸮�⸮⸮�⸮����⸮⸮��⸮�����⸮�⸮�⸮⸮�⸮⸮⸮��⸮⸮⸮⸮��⸮⸮�⸮⸮�⸮⸮�⸮⸮⸮⸮⸮⸮��⸮��⸮⸮�⸮⸮�⸮⸮��⸮⸮⸮⸮��⸮⸮�⸮⸮�⸮�⸮⸮⸮⸮�⸮ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0008,len:8
load:0x3fff0010,len:160
load:0x40078000,len:10632
load:0x40080000,len:252
entry 0x40080034

A firmata client would need to interpret and ignore this data in order for this board to work over a Serial transport. This won't affect Wi-Fi however so that is still a possible option, but overall this board seems like a poor choice for Firmata applications.

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented May 29, 2017

I have ConfigurableFirmata branch with ESP32 support that sorta works for Wi-Fi: firmata/ConfigurableFirmata#71. It's far from stable however. Needs testing and I could use some help improving it... especially in figuring out a buffering scheme that will likely lead to a larger structural change in using non-Serial/USB transports with Firmata.

@Wqrld
Copy link

@Wqrld Wqrld commented Jul 18, 2017

any progress? im thinking of picking up an esp32 soon

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented Jul 18, 2017

I would not recommend purchasing an ESP32 board specifically for use with Firmata any time soon. Buy an ESP8266 board instead.

@Wqrld
Copy link

@Wqrld Wqrld commented Jul 18, 2017

okay, now i have to decide to get bluetooth or firmata. Anyway, thanks for your work on this awesome project.

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented Jul 18, 2017

BLE is supported for Firmata on the Arduino 101 and the RedBear BLE Nano (with some minor changes). However, that said, BLE does not work well with Firmata because Firmata is stream-based and BLE is not designed for large data transfers.

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented Jul 18, 2017

I should add that how well BLE works with Firmata really depends on your application. It actually works well if you just need data from a single sensor or need to control a single actuator. It doesn't work well for general purpose control of a microcontroller where you need to use various digital and analog signals simultaneously.

@ttww
Copy link

@ttww ttww commented Jan 5, 2018

Ups, I wanted more pins and changed to esp32, but firmata is not supported... :-(
Any news/infos/plans on this issue?

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented Jan 5, 2018

The biggest blocker is that the Arduino analogWrite method is not yet supported on the esp32.

@monteslu
Copy link

@monteslu monteslu commented Jan 5, 2018

I'm using ledcwrite as a workaround until we get analogwrite: https://github.com/monteslu/ble-io/blob/master/arduino/esp32/esp32.ino#L229

Might still be helpful to have the board definition so we know what pins can do what in the meantime

@ttww
Copy link

@ttww ttww commented Jan 5, 2018

Thanks for that tip :-)

@draeron
Copy link

@draeron draeron commented Aug 11, 2019

does anyone has a functioning fork with the ESP32 working? i don't need analogWrite so this ain't a problem for me.

@soundanalogous
Copy link
Member

@soundanalogous soundanalogous commented Aug 13, 2019

@draeron you can try this branch and see my notes about it here.

@draeron
Copy link

@draeron draeron commented Aug 13, 2019

thx i'll be sure to check it out.

@T0T4R4
Copy link

@T0T4R4 T0T4R4 commented Jul 26, 2020

Firmata provided in IDE 1.8.13 still seems not to be working on bpi:uno32 , any plan to solve this issue ?

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

Successfully merging a pull request may close this issue.

None yet
8 participants
You can’t perform that action at this time.