When working with the ESP-01 module, you have two popular options for uploading code: the Arduino IDE and PlatformIO. Here's a guide on how to upload code using both methods.
- Open PlatformIO and create a new project. In the project wizard, navigate to the board selection step.
- Under the "Choose Board" section, select "Espressif ESP8266 ESP-12E" as the board for your project. It's important to choose this specific board, as selecting a different one may result in an upload failure.
- Continue with the project setup, and you can start writing your code.
- Once you're ready to upload the code to your ESP-01 module, connect the module to your computer.
- Click the upload button in PlatformIO to compile and upload the code to the ESP-01. The upload process should start, and you'll see the progress in the console.
If you choose wrong board, the platform IO may not be about to upload the code. The following error message will be in the output.
Serial port /dev/cu.usbserial-140
The correct board options should be "esp12e" in the platformio.ini.
- Open the Arduino IDE and go to the "Tools" menu.
- Under the "Board" options, scroll down and select "Generic ESP8266 Module." Choosing this board ensures compatibility with the ESP-01 module.
- Proceed to write your code in the Arduino IDE.
- Connect your ESP-01 module to your computer using a suitable programmer or USB-to-Serial adapter.
- Verify your code and click on the upload button in the Arduino IDE. The IDE will compile your code and upload it to the ESP-01 module.
By following these steps, you can successfully upload code to your ESP-01 module using either the Arduino IDE or PlatformIO. Remember to select the appropriate board configuration to ensure a smooth uploading process.
Feel free to explore both platforms and choose the one that best suits your development needs. Happy coding!