Problem with RTC (UTC time is 2000-01-01)

Hello!
First of all I wish you all Happy New Year 2016.

I have a SCK 1.1 for almost a year. Until 18.12.2015 i didn't have any issues but after that day SCK is offline.

I did almost everything what I did found hear and in WiFly Rn131 manual guide.

SCK check utility say that everything is OK :)
I have the latest wifly3-475.img (wifly3-475.mif).

After uploading latest SCK beta 0.9.2 with Arduino IDE I see these in Serial Monitor
SCK Connected!!
WiFly up to date.
Fail updating RTC!!
SCK Sleeping...

My wlan settings
wifly-GSX Ver: 4.75 Build: r1777, Oct 2 2015 10:23:13 on RN-131
MAC Addr=00:06:66:35:89:26
*READY*
Auto-Assoc RebelsClub chan=11 mode=MIXED SCAN OK
Joining RebelsClub now..
Associated!
DHCP: Start
DHCP in 1440ms, lease=86400s
IF=UP
DHCP=ON
IP=192.168.1.103:2000
NM=255.255.255.0
GW=192.168.1.1
Listen on 2000


<4.75> get wlan
SSID=RebelsClub
Chan=0
ExtAnt=0
Join=1
Auth=MIXED
Mask=0x1fff
Rate=12, 24 Mb
Linkmon=30
Passphrase=*********
EAP_Id=userid
EAP_User=peap-user


<4.75> set time zone +1

AOK
<4.75> show t t

Time=10:39:57
UpTime=219 s
RTC=1451734797
Restarts=1
Wake=1
RAW=2b43db868567
<4.75> save

Storing in config



And data reads from sensors looks like this
Temperature: 28064 C RAW
Humidity: 22388 % RAW
Light: 2.60 lx
Battery: 100.00 %
Solar Panel: 0 mV
Carbon Monxide: 436.62 kOhm
Nitrogen Dioxide: 22.03 kOhm
Noise: 95 mV
Wifi Spots: 0
UTC: 2000-01-01 00:43:09
*******************
Temperature: 28060 C RAW
Humidity: 22372 % RAW
Light: 2.60 lx
Battery: 100.00 %
Solar Panel: 0 mV
Carbon Monxide: 436.45 kOhm
Nitrogen Dioxide: 22.03 kOhm
Noise: 59 mV
Wifi Spots: 0
UTC: 2000-01-01 00:43:10
*******************


I ask you for help. Please help.
Tagged:

Comments

  • Hello!

    (Happy new year, friends!)

    I have the same problem here... Everything was working fine until last days of December (i think)...

    From then, i can't see any data published... and i get that "Fail updating RTC!!" message...

    I tried to reinstall everything... but i did not solve it...

    Please, help - i' ve lost hours and hours trying to fix it...

    Thanks in advance!
    Dims
  • We have aldo suffered the same problem in the pady. That happens in case the SCK fails to get the time for the first time from the server (smartcitizen.me/datetime). Then if fixes the time to 2000-01-01 00:00:00... To solve it we have to modify the firmware so that when the SCK starts, it keeps trying to get the time from the server before starting to report measurementes. Now we have 40 sensors up and running... and with the time correctly reported!!
    There is another issue regarding the storage of the measurements in the EEPROM we have also corrected... as in case the SCK is not able to podt the measurements for a long period, the exterrnal EEPROM becomes fulll... but the firmware does not seem to detect it and report weird values. To solve it, we have decided to force a hardware reset when the number of penfing measuremente is above a given threshold (two hours in our SCKs).

    Finally we have also introduce a slight modification in the firmware so that we can remotely request a SCK to do a reset (we have 40 SCKs distributed through our Campus and cannot afford to physically push the resrt button in case of failure)


    We plan to upload the firmware changes to the repository in brief.
  • Hy!

    Thank you @upmcityfuture for your reply. Please write here when you'll upload the changes to the repository.
  • Thanks @upmcityfuture,

    for reporting this issue on the EEPROM. We will release a new firmware version this week to solve this and the RTC issues.

    Please report any other issues here,

    Thank you very much for your work!

    Guillem
  • edited March 2016
    Hi,

    I'm glad to here something good from you.

    I find the solution for my RTC problem. In arduino project in Constans.h I changed

    static variable WEBTIME to new API
    // Time server request - EndPoint: http://api.smartcitizen.me/v0/datetime
    static char* WEBTIME[3]={
    /*Servidor de tiempo*/
    "GET /v0/datetime HTTP/1.1 \n",
    "Host: api.smartcitizen.me \n",
    "User-Agent: SmartCitizen \n\n"
    };

    My data is now posting to the server.

    Under API documentation I can't find anything about posting the data. Can you please tell me if this is ok?

    // Basic Server Posts to the SmartCitizen Platform - EndPoint: http://api.smartcitizen.me/v0/add
    static char* WEB[8]={
    "api.smartcitizen.me",
    "PUT /v0/add HTTP/1.1\n",
    "Host: api.smartcitizen.me \n",
    "User-Agent: SmartCitizen \n",
    "X-SmartCitizenMacADDR: ",
    "X-SmartCitizenApiKey: ",
    "X-SmartCitizenVersion: ",
    "X-SmartCitizenData: "};

  • edited March 2016
    Hello @Romanv,

    After fighting with the issue on the last days we just fix it, it was a backend issue due to recent changes in our nginx configuration. The SCK is far more sensible than a browser when an http request is not returning exactly what it expects.

    Time should sync fine now with the current sck_beta_v0_9 firmware, no update is required

    Your approach using api.smartcitizen.me it shouldn't work, mostly because the api is on https. However we are working hard on releasing the final documentation about how the data ingestion point works!

    Please, keep reporting any issues, your work is extremely valuable!
  • Hello @guillem ,

    Me again. I updated my SCK 1.1 to v0.9.3 and now my problems with RTC are back :-(

    SCK Connected!!
    WiFly up to date.
    RTC Update Failed!!
    RTC Update Failed!!
    With no valid time it's useless to take readings!!
    RTC Update Failed!!
    With no valid time it's useless to take readings!!
    RTC Update Failed!!
    With no valid time it's useless to take readings!!


    When I test this URL http://data.smartcitizen.me/datetime I get this as response UTC:2016,6,26,08,37,15#. I also test this URL with Postman and the result is the same.

    I also open port 2000 in my router for Wifly.


  • Funny... I moved my SCK to my neigbour and connect to his wifi and it works.
    We both have Linksys router but my is set to MIXED on 2.4 GHz and 5 GHz and his to Wireless A on 5 GHz and Wireless B/G on 2.4 GHz.
  • Hello @romanv

    It seems that your kit was successfully connected to your router but for some reason can't reach the time server.
    Is your internet connection working OK?

    In the 0.9.3 firmware we change the behaviour: if the kit can't get a valid time since last boot it will not take readings because it doesn't know what time it is, and if you post data without a valid timestamp the system won't ingest those readings. The kit keeps trying to get time from server until it succeeds and then return to normal operation.
    After the first valid time update if your kit experience temporal network errors they won't become a problem, the kit simply store the readings in eeprom and post them later.

    Is your kit working with your router already?
    Please keep us informed of your progress!

    regards
    Victor
Sign In or Register to comment.