Development Environment for ESP32 - Arduino or ESP-IDF? - Page 1
Forum section: electronics / general

author: don.r
author_rank: Frequent Contributor
timestamp: September 22, 2017, 04:38:51 pm
content: Going to start some ESP32 programming and wondering what people are using for a dev environment. I don't have a lot of legacy Arduino-specific code, just C/C++ generic. Needs are modest but don't want to learn a toolchain that will be overly restrictive or lacking in features.

author: TJ232
author_rank: Frequent Contributor
timestamp: September 22, 2017, 05:57:19 pm
content: Arduino IDE framework might be quite restrictive sometime.If you want to squeeze your ESP32 at the maximum just go with ESP-IDF:https://github.com/espressif/esp-idf

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: September 22, 2017, 06:24:47 pm
content: Arduino is a toy for beginners to get started quickly.No idea if ESP-IDE is any better but if it has any kind of debug support it has to be better than Arduino

author: don.r
author_rank: Frequent Contributor
timestamp: September 22, 2017, 07:51:25 pm
content: Quote from: mikeselectricstuff on September 22, 2017, 06:24:47 pmYeah, that was what I was worried about. Since the ESP-IDF (yeah, I made a typo) is the official one from Espressif, I'll go down that route. It does have a JTAG debugger.

author: martinayotte
author_rank: Regular Contributor
timestamp: September 23, 2017, 12:58:15 pm
content: Arduino-esp32 doesn't prevent using ESP-IDF, since it could be used as IDF components.

author: don.r
author_rank: Frequent Contributor
timestamp: September 23, 2017, 03:18:17 pm
content: Quote from: martinayotte on September 23, 2017, 12:58:15 pmYes. It looks like I can just borrow from Arduino-esp32 and load into esp-idf. Looking at the C API for the esp32 everything looks straightforward anyhow. The only issue would be inter-operability with other components that will probably have Arduino code but no ESP code but that looks to be not a problem.

author: cv007
author_rank: Frequent Contributor
timestamp: September 23, 2017, 08:45:04 pm
content: You may want to check out Micropython.I have a few Olimex ESP8266-MOD-WIFI that I have flashed with Micropython firmware. The Olimex board has solder jumpers to select the boot mode, so constantly flashing firmware was not really an option. I just use the mod-wifi rx to receive status messages from a pic16f and simply serve a web page to show the status. It works pretty good.I have a handful of py modules I created- ntp, telnetd, httpd, rcopy, utils, wifi, plus some other files like hostname, log.txt for logging, ssidpw file to store wifi logins. I have my own little micro unix-like systemSince you have a filesystem (about 1.4MB on my board which has 2MB spi flash), its simple to update the files. I usually leave open a terminal with a telnet connection to the board (will be at a REPL prompt to enter commands, just like being at a shell prompt), To update the py modules, I create/edit them on the pc, run netcat -l -p 8888 < myfile.py , then on the mod-wifi I type rget('myfile.py'), a few seconds later I have my new file uploaded. The pic16f simply sends a python command to log events - like log('P')\r\n to log a pump on event- the log function will prepend a time stamp and append the log file (csv format). The index.html will get the log.txt file and long poll for any updates to it.For my web page, I use the httpd.py file to serve a single index.html (or through query strings can do some simple admin tasks). Since I don't know html/css/javascript/svg/ajax,long polling all that well, it works pretty well to change the index.html file- edit on pc, upload, refresh browser, debug in browser if needed, repeat. I'm a Python beginner also, so it took me a week (spare time) to get the httpd module working reliably.The mod-wifi board does not have any io pins other than tx/rx brought out to the connector (there are two on the board that could be used, though), so cannot comment on how well hardware io works with Micropython. I would rather the pic16f do the real work anyway. Maybe I can get the mod-wifi to LVP program the pic16f someday.Just a thought.

author: TJ232
author_rank: Frequent Contributor
timestamp: September 24, 2017, 04:28:09 am
content: Question was about ESP32 dev env not ESP8266.

author: westfw
author_rank: Super Contributor
timestamp: September 24, 2017, 10:17:42 am
content: Using the Arduino package manager is a pretty convenient way to install the ESP toolchain, includes, and libraries, even if you never actually touch the Arduino IDE or their "quaint" libraries.(although it looks to me like ESP-IDF is a lot better than the last time I looked at it!)

author: cv007
author_rank: Frequent Contributor
timestamp: September 24, 2017, 05:09:16 pm
content: QuoteI can read, mostly. I thought it relevant as Micropython is also available for ESP32.QuoteMaybe Micropython will not suite the modest needs, but decided to share just in case it would be useful.I'll crawl back into my hole.

author: Aodhan145
author_rank: Frequent Contributor
timestamp: September 24, 2017, 05:13:44 pm
content: I have done a bit of work with the ESP32 and the esp-idf is the only way I would go. For my purposes the idf wasn't even good enough and was still a bit bloated.

author: lucazader
author_rank: Regular Contributor
timestamp: October 16, 2017, 05:30:15 am
content: I have used the IDF quite a bit and it is still improving greatly.Quite a lot of the bloat is gone, though some still remains.It is quite easy to get up and running and there are now quite a lot of examples.If you aren't wedded to the arduino ecosystem then the idf is probably the better way to go.

author: pigrew
author_rank: Frequent Contributor
timestamp: October 16, 2017, 05:47:16 am
content: I also think that ESP-IDF (optionally with Eclipse) is the way to go. The eclipse setup is a bit tricky and not so well documented. Edit the compile scripts to add "-j5" or whatnot to get multithreaded builds.I've not used them but the Lua and Python environments also look promising.Note that the ESP-IDF library isn't complete (e.g. some wireless functionality is missing), and I find the documentation lacking. You may end up needing third party Bluetooth stacks, if you're using Bluetooth.

author: lucazader
author_rank: Regular Contributor
timestamp: October 17, 2017, 05:26:47 am
content: I am using BLE and using the espressif stack. It is working really well now. (currently using the master branch, v3.0 RC1 is due out next week which will be based off the master)Also have a look into vs code as a dev environment for the esp32. Much easier to setup than eclipse and a better code editor.