LeClubSandwichStudio / LaCOOLBoard

Arduino library & sample sketches for La COOL Board, the open-source, open-hardware environmental monitoring and control device
http://www.lacool.co
MIT License
3 stars 5 forks source link

wrong date #31juneBug #168

Closed LeSuedois closed 6 years ago

LeSuedois commented 6 years ago

Coolboards with actual master shows invalid date. "timestamp": "2018-06-31T07:50:34Z" screenshot from 2018-07-01 10-00-51

LeSuedois commented 6 years ago

Serial output: *WM: Sent config page *WM: WiFi save *WM: Sent wifi save page *WM: Connecting to new AP *WM: Connecting as wifi client... *WM: Connection result: *WM: 3 [2018-07-01T07:27:16Z][HEAP:25560]INFO: Wifi network selected: Bbox-6D1D0A92 [2018-07-01T07:27:16Z][HEAP:25496]INFO: Adding new Wifi network: Bbox-6D1D0A92/9944D9FD2599241933FF92197EDDE3 [2018-07-01T07:27:17Z][HEAP:25080]DEBUG: Reading configuration file as JSON: /wifiConfig.json [2018-07-01T07:27:17Z][HEAP:25080]DEBUG: Configuration JSON:{"wifiCount":0,"timeOut":180} [2018-07-01T07:27:17Z][HEAP:25224]DEBUG: Saved JSON config to: /wifiConfig.json [2018-07-01T07:27:17Z][HEAP:25224]INFO: Added new network to Wifi configuration: SSID:Bbox-6D1D0A92PSK:9944D9FD2599241933FF92197EDDE3 [2018-07-01T07:27:17Z][HEAP:25560]INFO: Wifi status: connected *WM: freeing allocated params! [2018-07-01T07:27:17Z][HEAP:25752]INFO: RTC ISO8601 timestamp: 2018-07-01T07:27:17Z [2018-07-01T07:27:17Z][HEAP:25752]DEBUG: RTC UNIX timestamp: 1530430037 [2018-07-01T07:27:17Z][HEAP:25776]DEBUG: Received response from NTP server [2018-07-01T07:27:17Z][HEAP:25752]INFO: MQTT connecting... [2018-07-01T07:27:17Z][HEAP:25752]DEBUG: MQTT client id: 5CCF7F39EDF6 [2018-07-01T07:27:17Z][HEAP:25752]DEBUG: Loading X509 certificate [2018-07-01T07:27:18Z][HEAP:24536]DEBUG: Closing bin file [2018-07-01T07:27:18Z][HEAP:25752]DEBUG: Loading X509 private key [2018-07-01T07:27:19Z][HEAP:24088]DEBUG: Closing bin file [2018-07-01T07:27:19Z][HEAP:25752]DEBUG: Configuring MQTT [2018-07-01T07:27:28Z][HEAP:10640]INFO: Subscribed to MQTT input topic [2018-07-01T07:27:28Z][HEAP:11168]INFO: Synchronizing RTC... [2018-07-01T07:27:28Z][HEAP:11168]INFO: Waiting for NTP... [2018-06-31T07:27:27Z][HEAP:11168]INFO: RTC was synchronized with NTP [2018-06-31T07:27:27Z][HEAP:11168]INFO: RTC ISO8601 timestamp: 2018-06-31T07:27:27Z [2018-06-31T07:27:27Z][HEAP:11168]DEBUG: RTC UNIX timestamp: 1530430047 [2018-06-31T07:27:28Z][HEAP:10080]DEBUG: Reading configuration file as JSON: /coolBoardConfig.json [2018-06-31T07:27:28Z][HEAP:10080]DEBUG: Configuration JSON:{"logInterval":600,"ireneActive":false,"jetpackActive":false,"externalSensorsActive":true,"sleepActive":true,"manual":false,"mqttServer":"mqtts.lacoolboard.io"} [2018-06-31T07:27:28Z][HEAP:9880]DEBUG: JSON configuration message: {"state":{"reported":{"CoolBoard":{"logInterval":600,"ireneActive":false,"jetpackActive":false,"externalSensorsActive":true,"sleepActive":true,"manual":false,"mqttServer":"mqtts.lacoolboard.io"}}}} [2018-06-31T07:27:28Z][HEAP:9664]DEBUG: Message to log: {"state":{"reported":{"CoolBoard":{"logInterval":600,"ireneActive":false,"jetpackActive":false,"externalSensorsActive":true,"sleepActive":true,"manual":false,"mqttServer":"mqtts.lacoolboard.io"}}}} [2018-06-31T07:27:28Z][HEAP:9664]DEBUG: Message size: 197 [2018-06-31T07:27:28Z][HEAP:8992]INFO: MQTT publish successful [2018-06-31T07:27:29Z][HEAP:10032]DEBUG: Reading configuration file as JSON: /coolBoardSensorsConfig.json [2018-06-31T07:27:29Z][HEAP:10032]DEBUG: Configuration JSON:{"BME280":{"temperature":true,"humidity":true,"pressure":true},"SI114X":{"visible":true,"ir":true,"uv":true},"vbat":true,"soilMoisture":true,"wallMoisture":false} [2018-06-31T07:27:29Z][HEAP:9880]DEBUG: JSON configuration message: {"state":{"reported":{"CoolSensorsBoard":{"BME280":{"temperature":true,"humidity":true,"pressure":true},"SI114X":{"visible":true,"ir":true,"uv":true},"vbat":true,"soilMoisture":true,"wallMoisture":false}}}} [2018-06-31T07:27:29Z][HEAP:9664]DEBUG: Message to log: {"state":{"reported":{"CoolSensorsBoard":{"BME280":{"temperature":true,"humidity":true,"pressure":true},"SI114X":{"visible":true,"ir":true,"uv":true},"vbat":true,"soilMoisture":true,"wallMoisture":false}}}} [2018-06-31T07:27:29Z][HEAP:9664]DEBUG: Message size: 206 [2018-06-31T07:27:29Z][HEAP:8992]INFO: MQTT publish successful [2018-06-31T07:27:30Z][HEAP:10064]DEBUG: Reading configuration file as JSON: /coolBoardActorConfig.json [2018-06-31T07:27:30Z][HEAP:10064]DEBUG: Configuration JSON:{"actif":false,"inverted":false,"temporal":false,"low":[0,5000,0,0],"high":[0,5000,0,0],"type":["Temperature",""]} [2018-06-31T07:27:30Z][HEAP:9928]DEBUG: JSON configuration message: {"state":{"reported":{"CoolBoardActor":{"actif":false,"inverted":false,"temporal":false,"low":[0,5000,0,0],"high":[0,5000,0,0],"type":["Temperature",""]}}}} [2018-06-31T07:27:30Z][HEAP:9760]DEBUG: Message to log: {"state":{"reported":{"CoolBoardActor":{"actif":false,"inverted":false,"temporal":false,"low":[0,5000,0,0],"high":[0,5000,0,0],"type":["Temperature",""]}}}} [2018-06-31T07:27:30Z][HEAP:9760]DEBUG: Message size: 156 [2018-06-31T07:27:30Z][HEAP:9088]INFO: MQTT publish successful [2018-06-31T07:27:32Z][HEAP:10768]DEBUG: Reading configuration file as JSON: /coolBoardLedConfig.json [2018-06-31T07:27:32Z][HEAP:10768]DEBUG: Configuration JSON:{"ledActive":true} [2018-06-31T07:27:32Z][HEAP:10552]DEBUG: JSON configuration message: {"state":{"reported":{"led":{"ledActive":true}}}} [2018-06-31T07:27:32Z][HEAP:10480]DEBUG: Message to log: {"state":{"reported":{"led":{"ledActive":true}}}} [2018-06-31T07:27:32Z][HEAP:10480]DEBUG: Message size: 49 [2018-06-31T07:27:32Z][HEAP:9808]INFO: MQTT publish successful [2018-06-31T07:27:33Z][HEAP:10016]DEBUG: Reading configuration file as JSON: /externalSensorsConfig.json [2018-06-31T07:27:33Z][HEAP:10016]DEBUG: Configuration JSON:{"sensorsNumber":2,"sensor0":{"reference":"SDS011","type":"PM","connection":"I2C","address":13,"kind0":"PM10","kind1":"PM2.5"},"sensor1":{"reference":"NDIR_I2C","type":"CO2","address":77}} [2018-06-31T07:27:33Z][HEAP:9848]DEBUG: JSON configuration message: {"state":{"reported":{"externalSensors":{"sensorsNumber":2,"sensor0":{"reference":"SDS011","type":"PM","connection":"I2C","address":13,"kind0":"PM10","kind1":"PM2.5"},"sensor1":{"reference":"NDIR_I2C","type":"CO2","address":77}}}}} [2018-06-31T07:27:33Z][HEAP:9600]DEBUG: Message to log: {"state":{"reported":{"externalSensors":{"sensorsNumber":2,"sensor0":{"reference":"SDS011","type":"PM","connection":"I2C","address":13,"kind0":"PM10","kind1":"PM2.5"},"sensor1":{"reference":"NDIR_I2C","type":"CO2","address":77}}}}} [2018-06-31T07:27:33Z][HEAP:9600]DEBUG: Message size: 231 [2018-06-31T07:27:33Z][HEAP:8928]INFO: MQTT publish successful [2018-06-31T07:27:33Z][HEAP:10896]INFO: Collecting board and sensor data... [2018-06-31T07:27:34Z][HEAP:10872]DEBUG: Public IP address: 176.142.15.108 [2018-06-31T07:27:34Z][HEAP:10368]DEBUG: Raw value: 754 [2018-06-31T07:27:34Z][HEAP:10368]DEBUG: Battery voltage: 4.13 [2018-06-31T07:27:37Z][HEAP:10368]DEBUG: Raw soil moisture sensor value: 9 [2018-06-31T07:27:37Z][HEAP:10368]DEBUG: Computed soil moisture: 0.00 [2018-06-31T07:27:37Z][HEAP:10368]DEBUG: Builtin sensors data:{"publicIp":"176.142.15.108","timestamp":"2018-06-31T07:27:34Z","mac":"5CCF7F39EDF6","firmwareVersion":"v0.2.6-1-g16ff8a07","wifiSignal":-70,"visibleLight":269,"infraRed":327,"ultraViolet":0.06,"Temperature":26.14,"Pressure":100557.5,"Humidity":56.68457,"Vbat":4.127468,"soilMoisture":0} [2018-06-31T07:27:38Z][HEAP:10368]DEBUG: External sensors data:{"publicIp":"176.142.15.108","timestamp":"2018-06-31T07:27:34Z","mac":"5CCF7F39EDF6","firmwareVersion":"v0.2.6-1-g16ff8a07","wifiSignal":-70,"visibleLight":269,"infraRed":327,"ultraViolet":0.06,"Temperature":26.14,"Pressure":100557.5,"Humidity":56.68457,"Vbat":4.127468,"soilMoisture":0,"PM10":1.8,"PM2.5":0.3,"CO2":617} [2018-06-31T07:27:39Z][HEAP:10368]INFO: Setting actuators and reporting their state... [2018-06-31T07:27:39Z][HEAP:10368]INFO: Actuators configuration: automatic [2018-06-31T07:27:39Z][HEAP:10368]DEBUG: Updating and recording onboard actuator state... [2018-06-31T07:27:39Z][HEAP:10368]DEBUG: Hour value: 7 [2018-06-31T07:27:39Z][HEAP:10368]DEBUG: Minute value: 27 [2018-06-31T07:27:39Z][HEAP:10368]DEBUG: Setting onboard actuator pin to: 0 [2018-06-31T07:27:39Z][HEAP:10368]INFO: Sending log over MQTT... [2018-06-31T07:27:39Z][HEAP:9616]DEBUG: Message to log: {"state":{"reported":{"publicIp":"176.142.15.108","timestamp":"2018-06-31T07:27:34Z","mac":"5CCF7F39EDF6","firmwareVersion":"v0.2.6-1-g16ff8a07","wifiSignal":-70,"visibleLight":269,"infraRed":327,"ultraViolet":0.06,"Temperature":26.14,"Pressure":100557.5,"Humidity":56.68457,"Vbat":4.127468,"soilMoisture":0,"PM10":1.8,"PM2.5":0.3,"CO2":617,"ActB":0}}} [2018-06-31T07:27:39Z][HEAP:9616]DEBUG: Message size: 352 [2018-06-31T07:27:39Z][HEAP:8944]INFO: MQTT publish successful [2018-06-31T07:27:40Z][HEAP:10368]INFO: Listening to update messages... [2018-06-31T07:27:42Z][HEAP:11312]INFO: Going to sleep for seconds: 598

Kameeno commented 6 years ago

the issue is coming from the fact on the current code we return the ISO8601 timestamp from the raw values of RTC, the DS1337 does not have a calendar inside :) he can just return values from 01 to 31 for the date, please see the datasheet. schermata 2018-07-02 alle 10 21 54 to calculate the true date we need to calculate the UNIX timestamp by the values from DS1337, is after we can transform the unix date on ISO8601. @3rwww1 @simon-lacool @trap98