<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nrf9160 modem XFILEWRITE gps almanac</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62872/nrf9160-modem-xfilewrite-gps-almanac</link><description>Hi, 
 I see in the nrf9160 1.2.0 AT document there is a command XFILEWRITE that suggests the GPS almanac can be written and persist in the modem. 
 Can you provide more documentation on this command and the format of the data you can write? 
 I&amp;#39;d like</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Dec 2021 12:52:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62872/nrf9160-modem-xfilewrite-gps-almanac" /><item><title>RE: nrf9160 modem XFILEWRITE gps almanac</title><link>https://devzone.nordicsemi.com/thread/342719?ContentTypeID=1</link><pubDate>Thu, 09 Dec 2021 12:52:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45b7d41f-3fca-4370-b33c-aecc70feceb6</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;For anyone looking around for something similar to this feature, &lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/6353"&gt;here&amp;#39;s the pull request implementing support for minimal GNSS assistance&lt;/a&gt; consisting of factory almanac, time (from LTE network), and rough location based on MCC.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem XFILEWRITE gps almanac</title><link>https://devzone.nordicsemi.com/thread/293693?ContentTypeID=1</link><pubDate>Wed, 10 Feb 2021 08:41:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:deecee82-9d32-441b-b538-7ee8a94889fb</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;Okay, thank you for clarifying.&amp;nbsp;If you populate the following struct &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.4.2/subsys/net/lib/nrf_cloud/src/nrf_cloud_agps.c#L436-L443"&gt;here &lt;/a&gt;and include it in your application, that shoud let you get time to the GPS module as you describe it. We don&amp;#39;t have an example project doing this as you describe it yet, so it will have to be added manually I&amp;#39;m afraid.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem XFILEWRITE gps almanac</title><link>https://devzone.nordicsemi.com/thread/293490?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 09:11:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32252178-c15d-4180-b7f3-905cc8576d19</guid><dc:creator>LordLucan</dc:creator><description>&lt;p&gt;Thanks for prompt reply. I should have been clearer with the question.The original thread was to do with TTFF for the GPS. Let us suppose I have the current time by sme means. I need to get this current time into the nrf9160 GPS module _without_ doing a complete AGPS SUPL session. How do I get the time into the GPS module to achieve faster TTFF ?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem XFILEWRITE gps almanac</title><link>https://devzone.nordicsemi.com/thread/293484?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 08:36:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bb7890c-ac77-4e1c-8a0c-a564a286ab6e</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi You can get time from the LTE by subscribing to time notifications using the &lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/nw_service/xtime.html"&gt;%XTIME AT command&lt;/a&gt;. Alternatively, you can get the time (somewhat slower) from the GPS as well.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem XFILEWRITE gps almanac</title><link>https://devzone.nordicsemi.com/thread/293314?ContentTypeID=1</link><pubDate>Mon, 08 Feb 2021 11:48:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce89f7bc-597a-47e3-95c5-3a51e1741ecc</guid><dc:creator>LordLucan</dc:creator><description>&lt;p&gt;I&amp;#39;m just returning to this thread after a while. As suggested I&amp;#39;d like to get the current time into the GPS on startup. What is the recommended way of doing this?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem XFILEWRITE gps almanac</title><link>https://devzone.nordicsemi.com/thread/258082?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 11:40:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f73c6e5b-12ef-4215-b076-42a3a4c1c9a1</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Paul&lt;/p&gt;
