mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #632] using Static IP but with only last octet changed. #529
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#529
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mehulvarsh on GitHub (Jun 26, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/632
Hi Team,
I want to use WiFi Manager with Static IP configuration but only need to change the last octet of local IP. When i am doing it, the modified IP is working only on DHCP networks and not on all networks. the code is as below:
IPAddress _ip2 = WiFi.localIP();
_ip2[3]=240;
IPAddress _gw2 = IPAddress(192, 168, 1, 1);
IPAddress _sn2 = IPAddress(255, 255, 255, 0);
wifiManager.setSTAStaticIPConfig(_ip2, _gw2, _sn2);
Serial.print("local ip2: ");
Serial.println(WiFi.localIP());
Serial.print("modified ip2: ");
Serial.println(_ip2);
I want to change the local ip as the setSTAStaticIPConfig is doing but only changing the last octet. I tried my hands on changing the WifiManager.cpp file but no success. Can you please create a new function which can take "int" as input and can change the last octet of local IP?