• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

RandomNerd_Access_Point_1.ino, WIFI_AP IP address: 2?????

Q&A Forum › Category: Questions › RandomNerd_Access_Point_1.ino, WIFI_AP IP address: 2?????
0 Vote Up Vote Down
Paul D. Wilkie asked 2 years ago

Working with RNT’s tutorial RandomNerd_Access_Point_1.ino; the following code returned a value of 2???  How do I convert this response of 2 to a standerd notation; ie;  192.168.X.X
Serial.print(“WIFI_AP IP address: “);
Serial.println(WIFI_AP);
WIFI_AP IP address: 2?????

Question Tags: #Arduino, #WIFI_AP, ESP32, ESPAsyncWebServer, wifi
7 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
I’m not sure why you got that value.
Did you select the right baud rate for the serial monitor?
Either way, the access point should be 192.168.4.1
Regards,
Sara
 

0 Vote Up Vote Down
Paul D. Wilkie answered 2 years ago

Thank you for your prompt response, much appreciated.

Yes, baud rate is set to115200.

What is a quick function to send a simple message from my Arduino/sketch/ESP32 module/server/access point  to my iPhone/client/station to verify I do have a valid WiFi connection?

 

void loop ()

int cntr

Similiar as the following from an access point sketch utilizing communication from server to client:

WiFiClient client = server.available(); // listen for incoming clients

exit status 1
‘class AsyncWebServer’ has no member named ‘available’

void loop (){

int cntr;

client.print(cntr):

or

server.print(cntr);

cntr ++;

}

0 Vote Up Vote Down
Paul D. Wilkie answered 2 years ago

/*********
Rui Santos
Complete instructions at https://RandomNerdTutorials.com/build-web-servers-ebook/

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*********/
#include <Arduino.h>
#include <WiFi.h>
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
// Replace with desired access point credentials
const char* ssid = “ESP32-Access-Point”;
const char* password = “123456789”;
int cntr;
// Create AsyncWebServer object on port 80
AsyncWebServer server(80);
const char index_html[] PROGMEM = R”rawliteral(
<!DOCTYPE html>
<html>
<head>
<title>ESP Web Server</title>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<link rel=”icon” href=”data:,”>
<style>
html {
font-family: Arial;
text-align: center;
}
body {
max-width: 400px;
margin:0px auto;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
<p>Congratulations!<br>This is your first Web Server with the ESP.</p>
</body>
</html>
)rawliteral”;
void initAP() {
WiFi.mode(WIFI_AP);
WiFi.softAP(ssid, password);
}
void setup() {
// Serial port for debugging purposes
Serial.begin(115200);
Serial.println(“RandomNerd_Access_Point_1.ino”);
Serial.println(“03/26/2023”);
Serial.print(“ESP32 Module: “);
Serial.println(“TTGO T7 V1.3 Mini32”);

initAP();

Serial.print(“WIFI ssid: “);
Serial.println(ssid);
Serial.print(“WIFI password: “);
Serial.println(password);

Serial.print(“WIFI_AP IP address: “);
Serial.println(WIFI_AP);
server.on(“/”, HTTP_GET, [](AsyncWebServerRequest *request){
request->send(200, “text/html”, index_html);
// client.print(“HTTP/1.1 200 OK”);
});
// Start server
server.begin();
Serial.println(“server.begin();”);
cntr = 0;
}
void loop() {
WiFiClient client = server.available(); // listen for incoming clients
server.print(“HTTP/1.1 200 OK”);
// server.print(“cntr = “);//client.print(cntr);
// server.print(cntr);
cntr ++;
// Serial.println(“Hello World”);
// put your main code here, to run repeatedly:
}

0 Vote Up Vote Down
Paul D. Wilkie answered 2 years ago

Is there a means to attach items to these text boxes, shuch as complete sketches, etc?

0 Vote Up Vote Down
Paul D. Wilkie answered 2 years ago

Found this simple_server.ini on Github, regarding retrieving a Web-site ;
Serial.print(“IP Address #2: “);//added from Github/me-no-dev/ESPAsyncWebServer/simple_server.ino
Serial.println(WiFi.localIP());//added from Github/me-no-dev/ESPAsyncWebServer/simple_server.ino
 
11:33:28.004 -> RandomNerd_Access_Point_1.ino
11:33:28.004 -> 03/28/2023
11:33:28.004 -> ESP32 Module: TTGO T7 V1.3 Mini32
11:33:28.139 -> WIFI ssid: ESP32-Access-Point
11:33:28.139 -> WIFI password: 123456789
11:33:28.139 -> WIFI_AP IP address #1: 2
11:33:28.139 -> IP Address #2: 0.0.0.0
11:33:28.172 -> server.begin();
What do you think, if IP Adress returns 0.0.0.0; does that mean I have not established a Web-page via the ESP32 module?
 

0 Vote Up Vote Down
Paul D. Wilkie answered 2 years ago

How do i utilize the Insert/edit imiage button to insert an imamge in the text box?

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
Have you tried this example: https://randomnerdtutorials.com/esp32-access-point-ap-web-server/??
 
What is exactly the project you’re following?
 
To share a code upload it to github or pastebin and then share a link to the resource.
 
Regards,
Sara
 

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.