Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. MySensors.h erreur de compilation

MySensors.h erreur de compilation

Scheduled Pinned Locked Moved Troubleshooting
7 Posts 2 Posters 1.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Nicolas PhilippartN Offline
    Nicolas PhilippartN Offline
    Nicolas Philippart
    wrote on last edited by Nicolas Philippart
    #1

    Hello,

    I am trying to make a mysensor gateway with a NodeMcu esp8266 ch340g v3.
    But when I compile the code:

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h
    #define MY_BAUD_RATE 115200 // 9600
    
    // Enables and select radio type (if attached)
    //#define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    //#define MY_RADIO_RFM95
    
    #define MY_GATEWAY_ESP8266
    
    #define MY_WIFI_SSID monreseau
    #define MY_WIFI_PASSWORD 12345678
    
    // Enable UDP communication
    //#define MY_USE_UDP  // If using UDP you need to set MY_CONTROLLER_IP_ADDRESS below
    
    // Set the hostname for the WiFi Client. This is the hostname
    // it will pass to the DHCP server if not static.
    //#define MY_HOSTNAME "sensor-gateway"
    
    // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
    //#define MY_IP_ADDRESS 192,168,178,87
    
    // If using static ip you can define Gateway and Subnet address as well
    //#define MY_IP_GATEWAY_ADDRESS 192,168,178,1
    //#define MY_IP_SUBNET_ADDRESS 255,255,255,0
    
    // The port to keep open on node server mode
    #define MY_PORT 5003
    
    // How many clients should be able to connect to this gateway (default 1)
    #define MY_GATEWAY_MAX_CLIENTS 2
    
    // Controller ip address. Enables client mode (default is "server" mode).
    // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
    //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 68
    
    // Enable inclusion mode
    //#define MY_INCLUSION_MODE_FEATURE
    
    // Enable Inclusion mode button on gateway
    //#define MY_INCLUSION_BUTTON_FEATURE
    // Set inclusion mode duration (in seconds)
    //#define MY_INCLUSION_MODE_DURATION 60
    // Digital pin used for inclusion mode button
    //#define MY_INCLUSION_MODE_BUTTON_PIN D1
    
    // Set blinking period
    //#define MY_DEFAULT_LED_BLINK_PERIOD 300
    
    // Flash leds on rx/tx/err
    // Led pins used if blinking feature is enabled above
    //#define MY_DEFAULT_ERR_LED_PIN 16  // Error led pin
    //#define MY_DEFAULT_RX_LED_PIN  16  // Receive led pin
    //#define MY_DEFAULT_TX_LED_PIN  16  // the PCB, on board LED
    
    #if defined(MY_USE_UDP)
    #include <WiFiUdp.h>
    #endif
    
    #include <ESP8266WiFi.h>
    #include <MySensors.h>
    
    void setup()
    {
    	// Setup locally attached sensors
    }
    
    void presentation()
    {
    	// Present locally attached sensors here
    }
    
    void loop()
    {
    	// Send locally attached sensors data here
    }
    
    [/code]
    

    Here is the error I have when I compile:

    Arduino : 1.8.5 (Windows 10), Carte : "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
    
    GatewayESP8266:67: error: 'monreseau' was not declared in this scope
    
     #define MY_WIFI_SSID monreseau
    
                          ^
    
    C:\Users\Nico_raptor\Documents\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp:163:19: note: in expansion of macro 'MY_WIFI_SSID'
    
      (void)WiFi.begin(MY_WIFI_SSID, MY_WIFI_PASSWORD, 0, MY_WIFI_BSSID);
    
    In file included from C:\Users\Nico_raptor\Documents\Arduino\libraries\MySensors/MySensors.h:420:0,
    
                     from C:\Users\Nico_raptor\Documents\Arduino\GatewayESP8266\GatewayESP8266.ino:118:
    
    C:\Users\Nico_raptor\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp: At global scope:
    
    C:\Users\Nico_raptor\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp:57:53: error: declaration of C function 'void ets_update_cpu_frequency(int)' conflicts with
    
     extern "C" void ets_update_cpu_frequency(int freqmhz);
    
                                                         ^
    
    In file included from C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\cores\esp8266/pgmspace.h:10:0,
    
                     from C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\cores\esp8266/Arduino.h:256,
    
                     from C:\Users\NICO_R~1\AppData\Local\Temp\arduino_build_50513\sketch\GatewayESP8266.ino.cpp:1:
    
    C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2/tools/sdk/include/ets_sys.h:218:6: error: previous declaration 'void ets_update_cpu_frequency(uint32_t)' here
    
     void ets_update_cpu_frequency(uint32_t ticks_per_us);
    
          ^
    
    Utilisation de la bibliothèque ESP8266WiFi version 1.0 dans le dossier: C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\libraries\ESP8266WiFi 
    Utilisation de la bibliothèque MySensors version 2.3.0 dans le dossier: C:\Users\Nico_raptor\Documents\Arduino\libraries\MySensors 
    Utilisation de la bibliothèque EEPROM version 1.0 dans le dossier: C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\libraries\EEPROM 
    exit status 1
    'monreseau' was not declared in this scope
    

    And when I do not include the Mysensor library

    #if defined(MY_USE_UDP)
    #include <WiFiUdp.h>
    #endif
    
    #include <ESP8266WiFi.h>
    //#include <MySensors.h>
    
    

    Successful compilition

    Ps: I tried this code:
    http://henrysbench.capnfatz.com/henrys-bench/arduino-projects-tips-and-more/arduino-esp8266-lolin-nodemcu-getting-started/
    and it works very well

    Would there be a problem with the MySensors.h library ???

    PS: I am new in andruino

    mfalkviddM 1 Reply Last reply
    0
    • Nicolas PhilippartN Nicolas Philippart

      Hello,

      I am trying to make a mysensor gateway with a NodeMcu esp8266 ch340g v3.
      But when I compile the code:

      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      // Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h
      #define MY_BAUD_RATE 115200 // 9600
      
      // Enables and select radio type (if attached)
      //#define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      //#define MY_RADIO_RFM95
      
      #define MY_GATEWAY_ESP8266
      
      #define MY_WIFI_SSID monreseau
      #define MY_WIFI_PASSWORD 12345678
      
      // Enable UDP communication
      //#define MY_USE_UDP  // If using UDP you need to set MY_CONTROLLER_IP_ADDRESS below
      
      // Set the hostname for the WiFi Client. This is the hostname
      // it will pass to the DHCP server if not static.
      //#define MY_HOSTNAME "sensor-gateway"
      
      // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
      //#define MY_IP_ADDRESS 192,168,178,87
      
      // If using static ip you can define Gateway and Subnet address as well
      //#define MY_IP_GATEWAY_ADDRESS 192,168,178,1
      //#define MY_IP_SUBNET_ADDRESS 255,255,255,0
      
      // The port to keep open on node server mode
      #define MY_PORT 5003
      
      // How many clients should be able to connect to this gateway (default 1)
      #define MY_GATEWAY_MAX_CLIENTS 2
      
      // Controller ip address. Enables client mode (default is "server" mode).
      // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
      //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 68
      
      // Enable inclusion mode
      //#define MY_INCLUSION_MODE_FEATURE
      
      // Enable Inclusion mode button on gateway
      //#define MY_INCLUSION_BUTTON_FEATURE
      // Set inclusion mode duration (in seconds)
      //#define MY_INCLUSION_MODE_DURATION 60
      // Digital pin used for inclusion mode button
      //#define MY_INCLUSION_MODE_BUTTON_PIN D1
      
      // Set blinking period
      //#define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Flash leds on rx/tx/err
      // Led pins used if blinking feature is enabled above
      //#define MY_DEFAULT_ERR_LED_PIN 16  // Error led pin
      //#define MY_DEFAULT_RX_LED_PIN  16  // Receive led pin
      //#define MY_DEFAULT_TX_LED_PIN  16  // the PCB, on board LED
      
      #if defined(MY_USE_UDP)
      #include <WiFiUdp.h>
      #endif
      
      #include <ESP8266WiFi.h>
      #include <MySensors.h>
      
      void setup()
      {
      	// Setup locally attached sensors
      }
      
      void presentation()
      {
      	// Present locally attached sensors here
      }
      
      void loop()
      {
      	// Send locally attached sensors data here
      }
      
      [/code]
      

      Here is the error I have when I compile:

      Arduino : 1.8.5 (Windows 10), Carte : "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
      
      GatewayESP8266:67: error: 'monreseau' was not declared in this scope
      
       #define MY_WIFI_SSID monreseau
      
                            ^
      
      C:\Users\Nico_raptor\Documents\Arduino\libraries\MySensors/core/MyGatewayTransportEthernet.cpp:163:19: note: in expansion of macro 'MY_WIFI_SSID'
      
        (void)WiFi.begin(MY_WIFI_SSID, MY_WIFI_PASSWORD, 0, MY_WIFI_BSSID);
      
      In file included from C:\Users\Nico_raptor\Documents\Arduino\libraries\MySensors/MySensors.h:420:0,
      
                       from C:\Users\Nico_raptor\Documents\Arduino\GatewayESP8266\GatewayESP8266.ino:118:
      
      C:\Users\Nico_raptor\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp: At global scope:
      
      C:\Users\Nico_raptor\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp:57:53: error: declaration of C function 'void ets_update_cpu_frequency(int)' conflicts with
      
       extern "C" void ets_update_cpu_frequency(int freqmhz);
      
                                                           ^
      
      In file included from C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\cores\esp8266/pgmspace.h:10:0,
      
                       from C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\cores\esp8266/Arduino.h:256,
      
                       from C:\Users\NICO_R~1\AppData\Local\Temp\arduino_build_50513\sketch\GatewayESP8266.ino.cpp:1:
      
      C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2/tools/sdk/include/ets_sys.h:218:6: error: previous declaration 'void ets_update_cpu_frequency(uint32_t)' here
      
       void ets_update_cpu_frequency(uint32_t ticks_per_us);
      
            ^
      
      Utilisation de la bibliothèque ESP8266WiFi version 1.0 dans le dossier: C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\libraries\ESP8266WiFi 
      Utilisation de la bibliothèque MySensors version 2.3.0 dans le dossier: C:\Users\Nico_raptor\Documents\Arduino\libraries\MySensors 
      Utilisation de la bibliothèque EEPROM version 1.0 dans le dossier: C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\libraries\EEPROM 
      exit status 1
      'monreseau' was not declared in this scope
      

      And when I do not include the Mysensor library

      #if defined(MY_USE_UDP)
      #include <WiFiUdp.h>
      #endif
      
      #include <ESP8266WiFi.h>
      //#include <MySensors.h>
      
      

      Successful compilition

      Ps: I tried this code:
      http://henrysbench.capnfatz.com/henrys-bench/arduino-projects-tips-and-more/arduino-esp8266-lolin-nodemcu-getting-started/
      and it works very well

      Would there be a problem with the MySensors.h library ???

      PS: I am new in andruino

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      Hi @nicolas-philippart, welcome to the MySensors forum!

      Please post questions in English. You are welcome to use google translate if you like, things don't need to be perfect :)

      To fix the error, change

      #define MY_WIFI_SSID monreseau
      

      To

      #define MY_WIFI_SSID "monreseau"
      
      1 Reply Last reply
      0
      • Nicolas PhilippartN Offline
        Nicolas PhilippartN Offline
        Nicolas Philippart
        wrote on last edited by Nicolas Philippart
        #3

        Sorry, auto translator.

        with this code:

        #define MY_GATEWAY_ESP8266
        
        #define MY_WIFI_SSID "reseau_raptor_2"
        #define MY_WIFI_PASSWORD "12345678"
        
        #define MY_GATEWAY_ESP8266
        
        

        ** I have a compilation error: **

        In file included from C:\Users\Nico_raptor\Documents\Arduino\libraries\MySensors/MySensors.h:420:0,
        
                         from C:\Users\Nico_raptor\Documents\Arduino\GatewayESP8266\GatewayESP8266.ino:118:
        
        C:\Users\Nico_raptor\Documents\Arduino\libraries\MySensors/hal/architecture/ESP8266/MyMainESP8266.cpp:57:53: error: declaration of C function 'void ets_update_cpu_frequency(int)' conflicts with
        
         extern "C" void ets_update_cpu_frequency(int freqmhz);
        
                                                             ^
        
        In file included from C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\cores\esp8266/pgmspace.h:10:0,
        
                         from C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\cores\esp8266/Arduino.h:256,
        
                         from C:\Users\NICO_R~1\AppData\Local\Temp\arduino_build_50513\sketch\GatewayESP8266.ino.cpp:1:
        
        C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2/tools/sdk/include/ets_sys.h:218:6: error: previous declaration 'void ets_update_cpu_frequency(uint32_t)' here
        
         void ets_update_cpu_frequency(uint32_t ticks_per_us);
        
              ^
        
        Utilisation de la bibliothèque ESP8266WiFi version 1.0 dans le dossier: C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\libraries\ESP8266WiFi 
        Utilisation de la bibliothèque MySensors version 2.3.0 dans le dossier: C:\Users\Nico_raptor\Documents\Arduino\libraries\MySensors 
        Utilisation de la bibliothèque EEPROM version 1.0 dans le dossier: C:\Users\Nico_raptor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.2\libraries\EEPROM 
        exit status 1
        Erreur de compilation pour la carte NodeMCU 1.0 (ESP-12E Module)
        
        1 Reply Last reply
        0
        • Nicolas PhilippartN Offline
          Nicolas PhilippartN Offline
          Nicolas Philippart
          wrote on last edited by Nicolas Philippart
          #4

          ps: I noticed that the line of code

          #include <ESP8266WiFi.h> // dans cette ligne esp8266wifi est en rouge
          #include <MySensors.h> // dans cette ligne MySensors apparait en noir
          

          As if he did not find the library

          mfalkviddM 1 Reply Last reply
          0
          • Nicolas PhilippartN Nicolas Philippart

            ps: I noticed that the line of code

            #include <ESP8266WiFi.h> // dans cette ligne esp8266wifi est en rouge
            #include <MySensors.h> // dans cette ligne MySensors apparait en noir
            

            As if he did not find the library

            mfalkviddM Offline
            mfalkviddM Offline
            mfalkvidd
            Mod
            wrote on last edited by
            #5

            @nicolas-philippart see solution in https://forum.mysensors.org/topic/9558/error-compiling-gateway-for-esp8266-node-mcu-1-0-e12

            1 Reply Last reply
            0
            • Nicolas PhilippartN Offline
              Nicolas PhilippartN Offline
              Nicolas Philippart
              wrote on last edited by
              #6

              thank you very much for the information
              I look, I try and I keep you informed

              :-)

              1 Reply Last reply
              1
              • Nicolas PhilippartN Offline
                Nicolas PhilippartN Offline
                Nicolas Philippart
                wrote on last edited by
                #7

                with the successful map version 2.4.1, compilation and upload :-) :-)

                I open the console serie, nothing is displayed. So I check on my router ...
                Nickel connection is established

                I will search the forum to try to have the serial console and to combine the gateway with other sensor, etc.
                And later, try to code ... there is really a way to do a lot of home automation with this little chip

                Thanks again ;-)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                22

                Online

                11.7k

                Users

                11.2k

                Topics

                113.0k

                Posts


                Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • MySensors
                • OpenHardware.io
                • Categories
                • Recent
                • Tags
                • Popular