Unable to connect to webrepl

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
rasterman101
Posts: 6
Joined: Thu Oct 12, 2017 2:38 am

Unable to connect to webrepl

Post by rasterman101 » Sun Dec 17, 2017 2:32 am

I am using esp8266 huzzah feather and I am having no success connecting to the Webrepl.
Using putty, I type in the following commands and no connection results; Windows or webrepl.
I have also follow Tony D!'s tutorials and no results. Any suggesting will be appreciated.

import webrepl_setup
# Would you like to (E)nable or (D)isable it running on boot?
# (Empty line to quit)
# > E
# To enable WebREPL, you must set password for it
# New password: password
# Confirm password: password
# Changes will be activated after reboot
# Would you like to reboot now? (y/n) y

import network
ap = network.WLAN(network.AP_IF)
print(ap.config('essid'))
# Micropython-3b0fd7

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Unable to connect to webrepl

Post by Roberthh » Sun Dec 17, 2017 8:00 am

Can you verify, whether the boot.py on you device contains the lines:

Code: Select all

import webrepl
webrepl.start()
These should have been enabled by webrepl_setup. The, of course, you make the WiFi-connection between the device and your PC, either directly or though you router, and in your Browser you have to use the webrepl script (https://github.com/micropython/webrepl or http://micropython.org/webrepl)

rasterman101
Posts: 6
Joined: Thu Oct 12, 2017 2:38 am

Re: Unable to connect to webrepl

Post by rasterman101 » Sun Dec 17, 2017 3:07 pm

Thank you for your reply. Below is the information.
Roberthh wrote:
Sun Dec 17, 2017 8:00 am
Can you verify, whether the boot.py on you device contains the lines:

Code: Select all

import webrepl
webrepl.start()
These should have been enabled by webrepl_setup. The, of course, you make the WiFi-connection between the device and your PC, either directly or though you router, and in your Browser you have to use the webrepl script (https://github.com/micropython/webrepl or http://micropython.org/webrepl)

Code: Select all

## Responses here OK ###
import webrepl_setup
import network
ap = network.WLAN(network.AP_IF)
print(ap.config('essid'))

############
import webrepl
webrepl.start()
#WebREPL daemon started on ws://192.168.4.1:8266
#Started webrepl in normal mode

os.listdir()
['boot.py', 'data', 'webrepl_cfg.py']
f = open('boot.py', 'r')
x.read()
'# This file is executed on every boot (including wake-boot from deepsleep)\n#import esp\n#esp.osdebug(None)\nimport gc\nimport webrepl\nwebrepl.start()\ngc.collect()\n'
[code\]

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Unable to connect to webrepl

Post by Roberthh » Sun Dec 17, 2017 4:33 pm

The looks ok. Do you connect your PC's WiFi to the AP created by the device?

rasterman101
Posts: 6
Joined: Thu Oct 12, 2017 2:38 am

Re: Unable to connect to webrepl

Post by rasterman101 » Sun Dec 17, 2017 8:07 pm

Thanks for the support. Did not expect quick reply's.
Yes, I may have tried them both. Below is the procedure I used.
Using putty:
First Attempt.

Code: Select all

import network
ap_if = network.WLAN(network.AP_IF)
ap_if.active()
	# True
ap_if.ifconfig()
	#('192.168.4.1', '255.255.255.0', '192.168.4.1', '208.67.222.222')

import webrepl
webrepl.start()
Then I open webrepl on the local drive and receive a disconnect when pressing the connect button.
Second Attempt.

Code: Select all

import network
sta_if = network.WLAN(network.STA_IF)
ap_if.active(False)
sta_if.active(True)
	#5 ets_task(4020ed88, 28, 3fff8d90, 10)
sta_if.connect('MyRouter', 'abc12345')
sta_if.isconnected()
	#True
import webrepl
webrepl.start()
	#WebREPL daemon started on ws://192.168.1.81:8266
	#Started webrepl in normal mode
And no connection on Win7 and webrepl,; local or web.

rasterman101
Posts: 6
Joined: Thu Oct 12, 2017 2:38 am

Re: Unable to connect to webrepl

Post by rasterman101 » Sun Dec 17, 2017 9:50 pm

Got it. Not sure what happen but I flashed the esp8266 and I am now able to connect.

Roberthh, thanks for the support.

Post Reply