Webrepl through home wifi no working

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
tony_c
Posts: 3
Joined: Sat Nov 18, 2017 3:44 pm

Webrepl through home wifi no working

Post by tony_c » Sat Nov 18, 2017 3:56 pm

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.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Webrepl through home wifi no working

Post by pythoncoder » Mon Nov 20, 2017 9:20 am

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

Code: Select all

ping 192.168.1.101
This tests basic WiFi connectivity. If it fails I suggest you re-check the station interface address at the REPL as below:

Code: Select all

import network
sta_if = network.WLAN(network.STA_IF)
sta_if.ifconfig()
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.
Peter Hinch
Index to my micropython libraries.

tony_c
Posts: 3
Joined: Sat Nov 18, 2017 3:44 pm

Re: Webrepl through home wifi no working

Post by tony_c » Tue Nov 21, 2017 4:51 pm

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. :?

Post Reply