Esp32 DevKit v1 by Espressif
Firmware
- DJs ESP32 DOIT DevKit v1 Version 4 (updated 2024-12-18)
- EZ-ESP32 with Adafruit PCA9685 Version 1 (updated 2021-04-30)
The DOIT Esp32 DevKit v1 is a very affordable WiFi module with plenty of IO, including three hardware UARTs. Adding the firmware below makes the WiFi module an EZB that ARC can connect to. This firmware works with ARC versions greater than or equal to 2019.06.25.00.
*Note: For servo use with EZ-Cam, only pins 2,4,12-19,21-23,25-27,32-33 are recommended.
Video Tutorial
WiFi Modes
The code supports two WiFi modes: AP Mode, which turns the ESP32 into a WiFi server your computer connects directly to, and Client Mode, in which the ESP32 connects to your network router. You can view the IP Address and connection status information by viewing the Serial Monitor set to 115,200 in Arduino IDE.
Port Configuration
The pins in ARC are labeled D0 - D23. The ESP32 has GPIO-labeled pins, which are not in any ordered sequence. This translation chart below shows the mapping of the ESP GPIO to ARC Dx pins. The ports labeled TX/RX are the hardware UART ports, which correspond to hardware UART #0 in ARC.
I have done many small projects with the ESP8266 (temp sensors, garage door status, cell phone garage door opener, scrolling LED displays). Just great little boards, very cheap, WiFi and programming with the Arduino IDE they can't be beat. With this update, I guess it's time for me to try the new big brother ESP32. What Fun!
Thanks DJ
This looks like something I can play with and add some fun stuff around the house.
Those are good ideas! Perfect for these devices being so affordable. I think we bought a box for $4 each. What stuff do you guys have in mind?
i might make a controller for my blinds on the deck at my cabin
Updated the firmware to work with the latest beta ARC on 2019-06-25-00
Help install this firmware on M5stack! https://m5stack.com/collections/m5-core/products/grey-development-core
Hi, I understand that the firmware is for the DOIT ESP32 devkit1, but in France what I easily find it is the ESP32 NodeMCU, which has 38 pinouts ESP32 Do you think it could work, with this firmware or with minor changes ? Thanks
Not a clue - but they're usually $5 boards so it's worth a shot. Also, be warned that this board is really slow and doesn't do much.
Ok, thanks. Maybe i will give it a try. It is really a lot slower than, let's say, an IO-tiny ?
Oh yah - like by a ton. The IoTiny is incredibly fast. Think about that an IoTiny can stream audio and video and i/o in realtime over wifi with a web server. The ESP32 can ONLY do some i/o. Not even that much i/o.... just a little bit. A few servos and it starts acting wonky
OK, it seems indeed really limited...
Just a suggestion, maybe this kind of info (such as "Speed") could appear on the "Compatible hardware" page, next to "Connection", "Servos", "Camera", "Audio", or on the manual page of each hardware. It would help people like me to know the limitations and capabilities in this matter.
Thanks
Well - the speed is the reason why camera and audio aren’t capable
as for merely using I/o, it would be fine and you don’t notice the speed limitations. The speed limitation is why there aren’t checkboxes for other features. So giving a speed or potential parameter would be difficult to document because it’s abstract to what it’s related to.
if you use this device for only what it can do, it’ll be equivalent to the respective capabilities of other controllers, such as iotiny.
OK, I understand. I didn't interpret correctly the audio or camera check. For me it meant that there was no way to physically plug a camera or connect an audio output. But the way you put it totally makes sense.
Does the Esp32 firmware work with the ESP8266 NodeMCU CP2102 ESP-12E WiFi Internet Development Board Wireless Module Compatible with Arduino IDE
EzAng
I don't know - you can try. I've never heard of that before. I'm sure it'll work with small tweaks.
@EzAng, the ESP32 and the ESP8266 are different chips, so as @DJ mentioned you would need to tweak the EZ-B arduino code to make it work.
To put it frankly, I wouldn't bother with ESP8266 as it's the older version of the ESP32. The ESP32 has many more GPIO and ADC ports, and it looks like the ESP8266 has only 1 ADC port. The ESP32 is twice as fast as the ESP8266 and has also 2 cores. The price is only a fraction higher for the ESP32 so if it were me I'd choose the ESP32, hands down.
ok sounds good, thanks Jeremie
EzAng
Wiring was getting too messy (even for me) so I created a little ESP32 servo shield. In hindsight I really don’t need the FTDI as I won’t reprogram it unless a new firmware comes out so I think I will order just the ESP chips from China and make some smaller shields just for servo control.
That's a great idea! Looks good with the sticker labels!
Very cool work.
Small problem with ESP servo calibration and degrees of movement. Take a HDD servo connect to an ESP and press center and it is about 10 degrees off. Now plug it into a EZB press center Perfect.
OK recalibrate for ESP. Now add servo control and move it to 1 degree it should be at 90 degrees to servo motor but it is about 45 degrees. Now move it to 180 degrees and it is only at about 135 degrees.
now move back to 0 and press release and it will move back to 135 degrees now move servo by hand to 0 and press release again this time it moves back to 135 but doesnt release
using latest ESP firmware and port D5
That’s the esp32 servo firmware for ya. All of the arduino servo libraries are off a little. They weren’t written that well. Might want to take a look at other servo libraries to try instead of the one I choose. I think it choose that one because it was the highest recommended.
Take a look at this, I’m not sure what it means different channels vs same channel. I often wonder if the esp32 has enough clock left over after the tcp stack to run timers in real-time: https://www.arduino.cc/reference/en/libraries/esp32servo/
Wanna try a new firmware for me? I updated the servo library to the latest - see if this helps. Let me know if it works before I update it on the website firmware list: EZ-ESP32.zip
went to bed with a broken servo, woke up to a working servo. Nice thank for the quick turn around. you still have to recalibrate (although i guess I could use an offset with my bots that use them) and release doesn't work but I get 180 degrees and it is a lot snappier, the old driver was a bit grindy.
I think the ESP has a lot of promise as a controller. There are a lot of things that work with arduino like LIDAR etc and having a single $5 controller that does a lot of things with ARC would be great.
I am sure the new ESP32-S3 will solve all the performance issues as well
https://www.espressif.com/en/news/ESP32_S3
New drivers work well with Robot Hand. Question in Auto position, can you get two frames to execute at exact same time under the one action. I played with delay and speed etc but I can’t get a smooth in sync motion where frame 1 and frame 2 load in parallel (same time) and not serial (one starts and then the other starts) Example count in decimal works fine but if you count in binary you want to move two or more fingers at same time versus individual fingers and I really don’t want to create a frame for every permutation, just -1 out the servos that I don’t want to move.
Is it possible to use one of these to add wifi to an older ezb board? I have the version 3 which has a faulty bluetooth module.
Any esp type board should work. You’d have to write some firmware or find some code that converts wifi to uart. Here’s one I found for you with google: https://github.com/roboremo/ESP8266-WiFi-UART-Bridge
Thanks for the reference. I'll see what it does. I figured it was worth a tinker before scrapping out the board.
Anyone tried this one. It is an ESP32 with a camera. The ESP32-Cam is great but to be honest not enough ports so I thought this one would be useful if we get more ports.
https://www.amazon.ca/Freenove-ESP32-WROVER-Bluetooth-Compatible-Tutorials/dp/B09BC5CNHM/ref=sr_1_3_sspa?crid=28FD74NK9JZX&keywords=ESP32&qid=1649941215&sprefix=esp32%2Caps%2C97&sr=8-3-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEyV0xGSENDMk9CMEoyJmVuY3J5cHRlZElkPUEwMTU5MDYzMlhSTllQU1BXQkY3UCZlbmNyeXB0ZWRBZElkPUEwNTc3MjU0VlhHNlNDUzVTVEZDJndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==
If it's Arduino compatible, throw a firmware there, and she'll go.
But because it is esp32, you're still going to be limited by the i/o restrictions. The camera will use a number of the i/o ports, which will reduce the amount of available i/o to you. It'll also use the same internal timers and DMA, which will conflict with servo PWM generating timers.
ESP32 is an ESP32, even if you change the form factor. You will still experience the same limitations because, at heart, it's the same thing with a different breakout board.
When you look at any micro board that says ESP32, you'll see a shiny silver metal box. That is the same module that all ESP32 controllers use. They all have the same parts but with a different breakout board.
I was just thinking, if you need additional servo ports on an ESP32Cam, it has a UART. That means you can add an arduino or SCC-32 to the ESP32cam's uart. It'll require a minor firmware change but that's an easy fix. Pretty much you'd be sending all data from the TCP to the UART, and vice versa.
OK thanks I figured $20 was worth a try. I have been meaning to order one of those Adafruit servo controllers and try it with the ESP. For now I will just run a separate camera off another ESP32-CAM. Good thing ARC supports multiple controllers.
I wouldn't bother with the adafruit servo controller because the communication is slow and a little wonky with i2c.
You'd get more out of an Arduino with a servo shield. Simply connect the Arduino's RX and TX to the TX and RX of the ESP32 cam.
Once you do that, the firmware change is minor on the esp32. All you need to do is a while () loop that passes TCP to the UART and vice versa. All of the EZB code is removed.
Here, this is how it would work: https://synthiam.com/Firmware/ESP32-Cam-Arduino-Relay-XFXISYJTEYQ
To compile on Arduino IDE 2.0.3 I had to change line 591 to: analogWrite(translateaDigitalPort(port), (uint16_t) map(pos, 0, 100, 0, 255));
I'm assuming here it is supposed to use the included analogWrite and not the Arduino included one?
I don't think an Arduino analog write exists for the ESP Arduino library. At least at the time of the firmware creation, there wasn't. It shouldn't matter which one you use if there happens to be an Arduino AnalogWrite installed with the ESP package.
But i think you need to be casting the value to a uint8_t not a uint16_t. Because it's only a byte from 0-255. I mean, the 16bit int will work but it's unneeded extra bits
Gotcha. I commented out analogWrite and moved the files out of the project and it compiled. Looks like it was included November 2021 since version 2.0.1 so after the firmware was written.
esp32/hardware/esp32/2.0.6/cores/esp32/esp32-hal.h:void analogWrite(uint8_t pin, int value);
Aside from that error the rest of the firmware compiled fine.
that's good to know - i might have to revisit that firmware and remove the analogwrite.h to use the built-in one.
so you got it working then?
Yeah I'm just sitting at my bench with multimeter testing the PWM's on the pins. Works great.
p.s. nabu'er here as well :-) actually that's how I found ARC. It's just a hobby of mine and learning ros2 was not fitting into my schedule anytime soon.
I was really impressed how well the ESP32 worked with ARC. I think if someone sat down and built a free 3D printed opensource series of robots like a robot humanoid, robot hexapod, robot car etc based on the ESP and called it something like ES-Robot, it would be a huge success for schools and hobbyists
Haha, @nink - suggesting I start another hardware company to compete with my old company? I never want to get into hardware again - I still have nightmares about supply chain issues!
@Atomist, that's great! What a small world. The NABU has been such a great distraction for me. I never imagined I would experience anything like it - probably never will again.
I have to agree that the ESP32 works so well with ARC. I do wish it had more I/O, but that available I2C or UART could expand on that. Or, using a dynamixel or other "smart" servo would be great. There is a line of servos called Feetech that I've found to be somewhat comparable in quality but much lower cost.