Skip to main content
This topic has been closed for replies.

12 replies

EHuse
Visitor II
March 12, 2019

I am trying to use this guide to test access to the server and am having trouble. We are using the Teseo-LIV3F device. I have been able to get a password from the device using the $PSTMSTAGPS8PASSGEN command. But trying to access the server using that password and device id returns a 401 Unauthorized.

Application note AN5160 sections 4.1.1.4 implies that a password needs to be assigned by a location.io administrator. Is this no longer true and there is no requirement to first contact location.io?

Technical Moderator
March 12, 2019

Hi

The AN5160 is a generic application note which covers all the TeseoIII IC and modules.

In case of TeseoIII IC a dedicated account has to be provided for each customer.

In case of Teseo-LIV3F, the module has a dedicated account assigned on location.io system.

You can follow the presentation (link) to test your access to location.io.

Thanks

Regards

Francesco

EHuse
Visitor II
March 12, 2019

Hello,

Okay so that is good to know. So this is what I am attempting to test from a PC running Ubuntu. I'm using Curl but without the proxy setting. Can you look at this and tell me if I'm doing something incorrectly?

curl --verbose --header "Content-Type: application/json" --header "Accept: application/json" --header "Authorization: RXN-SP cId=ZYDLLXxEH94dEeX2,mId=MYST,dId=00513730383638361400759E,pw=xrhjr7hbCP464UpZdA0Oxearolh8DX++JpbRXdwxcJk=" --data "[{\"ee\":{\"version\":8,\"constellations\":[\"gps\"],\"seedAge\":0}}]" http://stm.api.location.io:80/rxn-api/locationApi

*  Trying 72.51.26.210...

* TCP_NODELAY set

* Connected to stm.api.location.io (72.51.26.210) port 80 (#0)

> POST /rxn-api/locationApi HTTP/1.1

> Host: stm.api.location.io

> User-Agent: curl/7.58.0

> Content-Type: application/json

> Accept: application/json

> Authorization: RXN-SP cId=ZYDLLXxEH94dEeX2,mId=MYST,dId=00513730383638361400759E,pw=xrhjr7hbCP464UpZdA0Oxearolh8DX++JpbRXdwxcJk=

> Content-Length: 59

* upload completely sent off: 59 out of 59 bytes

< HTTP/1.1 401 Unauthorized

< Content-Language: 

< Content-Type: text/html

< Date: Tue, 12 Mar 2019 15:14:22 GMT

< Content-Length: 994

* Connection #0 to host stm.api.location.io left intact

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Error report</title><style type="text/css"><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 401 - Unauthorized</h1><hr/><p><b>type</b> Status report</p><p><b>message</b>Unauthorized</p><p><b>description</b>This request requires HTTP authentication.</p><hr/></body></html>

Technical Moderator
March 12, 2019

Looking the field they seem correct to me.

Did you evaluate the <gpsTime> to create the password? It's the  current time expressed in the number of seconds since midnight 06-Jan-1980

Thanks

Regards

Francesco

EHuse
Visitor II
March 12, 2019

That leads me to a question. Do I need to update the password every time I access the server? If so, how many seconds is a password valid for? Right now for my test I'm doing things by hand. Sending the command to the chip on our board, then copy/paste the result into my PC to run the command.

I tried the test again with keeping the time as close as possible and it still failed. I'm using the GPS seconds reported from this web site http://leapsecond.com/java/gpsclock.htm

I did experiment with the $PSTMSTAGPS8PASSGEN  and it returns the same password for wide ranges of seconds but does eventually change with a large enough number change. So I'm guessing that the same password is valid for some length of time.

Technical Moderator
March 13, 2019

Hi

> Do I need to update the password every time I access the server?

Yes. You do.

> If so, how many seconds is a password valid for?

each password is valid several minutes (~10 minutes)

Regards

Francesco

EHuse
Visitor II
March 12, 2019

Okay, so that website was giving me a bad number for seconds. :) I found the right value and generated a password and it worked fine.

But I still have the question of how long a password is valid for? I'll probably reset it everytime we power up so not a big issue.

Thanks for your help.

EHuse
Visitor II
March 12, 2019

Okay, so I have a response coming back from the server now. But I'm a little confused about what to do with the data coming back. I see some NMEA commands listed to program seeds. I see the command $PSTMSTAGPSSEEDBEGIN, $PSTMSTAGPSBLKTYPE can be used. I assume this is programmed with the "seed" value coming back in a JSON response?

