ESP32 Arduino core roadmap

onehorse
Posts: 70
Joined: Mon Feb 15, 2016 1:35 am

ESP32 Arduino core roadmap

Postby onehorse » Thu Dec 15, 2016 6:27 am

Now that I have my ESP32 Dev Board working (thank you Igrr) and I am able to make use of the I2C bus (thank you me-no-dev) I just want to ask about my wish list of some useful features:

Does the ESP32 support a Real Time Clock? I have a 32.768 kHz crystal on my board and would like to keep time on the ESP32 if this is possible. If so, will there eventually be an API added to the Arduino core for the RTC?

How can I make use of powf, sinf, tan2f, and sqrtf functions? I can use these with the ESP8266/85 but for some reason the ESP32 Arduino core complains about them. Do I need to include some particular library to make them work?

Is there an internal temperature and voltage sensor in the ESP32? How can we access these?

Will light and deep sleep modes be supported? Does a particular pin need to be connected to reset in order to wake the ESP32 from deep sleep like the ESP8266/85? If so, which one? Light sleep is particularly useful for cutrting power usage.

In general, will there be other low power modes and/or the ability to select the CPU speed made available?

Will there be an I2S API made available for the Arduino core?

Of course, I would like to make use of wifi (especially the web server) and BLE.

Well, these would be enough to keep me busy for a while. Nothing here is urgent, I just want to get these issues on your radar and get a general feel for the scope and pace of Arduino core development for the ESP32.

Thanks for any information you can provide.

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: ESP32 Arduino core roadmap

Postby ESP_igrr » Sun Dec 18, 2016 8:51 pm

Many of these things first need to be supported in the ESP-IDF, then the Arduino core can provide Arduino-style wrappers for them.
As features land into the ESP-IDF, it usually takes me-no-dev a few days to integrate them into Arduino, at least for most of the features which have an existing API on the Arduino side.

32khz clock support is coming to the ESP-IDF, code related to clock switching will be open source (currently it exists inside librtc.a).

If you need RTC peripheral to function as a real time clock which maintains time when going to deep sleep, you can do this already, using C settimeofday/gettimeofday APIs. This isn't exposed in Arduino yet, mostly because Arduino doesn't have any standard time APIs (and Time library is a joke because it conflicts with standard library time.h header file on non-case-sensitive systems).

Floating point math functions should work. If you are getting some problems with them, please open a ticket on Github.

Deep sleep is supported in the ESP-IDF. Arduino API has to be changed somewhat compared to the ESP8266, because we now have more ways to wake up from deep sleep.

Light sleep is essentially suspending the CPU, this is supported in the ESP-IDF (and happens automatically), but due to Arduino "loop" which runs constantly, this doesn't work in Arduino. This will probably also be supported somehow, but i'm not sure what the API should be. Modem sleep is already supported and enabled by default, unless SoftAP mode is used. There is no API to disable it, but unlike the ESP8266, enabling modem sleep doesn't mess with LwIP timers, so there should be no problem with keeping it enabled.

Regarding I2S — we still need a driver on the ESP-IDF side, and possibly a chapter in the Technical reference manual, before Arduino library can be written. Good news is that there is now an official I2S library, so at least we don't have problems choosing an API for that.

BLE library is being worked on, it should be mostly compatible with Arduino101 BLE library.

onehorse
Posts: 70
Joined: Mon Feb 15, 2016 1:35 am

Postby onehorse » Sun Dec 18, 2016 11:37 pm

Thank you for the detailed reply; this is all great news!

On the subject of light sleep, this is what I had to do for the ESP8285:

Code: Select all

#include "gpio.h"
extern "C" {
#include "user_interface.h"
  bool wifi_set_sleep_type(sleep_type_t);
  sleep_type_t wifi_get_sleep_type(void);
}


which allows me to call this in the setup:

Code: Select all

initWifi();

     Serial.println("Light sleep enabled");
     wifi_set_sleep_type(LIGHT_SLEEP_T); // Enable light sleep mode to save power
It saves quite a bit of power when periodically sending wifi messages to a web server. In fact I prefer this over deep sleep not only because light sleep preserves the application state but unless I am in deep sleep for a long time (> 10 minutes) I find light sleep actually saves more power on average than coming in and out of deep sleep, reinitializing, etc.

I hope something simple like this light sleep function can be made to work for the ESP32 also.

For the ESP8266/85 we needed to connect GPIO 16 to #RST in order to be able to wake the ESP8266/85 from deep sleep. I take it from your comments this won't be necessary for the ESP32; this is important to know in case any hardware changes might be required to take advantage of the deep sleep mode.

I'll verify the trouble I had with the floating point functions and if it persists I will open a ticket.

Lastly, I ran afoul of what I expect to be a common conflict unless the name is changed. I tried out the wifi scanner using <WiFi.h> which of course conflicts with the <WiFi.h> included with the Arduino IDE download, and in my case, the latter was selected by the compiler and caused a compile error. I suggest that the ESP32-specific WiFi.h library be renamed <ESP32WiFi.h> just like the ESP8266 wifi library is named <ESP8266WiFi.h> in order to avoid this confusion in the future.

Thanks again for the great support!

puterwang
Posts: 9
Joined: Sun May 08, 2016 11:22 am

Re: ESP32 Arduino core roadmap

Postby puterwang » Mon Dec 19, 2016 1:31 am

ESP_igrr wrote: Regarding I2S — we still need a driver on the ESP-IDF side, and possibly a chapter in the Technical reference manual, before Arduino library can be written. Good news is that there is now an official I2S library, so at least we don't have problems choosing an API for that.

When the officia I2S library will be avaiavle?

rosenbp
Posts: 2
Joined: Fri Apr 14, 2017 5:06 am

Re: ESP32 Arduino core roadmap

Postby rosenbp » Wed Apr 19, 2017 9:23 am

Are there any news when light sleep (stopping loop()) might be implemented? Perfect would be a function to stop it for a given time or until an interrupt occurs.

aaronallar
Posts: 1
Joined: Mon Jun 26, 2017 12:35 am

Re: ESP32 Arduino core roadmap

Postby aaronallar » Mon Jun 26, 2017 2:01 am

Are there any updates on the BLE and BT classic?

Who is online

Users browsing this forum: No registered users and 55 guests