Upload the data folder (SPIFFS or LittleFS) from PlatformIO Make sure you have ESP32 Dev Module as your board and the correct port has been selected. Make sure to install the app to follow along with this example.Ĭompile and upload the following code, or if you wish, open the BLE_write example from the Files > Examples > ESP32 BLE Arduino menu. A good, basic app is the BLE Scanner for iPhone or Android. This example works with a BLE scanner on your phone. This example allows you to write messages on your phone that can then be read in a serial monitor on your computer. Here we will briefly go over the BLE_write example that can be found in Files > Examples > ESP32 BLE Arduino. Make sure you fill in the networkName and networkPswd variables with the name (or SSID) and password of your WiFi network! Once you've done that and uploaded the code, open your serial monitor.īoth the board manager install and the ESP32 arduino core install come with Bluetooth examples that range from acting as a simple BLE device to functioning as either a Bluetooth server or client. String line = client.readStringUntil('\r') Read all the lines of the reply from server and print them to Serial This will send the request to the serverĬlient.print((String)"GET / HTTP/1.1\r\n" ![]() Use WiFiClient class to create TCP connections Serial.println("Connecting to domain: " String(host)) Void requestURL(const char * host, uint8_t port) LedState = (ledState 1) % 2 // Flip ledState Serial.println("Connecting to WiFi network: " String(ssid)) Void connectToWiFi(const char * ssid, const char * pwd) RequestURL(hostDomain, hostPort) // Connect to serverĭigitalWrite(LED_PIN, LOW) // Turn off LED Serial.print("Press button 0 to connect to ") ĭigitalWrite(LED_PIN, HIGH) // Turn on LED Connect to the WiFi network (see function below loop) ![]() language:cĬonst char * networkName = "YOUR_NETWORK_HERE" Ĭonst char * networkPswd = "YOUR_PASSWORD_HERE" Please note: Make sure you are connecting to the 2.4GHz band on your wireless router the ESP32 is not (yet) compatible with 5GHz signals. The graphical datasheet below helps demonstrate where you can find those peripherals (click to embiggen!). There are, however, a few hardware features - namely the ADC and DAC - which are assigned to static pins. Than means you decide which pins are RX, TX, MISO, MOSI, SCLK, SDA, SCL, etc. 2 digital-to-analog converter (DAC) channelsĪnd, thanks to the chip's pin multiplexing feature, those peripherals can be connected to just about any of the broken out I/O pins.2 I 2C (only one is configured by default in the Arduino IDE).3 SPI (only one is configured by default in the Arduino IDE).3 UARTs (only two are configured by default in the Arduino IDE, one UART is used for bootloading/debug).13 analog to digital converter (ADC) channels.The ESP32 Thing Plus features your standard fare of hardware peripherals including: ![]() The ESP32 Thing Plus is designed around the ESP32-WROOM module with everything necessary to run and program the microcontroller, plus a few extra goodies to take advantage of the chip's unique features. Hardware accelerated encryption (AES, SHA2, ECC, RSA-4096). ![]()
0 Comments
Leave a Reply. |