Parallax-ESP Module Latest Hack

2456

Comments

  • Clock LoopClock Loop Posts: 1,900
    edited 2020-09-06 - 15:57:45
    Lol, It may seem like I know something, but im just a hack.

    @iseries You wanna push the fixes to github?


    And the entire Release folder that contains the files needed to run flash-all.sh (linux) or flash-all.bat (windows)
    http://forums.parallax.com/discussion/comment/1505814/#Comment_1505814
  • Please summarize the changes needed to fix the build problem. I already merged in @iseries pull request. What else is needed?
  • libesphttpd project needs to be updated with the new espmissingincludes.h.

    ESP8266_NONOS_SDK is linked to the wrong version. It should be 9960ef3 and not 3fe474e.

    Mike
  • iseries wrote: »
    libesphttpd project needs to be updated with the new espmissingincludes.h.

    ESP8266_NONOS_SDK is linked to the wrong version. It should be 9960ef3 and not 3fe474e.

    Mike
    Thanks! I've already done those two things although I haven't committed the new espmissingincludes.h file to the libesphttpd repository yet. Maybe I should just switch to Linux to get this problem resolved in the Parallax Github repository and then try to get the build working on my Mac as a separate step.

  • I'm trying to setup eep-open-sdk under Ubuntu and I get this error while trying to run make:
    checking for bash >= 3.1... no
    configure: error: could not find bash >= 3.1
    make[1]: *** [../Makefile:149: _ct-ng] Error 1
    make[1]: Leaving directory '/home/dbetz/esp-open-sdk/crosstool-NG'
    make: *** [Makefile:145: crosstool-NG/ct-ng] Error 2
    
    But I'm running bash version 5.0.17.
    dbetz@dbetz-VirtualBox:~/esp-open-sdk$ bash --version
    GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
    Copyright (C) 2019 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>;
    
    This is free software; you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    
  • Actually, esp-open-sdk hasn't been updated in at least three years. I think it would be better to figure out how to build this with current tools from Espressif.
  • I think even though the project hasn't been update in three years it uses a link to the espressif tools on there site so it should have download the current version. Now how it does that may be an issue.

    Mike
  • iseries wrote: »
    I think even though the project hasn't been update in three years it uses a link to the espressif tools on there site so it should have download the current version. Now how it does that may be an issue.

    Mike
    Also, it failed to build on my system due to an error that seems like a problem in the configure script.

  • David Betz wrote: »
    iseries wrote: »
    I think even though the project hasn't been update in three years it uses a link to the espressif tools on there site so it should have download the current version. Now how it does that may be an issue.

    Mike
    Also, it failed to build on my system due to an error that seems like a problem in the configure script.
    Okay, I got past that problem by editing crosstools-NG/configure.ac to allow bash versions beginning with "5".

  • Clock LoopClock Loop Posts: 1,900
    edited 2020-09-04 - 15:11:03
    David Betz wrote: »
    I'm trying to setup eep-open-sdk under Ubuntu and I get this error while trying to run make:
    checking for bash >= 3.1... no
    configure: error: could not find bash >= 3.1
    make[1]: *** [../Makefile:149: _ct-ng] Error 1
    make[1]: Leaving directory '/home/dbetz/esp-open-sdk/crosstool-NG'
    make: *** [Makefile:145: crosstool-NG/ct-ng] Error 2
    
    But I'm running bash version 5.0.17.
    dbetz@dbetz-VirtualBox:~/esp-open-sdk$ bash --version
    GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
    Copyright (C) 2019 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>;
    
    This is free software; you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    

    I covered that bug in my thread.

    I forgot to mention it, I suppose it should be fixed too!

    The fix: https://github.com/pfalcon/esp-open-sdk/issues/365
    Change line 193 at: esp-open-sdk/crosstool-NG/configure.ac
    like this:
     |$EGREP '^GNU bash, version ([0-9\.]+)')
    then run make again
    
  • Okay, I got everything to build except that I get this warning. Is this to be expected?
    cc -o mkupgimg mkupgimg.c
    mkupgimg.c: In function ‘main’:
    mkupgimg.c:93:19: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
       93 |  printf("Header: %d bytes, user1: %d bytes, user2: %d bytes.\n", sizeof(hdr), (int)l1, (int)l2);
          |                  ~^                                              ~~~~~~~~~~~
          |                   |                                              |
          |                   int                                            long unsigned int
          |                  %ld
    
  • David Betz wrote: »
    Okay, I got everything to build except that I get this warning. Is this to be expected?
    cc -o mkupgimg mkupgimg.c
    mkupgimg.c: In function ‘main’:
    mkupgimg.c:93:19: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
       93 |  printf("Header: %d bytes, user1: %d bytes, user2: %d bytes.\n", sizeof(hdr), (int)l1, (int)l2);
          |                  ~^                                              ~~~~~~~~~~~
          |                   |                                              |
          |                   int                                            long unsigned int
          |                  %ld
    

    I didn't get that error.
  • Clock Loop wrote: »
    David Betz wrote: »
    Okay, I got everything to build except that I get this warning. Is this to be expected?
    cc -o mkupgimg mkupgimg.c
    mkupgimg.c: In function ‘main’:
    mkupgimg.c:93:19: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
       93 |  printf("Header: %d bytes, user1: %d bytes, user2: %d bytes.\n", sizeof(hdr), (int)l1, (int)l2);
          |                  ~^                                              ~~~~~~~~~~~
          |                   |                                              |
          |                   int                                            long unsigned int
          |                  %ld
    

    I didn't get that error.
    Since it's only a warning it only happens the first time you run the makefile when it needs to build mkupgimg. If you do a "make clean" followed by "make" to you get it? Or maybe it has something to do with the version of GCC I'm using being more picky than what you're using.

  • I have run make clean, then make like 10 times, due to my own testing of the new /Parallax-Esp/release/Makefile
    So thats probably not it.

    Heres my gcc version
    gcc version 8.3.0 (Debian 8.3.0-6) 
    
  • Clock Loop wrote: »
    I have run make clean, then make like 10 times, due to my own testing of the new /Parallax-Esp/release/Makefile
    So thats probably not it.

    Heres my gcc version
    gcc version 8.3.0 (Debian 8.3.0-6) 
    
    I have
    gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
    
    I just committed the updated version of espmissingincludes.h to the libesphttpd project and updated the pointer to it in the Parallax-ESP project. I think it should build now.

  • If you have another update I should merge please submit a pull request.
  • I also updated the README.md file with instructions to checkout the correct version of the ESP SDK. It would be nice if that happened automatically but I'm not sure how to do that.
  • David Betz wrote: »
    If you have another update I should merge please submit a pull request.

    LOL, I need to learn how to do that.
    That's if I can find my github login/pass.
  • Or just send me a diff of the file you changed. You can generate that by doing 'git diff'.
  • David Betz wrote: »
    I also updated the README.md file with instructions to checkout the correct version of the ESP SDK. It would be nice if that happened automatically but I'm not sure how to do that.

    Excellent!
  • David Betz wrote: »
    Or just send me a diff of the file you changed. You can generate that by doing 'git diff'.

    Ok, trying it now.
  • Clock LoopClock Loop Posts: 1,900
    edited 2020-09-04 - 16:33:11
    /Parallax-ESP/release$ git diff
    diff --git a/release/Makefile b/release/Makefile
    index a8610fe..df51c13 100644
    --- a/release/Makefile
    +++ b/release/Makefile
    @@ -1,5 +1,8 @@
     #SDK=../../esp_iot_sdk_v1.5.2
    -SDK=../esp_iot_sdk_v2.0.0.p1
    +#SDK=../esp_iot_sdk_v2.0.0.p1
    +SDK=../ESP8266_NONOS_SDK
    +ESPTOOL=../../esptool
    +
     
     ZIP=parallax-esp-$(shell date "+%Y-%m-%d-%H%M").zip
     $(info ZIP $(ZIP))
    @@ -9,10 +12,12 @@ release/httpd.user1.bin \
     release/httpd.user2.bin \
     release/Parallax-ESP.ota \
     release/blank.bin \
    -release/esp_init_data_default.bin
    +release/esp_init_data_default_v08.bin \
    +release/esptool.py
     
     #IMAGES+=release/boot_v1.5.bin
    -IMAGES+=release/boot_v1.6.bin
    +#IMAGES+=release/boot_v1.6.bin
    +IMAGES+=release/boot_v1.7.bin
     
     CP=cp
     
    @@ -46,7 +51,11 @@ release/Parallax-ESP.ota:    ../build/httpd.ota
     release/blank.bin:     $(SDK)/bin/blank.bin
            $(CP) $< $@
     
    -release/esp_init_data_default.bin:     $(SDK)/bin/esp_init_data_default.bin
    +#release/esp_init_data_default.bin:    $(SDK)/bin/esp_init_data_default.bin
    +release/esp_init_data_default_v08.bin: $(SDK)/bin/esp_init_data_default_v08.bin
    +       $(CP) $< $@
    +
    +release/esptool.py:    $(ESPTOOL)/esptool.py
            $(CP) $< $@
     
     release:
    

    The README, needs to tell the user to GIT the esptool in the same directory as the Parallax-Esp folder.
  • David BetzDavid Betz Posts: 14,178
    edited 2020-09-04 - 16:36:39
    The README, needs to tell the user to GIT the esptool in the same directory as Parallax-Esp.
    Parallax used to use a C version of this tool because the Python version had some deficiency that I can't recall. Are you sure the current python tool works correctly for this firmware?

    Also, what does the _v08 version of esp_init_data_default do that the original didn't?
  • Clock LoopClock Loop Posts: 1,900
    edited 2020-09-04 - 16:44:52
    David Betz wrote: »
    Parallax used to use a C version of this tool because the Python version had some deficiency that I can't recall. Are you sure the current python tool works correctly for this firmware?

    I have tested it, it fully flashes the module, and it works properly.
    Heres the test results --> http://forums.parallax.com/discussion/comment/1505464/#Comment_1505464

    I did not know a c version existed..

    I just git this repo.
    git clone --recursive https://github.com/espressif/esptool
    

    Do you know where the c version is located? I can try that also.


    David Betz wrote: »
    Also, what does the _v08 version of esp_init_data_default do that the original didn't?

    I do not know the difference, I just know the original is missing now that we changed to ESP8266_NONOS_SDK
    Because its located here: /Parallax-ESP/ESP8266_NONOS_SDK/bin/esp_init_data_default_v08.bin
    IF you leave it as it was, the Makefile will not work.

  • The Parallax-ESP repository seems to be fixed now such that you should be able to just clone it and build it.
  • I also don't know the differences between

    boot_v1.6.bin
    and
    boot_v1.7.bin

    Esspressif says use the latest version, FROM THEM.

    https://bbs.espressif.com/viewtopic.php?t=4730

    https://github.com/espressif/ESP8266_NONOS_SDK/releases
    You can refer to the release note about the bootloader update.
    https://github.com/espressif/ESP8266_NONOS_SDK/releases
    
    It is always suggested that using the latest SDK with the latest bootloader.
    
    Thanks for your interest in ESP8266!
    
    
  • Clock LoopClock Loop Posts: 1,900
    edited 2020-09-04 - 17:29:00
    David Betz wrote: »
    I also updated the README.md file with instructions to checkout the correct version of the ESP SDK.

    It looks like this is no longer needed, you fixed it in the repo.

    ESP8266_NONOS_SDK @ 9960ef3

    NICE!
  • Clock Loop wrote: »
    David Betz wrote: »
    I also updated the README.md file with instructions to checkout the correct version of the ESP SDK. It would be nice if that happened automatically but I'm not sure how to do that.

    It looks like this is no longer needed, you fixed it in the repo.

    ESP8266_NONOS_SDK @ 9960ef3

    NICE!
    Yes, that does seem to be true. I'll get rid of it in the README.md file next time I push changes.
  • I made the change to use boot_v1.7 and also fixed a problem where the patch utility was patching the wrong boot binary.
Sign In or Register to comment.