Closed sslupsky closed 8 months ago
I just wonder would it make sense to look how gpsd (https://gitlab.com/gpsd/gpsd) is interfacing to different GNSS providers. It has this gps_type_t API https://gitlab.com/gpsd/gpsd/-/blob/master/include/gpsd.h#L423 for that. See https://gitlab.com/gpsd/gpsd/-/tree/master/drivers for different drivers. I do not mean we would need to do things the same way as gpsd, but we need to make sure that our APIs are able to support all different GNSS providers.
I will have a look at that. I had done some prior work with the Sparkfun library which was my starting point.
@jukkar Have you used gpsd? I had a look and it looks quite good.
A couple observations:
I have used gpsd (but over 10 year ago). I would not want to use it in zephyr as is, but perhaps we can look how it interfaces to different chips as it has lot of supported GNSS providers. Your API looks reasonable but you mentioned it was developed according to u-blox GNSS. So would that API work with other GNSS providers?
@jukkar I agree, I think there are some good things to learn from the studying the gpsd library. I think the API above would be fine across other GNSS providers. We need to add additional protocols as the API only contemplates four at the moment:
GNSS_SENTENCE_STATE_UBX,
GNSS_SENTENCE_STATE_NMEA,
GNSS_SENTENCE_STATE_RTCM,
GNSS_SENTENCE_STATE_RTCM3,
We also need to understand how the existing and future solutions interface to the mcu. I think the majority use a serial uart. Some have USB. u-blox supports i2c but I do not know if anyone else does.
Also cellular modems usually provide support for GNSS. For example GSM modems have GSM muxing implemented where one UART will provide multiple virtual channels to the caller, and the GNSS data is transferred in one of these channels. The muxed UART will look same as normal UART to the application so it should work ok.
@sslupsky I have only limited experience with GPS but the vast majority I've seen either use NMEA or UBX. I've never used RTCM but it seems to also be common and modern. Are there indeed other commonly used protocols than those 4 or is that good enough starting point?
@jukkar I believe this is also implied with your point but there are some modems that have an integrated GNSS and some that a dedicated interface as you described. To further add to the complexity, some have user-programmable application processors (though most need NDA'd permission) and some can only be interfaced via a host processor.
It might be worthwhile to pick a small subset of common standalone GNSS modules as well as GSM+GNSS modems as a starting point and plan to expand the design over time.
I have a quectel BG95 I could experiment with, would love to see this functionality added to Zephyr.
The BG95 would be a good one to target! Actually, many of the NB/Cat-M1 modules are based on the qcomm 9205, so picking one would provide good representation.
My personal reqs would be to start with:
Hi guys. For disclosure purposes, I'm from u-blox, though not the GNSS side (cellular). I am interested in this discussion because we have a C support library (I'd call it a "hopefully useful lump of well-tested code") for our cellular, Wifi, BLE and soon GNSS modules and I'd like it to be compatible with this API.
A very quick scan suggests that the proposal above is fine, though since it comes originally from support for a u-blox GNSS chip I guess that will be no surprise :-). Some comments:
malloc()
'ed/stuck-in-some-bit-of-RAM-they-found-spare-from-an-unused-DMA-buffer, etc. Or does the generic Zephyr dev
thingy allow this?Hi @RobMeades
couple of random comments to your questions:
Anyway, it would be nice to see a PR in review, so just propose something if you have the code and we can then start to comment it.
The GNSS API in zephyr is really desired. What's the current status of that?
@avigreen1978 as usual with open source work, someone needs to send an RFC Pull Request so we can start considering it for addition to the tree.
@sslupsky I'm trying to adopt gnss api for our zephyr porting on silab pg board. do you have any suggestion or any reference that we can work on? Thanks!
@allen-k-liu I built an API using the header I posted above and implemented a driver for a u-blox gnss device (SAM-M8Q). The driver and API work for my use case but it is not a complete solution. I am a couple zephyr versions behind so the code needs to be rebased to work with the most recent release of Zephyr. If someone was interested to collaborate on the code development it might make sense for me to generate an RFC PR and use my code as a starting point.
thanks a lot @sslupsky ! I'm interested to do so. We original planed to use u-blox m8q but probably will switch to sony's cxd5605. I'm not familiar with RFC PR, is it something you will summit to zephyr to merge to main line?
@allen-k-liu I had a look at the PG board: https://www.silabs.com/documents/public/user-guides/ug474-pg22-dk2503a-user-guide.pdf
does this board have gnss capability?
@sslupsky i just did quick scan, i don't see it. I used efm32pg12 (stk3402a) that zephyr has supported. But I haven't figure out where to insert gps module. probably under zephyr/module/gps/
@sslupsky Would you mind if you can share your gnss project branch so I can base on that to not go too far off? Thanks a lot!
@allen-k-liu I posted all my out-of-tree zephyr stuff here: https://github.com/sslupsky/zephyr-out-of-tree
Is there a good way we can "revive" the evaluation of this RFC?
We now have a vendor agnostic GNSS API supporting both Quectel and Ublox, and should support Nordic as well, included from release 3.6 If there is some request in this RFC that is still relevant, please reopen this issue and we can take it from there
Linking the documentation here so others can find it in the future :)
@bjarki-trackunit @beriberikix are there any thoughts on extending this to include RTCM3 corrections?
If not yet should this be re-opened or a new one opened?
@bperseghetti That would require a new RFC :)
Introduction
Has there been any work on developing a GNSS API for Zephyr?
Problem description
GNSS is a widely used technology for global positioning. Zephyr should consider support of an API to interface with various GNSS chips.
Proposed change
This proposed API was developed to work the u-blox GNSS solutions. It does not implement advanced GNSS capabilities at the current time. I am not familiar with the recent GPS solution offered by Nordic so it would be helpful to know what Nordic's thinking is regarding an API and how to make this better.