vpcola / ESP32SingleChannelGateway

A Fork of the popular ESP8266 single channel gateway adapted to ESP32 on the 915Mhz band.
74 stars 46 forks source link

Compiling error, weekday is not recognized #12

Open prince2k22 opened 1 year ago

prince2k22 commented 1 year ago

Dear sir, I am new in this environment. seeing various videos and looking into a number of similar sketches, This one looks promising. However I am not capable of compiling the project in Arduino 2.3 environment. I have also tried the earlier ver. without success. Compiler provides bellow error, which mainly caused by Time.h library I have also tried out with TimeLib.h with the same result. I will appreciate any feedback to get me on going with this.

C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino: In function 'void printTime()': C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:281:10: error: 'weekday' was not declared in this scope switch (weekday()) ^~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:293:14: error: 'hour' was not declared in this scope printDigits(hour()); ^~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:295:14: error: 'minute' was not declared in this scope printDigits(minute()); ^~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:295:14: note: suggested alternative: 'finite' printDigits(minute()); ^~ finite C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:297:14: error: 'second' was not declared in this scope printDigits(second()); ^~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:297:14: note: suggested alternative: 'sysconf' printDigits(second()); ^~ sysconf C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino: In function 'int WlanReadWpa()': C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:443:2: error: 'readConfig' was not declared in this scope readConfig( CONFIGFILE, &gwayConfig); ^~~~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:443:2: note: suggested alternative: 'gwayConfig' readConfig( CONFIGFILE, &gwayConfig); ^~~~~~ gwayConfig C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino: In function 'int WlanConnect(int)': C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:556:3: error: 'writeGwayCfg' was not declared in this scope writeGwayCfg(CONFIGFILE); ^~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino: In function 'int readUdp(int)': C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:752:8: error: 'sendPacket' was not declared in this scope if (sendPacket(data, packetSize-4) < 0) { ^~~~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:752:8: note: suggested alternative: 'sendstat' if (sendPacket(data, packetSize-4) < 0) { ^~~~~~ sendstat C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino: In function 'void sendstat()': C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1071:9: error: 'now' was not declared in this scope t = now(); // get timestamp for statistics ^~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1071:9: note: suggested alternative: 'pow' t = now(); // get timestamp for statistics ^~~ pow C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1074:63: error: 'year' was not declared in this scope sprintf(stat_timestamp, "%04d-%02d-%02d %02d:%02d:%02d CET", year(),month(),day(),hour(),minute(),second()); ^~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1074:63: note: suggested alternative: 'read' sprintf(stat_timestamp, "%04d-%02d-%02d %02d:%02d:%02d CET", year(),month(),day(),hour(),minute(),second()); ^~~~ read C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1074:70: error: 'month' was not declared in this scope sprintf(stat_timestamp, "%04d-%02d-%02d %02d:%02d:%02d CET", year(),month(),day(),hour(),minute(),second()); ^~~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1074:78: error: 'day' was not declared in this scope sprintf(stat_timestamp, "%04d-%02d-%02d %02d:%02d:%02d CET", year(),month(),day(),hour(),minute(),second()); ^~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1074:84: error: 'hour' was not declared in this scope sprintf(stat_timestamp, "%04d-%02d-%02d %02d:%02d:%02d CET", year(),month(),day(),hour(),minute(),second()); ^~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1074:91: error: 'minute' was not declared in this scope sprintf(stat_timestamp, "%04d-%02d-%02d %02d:%02d:%02d CET", year(),month(),day(),hour(),minute(),second()); ^~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1074:91: note: suggested alternative: 'finite' sprintf(stat_timestamp, "%04d-%02d-%02d %02d:%02d:%02d CET", year(),month(),day(),hour(),minute(),second()); ^~ finite C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1074:100: error: 'second' was not declared in this scope sprintf(stat_timestamp, "%04d-%02d-%02d %02d:%02d:%02d CET", year(),month(),day(),hour(),minute(),second()); ^~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1074:100: note: suggested alternative: 'sysconf' sprintf(stat_timestamp, "%04d-%02d-%02d %02d:%02d:%02d CET", year(),month(),day(),hour(),minute(),second()); ^~ sysconf C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino: In function 'void setup()': C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1298:9: error: 'timeStatus' was not declared in this scope while (timeStatus() == timeNotSet) { ^~~~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1298:9: note: suggested alternative: 'timerStarted' while (timeStatus() == timeNotSet) { ^~~~~~ timerStarted C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1298:25: error: 'timeNotSet' was not declared in this scope while (timeStatus() == timeNotSet) { ^~~~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1298:25: note: suggested alternative: 'timerStart' while (timeStatus() == timeNotSet) { ^~~~~~ timerStart C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1303:21: error: 'setTime' was not declared in this scope if (newTime != 0) setTime(newTime); ^~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1303:21: note: suggested alternative: 'newTime' if (newTime != 0) setTime(newTime); ^~~ newTime C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1308:2: error: 'writeGwayCfg' was not declared in this scope writeGwayCfg(CONFIGFILE ); ^~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1314:2: error: 'setupWWW' was not declared in this scope setupWWW(); ^~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1314:2: note: suggested alternative: 'setup' setupWWW(); ^~~~ setup C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1321:2: error: 'initLoraModem' was not declared in this scope initLoraModem(); ^~~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1325:3: error: 'cadScanner' was not declared in this scope cadScanner(); // Always start at SF7 ^~~~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1329:3: error: 'rxLoraModem' was not declared in this scope rxLoraModem(); ^~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1347:2: error: 'writeConfig' was not declared in this scope writeConfig( CONFIGFILE, &gwayConfig); // Write config ^~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1347:2: note: suggested alternative: 'gwayConfig' writeConfig( CONFIGFILE, &gwayConfig); // Write config ^~~ gwayConfig C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino: In function 'void loop()': C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1394:3: error: 'stateMachine' was not declared in this scope stateMachine(); // start the state machine ^~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1394:3: note: suggested alternative: 'stattime' stateMachine(); // start the state machine ^~~~ stattime C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1407:3: error: 'initLoraModem' was not declared in this scope initLoraModem(); ^~~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1410:4: error: 'cadScanner' was not declared in this scope cadScanner(); ^~~~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1414:4: error: 'rxLoraModem' was not declared in this scope rxLoraModem(); ^~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1416:3: error: 'writeRegister' was not declared in this scope writeRegister(REG_IRQ_FLAGS_MASK, (uint8_t) 0x00); ^~~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1416:3: note: suggested alternative: 'register' writeRegister(REG_IRQ_FLAGS_MASK, (uint8_t) 0x00); ^~~~~ register C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1490:4: error: 'hop' was not declared in this scope hop(); ^~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1490:4: note: suggested alternative: '_hop' hop(); ^~~ _hop C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1499:4: error: 'rxLoraModem' was not declared in this scope rxLoraModem(); ^~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1501:4: error: 'hop' was not declared in this scope hop(); ^~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1501:4: note: suggested alternative: '_hop' hop(); ^~~ _hop C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1505:5: error: 'cadScanner' was not declared in this scope cadScanner(); ^~~~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1568:3: error: 'initLoraModem' was not declared in this scope initLoraModem(); ^~~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1571:4: error: 'cadScanner' was not declared in this scope cadScanner(); ^~~~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1575:4: error: 'rxLoraModem' was not declared in this scope rxLoraModem(); ^~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1577:3: error: 'writeRegister' was not declared in this scope writeRegister(REG_IRQ_FLAGS_MASK, (uint8_t) 0x00); ^~~~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1577:3: note: suggested alternative: 'register' writeRegister(REG_IRQ_FLAGS_MASK, (uint8_t) 0x00); ^~~~~ register C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1601:21: error: 'setTime' was not declared in this scope if (newTime != 0) setTime(newTime); ^~~ C:\Users\User\Documents\Arduino\ESP-sc-gway\ESP-sc-gway.ino:1601:21: note: suggested alternative: 'newTime' if (newTime != 0) setTime(newTime); ^~~ newTime Multiple libraries were found for "WebServer.h" Used: C:\Users\User\AppData\Local\Arduino15\packages\Heltec-esp32\hardware\esp32\0.0.7\libraries\WebServer Not used: C:\Users\User\Documents\Arduino\ESP-sc-gway\libraries\WebServer_tng exit status 1

Compilation error: 'weekday' was not declared in this scope