how to change default ip address in ap mode?
how to change default ip address in ap mode?
hello everyone I did a search in google to know how to change the default names of the network, ip address and password in ap mode, I only found the name of the network but not the ip and the password, someone knows how to do it? first of all, Thanks.
Re: how to change default ip address in ap mode?
hello again I found the password, I just need to change the ip by default 192.168.4.1, thanks in advance
-
- Posts: 3
- Joined: Sun Apr 12, 2020 8:19 pm
Re: how to change default ip address in ap mode?
hi, i have the same problem how to change the default ip address 192.168.4.1 to another one e.g. 192.168.82.66
-
- Posts: 169
- Joined: Fri Aug 19, 2016 11:55 am
Re: how to change default ip address in ap mode?
I believe this is done using ifconfig().
-
- Posts: 3
- Joined: Sun Apr 12, 2020 8:19 pm
Re: how to change default ip address in ap mode?
on my esp I have this configuration:
# Complete project details at https://RandomNerdTutorials.com
try:
import usocket as socket
except:
import socket
import network
import network
from machine import Pin
import dht
import esp
esp.osdebug(None)
import gc
gc.collect()
ssid = 'AP-esp8266_garaz'
password = '123456789'
ap = network.WLAN(network.AP_IF)
ap.active(True)
ap.config(essid=ssid, password=password)
while ap.active() == False:
pass
print('Connection successful')
print(ap.ifconfig())
sensor = dht.DHT11(Pin(14))
# ESP8266 GPIO 5
relay = Pin(5, Pin.OUT)
# Complete project details at https://RandomNerdTutorials.com
try:
import usocket as socket
except:
import socket
import network
import network
from machine import Pin
import dht
import esp
esp.osdebug(None)
import gc
gc.collect()
ssid = 'AP-esp8266_garaz'
password = '123456789'
ap = network.WLAN(network.AP_IF)
ap.active(True)
ap.config(essid=ssid, password=password)
while ap.active() == False:
pass
print('Connection successful')
print(ap.ifconfig())
sensor = dht.DHT11(Pin(14))
# ESP8266 GPIO 5
relay = Pin(5, Pin.OUT)
Re: how to change default ip address in ap mode?
As Christian said, you need to add a call to ifconfig -- this works in both station and AP mode to set the device IP address.
-
- Posts: 3
- Joined: Sun Apr 12, 2020 8:19 pm
Re: how to change default ip address in ap mode?
thanks guys for the answer but could you make it clearer ... or some example, please
Re: how to change default ip address in ap mode?
The documentation that Christian linked to had an example
http://docs.micropython.org/en/latest/l ... N.ifconfig
Put that before or after the line "ap.config(ssid=...)".
http://docs.micropython.org/en/latest/l ... N.ifconfig
Put that before or after the line "ap.config(ssid=...)".