Hello, I just get started with micropython. I am able to get to REPL from UART and from AP, however, I couldn't get it to work through my home wifi. Here is what I did:
1) flash device with latest firmware esp8266-20171101-v1.9.3.bin
>>> import webrepl_setup
...
>>> import network
>>> sta = network.WLAN(network.STA_IF)
>>> sta.isconnected()
False
>>> sta.active(True)
>>> sta.connect('router','password')
>>> sta.isconnected()
True
>>> import webrepl
>>> webrepl.start()
WebREPL daemon started on ws://192.168.4.1:8266
WebREPL daemon started on ws://192.168.1.101:8266
Started webrepl in normal mode
If I connected to MicroPytho-xxxx wifi, I could get to ws://192.168.4.1:8266. But I couldn't get to ws://192.168.1.101:8266 when connected to my home wifi. Must be something silly on my side, please help.
Webrepl through home wifi no working
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Webrepl through home wifi no working
If you run webrepl_setup and tell it to run webrepl on boot, you should be able to power cycle the ESP8266 and webrepl should start automatically. If it doesn't, try issuing from a PC
This tests basic WiFi connectivity. If it fails I suggest you re-check the station interface address at the REPL as below:
The first element of the tuple should be '192.168.1.101'. The second, the subnet mask, is normally '255.255.255.0' and the third should be the address of your router '192.168.1.1' perhaps? The final one is the DNS server address which shouldn't affect the webrepl.
If this is all OK, I think there is something wrong with your WiFi setup. Ensure that your router is set up to accept 192.168.1.101.
If the ping test passes yet webrepl still fails I'm rather foxed. I suppose the next thing I'd do is check the contents of boot.py to ensure it is configured to start the webrepl.
Code: Select all
ping 192.168.1.101
Code: Select all
import network
sta_if = network.WLAN(network.STA_IF)
sta_if.ifconfig()
If this is all OK, I think there is something wrong with your WiFi setup. Ensure that your router is set up to accept 192.168.1.101.
If the ping test passes yet webrepl still fails I'm rather foxed. I suppose the next thing I'd do is check the contents of boot.py to ensure it is configured to start the webrepl.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Webrepl through home wifi no working
Thanks Peter.
It must be a mistake on my part somewhere. WebREPL is working now.
I did the same process many times before and it doesn't work. I tested today (hopefully exactly the same) and it's working. The only different is I use the different board as I broke the other one on the weekend.
It must be a mistake on my part somewhere. WebREPL is working now.
I did the same process many times before and it doesn't work. I tested today (hopefully exactly the same) and it's working. The only different is I use the different board as I broke the other one on the weekend.