GatawayESP8266 - Compile error



  • I installed on Windows 7 64bit: Arduino IDE 1.8.15, MySensors lib 2.3.2 and from "ESP8266 by ESP8266 Community" 3.0.0 board: NodeMCU 1.0 (ESP-12E Module). When trying to compile GatawayESP8266 (I only changed to my MY_WIFI_SSID and MY_WIFI_PASSWORD). I'm getting errors and can't compile it 😞
    [0_1621338567721_compile errors 1.txt](Uploading 100%)
    What am I doing wrong? 😞



  • Here is the beginning of a long list of errors

    Arduino:1.8.15 (Windows 7), Board:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
    
    In file included from c:\users\K\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.0-newlib4.0.0-gnu23-48f7b08\xtensa-lx106-elf\include\assert.h:10,
                     from c:\users\K\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.0-newlib4.0.0-gnu23-48f7b08\xtensa-lx106-elf\include\sys\reent.h:503,
                     from c:\users\K\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.0-newlib4.0.0-gnu23-48f7b08\xtensa-lx106-elf\include\stdlib.h:18,
                     from c:\users\K\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.0-newlib4.0.0-gnu23-48f7b08\xtensa-lx106-elf\include\c++\10.2.0\cstdlib:75,
                     from c:\users\K\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.0-newlib4.0.0-gnu23-48f7b08\xtensa-lx106-elf\include\c++\10.2.0\stdlib.h:36,
                     from C:\Users\K\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266/Arduino.h:27,
                     from sketch\GatewayESP8266.ino.cpp:1:
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyProtocol.cpp: In function 'char* protocolMyMessage2Serial(MyMessage&)':
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyProtocol.cpp:94:28: error: expected ')' before '__INT8'
       94 |                   PSTR("%" PRIu8 ";%" PRIu8 ";%" PRIu8 ";%" PRIu8 ";%" PRIu8 ";%s\n"), message.getSender(),
          |                            ^~~~~
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyProtocol.cpp:94:19: note: to match this '('
       94 |                   PSTR("%" PRIu8 ";%" PRIu8 ";%" PRIu8 ";%" PRIu8 ";%" PRIu8 ";%s\n"), message.getSender(),
          |                   ^~~~
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyProtocol.cpp: In function 'char* protocolMyMessage2MQTT(const char*, MyMessage&)':
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyProtocol.cpp:103:31: error: expected ')' before '__INT8'
      103 |                   PSTR("%s/%" PRIu8 "/%" PRIu8 "/%" PRIu8 "/%" PRIu8 "/%" PRIu8 ""), prefix,
          |                               ^~~~~
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyProtocol.cpp:103:19: note: to match this '('
      103 |                   PSTR("%s/%" PRIu8 "/%" PRIu8 "/%" PRIu8 "/%" PRIu8 "/%" PRIu8 ""), prefix,
          |                   ^~~~
    In file included from C:\Users\K\Documents\Arduino\libraries\MySensors/MySensors.h:43,
                     from C:\Downloads\mysensors\GatewayESP8266\GatewayESP8266.ino:114:
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp: In function 'bool _readFromClient(uint8_t)':
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp:317:38: error: expected ')' before '__INT8'
      317 |     GATEWAY_DEBUG(PSTR("GWT:RFC:C=%" PRIu8 ",MSG=%s\n"), i, inputString[i].string);
          |                                      ^~~~~
    C:\Users\K\Documents\Arduino\libraries\MySensors/MyConfig.h:2139:43: note: in definition of macro 'DEBUG_OUTPUT'
     2139 | #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
          |                                           ^
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp:317:5: note: in expansion of macro 'GATEWAY_DEBUG'
      317 |     GATEWAY_DEBUG(PSTR("GWT:RFC:C=%" PRIu8 ",MSG=%s\n"), i, inputString[i].string);
          |     ^~~~~~~~~~~~~
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp:317:19: note: to match this '('
      317 |     GATEWAY_DEBUG(PSTR("GWT:RFC:C=%" PRIu8 ",MSG=%s\n"), i, inputString[i].string);
          |                   ^~~~
    C:\Users\K\Documents\Arduino\libraries\MySensors/MyConfig.h:2139:43: note: in definition of macro 'DEBUG_OUTPUT'
     2139 | #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
          |                                           ^
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp:317:5: note: in expansion of macro 'GATEWAY_DEBUG'
      317 |     GATEWAY_DEBUG(PSTR("GWT:RFC:C=%" PRIu8 ",MSG=%s\n"), i, inputString[i].string);
          |     ^~~~~~~~~~~~~
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp:328:38: error: expected ')' before '__INT8'
      328 |    GATEWAY_DEBUG(PSTR("!GWT:RFC:C=%" PRIu8 ",MSG TOO LONG\n"), i);
          |                                      ^~~~~
    C:\Users\K\Documents\Arduino\libraries\MySensors/MyConfig.h:2139:43: note: in definition of macro 'DEBUG_OUTPUT'
     2139 | #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
          |                                           ^
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp:328:4: note: in expansion of macro 'GATEWAY_DEBUG'
      328 |    GATEWAY_DEBUG(PSTR("!GWT:RFC:C=%" PRIu8 ",MSG TOO LONG\n"), i);
          |    ^~~~~~~~~~~~~
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp:328:18: note: to match this '('
      328 |    GATEWAY_DEBUG(PSTR("!GWT:RFC:C=%" PRIu8 ",MSG TOO LONG\n"), i);
          |                  ^~~~
    C:\Users\K\Documents\Arduino\libraries\MySensors/MyConfig.h:2139:43: note: in definition of macro 'DEBUG_OUTPUT'
     2139 | #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
          |                                           ^
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp:328:4: note: in expansion of macro 'GATEWAY_DEBUG'
      328 |    GATEWAY_DEBUG(PSTR("!GWT:RFC:C=%" PRIu8 ",MSG TOO LONG\n"), i);
          |    ^~~~~~~~~~~~~
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp: In function 'bool gatewayTransportAvailable()':
    C:\Users\K\Documents\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp:425:38: error: expected ')' before '__INT8'
      425 |     GATEWAY_DEBUG(PSTR("GWT:TSA:C=%" PRIu8 ",DISCONNECTED\n"), i);
          |                                      ^~~~~
    
    

    and so on



  • @skom Welcome! You're doing nothing wrong.

    It looks like some changes in the 3.0.0 release of the ESP6266 core that came out a few days ago is breaking most if not all MySensors example sketches for boards included in that package.

    I don't know what is causing this. It seems to be related to the PSTR macro - maybe someone with better understanding of this should have a look at it.

    As a workaround, you can downgrad the ESP8266 core from 3.0.0 to 2.7.4 in the Arduino boards manager and it should compile just fine.



  • Thank you :), version 2.7.4 works πŸ™‚



  • @BearWithBeard Hello !

    I'm new to the forum. I just found out about MySensors today actually.

    I tried making my first gateway, and had the same exact problem as @skom
    A quick search brought me here.
    Looks like downgrading the ESP Board Library to 2.7.4 works fine indeed.

    Thank you sir.
    I love the Internet, and I love you guys. ❀



  • And even in 2022 people are very happy to find this information! Took me about 2 days to figure out what was going on. I did not get any compilation errors and uploading the sketch to the board went fine. However, even the cleanest MySensors sketch did not work on the Wemos D1 mini version 3.0.0. Other sketches like "blink" without Mysensors.h did work.

    Also for me the downgrading to 2.7.4 works. Maybe an idea to put this info on the Mysensors page?

    Thanks again for posting this solution!



  • @ajongen et. al.

    2024 and alll is not well. The unmodified GatewayESP8266 does not compile now
    MySensors 2.3.2
    ESP8266 by ESP8266 (community) 2.7.4

    In file included from c:\Users\gferry\Documents\Arduino\libraries\MySensors/MySensors.h:441:0,
                     from C:\Users\gferry\AppData\Local\Temp\.arduinoIDE-unsaved202412-16144-b9g35b.q5il\GatewayESP8266\GatewayESP8266.ino:114:
    c:\Users\gferry\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp: In function 'bool can_yield()':
    c:\Users\gferry\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp:96:26: error: too many arguments to function 'bool can_yield()'
      return can_yield(g_pcont);
                              ^
    c:\Users\gferry\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp:93:17: note: declared here
     extern "C" bool can_yield()
                     ^
    
    exit status 1
    
    Compilation error: exit status 1
    

    ESP8266 by ESP8266 (community) 3.1.2

    In file included from c:\Users\gferry\Documents\Arduino\libraries\MySensors/MySensors.h:441,
                     from C:\Users\gferry\AppData\Local\Temp\.arduinoIDE-unsaved202412-16144-b9g35b.q5il\GatewayESP8266\GatewayESP8266.ino:114:
    c:\Users\gferry\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp: In function 'bool can_yield()':
    c:\Users\gferry\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp:96:26: error: too many arguments to function 'bool can_yield()'
       96 |  return can_yield(g_pcont);
          |                          ^
    c:\Users\gferry\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp:93:17: note: declared here
       93 | extern "C" bool can_yield()
          |                 ^~~~~~~~~
    c:\Users\gferry\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp: In function 'void esp_yield_within_cont()':
    c:\Users\gferry\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp:102:2: error: 'cont_yield' was not declared in this scope; did you mean 'can_yield'?
      102 |  cont_yield(g_pcont);
          |  ^~~~~~~~~~
          |  can_yield
    c:\Users\gferry\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp: In function 'void loop_task(ETSEvent*)':
    c:\Users\gferry\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp:200:26: error: invalid operands of types 'void' and 'int' to binary 'operator!='
      200 |  if (cont_check(g_pcont) != 0) {
          |      ~~~~~~~~~~~~~~~~~~~ ^~ ~
          |                |            |
          |                void         int
    
    exit status 1
    
    Compilation error: exit status 1
    


  • I just tested with board esp8266 library downgraded to 2.7.4 and unmodified GatewayESP8266 from Mysensors 2.3.2 examples and compilation finished OK without errors. Maybe try to remove/install board library.

    29425bad-5a91-495c-b169-a331150cc428-image.png



  • @ferro Thanks for checking for me. I'll do that.

    OSD



  • I removed both the ESP8266 library and the MySensors library, then re-installed the MySensors Library and then the 2.7.4 ESP8266 library. Works!

    I did see that the default number of nodes is 2. I suspect that as a gateway, it can't handle many nodes.

    OSD



  • hey @OldSurferDude as I wrote in https://forum.mysensors.org/topic/12217/gateways/2?_=1707229400694, it is limited to 2 controllers. The esp8266 can handle many nodes. I had one with 9 or 10 IIRC. Now I got a ESP32 handling 39 nodes without any proplems.



  • @eiten That's good to hear! Obvisouly I misunderstood the meaning of

    // How many clients should be able to connect to this gateway (default 1)
    #define MY_GATEWAY_MAX_CLIENTS 2
    

    thinking it meant nodes, but as you say, it means controllers.

    Considering that one can get and ESP12F, a power supply, and an nRF24l01+ radio for it for about US$3 makes the ESP8266 much more desireable than an RPi at US$56.

    There is one thing that is troubling and that is support. Already noted is that the current revision of the ESP8266 board in the Arduino IDE does not support the ESP8266 gateway. It appears that MySensors, too, is losing adherents.

    -OSD



  • @OldSurferDude said in GatawayESP8266 - Compile error:

    It appears that MySensors, too, is losing adherents.

    Sad but true, it seems. I'm fighting myself out of a depression, but when I'm a little better, I'll try to fix the ESP8266 support in MySensors.

    Regards, Edi



  • Hi everyone

    Which MySensors lib did you use? The 2.3.2 or the delevopment version? I tried to fix the errors, but they don't appear in the development branch. Only another error which i fixed.

    Regards, Edi



  • @eiten Ran into the same error but of course the community is always at hand, ready to help! Great! I'm using MySensors 2.3.2 release version. Downgrading the ESP8266 board library to 2.7.4 as suggested by @OldSurferDude did the trick.
    I'm still clinging to MySensors. So simple and inexpensive to use! All sensors and other stuff connects over three MQTT GW in three locations back to my Home Assistant.
    PS: Get well soon!

    Regards, Gunnar


Log in to reply
 

Suggested Topics

  • 4
  • 9
  • 8
  • 17
  • 2
  • 4

16
Online

11.4k
Users

11.1k
Topics

112.7k
Posts