• 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

LAN connection withOUT providing Gateway?

Q&A Forum › Category: ESP32 › LAN connection withOUT providing Gateway?
0 Vote Up Vote Down
Barry asked 3 years ago
Question Tags: ESP32 LAN WiFI
2 Answers
0 Vote Up Vote Down
Barry answered 3 years ago

Regarding ESP32 web server.
I’m using the scheme from the WiFi Manager section of the book. Is there a way to omit the Gateway and Subnet Mask?
I use the 192.168.1.x at home, but a friend uses 10.10.10.x
This requires me to make a separate build for him. I’d like to just omit the Gateway and Mask, assuming the router already has that info.
Code Snippet
if (!WiFi.config(localIP, gateway, subnet)){
Serial.println(“STA Failed to configure”);
return false;
}
I think this is really checking to see if the ESP32 received a Gateway from the router, rather than setting the parameters. Is this the case?

I could make another field for wifi config and have the user enter the Gateway, but I’d rather not. Also could look at the users IP address and make the Gateway x.x.x.1   <– type conversion problem as Gateway is of type  IPaddress .
Not sure if that will always work though.

Thanks
Barry

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

Hi Barry.
I need to update the code to fix that issue. But, I still  don’t know when I’ll have the time to do that.
One of our readers solved that issue and published his project. Read the comments section of this post: https://randomnerdtutorials.com/esp32-wi-fi-manager-asyncwebserver/
https://github.com/ldijkman/randomnerd_esp32_wifi_manager
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

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition 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.