Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

ESP8266 Enterprise wifi is there are checksum somewhere? Binary patching doesnt work as espected

asr0asr0 Germany

Hi,
I am trying to get enterprise wifi working with the esp8266.
I did the binary patching like explained here: https://github.com/esp8266/Arduino/issues/1032
the new and old libwpa2.a have exactly the same size. So, is there some checksum somewhere or is it because I made a new commit to the docker image?

This is the output:
mos build --local --repo ../mongoose-os --verbose --arch esp8266 --logtostderr --verbose
Using mongoose-os located at "../mongoose-os"
The flag --module is not given for the module "mjs", going to use the repository
Building...
Make arguments: -j -f ../mongoose-os/fw/platforms/esp8266/Makefile MGOS_PATH=../mongoose-os PLATFORM=esp8266 APP_FS_FILES=fs/* mjs/mjs/lib/api_.js ../mongoose-os/fw/mjs_api/api_.js ../mongoose-os/fw/platforms/esp8266/mjs_api/api_.js FW_DIR=build/fw APP=mjs_base MGOS_ENABLE_MQTT=1 MGOS_ENABLE_ONEWIRE=1 GEN_DIR=build/gen BUILD_DIR=build/objs MGOS_ENABLE_AWS_SHADOW=1 FFI_SYMBOLS= SSL=mbedTLS APP_CONF_SCHEMA=src/conf_schema.yaml APP_SOURCES=src/.c src/*.cpp mjs/mjs.c FS_STAGING_DIR=build/fs APP_VERSION=1.0
Using docker.cesanta.com/esp8266-build:2.0.0-1.5.0-r4
/bin/bash: /bin/bash: cannot execute binary file
../mongoose-os/fw/docker_common.mk:95: recipe for target 'all' failed
make: *** [all] Error 126
I0518 02:22:22.725280 25767 main.go:207] Error: exit status 2
exit status 2
/go/src/cesanta.com/mos/build.go:326:
/go/src/cesanta.com/mos/build.go:258:
/go/src/cesanta.com/mos/build.go:64:
/go/src/cesanta.com/mos/main.go:120:
Error: exit status 2

Thanks

Comments

  • SergeySergey Dublin, Ireland

    I assume that an un-patched image works.

    No checksumming is done afaik, so I guess the patch does something that breaks the image.

  • asr0asr0 Germany
    edited May 18

    Okay, I did 3 things: 1.I changed the string to the same string just to see if the tool breaks something bbe -e "s/anonymous@espressif.com/anonymous@espressif.com/" -o libwpa2.a libwpa2.orgiinal It didnt compile. 2. I changed the file back to the original file ( permissions too) -rw-r--r-- 1 user user 362194 May 17 23:29 libwpa2.a It didnt compile. 3.I reverted the docker commit. It compiled! So it means if I commit something to the docker images it breaks. This is what the docker history looked like before reverting:> docker history docker.cesanta.com/esp8266-build:2.0.0-1.5.0-r4

    IMAGE               CREATED              CREATED BY                                      SIZE                COMMENT
    83431bddbd8d        About a minute ago                                                   364 kB              
    e565ec8cd616        4 minutes ago                                                        63.1 MB             
    afc2244adeab        14 hours ago                                                         42 MB               
    682ad2ca5f9b        2 months ago         /bin/sh -c #(nop)  ENV MIOT_SDK_REVISION=2...   0 B                 
    <missing>           2 months ago         /bin/sh -c #(nop)  VOLUME [/cesanta]            0 B                 
    <missing>           2 months ago         /bin/sh -c #(nop) ADD multi:18a62da00bbbc1...   265 kB              
    <missing>           2 months ago         /bin/sh -c git clone https://github.com/ce...   6.98 MB             
    <missing>           2 months ago         /bin/sh -c #(nop)  USER [root]     
    

    What do you recommend doing next? It seems like i cant commit changes to the docker image without breaking the build. I am new to docker, is there a special process? I do:

    docker run -it -u root --entrypoint=/bin/bash docker.cesanta.com/esp8266-build:2.0.0-1.5.0-r4 
    <make changes>
    exit
    docker commit c6f3aff515f9<the name of the container after the @ during the session> docker.cesanta.com/esp8266-build:2.0.0-1.5.0-r4 
    
  • asr0asr0 Germany

    Okay I found the reason for this error. I just did docker run -it without the entrypoint and it worked. Now it crashes when connecting to the wifi and I am trying to figure out how to debug the coredumps.

  • SergeySergey Dublin, Ireland

    If you have saved the logs (together with the coredump) to /tmp/console.log, then set MOS_REPO and

    make -C $MOS_REPO/platforms/esp8266 debug_coredump CONSOLE_LOG=/tmp/console.log ELF_FILE=$(ls $PWD/build/objs/*.elf) BIN_FILE=$(ls $PWD/build/objs/*.bin)
    
  • asr0asr0 Germany
    edited May 22

    Okay, I think I am going to give up. The chip crashes at different random points sometimes even after the connection got established and depending on the wifi I connect to (University, or my test setup). The only information I get from the core dump is that the stack frame is corrupted.

    rBoot v1.2.1 - richardaburton@gmail.com
    Flash Size: 32 Mbit
    Flash Mode: DIO
    Flash Speed: 40 MHz
    rBoot Option: Big flash

    Booting rom 0.
    system param error, use last saved param!
    n r n| l prl r l mode : softAP(5e:cf:7f:f7:a1:d3)
    ad
    esp_mgos_init2 mjs_base 1.0 (20170522-203942/???)
    esp_mgos_init2 Mongoose OS Firmware 2017052220 (20170522-203515/esp8266_eap_wifi@3fb8809c+)
    esp_mgos_init2 SDK 2.0.0(656edbf), RAM: 51808 total, 48916 free
    esp_print_reset_info Reset cause: 6 (sys reset)
    fs_mount Mounting FS: 131072 @ 0xdb000
    mgos_sys_config_init MAC: 5ECF7FF7A1D3
    mgos_sys_config_init WDT: 30 seconds
    bcn 0
    del if1
    usl
    mode : null
    mgos_wifi_set_mode WiFi mode: STA
    mode : sta(5c:cf:7f:f7:a1:d3)
    add if0
    WPA2 ENTERPRISE VERSION: [v2.0] enable
    mgos_wifi_setup_eap WiFi STA: Connecting to eduroam
    mgos_i2c_create I2C GPIO init ok (SDA: 12, SCL: 14)
    mg_bind_opt 0x3ffef87c 80 -,-,-
    mg_lwip_if_listen_tc 0x3ffef87c tcp_bind(0.0.0.0:80) = 0
    mg_add_conn 0x3ffef17c 0x3ffef87c
    mgos_sys_config_init HTTP server started on [80]
    mg_rpc_channel_mqtt 0x3fff050c esp8266_F7A1D3/rpc/#
    mg_rpc_add_channel_i 0x3fff050c '*' MQTT, trusted
    mg_rpc_channel_uart 0x3fff05b4 UART0
    mg_rpc_add_channel_i 0x3fff05b4 '' UART, trusted
    mg_rpc_add_channel_i 0x3fff0624 'RPC.LOCAL' loopback, trusted
    mgos_init Init done, RAM: 45908 free, 43696 min free
    mgos_upd_boot_finish 1 0
    mg_rpc_ev_handler 0x3fff0624 CHAN OPEN (loopback)
    scandone
    state: 0 -> 2 (b0)
    state: 2 -> 3 (0)
    state: 3 -> 5 (10)
    add 0
    aid 1
    cnt
    mongoose_poll New heap free LWM: 27728
    EAP-PEAP: received 69 bytes encrypted data for Phase 2
    EAP-PEAP: received Phase 2: code=1 identifier=129 length=22
    EAP-PEAP: Phase 2 Request: type=1
    EAP-PEAP: received 85 bytes encrypted data for Phase 2
    EAP-PEAP: received Phase 2: code=1 identifier=130 length=33
    EAP-PEAP: Phase 2 Request: type=26
    EAP-PEAP: Selected Phase 2 EAP vendor 0 method 26
    EAP-MSCHAPV2: RX identifier 130 mschapv2_id 130
    EAP-MSCHAPV2: Generate Challenge Response
    EAP-PEAP: received 101 bytes encrypted data for Phase 2
    EAP-PEAP: received Phase 2: code=1 identifier=131 length=56
    EAP-PEAP: Phase 2 Request: type=26
    EAP-MSCHAPV2: RX identifier 131 mschapv2_id 130
    EAP-PEAP: received 117 bytes encrypted data for Phase 2
    EAP-PEAP: received Phase 2: code=1 identifier=132 length=71
    EAP-PEAP: Phase 2 Request: type=33

    abort() @ 0x40281241
    A0: 0x40281241 A1: 0x3ffff9e0 A2: 0x00000023 A3: 0x00000000
    A4: 0x0000004e A5: 0x0000004e A6: 0x4021ae50 A7: 0x00000000
    A8: 0x3ffe8364 A9: 0x00000190 A10: 0x00000000 A11: 0x0000000a
    A12: 0x00000000 A13: 0x0000004e A14: 0x00000000 A15: 0x3ffefe6c

    (exc SP: 0x3ffff9b0)

    --- BEGIN CORE DUMP ---

  • SergeySergey Dublin, Ireland

    Yeah, welcome to the club.

    Wifi stack sources are not available, it is quite hard to do anything meaningful here.

  • asr0asr0 Germany

    Do you know if its any better with the ESP32? I really need to get something done.

  • SergeySergey Dublin, Ireland

    In my opinion, ESP32 software stack is of much better quality.

Sign In or Register to comment.