Does this data require an initial general location? (i.e. using cell site or wifi address)

There is also a command $PSTMEPHEM, which can program ephemeris data? Is this command still used?

Technical Moderator
March 13, 2019

Ciao

From location.io you can access two kind of data:

  • Real-Time ephemeris data
  • Extented ephemeris (to predict 2weeks ephemeris data)

Which data you download depends on the HTTP_REQ you did.

iolocation provides you a JSON file.

The JSON file has to be parsed to fill the '$PSTMSTAGPSSEEDBEGIN, $PSTMSTAGPSBLKTYPE' (for Extended Ephemeris) or $PSTMEPHEM (for Real Time data) command and inject the data into the Teseo-LIV3F.

BUT the JSON-File description is under NDA (you can read a subset in the AN5160 which is public)

To avoid NDA as ST we prepared a prebuilded library available in the X-CUBE-GNSS1 (the STM32 drivers but the Library is ARM-Cortex-M0 oriented to be portable) to provide a library which parses the JSON file and injects the data in Teseo-LIV3F

EHuse
Visitor II
March 13, 2019

Okay, now I'm a little overwhelmed. I think I have found the X-CUBE-GNSS1 package and downloaded it. But there's a lot of code there.

Are you saying that to use A-GPS we need to link in a pre-built library into our code base that will parse the JSON responses?

Our board uses a QCA9558 processor and we are running a version of OpenWRT on it.

EHuse
Visitor II
March 21, 2019

From my example line above, the $PSTMEPHEM is generating the error. Actually any of the lines I've generated (both PSTMEPHEM and the PSTALMANAC) return an error. I'm doing a RT-assistance request for GPS data.

Here is a response that I got... (my translation to PST command is below)

{"rtAssistance":{"body":[{"GPS:1NAC":"HwAD\/QBKKGABAAAALQAtAAA3hHYAlCAcAGAb0XNZDAAAYK4A\/73\/+e4kCUUzFU9CKDAH9ARc\/qMIHqENM\/9grgAZ\/6O5ls2U\/+Uns57lJugb3vFT\/\/+jiQVZAQP9AEooYAEBAABjAGMAAD+EdgCUIBwAYBvRc1nUAABgrgD\/rP\/6dWQJ5TUpWzaM9QgzCbCWiwkjoQ1Wr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j9PQAAAKEM0wAK4SIAH0E2AAOgCv6uAAEPWJQAkBrz\/UIAAAChC\/UAZ3scABampwBJ4j\/\/4\/\/\/EGmWAJAbPP1qAAAAoQ1q\/5DLyP+6GsYAJRBhAB0AAhF7vACQBub9PQAAAKENUv+3VfkAODl6\/8UbVQAnAAESTXwAkBnH\/WoAAAChDLn\/kq9CADd8n\/+Xm1X+nQABEyO5AJD39\/0YAAAAoQzf\/98lXgBeYDD\/wSGlAiUAABTK8wCQAzH9PQAAAKENuv+2+kj\/xHsH\/4XgqP8SAAIVO60AkPXb\/RQAAAChC9P\/4SNt\/8cZ8QAIpYn9Qf\/+Fmo6AJAA3\/1PAAAAoQyQAA3jWv+i8VX\/7fwy\/zYAABdDmQCQ\/bH9LAAAAKENWgA3R1oAGJJB\/9pZ0\/+9AAAYRKUAkBKB\/TIAAAChDXcAZB9kACOSBP+KkfD8+\/\/\/GR5\/AJAGU\/0iAAAAoQwfAGMBvAAF5xMAb6afAKUAAxo4jACQF6r9ZAAAAKEMyf+OhlcAEkZ4ACd4R\/+f\/\/4bnNkAkBpD\/UIAAAChDTQAZ6TV\/8QWBQBJNbwDJAAAHAbWAJAcKv1tAAAAoQwY\/5E+1wA7slQASVZ5AP7\/\/h0e4wCQ\/y79KwAAAKEMcwA7HDT\/hScw\/7aWh\/+z\/\/4eS64AkAuf\/T4AAAChDEAAOnwX\/\/\/TqP+l8lgANf\/\/HxaLAJAJpv1YAAAAoQ3IAA5U6P+W5xEAQ5Vp\/1EABQ=="}],"status":200}}

And here is my list of decoded commands

Send $PSTMEPHEM command...

$PSTMEPHEM,1,64,fd07ae60ae602d2d2d64150089a56e004509e8261e08f407e5ffa3ff15330000e5a0227ba3ffcb57ff347cf43029b1a294cf050d53f34d6f0c00bdff24efe803*55

