-1

I have Arduino IDE v. 1.8.13. I bought an ESP8266-01 module which I want to use in my Arduino-UNO board to send fingerprint registration confirmation (ID) via HttpClient to a xampp server since I dont want to store the fingerprint image in the database. My ESP connection is as below: ESP8266-01 Wifi Module connection

In the serial monitor, my AT commands work well when I connect the module to my wifi using AT+CWJAP="ssid","password".

When I upload my code, which is supposed to connect to wifi, it says WiFi shield not present. Im new to this, is there anything I am missing? Thanks in advance.

Here is my code:

#include <ArduinoHttpClient.h>
#include <WiFi101.h>
#include "arduino_secrets.h"
char ssid[] = SECRET_SSID;
char pass[] = SECRET_PASS;

char serverAddress[] = "localhost/bel/arduino/scannerstatus/php";  // server address
int port = 80;

WiFiClient wifi;
HttpClient client = HttpClient(wifi, serverAddress, port);
int status = WL_IDLE_STATUS;

void setup() {
  Serial.begin(9600);
  while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to Network named: ");
    Serial.println(ssid);                   // print the network name (SSID);
    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid, pass);
  }

Basically, my uploaded code does not go past the wifi connection stage. Even though the AT commands individually can connect to wifi. I have tried different ESP8266 libraries and HttpClient libraries but they all seem to not connect to wifi. Is there any other way to call a php script from arduino without using wifi?

  • 1
    Why are you using wifi101??? – Majenko Jul 30 at 16:46
  • 1
    WiFi101 library is for Arduino WiFi101 shield. with esp8266 you can use some of the libraries which use a firmware in esp8266 – Juraj Jul 30 at 16:46
  • I have tried WiFi.h, WiFi101 (which seems to have come with my arduino). They all dont work. @majenko – Ngugi Kariuki Jul 30 at 16:49
  • 1
    Those are for specific hardware. You need to match your library to your device. Or in your case just send serial commands. – Majenko Jul 30 at 16:50
  • 1
    try the WiFiEsp library. but before using it, change the AT+UART speed to 9600 – Juraj Jul 31 at 15:31
-2

Can you please include some explanation of how the Arduino Uno and ESP8266-01 are connected. You will need to program for the ESP8266 ESP-01 module like shown below, enter image description here

You will need to write code for the ESP module to connect to the WIFI and listen to its Serial Com Port. The ESP will need to handle the message interpretation & WIFI updating.

The Arduino Uni will not be capable of directly using the ESP-01 module as a WIFI shield. It will need to communicate with the ESP via a serial coms link, you will need to send commands that include instructions & a Message to the ESP from the Arduino.

enter image description here

https://create.arduino.cc/projecthub/jeffpar0721/add-wifi-to-arduino-uno-663b9e - Link to the above image document, this should help explain my concept in more detail

I apologies if my comments above miss the point but with the amount of information provided I don't think I can help further.

| improve this answer | |
  • Thanks Jack for the quick informative reply. Let me edit the info – Ngugi Kariuki Jul 30 at 16:38
  • dd you here about AT firmware or WiFiLink firmware? – Juraj Jul 30 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.