WEBREPL set password error on new NODEMCU 4MB

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
EasyRider
Posts: 94
Joined: Wed Dec 30, 2015 8:17 am

WEBREPL set password error on new NODEMCU 4MB

Post by EasyRider » Sat Jul 16, 2016 3:28 am

New NodeMcu 4MByte board.
Firmware: - MicroPython v1.8.2-14-g780114e on 2016-07-15; ESP module with ESP8266

Fully erased/formated ALL flash.

Initial Webrepl connection, entered and confirmed new password.

Board did not reset but came up with this error.
Traceback (most recent call last):
File "webrepl_setup.py", line 71, in handle_conn
OSError: [Errno 13] EACCES
Have used previous firmware versions but did not come against this error.

Had a look in webrepl_setup.py, line 71

Code: Select all

with open("port_config.py", "w") as f:
        f.write("WEBREPL_PASS = %r\n" % passwd1.decode("ascii"))
Looks like port_config.py file is not accessible?

Would appreciate advice on possible issues.

Regards
John

EasyRider
Posts: 94
Joined: Wed Dec 30, 2015 8:17 am

Re: WEBREPL set password error on new NODEMCU 4MB

Post by EasyRider » Sat Jul 16, 2016 4:02 am

Firmware is a pre-compiled bin from official Mycropython download website.

warren
Posts: 73
Joined: Tue Jul 12, 2016 5:47 pm

Re: WEBREPL set password error on new NODEMCU 4MB

Post by warren » Tue Jul 19, 2016 4:40 pm

Me too.

Brand new Huzzah ESP12

Erased flash then flashed it with the latest binary ( esp8266-2016-07-19-v1.8.2-19-gc3f519a.bin ) - Result:

Code: Select all

MicroPython v1.8.2-19-gc3f519a on 2016-07-19; ESP module with ESP8266
I can import and start webrepl. I can log in and enter setup mode.

But when I enter the password the second time, I get the following in the console

Code: Select all

Traceback (most recent call last):
  File "webrepl_setup.py", line 71, in handle_conn
OSError: [Errno 13] EACCES
Following up on suggestion above:

"Looks like port_config.py file is not accessible? "

I did this:

>>> import uos
>>> uos.listdir()
[]
>>>

I was playing with another working ESP earlier and I *think* i remember seeing port_config.py in the file system when I used this command - in which case it is indeed missing..

What else is supposed to be here?

Thanks

warren
Posts: 73
Joined: Tue Jul 12, 2016 5:47 pm

Re: WEBREPL set password error on new NODEMCU 4MB

Post by warren » Tue Jul 19, 2016 7:00 pm

I noticed something else:

I am using esptools to flash. I use this command:

Code: Select all

python esptool.py -p /dev/ttyUSB0 --baud 115200  write_flash --flash_size=4m 0 esp8266-2016-07-19-v1.8.2-19-gc3f519a.bin 
When it has finished, I return GPIO0 to 'HIGH' and power reset the board. The following output appears, partially corrupted:

Code: Select all

���Performing initial setup
bcn 0
del if1
usl
add if1
#4 ets_task(4020e374, 29, 3fff7060, 10)
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
Fatal exception�3Fatal exception�0Fatal exception�0Fatal exception�0Fatal exception�0Fatal exception
If at that point I power cycle it again, I get:

Code: Select all

��c쏜�$��$���dsdÃl'�p{l�l��<��{g#���could not open file 'boot.py' for reading
could not open file 'main.py' for reading

#4 ets_task(4010035c, 3, 3fff62f0, 4)
MicroPython v1.8.2-19-gc3f519a on 2016-07-19; ESP module with ESP8266
Type "help()" for more information.
>>> 
But I don't see 'Performing initial setup' again whether I power cycle or just use RESET.

So I assume that after flashing with a new bin, Micropython does a few initial setups on the flash - presumably including adding the port_config.py and others - right?

So I guess that if 'performing initial setup' hits fatal exceptions, the file system is not completed...

Any fixes?

Thanks

EasyRider
Posts: 94
Joined: Wed Dec 30, 2015 8:17 am

