New firmware - time() returning incorrect

Hello,

My 005 did a firmware update a few hours ago, and now time() (on device) returns only 3-4 digits (I am assuming the last digits - not exactly sure if the update caused this to be honest). Agent code returns fine, but device code is not. Here is a pretty print of a bull message:

016-07-30 23:44:07 UTC-4 [Agent] {
2016-07-30 23:44:07 UTC-4 [Agent] “type”: 2,
2016-07-30 23:44:07 UTC-4 [Agent] “name”: “boot”,
2016-07-30 23:44:07 UTC-4 [Agent] “id”: 1,
2016-07-30 23:44:07 UTC-4 [Agent] “ts”: 6043,
2016-07-30 23:44:07 UTC-4 [Agent] “data”: {
2016-07-30 23:44:07 UTC-4 [Agent] “lastboot”: 6043,
2016-07-30 23:44:07 UTC-4 [Agent] “macaddress”: “98f1706fd3be”,
2016-07-30 23:44:07 UTC-4 [Agent] “agenturl”: "https://agent.electricimp.com/*************"
2016-07-30 23:44:07 UTC-4 [Agent] }
2016-07-30 23:44:07 UTC-4 [Agent] }

device code
`#require "Bullwinkle.class.nut:2.0.1"
server.log(time())
bull <- Bullwinkle();

thistable <- {};
thistable[“macaddress”] <- imp.getmacaddress();
thistable[“lastboot”] <- time();
server.log(time())
server.log(“booting!!!”);
bull.send(“boot”, thistable);`

not sure if I a missing something… I guess I should also note that the device is connected, and I have tried to re-upload the code multiple times…

Time is set when the device connects to the server and can process inbound packets - if your code is running without yield from boot then the time wouldn’t be set correctly, I believe.

If you run code like this:

server.log("this forces a connect"); imp.onidle(function() { server.log(time()); });

…do you see the right time?

device code (literally the entire device code)

server.log("this forces a connect"); imp.onidle(function() { server.log(time()); });

result

2016-07-31 02:47:36 UTC-4 [Device] this forces a connect
2016-07-31 02:47:36 UTC-4 [Device] 17053

restarted device (unplugged power then plugged back in again)

result

2016-07-31 02:52:17 UTC-4 [Device] this forces a connect 2016-07-31 02:52:17 UTC-4 [Device] 7

seems to be a second counter from power on

Can you log the device firmware version?

server.log(imp.getsoftwareversion());

The behaviour you describe is expected on imp005 in release-33.28 and earlier; subsequent releases should be getting the time right once connected to the server (assuming the server is actually providing a timestamp). We currently intend to provide a fully working RTC on imp005 (one which on a warm boot works even before connected to the server) in the next major release.

Peter

2016-08-01 11:04:36 UTC-4 [Device] 33ac942 - release-33.28 - Tue Jun 21 10:05:46 2016 - production

Ah yes, you were on 33.28. I’ve put you on 34.1 with the other imp005’s for now.

Thank you! I would like to note the performance of the 005 is great. Some of the calculations I had trouble performing quick enough before on the 002 now take about 1/10th the time.