The code below is the closest I have gotten to it working. It compiles, but i get "[WiFEsp] >>> TIMEOUT >>"
#include "WiFiEsp.h"
// Emulate Serial1 on pins 6/7 if not present
#ifndef HAVE_HWSERIAL1
#include "SoftwareSerial.h"
SoftwareSerial Serial1(6, 7); // RX, TX
#endif
char ssid[] = "Andreas"; // your network SSID (name)
char pass[] = "12345678"; // your network password
int status = WL_IDLE_STATUS; // the Wifi radio's status
void setup() {
Serial.begin(115200);
Serial1.begin(9600);
WiFi.init(&Serial1);
while (status != WL_CONNECTED) {
Serial.print("Attempting to connect to WPA SSID: ");
Serial.println(ssid);
// Connect to WPA/WPA2 network:
status = WiFi.begin(ssid, pass);
// wait 10 seconds for connection:
delay(5000);
}
IPAddress ip = WiFi.localIP();
Serial.print(ip);
}
void loop() {
// put your main code here, to run repeatedly:
}
Extending the DIP switch mode configuration explained in the product description, I accidentally discover that we can also enable USB communication (for receiving data in Serial Terminal for troubleshooting purpose only, not updating sketch) while having the ATmega connected with ESP as summarized in the following table,
Mode
Switch 1
Switch 2
Switch 3
Switch 4
Switch 5
Switch 6
Switch 7
Switch 8
ATmega <—> ESP and ATmega <—> USB
ON
ON
ON
OFF
OFF
OFF
OFF
OFF
ATmega <—> ESP and ESP <—> USB
ON
ON
OFF
OFF
ON
ON
OFF
OFF
I'm not sure if this is unintentional or a lacking documentation