MySensors.h erreur de compilation



  • 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


  • Mod

    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"
    


  • 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)
    


  • 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


  • Mod



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

    🙂



  • 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 😉


Log in to reply
 

Suggested Topics

  • 3
  • 6
  • 2
  • 6
  • 5

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts