ESP32

65 ₪


datasheet



step1: Download Arduino IDE






step2: Installing ESP32 Add-on in Arduino IDE

To install the ESP32 board in your Arduino IDE, follow these next instructions: 1- In your Arduino IDE, go to File> Preferences





Enter https://dl.espressif.com/dl/package_esp32_index.json into the “Additional Board Manager URLs” field as shown in the figure below. Then, click the “OK” button:





Note: if you already have the ESP8266 boards URL, you can separate the URLs with a comma as follows:



https://dl.espressif.com/dl/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json



3- Open the Boards Manager. Go to Tools > Board > Boards Manager…





4- Search for ESP32 and press install button for the “ESP32 by Espressif Systems“:





5- That’s it. It should be installed after a few seconds.







step3: Testing the Installation

Plug the ESP32 board to your computer. With your Arduino IDE open, follow these steps: 1. Select your Board in Tools > Board menu (in my case it’s the DOIT ESP32 DEVKIT V1)





2. Select the Port (if you don’t see the COM Port in your Arduino IDE, you need to install the CP210x USB to UART Bridge VCP Drivers):







3. Open the following example under File > Examples > WiFi (ESP32) > WiFiScan





4. A new sketch opens in your Arduino IDE:





code
نسخ
اقتباس
عرض
تنزيل
	
								
/* Example from WiFi > WiFiScan Complete details at https://RandomNerdTutorials.com/esp32-useful-wi-fi-functions-arduino/ */ #include "WiFi.h" void setup() { Serial.begin(115200); // Set WiFi to station mode and disconnect from an AP if it was previously connected WiFi.mode(WIFI_STA); WiFi.disconnect(); delay(100); Serial.println("Setup done"); } void loop() { Serial.println("scan start"); // WiFi.scanNetworks will return the number of networks found int n = WiFi.scanNetworks(); Serial.println("scan done"); if (n == 0) { Serial.println("no networks found"); } else { Serial.print(n); Serial.println(" networks found"); for (int i = 0; i < n; ++i) { // Print SSID and RSSI for each network found Serial.print(i + 1); Serial.print(": "); Serial.print(WiFi.SSID(i)); Serial.print(" ("); Serial.print(WiFi.RSSI(i)); Serial.print(")"); Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?" ":"*"); delay(10); } } Serial.println(""); // Wait a bit before scanning again delay(5000); }


5. Press the Upload button in the Arduino IDE. Wait a few seconds while the code compiles and uploads to your board.





6. If everything went as expected, you should see a “Done uploading.” message.





7. Open the Arduino IDE Serial Monitor at a baud rate of 115200:





8. Press the ESP32 on-board Enable button and you should see the networks available near your ESP32:





Error in ubuntu: error(1): arduino IDE import serial ImportError: No module named serial Solution: sudo apt install python-is-python3 ----------------------------------------------- sudo apt-get install python3-serial -y OR sudo apt-get install python-serial -y error(2): exec: \"python\": executable file not found in $PATH Error compiling for board DOIT ESP32 DEVKIT V1. Solution: sudo apt install python-is-python3



Troubleshooting

If you try to upload a new sketch to your ESP32 and you get this error message “A fatal error occurred: Failed to connect to ESP32: Timed out… Connecting…“. It means that your ESP32 is not in flashing/uploading mode. Having the right board name and COM por selected, follow these steps: Hold-down the “BOOT” button in your ESP32 board





Press the “Upload” button in the Arduino IDE to upload your sketch:





After you see the “Connecting….” message in your Arduino IDE, release the finger from the “BOOT” button:





After that, you should see the “Done uploading” message That’s it. Your ESP32 should have the new sketch running. Press the “ENABLE” button to restart the ESP32 and run the new uploaded sketch.



ESP32 Wi-Fi Modes

The ESP32 board can act as Wi-Fi Station, Access Point or both.







ArduinoJSON Library

You also need to install the ArduinoJSON library. You can install this library in the Arduino IDE Library Manager. Just go to Sketch > Include Library > Manage Libraries and search for the library name as follows:





سلة المشتريات افراغ السلة