Sending Assisted GNSS (A-GNSS) to Bangle 2 GPS (AT6558) #7026
Replies: 1 comment
-
Posted at 2021-12-30 by @fanoush did you get some data from their servers? I tried it like half year ago and the trial user/password worked to get agps data, but last time I tried (week ago?) it did not work for me Posted at 2021-12-30 by HughB
Just tried it and I got.
Posted at 2021-12-31 by @fanoush yes, same result, this worked for me some (long) time ago. I am not so optimistic about support case but yes we can try to contact them that the example does not work. I guess the right solution in the long run may be to get own user/password for bangle or figure out the one that is used by original Q3 firmware/android app. Posted at 2022-01-01 by HilmarSt Please provide the links to the Q3 firmware / App. Posted at 2022-01-01 by fparri I think this is the Android app: https://play.google.com/store/apps/details?id=com.sma.smartv3 Posted at 2022-01-01 by @fanoush I use "Join Fit Watch" with Q3, that one was linked in manual that came with it. Posted at 2022-01-01 by fparri Ah perfect! Thanks for pointing out, Fanoush :) Posted at 2022-01-02 by HilmarSt Thanks user137757 and Fanoush. Posted at 2022-01-02 by HughB That would not surprise me, especially if the watches all use the same chip, plus would expect quite a bit of commonality across manufacturers and suppliers of AGPS data. Posted at 2022-01-05 by @gfwilliams Thanks - this looks really promising. If you can find a URL @HilmarSt I can set my server up to grab data off it once a day and host locally, which is what I do for UBlox AGPS on Bangle.js 1. I'm not sure, but for UBlox you literally just stream the file you downloaded straight to the GPS chip - it contains all the commands already. It is possible that this one is similar too... Posted at 2022-01-05 by HughB I read the code and its seems to construct the necessary UBLOX commands in the javacript that is embedded in the HTML interface. We would have to work out the necessary CASIC commands to do this. I am working on trying to get a checksum function working for CASIC. Should get back to that soon, but I am back at work now so its the odd hours in the evening now. Posted at 2022-01-05 by @fanoush
it is not like ublox which makes it public at http://alp.u-blox.com/ Attachments:
Posted at 2022-01-08 by HilmarSt Just a crazy idea: While searching the internet for "gnss-aide.com" it seems that also ublox devices use this service. Which AGPS provider does the Bangle.js 1 use? Posted at 2022-01-08 by HughB There's a working bit of code that does a AGPS load written in C for the AT6558 that demonstrates how to send the CASIC commands for AGPS. What we need are the checksum calculation writing and the AGPS Bangle1 app cloning to use the CASIC commands. If a simple bit of javascript can be written that will load 1 set of AGPS data onto the B2 then I am sure someone would be able to do the web wrap. There is a lot of stuff I dont understand in the web wrap for the Bangle1 AGPS App, but I can see how it works from a UBLOX perspective. I was working on the checksum function but got sidetracked with analogue clocks etc :) Posted at 2022-01-08 by @fanoush ther is no standard for com port over BLE but it could work with something like https://github.com/Jakeler/ble-serial if bangle would make gps serial available over bluetooth as one of those ble serial adapters (like HM-10) which is quite easy. However I guess the data received from that password protected agps service could be simply written to the gps as is. But still that GnssToolKit3 tool could be interesting to use. Posted at 2022-01-09 by Mark_M It would be very nice to have such gateway. Because that would allow to update AT6558 firmware. Currently it is quite outdated. Some CASIC commands work, some do not. I even cannot figure out how to see SW version.
It returns ACK-NACK Posted at 2022-01-09 by Mark_M It would be very nice to have such gateway. Because that would allow to update AT6558 firmware. Currently it is quite outdated. Some CASIC commands work, some do not. I even cannot figure out how to see SW version.
It returns ACK-NACK When I try to query via CFG-MSG, it again returns ACK-NACK
Some messages return ACK-ACK, but never return result payload. Posted at 2022-01-10 by HilmarSt
I've tried to find one in the .apk and in .dex -> .jar -> .java but with no success. As the communication with www.gnss-aide.com seems to be not encrypted, there should be a good chance to find the URL in the communication of the Android App with help of the Wireshark protocol analyzer. Posted at 2022-01-10 by @fanoush
you can also just setup a http proxy for network connection in android an check proxy logs
If you can use SWD it is possible to flash original Q3 firmware to bangle 2 and later revert back. With a bit of luck and experience it is possible also without SWD, but you already know that if it is your case ;-) I can PM you direct link to Q3 firmware DFU zip on their servers if you know what to do with it. It needs softdevice S140 6.1.1 which is not the one used currently for Espruino. Posted at 2022-01-10 by @gfwilliams Well that's irritating - I just tried here with an unflashed Q3 and despite setting up a proxy with a trusted certificate, the app doesn't trust it. However when I try to update the AGPS it requests some API at SMA by the look of it, so I doubt it goes direct. Although we may be able to get the GPS data second-hand from SMA's servers. @HilmarSt were you looking in the code for a gnss-aide.com address? What about if you try and look for some GPS-related API access? Posted at 2022-01-10 by @fanoush
I think you need rooted phone and put certificate to system partition for it to work for android 7 and up. however proxy only for http could work? https://stackoverflow.com/a/22040887 or see https://docs.mitmproxy.org/stable/howto-install-system-trusted-ca-android/ but I guess using device with android <7 may be easier? Posted at 2022-01-10 by HilmarSt fanoush, thank you very much for the offer. Posted at 2022-01-10 by HilmarSt
I've used a .dex to .java decompiler and did a full text search in the sources. Maybe someone is able to solder 2 wires to the serial port of the GPS hardware in the Q3 watch and capture the AGPS data from there... Posted at 2022-01-10 by @gfwilliams Well that was painful, but: Posted at 2022-01-10 by HilmarSt Nice:
I'm number 7 of 1000 allowed downloaders. How did you do that? Posted at 2022-01-11 by Mark_M Now I see why the CASIC protocol is so poorly documented. Many functions do not work as documented. No firmware updates, etc... Posted at 2022-01-11 by Mark_M
me too :) I suspect the bin is something specific to CASIC. I do not know what it is for. You can also download big EPO from
https://www.reddit.com/r/Garmin/comments/hyg0l5/manual_gps_epobin_update_with_garmin_offline_for/ so it probably needs to be shrunk to the first 258048 bytes. Posted at 2022-01-11 by pelrun Well that ble_epo_offline.bin file is just a bunch of CASIC MSG-GPSEPH/MSG-GPSION/MSG-GPSUTC messages with a text header. So there's nothing too tricky about it. If the chip accepts it we could even build it ourselves using data from another service (e.g. supl.google.com) or pulled from another gps unit. Posted at 2022-01-11 by Mark_M According to CASIC docs MSG-GPSEPH/MSG-GPSION/MSG-GPSUTC messages are "type cycle" (read-only). Is it possible to set that data using these messages? May be these are to dump a sort of backup? Posted at 2022-01-11 by Mark_M actually if you download AGPS.zip from https://www.icofchina.com/xiazai/# and then translate Chinese docs, there are descriptions how to load Long Term Ephemeris data. I assume it is the larger DAT file in YYYYMM subdirectory. Posted at 2022-01-11 by pelrun I can completely parse the ble_epo_offline file, and it doesn't make sense for these messages to be used if they're really read-only. It's possible they've been nasty and added extra checksum values in the reserved fields that have to be correct in order to accept the message. I'm not yet convinced the .DAT files are useful; they're either obfuscated or they're a completely unknown format. Edit: just read that paper Mark_M cited - that's definitely the same format, and since it's for a Mediatek GPS chipset it looks like those files are intended for another SMA product that uses it - not useful for us. Posted at 2022-01-11 by @gfwilliams
My guess is that SMA download off of CASIC's servers, and just copy it to their own server every few hours. That way everyone gets the same file, they don't go past their download limits or distribute their username/password.
Ok, so are we saying we just strip off the header and stream it direct to the GPS? Regardless of what they say in the docs, it'd be easy enough to test if it decreased the time to get a fix. edit: Just to add that I'm not sure what 'read only' means in this context, but you'd expect the almanac data to only be written to RAM (not flash)? After all, it'll be kept as long as the battery doesn't go flat, which is what happens to the almanac data that is read direct from the GPS Posted at 2022-01-11 by pelrun It's volatile data, definitely. Standalone GPS units invariably have a ram backup battery to keep the most recent almanac/ephemeris/location/time data to allow a warm boot, but I'd expect the watch to be designed to keep the gps warm off the main battery even when disabled (it's microamps or less) or else the software needs to cache the AGPS data and feed it back in when necessary. The other part of improving the TTFF is having an approximate location/time to start from, which obviously isn't part of the ephemeris data. The AGPS.zip file has code that builds an AID-INI message that has that in it, so I think the full solution is going to need both parts. Posted at 2022-01-11 by Mark_M There are NMEA (CAS00) and CASIC (CFG-CFG) commands that allow to clear, save and load configuration information to/from the chip internal flash.
When I pushed last 3 messages from the file I've got NACK for 0x08,0x07 and ACKs for 0x08,0x05 and 0x08,0x06
Posted at 2022-01-11 by HilmarSt Does a particular message always gets NACK - even when sent in a different order or with pauses between them? Posted at 2022-01-11 by Mark_M I am more afraid that size of the message can be a factor. Can Espruino split the array making it not a byte buffer, but rather an associated array due to free RAM fragmentation? Posted at 2022-01-11 by pelrun The paper and links you've found make it very clear that the .DAT files are specifically for Mediatek GPSes. Since we don't use one of those there's no point chasing that red herring. I just tried the three messages you listed myself and got ACK-ACK for all of them. Posted at 2022-01-11 by pelrun Incidentally, I had to turn off all the NMEA messages with CAS03 before I got reliable responses from the CASIC commands. Posted at 2022-01-11 by Mark_M
is this file for Mediatek? https://api.smawatch.cn/epo/202201/m2_epo_offline_2022-01-11_847f4858827d0765e0402b8d7158c0aa.DAT
That is good! May be I just need to restart the watch to defragment RAM. Posted at 2022-01-11 by HughB
Can you share the command string for this. I could not get them to shut up at all. Posted at 2022-01-11 by Mark_M
Posted at 2022-01-12 by @gfwilliams
On Bangle.js 2 I seriously doubt available RAM is a factor you have 256k - and every time you load a new app, RAM is cleared, so defragmentation will not be an issue.
Interestingly looking at the watch firmware, it pretty much only ever seems to send:
Which is setting it to GGA only? I wonder if that helps with power usage at all... Posted at 2022-01-12 by @gfwilliams I posted this up in some previous conversation, but had trouble finding it now, so: geary/AnyTone-D868UV#61 Some interesting info about improving time to GPS lock there Posted at 2022-01-12 by Mark_M Basically the advise there is - turn off Beydou. Posted at 2022-01-12 by @gfwilliams As far as I can tell from the board I have here it's fine - the antenna arrangement is very different but the two connections look fine. Honestly, I think if the antenna wasn't connected you wouldn't see any GPS lock. I've just updated the AGPS app on https://espruino.github.io/BangleApps/ and it should now work with GPS. Hopefully it also turns off Beidou. Not sure if I missed this discussion elsewhere (there seem to be a bunch of threads open now) but in https://www.icofchina.com/d/file/xiazai/2017-05-02/ea0cdd3d81eeebcc657b5dbca80925ee.pdf there are some interesting NAV-PV/NAV-TIMEUTC commands that I guess may really help. The commend in the ... also that GitHub link I posted shows some other (undocumented) form of ASCII lat/lon string that the device they have is sending. I guess one option is I reflash a dismantled Q3 that I have, solder onto the GPS RX/TX wires, and then try and run AGPS and see what commands are actually sent to the chip Posted at 2022-01-12 by Mark_M If you are talking about the string after PCAS04 Posted at 2022-01-12 by BartS23 I have tried the AGPS update on my Bangle 2. Unfortunately, I no longer get any GPS messages. I tried a reboot, reboot without code and factory reset.
Posted at 2022-01-12 by Mark_M you receiving GPTXT. So your GPS is fine. Try to enable messages via $PCAS03, i.e.
Posted at 2022-01-12 by @gfwilliams Thats an odd one, because I've run this on several devices here and it's been fine. Were you experimenting with it before and could you have run PCAS03 yourself? Posted at 2022-01-12 by BartS23 Thanks for your Help! $PCAS03 solved my problem. I did a little experimenting yesterday. But afterwards I was sure that it still worked. Posted at 2022-01-13 by Mark_M @gfwilliams
Posted at 2022-01-13 by @gfwilliams
I don't think so - I honestly think they don't know much more than us. Ideally we'd contact Hangzhou ZhongKe (the chip manufacturers) Posted at 2022-01-13 by pelrun Also I'm not sure what you're asking for out of this hypothetical firmware and documentation that we don't already have. So far what I've tried out of the existing documentation has worked, and anything that doesn't is unlikely to be rectified. Posted at 2022-01-13 by Mark_M I have two CASIC documents v3.6 and v4.2. Many CASIC commands do not work.
always returns NACK
it also returns NACK If such a simple command does not work, it looks very suspicious to me. Posted at 2022-01-13 by pelrun Is there a specific feature you're trying to access? At the moment it just looks like you're fishing. Also, as someone who has worked in the commercial embedded world for many years, "SMA ... probably got all current docs, binaries and support from them. They, as a big customer, also can request firmware updates." is just fundamentally incorrect in every respect. Half the time the documentation is provided under NDA, the other half of the time the documentation simply doesn't exist at all. And finally, even if SMA had some secret firmware update they weren't bothering to pass on to customers, why would they turn around and give it to us? They might be a big customer, but we aren't. Posted at 2022-01-14 by Mark_M Sure I am "fishing". I've bought this watch for fun, not for business. It is not a question of life and death for me if some functionality is not documented, and some completely does not work despite it is documented. What I would try to use is RXM-SENSOR (0x03 0x07) - there is another accelerometer, gyroscope and thermometer. Posted at 2022-01-14 by pelrun It's not wrong to try and see what else you can get out of your device, but it's also important to temper your expectations. The documentation we have covers an entire class of devices with wildly different feature sets, and pricing to match. You get what you pay for, and SMA isn't going to spend extra on a chip with features they aren't intending to use or advertise. Heck, they probably designed the watch around the absolute cheapest option they had access to. So, some of the commands you're aware of are for features that simply aren't present in the AT6558 - RINEX is one of those things that a manufacturer is likely to charge a lot more for, as that's sought after for more expensive devices in narrow markets with much higher margins on them than the consumer GPS market, like professional survey equipment. That said, the datasheet does claim the AT6558 is suitable for DGPS use, so shrug And some commands are intended to give options to the hardware designer. There is no secret second IMU in the AT6558. Not even the more expensive chips have one. What they do have are spare pins on their IC packages that they can cheaply repurpose as a GPIO or serial bus expander. If you look at the datasheet you'll see several reconfigurable GPIO pins, including some that can be assigned as an I2c or SPI master. You can connect a separate device to these pins and then communicate with it via the GPS, which is useful if you've run out of pins on your primary microcontroller. This is explicitly called out in the datasheet in section 5.7 SPI - "SPI master device interface is used for connecting the SPI interface devices, such as MEMS sensors, FLASH, etc..". RXM-SENSOR is a convenience function for controlling an external IMU on this second bus - but since we already have an IMU directly connected to the nRF52 in the watch, this is unnecessary and therefore won't be connected to anything useful. Posted at 2022-01-14 by @gfwilliams
I provide you with what I know and the products of my work, for free. I'm not only doing that, but I work every day answering questions and improving Espruino for nothing more than the small profit I made on your initial purchase of the Bangle. I said the Bangle.js had GPS, I've made it so you can totally access it from code, told you the exact model number and even linked to a datasheet most of which works. That's far more than any other watch manufacturer I'm aware of. If there's not 100% accurate documentation then by all means go and find it yourself, contribute the result and I will happily add it to the docs so other users can find it. Posted at 2022-01-14 by Mark_M Hi Gordon, I appreciate what you are doing very much. Posted at 2022-01-14 by Mark_M
yes, this makes sense. Posted at 2022-01-15 by @fanoush
It is more that
Posted at 2022-01-15 by HilmarSt
That would be very nice. Posted at 2022-01-15 by Mark_M I've already implemented loading of the "small" file ble_epo_offline.bin Posted at 2022-01-15 by Mark_M the zip file is here. Attachments: Posted at 2022-01-15 by Mark_M interesting... Loading from file ble_epo_offline.bin some messages give NACK. For example, first always gives NACK. Second gives ACK.
Posted at 2022-01-16 by pelrun Also, in case you missed it, Gordon has already integrated uploading the ble_epo_offline.bin file using the Assisted GPS app, and it makes a massive difference for TTFF even if a few messages are silently failing under the hood. Posted at 2022-01-16 by Mark_M So, that is great!, the issue with AGPS is resolved. ( Unless we want to dig deeper trying to load the "big" file from here https://api.smawatch.cn/epo/202201/. I've looked into the file, its data structure is not clear. ) Yes I saw Gordon has announced this app. I've just looked into the code. It pushes the file content to Serial. When I tried to do this similarly, manually loading the bin file to storage and then just read it into Uint8Array and pushed the buffer to Serial as a whole, the Serial chocked with FIFO error after couple of messages. CASIC doc tells not to push next message before ACK message is received. I've done it this way in my experimental code, that parses the content and pushes messages one by one. It works ok, though some messages fail with NACK. But at least it does not chock. Posted at 2022-01-16 by pelrun I feel like we're going around in circles here; not sure how many times I need to reiterate that the .DAT files you keep pointing to are not for the AT6558. Posted at 2022-01-16 by Mark_M https://api.smawatch.cn/epo/ble_epo_offline.bin is for AT6558 Posted at 2022-01-16 by pelrun You're the one who posted the information definitively identifying those files as being for Mediatek chipsets, so I don't know what else to tell you. Posted at 2022-01-16 by Mark_M Mediatek's one was from http://epodownload.mediatek.com/EPO.DAT Anyway what would be a best or easiest way for Bangle2 app to download the SMA .bin file from URL, without a need to go to Apps site and run Assisted GPS manually? This way it can be automated. Because the .bin file is updated at least daily there. Posted at 2022-01-16 by HughB
I'm not convinced. The code for the AGPS app is here: Lines 137-141 handle Bangle 1 and send UBLOX AGPS data. Lines 142-155 handle Bangle 2 and only send a CAS04 NMEA command to select the type of GPS service. The code is incorrectly saying CASIC when these commands are NMEA protocol. The comments in lines 151-154, show that the author knows that to send AGPS to the Bangle 2 GPS chip you need to use the CASIC AID-INI (0x0B 0x01) message and this is not implemented yet. UPDATE: I should add that using the AGPS app sending CAS04 set to GPS only I did observe the first fix time to be about 1 minute which is perfectly fine for what I want and I could just modify my GPS touch app to send a CAS04 first. Posted at 2022-01-16 by Mark_M CASIC AID-INI is probably for other data. In the .bin file there are 32 MSG-GPSEPH (0x08 0x07) messages, for each GPS satellite. Then one MSG-GPSION (0x08 0x06) and one MSG-GPSUTC (0x08 0x05). The last one I'd probably re-craft with more current time, if it will work. Posted at 2022-01-16 by HughB
I assume you have sent these one by one manually. You probably only need a 30ms gap between each one. You can chain timeout or use promises. Or a really crude way.
On Bangle 1 - we just sent the data with enough delay and did not check for an ACK. Posted at 2022-01-16 by Mark_M
No, after one first message is pushed, when response is captured, I check if it is ACK class. If it is, I call pushing of second message, and so on, until the buffer's end is reached.
this code is very experimental. And parseCASIC(data) is not here. it is part of CASIC module I am working on. Posted at 2022-01-18 by @gfwilliams Thanks - sorry, if it seemed by response previously was a bit terse - it wasn't my intention :)
Yeah, that is actually a whole other issue. The idea is eventually the Bangle.js-specific Gadgetbridge app for Android will run the App Loader website internally. It should then be able to run the AGPS upload code in the background (maybe at midnight?).
@hughb I just don't understand. It is pretty clearly appending the data at https://github.com/hughbarney/BangleApps/blob/fa07467c4236409a00526254bce6c0ad35e5c623/apps/assistedgps/custom.html#L157-L160 and if you look with It seems users have reported it's working, so what exactly are you basing your assumption that it's not working/sending data on??
We went through this exact thing with Bangle.js 1 didn't we? Why does your app need to send the command? If you use the For GPS config we could just port the @Mark_M it may be that streaming the data over bluetooth slows things down enough that everything works ok? I guess to check we'd need to move to Serial2 and the print the responses though. Right now, we split the file into chunks of 128 bytes (https://github.com/hughbarney/BangleApps/blob/fa07467c4236409a00526254bce6c0ad35e5c623/apps/assistedgps/custom.html#L157-L160) - they're sent over serial and we actually wait for a response after the command has finished (that doesn't mean it's been sent over serial, but it does add a nice delay). I guess it would make a lot of sense to detect the chunks of data in the Posted at 2022-01-18 by Mark_M No problem :)
Wow, that is complex. Is it possible, may be via the GB, or another way, just to download a content from an URL?
I believe it would work better than just relying on 128 bytes chunks. Because end of previous message and beginning of next one can be inside a chunk. Regarding a pause. I am really missing it. Tried to implement sleep() in C, but got an error
Posted at 2022-01-18 by @fanoush
there are promises, setTimeout (just google 'javascript sleep') or in this case you can send next message in ack/nack handler of previous message?
To make fastest sleep ever? You can shoot yourself in the foot much easier in javascript via
this needs to run gcc behind scenes, you are probably copy pasting directly to console or directly upload file or compiler in WebIDE does not work for some reason. Posted at 2022-01-18 by pelrun The ephemerides are only valid for about 4 hours, so an upload at midnight is probably not too useful. @Mark_M, the docs explicitly say CFG commands require waiting for an ACK, all others do not. The AGPS data only uses MSG commands. This is probably because the CFG commands modify flash settings, which are a lot slower than anything that just goes into RAM. Posted at 2022-01-18 by @fanoush
some agps documents describe the procedure how to find out that gps has stale data and needs it, attached translations. the second one has chapter "when do you need AGNSS" with enabling status NMEA message for this and " If the time stamp is valid (non-zero) and the number of valid ephemeris is large (more than 8), there is no need to download the AGNSS" Attachments:
Posted at 2022-01-18 by Mark_M
promises are too cumbersome (for me :)). setTimeout is not blocking current "thread". Though it is possible to issue multiple growing timeouts for each message.
That is exactly what I've done. And this is the best way. Better than a "pause".
while loop will eat energy. Sleep supposed to halt CPU. Yes in case of single threaded it will stop everything. Question - will it stop UARTs?
yes :(. Understood. Posted at 2022-01-18 by Mark_M
may be. I've just preferred to wait for ACK. One may use "a pause" or a natural slowness of BLE serial. Posted at 2022-01-18 by Mark_M fanoush. This doc is about LTE. They supposed to be loaded via AID class. The .bin data we load via MSG-GPS* is probably not LTE. Though MSG-GPSEPH is ephemerides. Short term ones? Needs to check what that $PCAS06,L*67\r\n shows before and after .bin loading. Posted at 2022-01-19 by HughB
Ignore my previous statement on AGPS - I was plain wrong. I was looking for CASIC commands and checksumming. I did not realise that the download came pre-checksummed etc. The AGPS app clearly works and reduces the TTFF to 1 minute for me. Posted at 2022-01-19 by HughB
That would be the plan if we can get the CASIC commands to work. But not a lot of success so far by the sound of things. I've not been actively looking at it recently. Posted at 2022-01-19 by Mark_M there is some success, depends which commands do you need. Posted at 2022-01-19 by @gfwilliams
Not at the moment, but in the future it will be added. IMO using the App Loader is the less complex solution though as it means a lot less duplicated code, and less stuff running on the wath slowing it down :) @fanoush finding out when AGPS data is needed would be really neat. It would be handy to be able to flag to the user when an update would help - I wasn't aware it only lasted 4 hours - that's not ideal :)
In Espruino, there is just one thread. So if you're writing inline C code that puts the device to sleep and waits for an interrupt, lots and lots of things are going to start breaking (including handling Serial data from the GPS, which I think you care about). You can upload Inline C from the IDE (it's just not supported via the App Loader yet - you have to include the precompiled blob). Basically you just need to do what you're doing and wait for the JS data event. If you want to go deeper you'll have to compile your own Espruino firmware, and even then you have to work within the framework that is available - which means not blocking execution unless absolutely required. Posted at 2022-01-20 by Mark_M
May be App Loader is the less complex and more optimal, but it requires manual intervention.
I know, I am probably too spoiled by multi-threaded environments. :) Posted at 2024-10-11 by @gfwilliams Resuming this conversation on https://forum.espruino.com/conversations/400068/ |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-12-30 by HughB
@gfwilliams - I wonder if there are any plans to build an App to send
A-GNSS data to the Bangle 2 GPS chip.s Has there been any attempt
to do this.
I found the following if it is any use to you.
I have been unsuccessful so far in sending any CASIC commands to the B2 GPS.
If you go to https://www.icofchina.com
Got to the downloads link
https://www-icofchina-com.translate.goog/?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB
Download AGPS.zip
Unzip and there is a file called agps_demo.c
This shows how to download the A-GNSS information data.
Unzip and inside the AGPS folder is a CasicAgns.zip file.
Inside that zip is file called casicAgnsAidIni.c
This file has the following code at the bottom.
The code above makes it look like the start of the CHKSUM is calculated as
This is ties in with the statement in the CASIC document.
The calculation of the check value can follow the following algorithm:
ckSum = (id << 24) + (class << 16) + len;
for (i = 0; i <(len / 4); i++)
{
ckSum = ckSum + payload [i];
}
The point is - that it looks like the CASIC command should work on our Bangle 2 GPS chip.
However so far I have been unable to get a response to a basic CFG-PRT command.
See the other thread by @Mark_M
http://forum.espruino.com/conversations/371336/#comment16328801
Beta Was this translation helpful? Give feedback.
All reactions