How to get the automatic AP back on lopy ?
-
Hi, I'm using a Lopy4. I managed to connect with a computer to the automatic AP named "lopy-wlan-xxx". Then I went on ftp://192.168.4.1 and everything worked fine.
I tried to change the AP name with the following command :
network.WLAN(mode=network.WLAN.AP, ssid="lopy_test", auth=(network.WLAN.WPA2,'lopy123456'))
It worked (I could see the new network on the computer) but I couldn't get to ftp://192.168.4.1. I tried to change the mode (AP, STA, STA_AP) but I can't get on the ftp link anymore.
Does anyone know how to get back to the way it was (default configuration with the automatic access point) or get the FTP to work with a custom network ?
Thanks
-
@robert-hh Ok, thanks !
-
@melkoutch If you just have a 1-to-1 connection, then you can do anything. If you have several devices already in a network with a router, then it may be more convenient to have the Lopy4 also connected to the router.
And not, it is not faster.
-
@robert-hh Yes I saw that but when you say "more convenient" what do you mean ? Is it like faster ? I really just need one computer to get access to the ftp server so is it worth it to take a router raher than making the board an AP ?
-
@melkoutch You could set up the device to connect to you home router, along the instructions at https://docs.pycom.io/tutorials/all/wlan.html
That is usually much more convenient.
-
@Eric73 I hadn't tried that, and it worked ! Thanks !
-
@melkoutch Have you try to restart ftp server after changing AP name ?
import network server = network.Server() server.deinit() # disable the server # enable the server again with new settings server.init(login=('user', 'password'), timeout=600)
(from pycom documentation)
Warning : if you use telnet to acces to the board you will lose the connexion after server.deinit()
Use serial cable to do this
-
@Eric73 Hi, yes I did try. I did this exact line and then tried to get to ftp://192.168.0.4 (tell me if I'm wrong) but it didn't work.
-
Hi, have you try to set your IP with something like this
network.WLAN.ifconfig(config=('192.168.0.4', '255.255.255.0', '192.168.0.1', '8.8.8.8'))
Documentation found here:
https://docs.pycom.io/firmwareapi/pycom/network/wlan.html#wlanifconfigid0-configdhcp-or-configtuple