$PSTMEPHEM,2,64,fd07ae60ae60636363f415001ca86e00e509ba23230933087bff5f0029350000590b497a8b971f5daf577cf4f58da5aebc10470a7808d20bd400acff6476e913*58

$PSTMEPHEM,3,64,fd07ae60ae606b6b6bb4e7002aa66e0040f3331e0c0f61f423001f00043400001a68a77a86b86d5484797bf4c0782b7cf2738437c5744d6b050008005c21f513*54

$PSTMEPHEM,5,64,fd07ae60ae6037373788ec0014a56e005ef30920140c0df5dfff56002f370000b44c1e7ae6f348564e327cf4c33ae61a052e7636c39a3570e8000000ed0aef03*50

truncated to keep the post length down.

EHuse
Visitor II
March 21, 2019

Okay, this may actually complicate the issue more, but I noticed that the response I get back from the Curl request does not have the outer set of brackets "[]". If I add these into the message before I decode it, the JSON parsing crashes with a segment fault on my PC. One of the string compares locks it up.

I noticed this when I added the "seed_valid()" function into my code and it rejected the JSON message because it did not have the outer set of brackets.

EHuse
Visitor II
March 21, 2019

Another question, is the STAGPS on by default?

Does the setting of its state via the $PSTMSTAGPSONOFF command survive a power cycle?

EHuse
Visitor II
March 21, 2019

Also, what is the default value of $PSTMSTAGPSSETCONSTMASK? Do I have to set the mask to make the STAGPS work properly?

EHuse
Visitor II
March 25, 2019

When I issue a cold start ($PSTMCOLD) to the device, it seems that I must wait around 30 seconds before I send $PSTEPHEM commands to it. Is I send them earlier, I get an OK response but the if I dump the ephemeris, it does not seem to have stored the data.

Technical Moderator
March 26, 2019

Ciao

There should be some issue in the parser and the '$PSTEPHEM' commands raised are not acquired by Teseo (which remains with an empty almanc/epemeris data-base).

The 30 seconds you see is the standard TTFF from COLD the data you receives after 30 seconds have been just downloaded from satellites.

For sure you have the antenna connected.. If you unplug the antenna... after 30 seconds you will have still an empty database.

Regards

Francesco

Technical Moderator
March 26, 2019

FYI: the ephemeris and almanac data injection have to be anticipated by an PSTMINITTIME.

Generally the NMEA script should be like:

$PSTMINTTIME...

$PSTMALAMANC...

..

$PSTMALAMANC...

$PSTMEPHEM

..

$PSTMEPHEM

Did you add the PSTMINITTIME?

Ciao

Francesco

EHuse
Visitor II
March 25, 2019

Another question, there are options to program realtime Ephemeris, Almanac data, and the "synthetic" data. Is it necessary to program all of them from the server data.

Right now, I'm just programming the real time Ephemeris data ($PSTEPHEM) and it doesn't seem to help that much in getting lower time to fix.

Technical Moderator
March 26, 2019

Ciao

> Is it necessary to program all of them from the server data.

No it isn't necessary.

> Right now, I'm just programming the real time Ephemeris data ($PSTEPHEM) and it doesn't seem to help that much in getting lower time to fix.

I think the data injected have been rejected.

Regards

Francesco

EHuse
Visitor II
March 28, 2019

Hey again,

I have verified that the PSTEPHEM commands do respond with $PSTMEPHEMOK*4B. I also do a ${PSTDUMPEPHEM) to verify that all 31 GPS satellites have been programmed. So I'm fairly sure that the data is being programmed into the chip okay.

I also had the device get a lock without any preprogrammed ephemeris data and dumped the ephemeris data from the chip. Then I generated the ephemeris data from the server and compared the 2. Many data lines were identical and all of them were similar. I assume the ones that changed were just due to the ephemeris data being updated on the server before the chip got it.

So I think I'm programming the ephemeris data okay but it doesn't seem to help much with time to fix.

Warm starts are very quick for time to fix. Also doing a cold start without erasing the ephemeris data ($PSTCOLD,0xC) is quite quick.

So I'm at a loss on what to do next. I don't understand why programming the ephemeris data isn't really helping on a cold start.

I could try adding the GLONASS satellites to the server data but the difference in endianess means I pretty much have to redo all the bit fields in the message. It's a lot of work to port the messages to a different platform.