Page 1 of 1

garbage value apon pressing reset switch on esp8266

Posted: Tue Feb 18, 2020 4:32 pm
by jay2026
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

Re: garbage value apon pressing reset switch on esp8266

Posted: Wed Feb 19, 2020 12:51 am
by jimmo
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.

Re: garbage value apon pressing reset switch on esp8266

Posted: Wed Feb 19, 2020 5:05 am
by jay2026
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

Re: garbage value apon pressing reset switch on esp8266

Posted: Wed Feb 19, 2020 5:11 am
by jimmo
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).

Re: garbage value apon pressing reset switch on esp8266

Posted: Wed Feb 19, 2020 8:58 am
by wr300000
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?

Re: garbage value apon pressing reset switch on esp8266

Posted: Wed Feb 19, 2020 9:06 am
by Roberthh
Is there a reason why you cannot change boot.py or re-flash the device?

Re: garbage value apon pressing reset switch on esp8266

Posted: Wed Feb 19, 2020 9:28 am
by wr300000
@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..

Re: garbage value apon pressing reset switch on esp8266

Posted: Wed Feb 19, 2020 10:12 am
by Roberthh
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.

Re: garbage value apon pressing reset switch on esp8266

Posted: Wed Feb 19, 2020 1:39 pm
by wr300000
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...