Re: WEBREPL set password error on new NODEMCU 4MB

Post by EasyRider » Wed Jul 20, 2016 12:15 am

I was using in WIN 7, "ESP FLASH DOWNLOAD TOOL V2.3" and looks like it was screwing up flash when uploading micropython . I went through flash size settings and start offsets dozens of time and I don't think that settings was an issue. But after uploading micropython, sometimes os.listdir() showed a lot of garbage , suggesting that something was screwed up in flash.

Anyway, went to ESP8266Flasher used as official NodeMcu flash tool and have not had any problems since.

warren
Posts: 73
Joined: Tue Jul 12, 2016 5:47 pm

Re: WEBREPL set password error on new NODEMCU 4MB

Post by warren » Wed Jul 20, 2016 12:20 pm

I did just try flashing micropython using the windows Nodemcu flasher - I get silar results to the first time, but a different OS error:

Code: Select all

Traceback (most recent call last):
  File "webrepl_setup.py", line 71, in handle_conn
OSError: [Errno 19] ENODEV

>>> import uos
>>> uos.listdir()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV
Anyone got a solution for this?

Being able reliably to use Webrepl is pretty basic for development...

EasyRider
Posts: 94
Joined: Wed Dec 30, 2015 8:17 am

Re: WEBREPL set password error on new NODEMCU 4MB

Post by EasyRider » Wed Jul 20, 2016 12:50 pm

Nodemcu firmware programmer under widows 7 has been working ok for me.

Make sure you have these settings correct.

Under "Config" tab , check the correct box on left for the micropython firmware file selected that you want to upload, offset in the right column is set to 0x00000.

Under "Advanced" tab select correct Flash size for your ESP8266, my Nodemcu is 4Mbyte.
I use Baudrate set to 460800, Flash speed 40Mhz, SPI Mode as DIO.

Obviously in "Operation" tab select correct Com port for your PC connection to ESP8266.

warren
Posts: 73
Joined: Tue Jul 12, 2016 5:47 pm

Re: WEBREPL set password error on new NODEMCU 4MB

Post by warren » Wed Jul 20, 2016 5:22 pm

EasyRider wrote:
Nodemcu firmware programmer under widows 7 has been working ok for me.
Make sure you have these settings correct.
Thanks.

I think the basic flashing works fine - I flashed both Micropython and Nodemcu with both esptool and the windows nodemcu tool.

The Nodemcu firmware 'just works'.

The micropython is more unreliable. Even when webrepl could not work because of the initial problem reported earlier, micropython itself was loaded - the interpreter understood commands etc.

Strangely, after flashing nodemcu and then back to micropython, webrepl started to work. I did check the settings several times and every time used esptool to erase the flash before reflashing...

I will continue to do tests to eliminate any other factors to see why initial micropython flashing is so unreliable...

Thanks

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: WEBREPL set password error on new NODEMCU 4MB

Post by pfalcon » Fri Jul 22, 2016 9:54 am

FAQ now contains some information known about FlashROM access failures (search of "power problems"). Not saying that the problem in this particular thread is a power supply problem, just saying that >1 people who had problems with accessing flash reliably traced them to power supply problems.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: WEBREPL set password error on new NODEMCU 4MB

Post by pfalcon » Fri Jul 22, 2016 10:26 am

Code: Select all

python esptool.py -p /dev/ttyUSB0 --baud 115200  write_flash --flash_size=4m 0 esp8266-2016-07-19-v1.8.2-19-gc3f519a.bin
If you're using this command, you're guaranteed to have problems sooner or later. "--flash_size=4m" is in megabits and setting it that low may/will corrupt the firmware which is at/surpassed 512K.

That's why we say to everyone: please follow the official instructions as specified in the README: https://github.com/micropython/micropyt ... er/esp8266 . If it says that flashing should be done with "make deploy", that's how it should be done. Of course, you can do it in any other way, but then you know better what you're doing, and all errors and issues are yours. If you report any issue, please for sure report it against the official procedure, checking and describing each step being made (oftentimes, by just having a second look, one can see where an error/mistake was made).
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

Post Reply