Uduino is now compatible with the esp8266 and esp32 boards. This tutorial will go through the main steps to use Wifi for esp8266 and and esp32 boards.
Please be sure to look at the known compatible boards at the bottom of the page
Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. We have packages available for Windows, Mac OS, and Linux (32 and 64 bit).
http://arduino.esp8266.com/stable/package_esp8266com_index.json
into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.Tools > Board
menu and install esp8266 platform (and don't forget to select your ESP8266 board from Tools > Board
menu after installation).It is a similar procedure for esp32 boards, but with https://dl.espressif.com/dl/package_esp32_index.json
.
File>Examples>Uduino_Wifi>Uduino_Wifi
Uduino Wifi is compatible with your Uduino serial code. Just replace Serial.println
by `uduino.println, without changing anything else: it should work!
Uduino Wifi works the same way Uduino works. You need to adjust a few lines:
#include<Uduino_Wifi.h> // Notice that here we replace uduino by Uduino_WiFi
Uduino_Wifi uduino("uduinoBoard");// Notice that here we replace
void setup()
{
uduino.connectWifi("your-ssid", "your-password"); // Change with your credentials
//... uduino.addCommand ...
}
void loop()
{
uduino.update();
if(uduino.isConnected()) {
uduino.println("Connected!!");
uduino.delay(100);
}
}
To use Uduino Wifi, on the inspector Panel toggle "Wifi" and uncheck "DesktopSerial".
You now have access to additional settings: IP address and port.
The default port is 4222 , the default IP address is 192.168.x.x, replace it with the IP address of your board.
To get the IP address of the board, open the serial port once the sketch is uploaded.
It is possible to run both Uduino Wifi and Uduino Desktop Serial at the same time! For that, keep the two checkboxes checked .
It is possible to run both Uduino Wifi and Uduino Desktop Serial at the same time! For that, keep the two checkboxes checked .
Uduino Wifi is working with multiple wifi boards. Connect as many boards as you want, and add their IP addresses in Unity.
It is mandatory to have different ports. For that, change the port with the function uduino.setPort()
#include<Uduino_Wifi.h> // Notice that here we replace uduino by Uduino_WiFi
Uduino_Wifi uduino("uduinoBoard");// Notice that here we replace
void setup()
{
uduino.setPort(4233); // Replace the port
uduino.connectWifi("your-ssid", "your-password"); // Change with your credentials
}
void loop()
{
uduino.update();
if(uduino.isConnected()) {
uduino.println("Connected!!");
uduino.delay(100);
}
}
When I open the Serial port I only see "..........."
Verify the ssid and the password of your WiFi credentials.
So far, we didn't test most of the esp8266 boards. Theoretically, any board supported by the ESP8266 Arduino core and ESP32 should work.
Here is the list of the known compatible boards: