How to connect UNO+WiFi R3 ATmega328P + ESP8266 Module 32Mb to WiFi?

How do I connect to the WiFi using this board: UNO R3+WiFi ATmega328P+ESP8266 32Mb Memory USB-TTL CH340G Compatible For Arduino Uno NodeMCU ESP8266 - ArduinoTech. I have tried several different type of code and none of it works.

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:

}

do you have the esp8266 wired to pin 6 and 7 and internal connection to hw Serial turned off?
does the esp8266 have AT firmware?

Do you want that board to be an AP, or a server connected to a router?

Here are all the examples for the 8266, one of those should give you a good start

@sonofcy that examples will not run on an Uno

Oh damn, i didn't see that i got new examples of it. Thanks, I found an example that i can work with because of this!

He doesn't have an UNO, it's one of those hybrid types, half 8266 half UNO.
Here are the DIP SW settings to upload 8266 WiFi sketches

I know. but the sketch in the post is for Uno.

This might be a helpful tutorial from the forum: ATmega328p + ESP8266 WIFI tutorial.

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

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.