&lt;p&gt;The reason you might not have seen it work initially is that the device needs to fetch the almanac initially. This takes ~12.5 minutes of continuous GPS reception if it&amp;#39;s fetched from a satellite. It can also be fetched by AGPS, which I guess you have done in your latest reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In order to utilize the almanac/ephemeris to speed up TTFF optimally, coarse time and place are needed as well. The device will have both if it made a successful fix recently (less than 30 minutes ago). The coarse place is also stored in Flash at a graceful power-down. However, time can not be stored, so at power-up, you&amp;#39;ll need to get the coarse time from somewhere, either LTE or an external source, and inject it to GPS to speed up TTFF.&lt;/p&gt;
&lt;p&gt;As for the constants you&amp;#39;re referring to, it should not be a problem on the GPS side of things to inject this from the application. Question is, where would you like to get these from, and how. All of them can for example come from AGPS, but if you don&amp;#39;t want to use SUPL or MQTT, I suppose you&amp;#39;ll have to get it from a PC. The almanac can be injected with some&lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/intro.html"&gt; AT command&lt;/a&gt;, and time can be fetched from the LTE modem with an AT command and then injected.&lt;/p&gt;
&lt;p&gt;Please note that we&amp;#39;re entering the summer vacation period here in Norway, so delays must be expected as we are low on staff for the month of July. Sorry about the inconvenience!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem XFILEWRITE gps almanac</title><link>https://devzone.nordicsemi.com/thread/257851?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 13:10:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a214f979-1a8b-40a4-a3c4-5b5222bb2069</guid><dc:creator>LordLucan</dc:creator><description>&lt;p&gt;I&amp;#39;ve also done a bit more work on this trying to discover why gps TTFF is so slow.&lt;/p&gt;
&lt;p&gt;What I&amp;#39;ve noticed with the GPS SUPL sample is that in nrf_scoket.h there are a number of constants NRF_GNSS_AGPS_* that are used to write AGPS data to the modem. Thinking about this a bit more maybe the issue is that from a cold start the GPS modem needs to get either the current UTC time or an approximation of the current location for faster TTFF.&lt;/p&gt;
&lt;p&gt;So I&amp;#39;ve now modified your GPS sample to filter out NRF_GNSS_AGPS_EPHEMERIDES and NRF_AGPS_ALMANAC. If I do this then the GPS locks quickly in a few seconds still. So, I&amp;#39;m thinking that almanac/ephemeris data is persisting but what is required is either position or time to be uploaded to the modem.&lt;/p&gt;
&lt;p&gt;So the question is. Can you please document or point me to the details of the data formats for the NRF_GNSS_AGPS_* constants? I&amp;#39;d like to set these myself without having to connect to the supl server.&lt;/p&gt;
&lt;p&gt;Just generally, Nordic have done a great job with the nrf9160 but we as customers should not be having to reverse engineer how the GPS works in order to get good performance. This should all be documented somewhere.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem XFILEWRITE gps almanac</title><link>https://devzone.nordicsemi.com/thread/257785?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 10:55:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:361f6682-a486-4258-88b8-17a79347cabe</guid><dc:creator>LordLucan</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry, but I&amp;#39;m not convinced this is working at all. Either I&amp;#39;m not shutting down the modem correctly or the almanac/ephemeris is not being preserved.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To recap, I&amp;#39;ve now modified your gps sample to send to the modem AT+CFUN=0 once a fix is obtained. Hoping that the alamanac/ephemeris will be preserved. Now ...&lt;/p&gt;
&lt;p&gt;1. If I run your gps sample with SUPL support an LTE connection is made, SUPL data comes down, is written to the modem. The gps then gets a fix within seconds. That&amp;#39;s great. Once a fix is obtained I close down the modem by sending AT+CFUN=0. I also wait for a valid OK from the modem. If I then reset the board with LTE turned off, so no SUPL data is fetched, then gps does not get a fix, or if it does it takes many minutes.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2. If I compile out SUPL support, then reflash your app again GPS TTFF is very intermittent if at all. I have to wait somtimes upwards of ten minutes to get a fix. This is after doing 1. I would expect from your description the almanac/ephemeris to persist in flash over a reset and be loaded back again. I&amp;#39;ve no evidence this is happening.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In summary the only way I can get a fast TTFF is to pull down SUPL data over LTE and write this to the modem. I&amp;#39;m not at all convinced the data is being preserved.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Modem firmware version is 1.2.0. GPS antenna is on open land, not indoors.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you please consult your GPS expert on how to preserve the almanac/ephemeris. Also, can I read it back using your socket library to check it?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem XFILEWRITE gps almanac</title><link>https://devzone.nordicsemi.com/thread/256588?ContentTypeID=1</link><pubDate>Wed, 24 Jun 2020 07:54:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d8ed97d-bce3-43c3-81ca-5a0d450b1567</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Paul&lt;/p&gt;
&lt;p&gt;A graceful power-down in this context is referring to a graceful power-down of the modem, as specified in the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.2.0/nrf/ug_nrf9160.html?highlight=graceful#network-mode"&gt;documentation here&lt;/a&gt;. If you&amp;#39;re powering down the modem by using AT+CFUN=0 the almanac will be stored to flash.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem XFILEWRITE gps almanac</title><link>https://devzone.nordicsemi.com/thread/256364?ContentTypeID=1</link><pubDate>Tue, 23 Jun 2020 09:44:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d3721c9-008a-4018-8518-f0dc2ef931c8</guid><dc:creator>LordLucan</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for this. What do you consider a &amp;quot;graceful power-down&amp;quot; of the modem, can you elaborate please?&lt;/p&gt;
&lt;p&gt;How can I tell whether the almanac/ephemeris is out of date or not? ie when was it last updated?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not seeing any evidence at the moment that this data persists. In the GPS sample with SUPL support the data is _always_ fetched. That is the modem sends out a NRF_GNSS_AGPS_DATA_ID request with just about all flags set. If the data is fetched then TTFF is very short, a few secs. If not then it can take about 30s. So clearly the data is not persisting at the moment.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem XFILEWRITE gps almanac</title><link>https://devzone.nordicsemi.com/thread/256348?ContentTypeID=1</link><pubDate>Tue, 23 Jun 2020 08:59:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dfccbc5f-b7e3-496d-8c6b-e8380b079484</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Paul&lt;/p&gt;
&lt;p&gt;The GPS almanac/ephemeris data is stored into flash &amp;quot;by default&amp;quot;. Flash storing of data happens regularly but rather infrequently (every 8 hours), but also on &amp;quot;graceful power-down&amp;quot;. So the ephemeris and almanac data sit in RAM until either of the above happens. If the power-down is not graceful (e.g. battery is forcefully removed or upon a crash), the data will be lost.&lt;/p&gt;
&lt;p&gt;Almanac is valid for months, so if it has at least once been stored in the not too distant past, it&amp;#39;ll still be valid, even if there&amp;#39;s a subsequent non-graceful power-down. Ephemerides are renewed every 2 hours regardless of whether it has been stored to flash or not.&lt;/p&gt;
&lt;p&gt;If you need to store this data to flash more frequently, I guess you could call the XFILEWRITE AT command in order to do this manually upon, I.E. lost LTE connection or similar.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>