garbage value apon pressing reset switch on esp8266

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
jay2026
Posts: 20
Joined: Sat Feb 15, 2020 6:10 pm

garbage value apon pressing reset switch on esp8266

Post by jay2026 » Tue Feb 18, 2020 4:32 pm

Hi, i'm using esp8266 development board to learn micropython and im facing a problem when i press RST on the board the issue is as follow
>> rld����l�|
�$�p�r���{���
#��oo�loN���Bp��$rl{$p�o�

l


cN�|���d�
c��oo�l��l`�2no$`n{�����d p�N�{�����

#n�|$l
�b��Nn�
l`�ol`n{����

�$p�o�

r�ܜ����
"
o�|�


#��oo�

$`�N
l or���o
���lr��o���l��
l��|�����{o"���$�2
c�$
c��������"
�cd $
lܞ���{rNb���d$��
"��
B��ܜ�B��l#l�d�������{o#���
��

c�
c서���

c�$bl���p�N��{��n|�
d$ll ��{�p��$�l`�œn�l�l�

l ��{�p����ll`rl��o����B��b�#"r��r
#��n�Nn�l���l
�$��l$�������sd�n�����c
l$��
#��bb
l
�"rd{lr�o���
��Nܾ"���
������cl�b�#l���$n�p{l�
d��|����s#4 ets_task(40100164, 3, 3fff829c, 4)
main.py: Hello

MicroPython v1.9-8-gfcaadf92 on 2017-05-26; ESP module with ESP8266
I dont know how to solve this issue

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: garbage value apon pressing reset switch on esp8266

Post by jimmo » Wed Feb 19, 2020 12:51 am

Unfortunately this is just how the ESP8266 works.

It has a bootloader which writes a bunch of info out to the serial port, but at a different baud rate (74880, instead of the 115200 that MicroPython uses). Because your serial console is at 115200, the 74880 bits look like garbage.

So if you change your serial console to use 74880 and hit reset, then you'll see the reverse -- the boot messages will appear but then the MicroPython prompt will be garbled.

jay2026
Posts: 20
Joined: Sat Feb 15, 2020 6:10 pm

Re: garbage value apon pressing reset switch on esp8266

Post by jay2026 » Wed Feb 19, 2020 5:05 am

jimmo wrote:
Wed Feb 19, 2020 12:51 am
Unfortunately this is just how the ESP8266 works.

It has a bootloader which writes a bunch of info out to the serial port, but at a different baud rate (74880, instead of the 115200 that MicroPython uses). Because your serial console is at 115200, the 74880 bits look like garbage.

So if you change your serial console to use 74880 and hit reset, then you'll see the reverse -- the boot messages will appear but then the MicroPython prompt will be garbled.
is there no work around for it

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: garbage value apon pressing reset switch on esp8266

Post by jimmo » Wed Feb 19, 2020 5:11 am

jay2026 wrote:
Wed Feb 19, 2020 5:05 am
is there no work around for it
I guess you could change the MicroPython firmware to run the UART at 74880 instead of 115200 -- see ports/esp8266/main.c

Code: Select all

// Activate UART(0) on dupterm slot 1 for the REPL
    {
        mp_obj_t args[2];
        args[0] = MP_OBJ_NEW_SMALL_INT(0);
        args[1] = MP_OBJ_NEW_SMALL_INT(115200);
        args[0] = pyb_uart_type.make_new(&pyb_uart_type, 2, 0, args);
        args[1] = MP_OBJ_NEW_SMALL_INT(1);
        extern mp_obj_t os_dupterm(size_t n_args, const mp_obj_t *args);
        os_dupterm(2, args);
    }
then you could just see everything at 74880.

(I haven't tested that though).

wr300000
Posts: 32
Joined: Sun Jan 14, 2018 3:54 pm

Re: garbage value apon pressing reset switch on esp8266

Post by wr300000 » Wed Feb 19, 2020 8:58 am

Hi Jimmo,
My case is quite different, I built 8266 firmware and ran correctly. Everything is fine until I test some wifi connectivity but I forgot to disable esp O/S debug in boot.py.
>>>import esp
>>>esp.osdebug(None)
This board always reply readable error response message from my incomplete previous code every second. I could not interrupt it neither ctrl-C or ctrl-D and webrepl was not started in boot.py either. Do you have any way to stop it rather than replace flash chip on board?

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

Re: garbage value apon pressing reset switch on esp8266

Post by Roberthh » Wed Feb 19, 2020 9:06 am

Is there a reason why you cannot change boot.py or re-flash the device?

wr300000
Posts: 32
Joined: Sun Jan 14, 2018 3:54 pm

Re: garbage value apon pressing reset switch on esp8266

Post by wr300000 » Wed Feb 19, 2020 9:28 am

@Roberthh
Because of my prior code is not successful and keep looping by sending esp O/S debug message every second to interfere the communication on UART port which making fail to connect to board anymore..

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

Re: garbage value apon pressing reset switch on esp8266

Post by Roberthh » Wed Feb 19, 2020 10:12 am

You should still be able to erase the flash and reload a clean image. In order to erase, use erase_flash instead of write_flash when using esptool.py.

wr300000
Posts: 32
Joined: Sun Jan 14, 2018 3:54 pm

Re: garbage value apon pressing reset switch on esp8266

Post by wr300000 » Wed Feb 19, 2020 1:39 pm

Roberthh, yes you are right. I use bash's alias command as one character represents typing tails for erasing the chip. This time I can interrupt them within an assigned sec period. Thank you again...

Post Reply