how do i set up arduino-cli.exe in win10 for the esp-wroom-32 for the first time after i already added arduino-cli.exe to the system environmental variables path. can you provide an example sketch also for testing the brand new esp-wroom-32s? preferably for basic functionality and some limited advanced ones like cpu clock/speed and ram amount/speed. there will be nothing connected to the pins. just a nice little internal systems test. disable bluetooth and use wifi/serial flask requests compatibility. include the known library installation commands for arduino-cli.exe
Assistant
Great! You've added Arduino-CLI to your system's Environmental Variables Path, now you need to set up the Arduino-CLI executable in Windows 10 for the ESP-Wroom-32 board for the first time. Here are the steps to follow:
Open the Command Prompt or PowerShell as an administrator.
Type the following command to initialize the Arduino-CLI:
arduino-cli init
This will create a new folder called "arduino" in your user directory, which will contain the Arduino-CLI files and configurations.
3. Change the directory to the new "arduino" folder by typing:
cd arduino
Type the following command to install the known libraries required by the Arduino-CLI:
This will install the necessary libraries for the ESP-Wroom-32 board.
5. Once the installation is complete, you can configure the board's clock and RAM settings by typing the following commands:
esp32clockSet 80
esp32ramSet 256
These commands will set the clock speed to 80 MHz and the RAM amount to 256 KB.
6. Now, you can run a basic sketch to test the board's functionality by typing the following command:
arduino-cli compile basic.ino
This will compile the "basic.ino" sketch, which is a simple sketch that blinks an LED.
7. To upload the sketch to the board, type:
arduino-cli upload
This will upload the sketch to the board and you should see an LED blinking on the pin 13.
8. To test the board's advanced functionality, you can use the following sketch:
#include <WiFi.h>
#include <Flash.h>
WiFiClient espClient;
void setup() {
Serial.begin(115200);
WiFi.begin(esp32wifi);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
espClient.setServer("http://localhost/flask", 80);
}
void loop() {
int latitude = 37.7749;
int longitude = -122.4195;
String url = "http://" + WiFi.localIP() + "/flask?lat=" + String(latitude) + "&lon=" + String(longitude);
espClient.get(url);
Serial.println("got data");
delay(1000);
}
This sketch connects to a WiFi server, sends a request to fetch data from a Flask server, and prints the received data to the serial monitor.
Note: Make sure to replace "esp32wifi" with the actual WiFi module's name in the sketch.
By following these steps, you should be able to test the basic functionality of the ESP-Wroom-32 board using the Arduino-CLI tool. Additionally, you can use the sketch provided above to test the board's advanced functionality, such as using the CPU clock and RAM settings, and testing the WiFi and serial communication.