Apnea Board Forum - CPAP | Sleep Apnea
Using FlashAir, what's the timestamp on the data files? - Printable Version

+- Apnea Board Forum - CPAP | Sleep Apnea (https://www.apneaboard.com/forums)
+-- Forum: Public Area (https://www.apneaboard.com/forums/Forum-Public-Area)
+--- Forum: Software Support Forum (https://www.apneaboard.com/forums/Forum-Software-Support-Forum)
+--- Thread: Using FlashAir, what's the timestamp on the data files? (/Thread-Using-FlashAir-what-s-the-timestamp-on-the-data-files)

Pages: 1 2


Using FlashAir, what's the timestamp on the data files? - cathyf - 04-16-2021

I am intrigued by the Flashair technology, and have an off-the-wall question for those of you who use one and have a ResMed cpap -- when the data files appear, are the creation times and modified times set by the system clock in the CPAP? Or do they get the time from the network?

(I'm curious because if the file metadata gets the time from the network, that would give you a precise measure of the clock drift on the machine. Because these files have DateTimes as file names, so if you compare the time in the name to the time in the metadata, you know exactly how far the clock is off. Of course if the metadata gets set by the machine, it won't help.)

(You know it's a complete engineering fail that these machines have cell phone modems, they "phone home" every day, but the engineers didn't set them up to correct the clock using the cell phone network!)


RE: Using FlashAir, what's the timestamp on the data files? - Dog Slobber - 04-18-2021

When using a FlashAir the timestamps used, refer to the device.


RE: Using FlashAir, what's the timestamp on the data files? - cathyf - 04-19-2021

Ah, well. it was a thought...

The ResMed engineers who didn't think to put the code in to sync the clock using the cell phone network are idiots! Maybe they'll fix that in the AirSense11?


RE: Using FlashAir, what's the timestamp on the data files? - biorn - 04-19-2021

(04-19-2021, 03:06 PM)cathyf Wrote: Ah, well. it was a thought...

The ResMed engineers who didn't think to put the code in to sync the clock using the cell phone network are idiots! Maybe they'll fix that in the AirSense11?

Ya that why they put ble connectivity. Will be possible to purchase a Bluetooth sundial Laugh-a-lot


RE: Using FlashAir, what's the timestamp on the data files? - Dog Slobber - 04-20-2021

(04-19-2021, 03:06 PM)cathyf Wrote: Ah, well. it was a thought...

The ResMed engineers who didn't think to put the code in to sync the clock using the cell phone network are idiots! Maybe they'll fix that in the AirSense11?

The cellular networks don't serve time, nor do cell devices use the network to use a more traditional time protocol like NTP or PTP, though one can use an app for that. Cell phones capable of time syncing use GPS Network Time Synchronization.


RE: Using FlashAir, what's the timestamp on the data files? - biorn - 04-20-2021

(04-20-2021, 09:04 AM)Dog Slobber Wrote: The cellular networks don't serve time, nor do cell devices use the network to use a more traditional time protocol like NTP or PTP, though one can use an app for that. Cell phone's use GPS Network Time Synchronization.

Here are the commands i used: 
Command to read the GSM RTC clock : 
AT+CCLK?
Command to enable GSM RTC network time sync : 
AT+CLTS=1
Command to save the command settings to memory so that the time is synchronized on every boot up automatically. 
AT&W 

Procedure : 
Read current time (You can see that the time is not right): 
AT+CCLK?
+CCLK: “04/01/01,00:14:12+22”
OK
Enable auto network time sync : 
AT+CLTS=1
OK
Check if value is set : 
AT+CLTS?
+CLTS: 1
OK
Save the setting to permanent memory so that module enables sync on restart also  : 
AT&W
OK
Restart the module and check time  : 
AT+CCLK?
+CCLK: “18/06/21,12:00:21+22”
OK

or you can use http request too or sms request or what you want


RE: Using FlashAir, what's the timestamp on the data files? - Crimson Nape - 04-20-2021

biorn - It would be helpful to know what device, and app, was used for issuing those commands.


RE: Using FlashAir, what's the timestamp on the data files? - Dog Slobber - 04-20-2021

Those are commands used for GSM devices, think of them as being similar to the old modem AT commands.

Time messages (NITZ) are optional and not supported universally by GSM providers, and allegedly are quirky with Time Zone. Which is why [most] cell phones use GPS.


RE: Using FlashAir, what's the timestamp on the data files? - biorn - 04-20-2021

(04-20-2021, 10:12 AM)Crimson Nape Wrote: biorn - It would be helpful to know what device, and app, was used for issuing those commands.

It's just an exemple of request time possibility with the embeded gsm modem. (request time on the network)


RE: Using FlashAir, what's the timestamp on the data files? - cathyf - 04-21-2021

(04-20-2021, 09:04 AM)Dog Slobber Wrote:
(04-19-2021, 03:06 PM)cathyf Wrote: Ah, well. it was a thought...

The ResMed engineers who didn't think to put the code in to sync the clock using the cell phone network are idiots! Maybe they'll fix that in the AirSense11?

The cellular networks don't serve time, nor do cell devices use the network to use a more traditional time protocol like NTP or PTP, though one can use an app for that. Cell phones capable of time syncing use GPS Network Time Synchronization.

I was thinking more along the lines of the machine is talking to the ResMed network and could ask what time it is. From there it would be simple to write that information somewhere in the data stream. The clock doesn’t drift very far very fast, so that would fix most problems well enough. 

Having been a bemused bystander to the great network time religious wars, I can say that the takeaway is that it’s not that hard to do something reasonably intelligent, and then developers can figure out what to do from there. 

I’m wondering if you could use the FlashAir syncing to keep reasonable track. There are a whole bunch of files being created with times embedded in the names, and everything has creation times in the metadata. You ought to be able to run a script that would keep track of which flies first appeared when and then you should be able to zero in on the clock drift after watching files pop up all night. 

But, anyway, the computer nerds had invested an extraordinary amount of thought into managing times over far-flung networks, and had it pretty well figured out long before GPS was even dreamt of. The ResMed engineers obviously put some considerable thought into how to manage the problem that the date rolls to the next day in the middle of the night which you want to be all part of “one night’s sleep”. And what they came up with is not stupid. So they solved the hard problem but didn’t think about the easy problem!