Visual Studio Code and PlatformIO

Regular readers will know that I’m a big proponent of PlatformIO as a programming platform for the ESP family; it’s just so much better than the Arduino IDE for us command-line interface die-hards. As I’ve noted before, I’m not a religious fanatic on the CLI vs GUI thing; it’s just that GUIs (with a couple of exceptions) don’t really click for me. Most of the time I just don’t “get it” and what’s on offer usually seems to limit the functionality without really adding much, if anything, in ease of use. Recently though, I’ve been searching for information on getting started with the ESP32’s built-in version of FreeRTOS (specifically, looking for more information on real-world use, rather than just a couple of sentences about the syntax of the xTaskCreate() call) and I found a couple of very useful videos by Xavier on his “Simply Explained” channel which, as the name suggests, do a very good job of explaining by example, how to use FreeRTOS. The thing which (as a doddering old git) really caught my attention was his use of Visual Studio Code. I was captivated by the pop-up prompt with info on the parameters (of which there are plenty) to feed to xTaskCreate. While I imagine that functionality can get pretty tedious when it pops up for each and every printf(), it does look like a definite winner when you’re learning something new (and don’t have much in the way of short-term memory any more).

Now, what was I saying again? Oh yes, here’s the link to one of Xavier’s videos. He’s got a ton of content on his channel on many diverse (but usually tech-related) topics. This one is not the first in the series, so if the abrupt lead-in is a bit too much you can go to his Intro on FreeRTOS instead. I highly recommend watching Xavier’s videos if you’re trying to get started with FreeRTOS.

Of course, I immediately went off and downloaded Visual Studio Code and fired it up …only to just as immediately get totally lost when I couldn’t get it to do anything that I wanted. I did watch a few more videos from a nice lady at Microsoft, but ended up suffering from information overload and Windows-itis. I went for a nice cup of tea instead. And then went back to PlatformIO in an xterm, just so that I could get something done.

More recently, one of my regular morning reads, Hackaday, had an article on making laminated artwork for front panels with an accompanying video (worth a look in itself) by Richard Langner. I was impressed by Richard’s succinct, no-nonsense style and dipped into his video listings to see what other goodies were there. Lo and behold, right at the top of the list were a couple of videos on how to get started with Visual Studio Code with PlatformIO. The first was only a minute and a half long and the second just over six minutes. Both are filled with essential information on doing just what I wanted to do (have the editor prompt me with useful info, but still be able to use PlatformIO as my programming environment). As they’re so short, I’m including both as embedded links below. Take a look. Even if you don’t like them, you won’t have wasted much time.

Many thanks to both Richard and Xavier (oh, and Al Williams and the team at Hackaday, as well as Ivan and everyone at PlatformIO) for making my life not just easier, but a lot more interesting, too.

Yay! ESP32 SPIFFS Arrives.

This is one that seems to have been blocking a few projects up until now (going by the number of “any updates?” emails to the forum thread).

The official SPIFFS implementation is now available from the Arduino-ESP32 repository.

That’s the good news.  The bad news is that it’s flagged as “initial” and doesn’t seem to have things like “info” support yet.  Never mind, we have SPIFFS;  thanks Hristo and Ivan!

 

Getting started with PlatformIO and the ESP32

Here’s the shortest “Getting Started” you’ve ever seen (disclaimer†  …I’m making the huge assumption that you already use PlatformIO as your development environment for your ESP8266 projects.  If you don’t, you should!).

Add support for the ESP32 with:-

platformio platform install espressif32

Create your new development (project) directory and, in that new directory, initialize the environment for the type of board you have‡  with:-

platformio init --board=esp32dev

Start writing code, as normal, in the newly created src directory and then compile with:-

platformio run

At this point, PlatformIO will go off and automatically download the framework support for your environment (this first time, only) and then compile your code.

You just can’t get any easier than that!


† I don’t actually have an ESP32 board yet.

‡ List the available target boards with “platformio boards

Ψ If you’re tired of typing “platformio” in full each time, you can shorten it to “pio” (“platformio” is used for clarity here).

ω For more information on getting started with PlatformIO, see the full documentation at:- http://docs.platformio.org/

And another one for the ESP32, too

 

Explore Labs ESP3212 breakout board

Just in case you’re looking for a breakout board for your ESP3212 (rather than the boring old ESP8266), Tindie has you covered for that, too.  It doesn’t have the neato prototyping area that our previous offering had (in fact, as far as I can see, it doesn’t have anything at all, except for 0.1″ spaced connectors for all of the ESP32 pins), but it is considerably cheaper, at only $1.49 plus postage.  Of course, first you need that ESP3212.

ESP32 Dev Boards @ CNX Software

CNX Software, a site definitely worth adding to your bookmarks, has just published a short list of ESP32 development boards, gleaned mainly from blogs and social media sites.  Some of them are work-in-progress and some of them appear to be vapourware, but it’s still an interesting article and a nice little teaser for those of us still searching for someone to throw a few dollars at for a real, live ESP32.

ESP32 Module!!

This picture of the WROOM-32 module pinouts has been produced by Alberto Piganti (PighiXXX).  I would have dismissed it as an April Fools Day joke, especially given the strange capacitor layout around the antenna area …but it’s August and, more importantly, the 

WROOM-32 Module
Courtesy of Alberto Piganti

information was re-tweeted by John Lee, of Espressif.   Also, the datasheet for the module appears to be available.

I really don’t know whether this is a mock-up, prototype, or just a rendering based on the pin-outs and top-view outline available in the datasheet (although it is most likely the latter) and right at this moment I don’t have the time to be able to follow-up.  So if any of you interested readers out there would like to do some sleuthing, please carry on and let us know what you find out in the comments section.

The picture link will load the original, full-size PDF file, BTW (just in case you’re allergic to PDFs).

 

ESP32 Announcement

Just in case you haven’t already seen it, here’s the announcement from Espressif of their new, ESP32 chip.

ESP32 announcement from Espressif

John Lee (of Espressif) has also just noted on his twitter account that, “ESP32 and ESP8266 target slightly different markets. They do share very similar APIs. ESP32 is not a replacement for ESP8266!“.  He also suggests in a different post that the plan is to lower the price of the existing ESP8266 chips at the beginning of next year and bring the ESP32 to market at a price “slightly above” that of the current ESP8266.  Apart from the obvious pricing information, that also implies that we’ll be seeing the new chip in the wild very soon.  That’s the good news …but it’s worth remembering that John is talking about the chips themselves, so how much that price increase affects the module pricing remains to be seen, especially as the new features (BLE, extra I/O’s, etc.) imply extra board real-estate and increased component count at module level.  We should probably steel ourselves for a not-insignificant retail price hike between the ESP8266 and ESP32 modules.

 

ESP32_Module_smallUpdate – Pete Scargill has received an early version of the ESP32 module PCB layout from Espressif.  Go to his blog (also available in the sidebar links section) to see the whole thing and read more about what people think the layout implies about the capabilities of the new chip.