Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#357426 - 06/02/2013 14:49 Odd question about AT command set
sn00p
addict

Registered: 24/07/2002
Posts: 618
Loc: South London
Hi,

Wonder if anybody knows the answer to this one, because I can't seem to find the answer to it.

There is an AT command which retrieves the GSM network time, this is:

AT+CCLK?

And it returns something like:

+CCLK: "13/02/06,09:25:12+08"

Which gives you the time and date and the offset from GMT, now not being a timezone guru does this indicate that the time is 09:25:12 GMT in the morning or 09:25:12 local time with the time zone being 2 hours ahead? (the offset is in 15 minute units so 8=2 hours).

All the documentation I have got for the modules we use don't actually tell you whether it's GMT or local time which it returns, and with the UK being on GMT at the moment I can't actually tell whether it returns GMT or local time, either way you know the offset to GMT, I just don't want to make the wrong call here.....

Thanks.

Adrian


Edited by sn00p (06/02/2013 14:50)

Top
#357448 - 06/02/2013 22:22 Re: Odd question about AT command set [Re: sn00p]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Note that this usually reads the module internal clock, NOT the network time. You need to configure the modem to sync its RTC to the network with a separate command. Off the top of my head it's AT+NITZ or AT#NITZ for Telit models at least.

I'm pretty sure the time includes the offset already. I can check if you give me a day or two.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#357450 - 06/02/2013 23:08 Re: Odd question about AT command set [Re: sn00p]
gbeer
carpal tunnel

Registered: 17/12/2000
Posts: 2665
Loc: Manteca, California
Pretty sure that is pacific std time, and it's in 24 hour format.
_________________________
Glenn

Top
#357455 - 07/02/2013 02:20 Re: Odd question about AT command set [Re: gbeer]
Rod
journeyman

Registered: 04/05/2000
Posts: 84
Loc: Australia
I just tried this on a Telit HE910 module. The AT#CCLK? command is reporting local time, the offset here in Sydney is 44 (11 hours).

Code:
#CCLK: "13/02/07,15:14:48+44,1"
OK

Top
#357459 - 07/02/2013 05:47 Re: Odd question about AT command set [Re: Shonky]
sn00p
addict

Registered: 24/07/2002
Posts: 618
Loc: South London
Originally Posted By: Shonky
Note that this usually reads the module internal clock, NOT the network time. You need to configure the modem to sync its RTC to the network with a separate command. Off the top of my head it's AT+NITZ or AT#NITZ for Telit models at least.

I'm pretty sure the time includes the offset already. I can check if you give me a day or two.


Yeah, but the module doesn't have battery backup, so it either reads time starting at the epoch or network time once it's synced, it's easy enough to figure out if it's done a sync.

The modules that we're using have a default configuration which has NITZ enabled (they're motorola ones, although telit bought motorola and the latest batch we have got from them are badged as telit).

Quite why they don't explain whether this is GMT or localtime in any of their manuals (or any other manufacturers manuals that I could find) is, well, beyond me....

I think rod has given me the definitive answer with his reply.

Top
#357460 - 07/02/2013 05:50 Re: Odd question about AT command set [Re: Rod]
sn00p
addict

Registered: 24/07/2002
Posts: 618
Loc: South London
Originally Posted By: Rod
I just tried this on a Telit HE910 module. The AT#CCLK? command is reporting local time, the offset here in Sydney is 44 (11 hours).

Code:
#CCLK: "13/02/07,15:14:48+44,1"
OK


I'm guessing that you did that at 15:14 local time because your post time lines up with the offset from the CCLK.

localtime it is.

Many thanks.

Adrian

Top
#357461 - 07/02/2013 05:51 Re: Odd question about AT command set [Re: sn00p]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Right. I'm just saying you will need the smarts even if NITZ is set.

And Rod confirms what I was remembering so you should be good to go. Telit can't tell you? Their support of us is pretty responsive.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#357462 - 07/02/2013 05:53 Re: Odd question about AT command set [Re: Shonky]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Also one thing I have noticed is that this doesn't work in all countries around the world. Usually less developed ones. Is it for the UK only?

I know just recently it's worked in UK, India, UAE, Singapore and Australia but 6 months ago, India didn't work for example. It's quite handy to just turn your phone on and have the time and timezone update itself.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#357463 - 07/02/2013 06:03 Re: Odd question about AT command set [Re: Shonky]
sn00p
addict

Registered: 24/07/2002
Posts: 618
Loc: South London
Tbh I've found so many bugs in this device that I've lost faith in it, to be fair they do usually fix them, but some of them have required me to send stuff off to israel by "snail mail" and it takes ages....even longer when you have a customer breathing down my neck.

Primarily UK, some are in europe as well.

This is actually a stop gap fix for another issue, we have a maxim-dallas RTC on board which under "some" circumstances forgets its clock, it's fully battery backed, go figure. There are plenty of other people mentioning this issue on the net, but nobody seems to know how to fix it.

The network time allows me to reset the clock on the RTC if I know that it's gone bad. We've tried just about every experiment under the sun to try to get the RTC to fail in the office and can't, but you can guarantee that it will happen out in the field, it's rare, but it happens and when it does happen, it's painfully obvious.

Still need to find the issue with the RTC, but this gives a bit of a safety net as most of these units that require date/time have our modem board fitted.

Adrian

Top
#357467 - 07/02/2013 13:29 Re: Odd question about AT command set [Re: sn00p]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Perhaps a unrelated interrupt happening during low-level RTC accesses, resulting in stretched/incorrect transfer timing?

Top
#357481 - 08/02/2013 06:48 Re: Odd question about AT command set [Re: mlord]
sn00p
addict

Registered: 24/07/2002
Posts: 618
Loc: South London
Originally Posted By: mlord
Perhaps a unrelated interrupt happening during low-level RTC accesses, resulting in stretched/incorrect transfer timing?


I have no idea, the RTC appears to have been reset (i.e the registers have gone back to "zero"), as far as I can tell this can only happen if power is removed from the RTC. The RTC battery backup is directly connected to the RTC, so even if the main power goes, the battery kicks in. On powerfail you cannot write to the registers of the RTC.

Infact, the only time we write to the RTC is when the device receives instructions to do it.

i2c (afaik) should be immune to timing, you can go as slow or fast (as long as the device can keep up) as you want. It's not even like a single register is getting corrupted, the whole thing just "resets".

It's very odd. The battery on it should be good for 20 odd years!

Thing is that these particular pieces of equipment are sat on poles by the side of the road, so it's not a convenient place to debug!

Adrian

Top
#357482 - 08/02/2013 12:11 Re: Odd question about AT command set [Re: sn00p]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
I have seen many I2C style interfaces that clearly specify a minimum clock (yeah, sounds odd, but..). Going slower has unspecified side effects. So that's an outside possibility, but the chip datasheet ought to have something to say about that.

Apart from a chip bug, the only other thing that comes to mind is EMI / spikes on the interface lines or mains power to the chip.

I'm sure you're poking at that stuff already, but there's only so many ways to get an RTC chip to mess up. It's got to be one of them.

Cheers

Top
#357514 - 09/02/2013 03:35 Re: Odd question about AT command set [Re: mlord]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
High vibration/shock environment? Are these plug in batteries or an all in one solution?

Temperature?

EMI/EMC is my other thought too.

So is the RTC being corrupted whilst powered or on battery backup (or both)?
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top