Espressif: Difference between revisions
Brian Wilson (talk | contribs) |
Brian Wilson (talk | contribs) |
||
Line 26: | Line 26: | ||
520 kB RAM, 4MB flash; really not enough RAM to mess around with Micropython. | 520 kB RAM, 4MB flash; really not enough RAM to mess around with Micropython. | ||
[[M5 Atom]] Matrix grey with 5x5 Neopixel LED matrix and a 6-axis IMU | |||
[[M5 Atom]] Echo white, with a speaker and microphone. It also has a Neopixel. | |||
==== M5StickC ==== | |||
[https://github.com/m5stack/M5StickC M5StickC] orange and wearable. | [https://github.com/m5stack/M5StickC M5StickC] orange and wearable. | ||
Also has | I have a few of these because they are cheap, come with lots of sensors, a tiny 80x160 LCD, and are nicely enclosed in a little case. | ||
Also has a 6-axis gyro/accelerometer, and a microphone. Also it can detect alien lifeforms in a 100 meter radius. | |||
It uses an ESP32-PICO-M4 processor with 4MB of RAM. It's supposed to be a wearable so it has a battery. | |||
This MCU uses more power than an ESP32S3 if that matters to you. | |||
Initially I set up one with a PIR hat and used it to control a light for about a year. Currently it's offline due to household politics. | |||
It works really perfectly for this with an MQTT connection to Home Assistant. | |||
* What can I do with the internal temp sensor? | |||
* What can I do with its RTC? Datasheet https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/Stamp/StampTimerPower/RTC8563.pdf | |||
* What can I do with the accel/gyro? Detect vibration or change of direction in a car? Step count? | |||
* What can I do with the mic? | |||
* Can I turn off TV's with the IR LED? | |||
Internal photos (This "plus" version has bigger screen) https://www.gwendesign.ch/kb/m5stack/m5stickcplus/ | |||
and https://www.gwendesign.ch/kb/m5stack/m5stickc/ | |||
It has some magnets in it so you can stick it to things! Cool. | |||
Batteries - it has an RTC button cell and a tiny (95mAH) LiPo. More of a UPS than a power supply. | |||
Looks like taking it apart is a waste of time, things are pretty packed in there. Don't bother. Have lots of other ESP32 things already. | |||
== Projects == | == Projects == |
Revision as of 19:05, 9 August 2023
Hardware
ESP-C3-12F - These are in the old ESP12F form factor but have a RISC-V processor. I will put them in a page on the C3, here ESP-C3.
ESP12F and programmer, see docs at Amazon
Wemos D1 R1 - ESP8266 board in Arduino form factor. Purchased from MPJA for about $13, available on eBay for $7.
Espressif WROVER-DEVKITC-VIE boards (2) from Digikey ($11). Great except they are too wide to use on a breadboard. This device has 520KB RAM + 4MB Flash + 8MB PSRAM making it a good choice for Micropython.
I have a some Home control stuff deployed around my house that's based on ESP8266 chips including FEIT dimmers and Martin Jerry switches. I intend to reflash them all soon to get them off the IoT and onto the local network. There are more details on the ESP8266 page.
ESP-PROG / JTAG board. https://www.digikey.com/en/products/detail/espressif-systems/ESP-PROG/10259352 Flash download tools: https://www.espressif.com/en/support/download/other-tools There is no install step, you just run it.
M5 hardware
520 kB RAM, 4MB flash; really not enough RAM to mess around with Micropython.
M5 Atom Matrix grey with 5x5 Neopixel LED matrix and a 6-axis IMU
M5 Atom Echo white, with a speaker and microphone. It also has a Neopixel.
M5StickC
M5StickC orange and wearable. I have a few of these because they are cheap, come with lots of sensors, a tiny 80x160 LCD, and are nicely enclosed in a little case. Also has a 6-axis gyro/accelerometer, and a microphone. Also it can detect alien lifeforms in a 100 meter radius.
It uses an ESP32-PICO-M4 processor with 4MB of RAM. It's supposed to be a wearable so it has a battery. This MCU uses more power than an ESP32S3 if that matters to you.
Initially I set up one with a PIR hat and used it to control a light for about a year. Currently it's offline due to household politics. It works really perfectly for this with an MQTT connection to Home Assistant.
- What can I do with the internal temp sensor?
- What can I do with its RTC? Datasheet https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/Stamp/StampTimerPower/RTC8563.pdf
- What can I do with the accel/gyro? Detect vibration or change of direction in a car? Step count?
- What can I do with the mic?
- Can I turn off TV's with the IR LED?
Internal photos (This "plus" version has bigger screen) https://www.gwendesign.ch/kb/m5stack/m5stickcplus/ and https://www.gwendesign.ch/kb/m5stack/m5stickc/
It has some magnets in it so you can stick it to things! Cool.
Batteries - it has an RTC button cell and a tiny (95mAH) LiPo. More of a UPS than a power supply.
Looks like taking it apart is a waste of time, things are pretty packed in there. Don't bother. Have lots of other ESP32 things already.
Projects
Motion sensor -- I have had one deployed for months in our bedroom, it switches on a light in the evening. Works via MQTT I used a RADAR sensor that is too good, it can see through drywall and picks up motion everywhere. I am switching to PIR sensors soon.
LED strip controller -- working on this soon, to control RGBW strips over WiFi, or maybe I will press on with the Nordic nRF52840's and Zigbee.
Toolchains
Right now it's a blob in my mind so I am here writing this to sort it out. I got some nRF52840's and that's just added to the confusion.
Arduino, Espressif IDF, FreeRTOS Visual Studio Code, PlatformIO
I have been using Arduino but I really want to try out working with RTOS and I want to use VSCode as my IDE, I am getting comfortable with it at work.
There is a tutorial here: https://randomnerdtutorials.com/vs-code-platformio-ide-esp32-esp8266-arduino/
- Visual Studio Code (VSCode) is an IDE. It is far more useful than Arduino's IDE.
- PlatformIO is an extension for VSCode.
- There is also an Espressif IDF extension.
- PlatformIO adds the "alien" icon in the left bar.
- ESP-IDF adds a bunch of tools to the blue bar at the bottom.
VSCode + PlatformIO + Arduino framework
When creating a project with PlatformIO you can pick Arduino as the Framework if you don't need the ESP-IDF platform. I put all my source code in ~/source/platformio/.
I cloned the M5Stack repo https://github.com/m5stack/M5Stack.git The Examples/ are great.
I just built and uploaded a Blink program and it worked flawlessly on the first try. In the blue bar there are build and upload tools. There is a "serial monitor" tool in the blue bar too. Output goes to a Terminal window.
So far I find this experience much better than using Arduino IDE, perhaps because I already use VS Code, also partly because the project is organized more the way I'd want. I like having one window for everything, I've never liked how Arduino opens a new window for each "sketch". Also I never liked the word "sketch", lol.
VSCode + PlatformIO + ESP-IDF framework
I followed this tutorial. https://docs.platformio.org/en/latest/tutorials/espressif32/espidf_debugging_unit_testing_analysis.html#
It worked fine, I tested it on an M5 Atom Matrix. I got a soft AP running.
Libraries
PlatformIO has its own library manager and when you add a library, the library is downloaded and referenced in the platformio.ini in the current project.
So how do I do that?
JTAG debugging
https://mcuoneclipse.com/2019/10/20/jtag-debugging-the-esp32-with-ft2232-and-openocd/
Books and resources
Random Nerd