Author Topic: Current time in HH:MM:SS  (Read 1286 times)

michal

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Current time in HH:MM:SS
« Reply #15 on: July 30, 2016, 08:20:24 am »
Indeed kristofferis.

I don't think I've seen that one. Just some of the examples.

michal

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Current time in HH:MM:SS
« Reply #16 on: July 30, 2016, 04:25:01 pm »
The two modules that weren't beaconing started to do so overnight. But still no data :/


kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: Current time in HH:MM:SS
« Reply #17 on: July 30, 2016, 04:28:56 pm »
Connect to the device from mcStudio and debug (play button) your code and see if the code works.
If it works and that you are happy with the result, upload the code to the mcModule.
If it then stops working then we have an issue. But please try the above suggestion.

michal

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Current time in HH:MM:SS
« Reply #18 on: July 30, 2016, 05:05:57 pm »
The thing is the code has been running without fault continuously for 3 days. It's the same code I pasted earlier.

michal

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Current time in HH:MM:SS
« Reply #19 on: July 30, 2016, 05:58:22 pm »
And for what it's worth.. Here are the files that the data gets logged to:

Code: [Select]
pi@raspberrypi:~/public_html $ ls -l *.csv
-rw-r--r-- 1 pi pi   234 Jul 31 08:52 ComputerRoomBatt.csv
-rw-r--r-- 1 pi pi  3675 Jul 31 08:52 ComputerRoomTemp.csv
-rw-r--r-- 1 pi pi  1131 Jul 30 18:26 DownstairsBatt.csv
-rw-r--r-- 1 pi pi 16912 Jul 30 18:37 DownstairsTemp.csv
-rw-r--r-- 1 pi pi   533 Jul 30 18:34 FridgeBatt.csv
-rw-r--r-- 1 pi pi  7127 Jul 30 18:34 FridgeTemp.csv
-rw-r--r-- 1 pi pi   364 Jul 31 08:48 UpstairsBatt.csv
-rw-r--r-- 1 pi pi  5225 Jul 31 08:53 UpstairsTemp.csv

Going to try power cycling the Fridge and Downstairs modules which HAD been working until things went topsy-turvy and which modules work and don't work inverted (only host processor update).

All of them are running the same code except for the publish names.

michal

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Current time in HH:MM:SS
« Reply #20 on: July 31, 2016, 01:34:39 am »
Power cycling them did not help. They still beacon regularly but no data.

Occam's Razor would seem to suggest that the host processor firmware is the reason that the originally working modules have stopped working. It might be that the module must be programmed through a gateway that has the current (and not the previous) firmware for them to work (as is the case with the working modules).

So that is what I am going to try next.

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: Current time in HH:MM:SS
« Reply #21 on: July 31, 2016, 02:16:48 am »
Yes, that's why I asked you to connect to the mcModule and run the code.
Make sure you have latest firmware and software and upload the code again.
And I recommend to always debug the code to verify it.

michal

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Current time in HH:MM:SS
« Reply #22 on: July 31, 2016, 02:27:44 am »
Bizarrely, while I was trying to do just that (couldn't connect to the modules to re-upload the code) they both just started working again.

Got about 30 minutes (ie 6 messages every 5 minutes) of data all with an incorrect timestamp (as if the module had been reset, though I hadn't reset it).

Is there some sort of watchdog that resets the modules after about 24 hours?

I will definitely be running rather than loading any unverified code onto my modules in future.

michal

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Current time in HH:MM:SS
« Reply #23 on: July 31, 2016, 03:55:04 am »
And now they've all stopped working... And then came back 15 minutes later.. At least the beacons.

There's something going on here as the two that went AWOL yesterday did so at 18:37 and then they all went AWOL for 15 minutes today at 18:38.. It  COULD be a coincidence.. But if it happens again tomorrow around the same time..

We'll see.

EDIT: Oh, and the time reset on one of the modules.

michal

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Current time in HH:MM:SS
« Reply #24 on: August 01, 2016, 07:25:49 am »
Umm..

I've come across another problem..

It's the 32nd of July..

Code: [Select]
2016-07-31T23:58:06Z,21.250000
2016-07-32T00:03:06Z,21.375000

I think this may be a bug?
Funny Funny x 1 View List

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: Current time in HH:MM:SS
« Reply #25 on: August 01, 2016, 08:06:09 am »
I agree :) let's add this to the list of bug's.

mc-Abe

  • Full Member
  • ***
  • Posts: 167
    • View Profile
    • mc-Things
Re: Current time in HH:MM:SS
« Reply #26 on: August 02, 2016, 11:00:40 am »
Oops! That is certainly a bug, we have found the issue and it has been fixed. Will be in the next release of mcModule.

There is indeed a watchdog on the module but it is not intended to be triggered. It would be consistent with the 15 minute reset you are seeing though. This is not something that you should see and it intended as a device recovery mechanism. Is it possible for you to share you code? You can private message it to me and I can see why this could be happening.

michal

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Current time in HH:MM:SS
« Reply #27 on: August 05, 2016, 06:43:16 am »
Sorry! Didn't notice your post till just now.

The code is the same as I posted earlier. Haven't seen any resets in a couple of days so seems good for now.

Might try logging the UID and uptime as well for debug and tracking purposes.

Riverrider

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Current time in HH:MM:SS
« Reply #28 on: August 05, 2016, 02:48:51 pm »
I've been working on an app to turn on a sprinkler timer for 1 hour per day (and, eventually, on selected days) but couldn't get it to activate at the specified hour. Initially tested in the debugger to avoid any "bricking" as mentioned here but without breakpoints. Finally got smart and actually looked at the time being received from DateTime.Now. Also included the string value in an IFTTT log. Here's an excerpt while cycling once a minute:

August 5, 2016 at 02:19PM   Module469   ValveOpen   2016-08-05T23:19:46+05:00   
August 5, 2016 at 02:20PM   Module469   ValveClosed   2016-08-05T23:20:47+05:00   
August 5, 2016 at 03:19PM   Module469   ValveClosed   2016-08-05T19:16:39Z   
August 5, 2016 at 03:20PM   Module469   ValveOpen   2016-08-05T19:17:39Z   

Note that I'm in the US East coast time zone. (The last two entries had the "Z" argument on the ToString() while the missing times where taken up with other things including trying to post log entries with the "L" argument - which refused to post but showed ok in the debugger. What's up with that?)  As you can see, the time zone correction shows a +5 hours where it should be MINUS 5. Is there something I'm missing?

Riverrider

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Current time in HH:MM:SS
« Reply #29 on: August 05, 2016, 04:47:26 pm »
I was missing something. It's been months since I first configured the gateway. And yes, it did have +05:00 in the Time Zone field. One must also remember to reset the gateway after changing anything. Still can't get the IFTTT log entries when formatting the time string with the "L" argument. Just doesn't log at all. The other formats work properly.