Closed ASerbinski closed 4 months ago
Hi @ASerbinski! We appreciate you submitting your first issue for our open-source project. 🌟
Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙
Hi, the gnss alias needs to point to the gnss node, rather than the uart node :) The sample contained some overlays which incorrectly pointed to the uart node, which where fixed with this PR #72249
The reason the node needs to be updated is this:
https://github.com/zephyrproject-rtos/zephyr/blob/7046c9030e7020f6ce416e7061bd1fd7f9b553b8/include/zephyr/drivers/gnss.h#L454-L469
When defining the callback, a pointer to a specific GNSS can be used to filter out which device calls that specific callback, which can be useful if there are two GNSS devices. Setting the _dev
argument to NULL would allow the callback to call, but if you tried to use the GNSS API with the UART node (currently pointed to by the alias), you would get undefined behavior :)
Proof that the GNSS callback works is here https://github.com/zephyrproject-rtos/zephyr/blob/7046c9030e7020f6ce416e7061bd1fd7f9b553b8/drivers/gnss/gnss_dump.c#L167 this is the callback which produces the log output you are seeing :) that was the thing which helped me isolate the issue in the first place (the _dev is NULL)
@bjarki-trackunit ; Thank you so much, I have it working now!
Describe the bug I'm working with an Adafruit Feather M0 Lora (https://docs.zephyrproject.org/latest/boards/adafruit/feather_m0_lora/doc/index.html) with a GPS "featherwing" (https://www.adafruit.com/product/3133)
Currently attempting to get the GNSS sample working correctly (https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/gnss)
Now because the GPS uses the same UART as is normally used for the Zephyr console, I had to make some changes to put the console on the USB in addition to defining the GNSS.
I added these lines to prj.conf;
And I created boards/adafruit_feather_m0_lora.overlay:
It builds fine, it flashes fine, and I can receive from the console using minicom, which gives me lots of output that looks like this (I've truncated some lines due to sensitive location data);
That looks pretty nice, its obviously receiving and processing the data received from the GPS. However, missing is the output from the two callbacks "gnss_data_cb" and "gnss_satellites_cb". These callbacks are apparently not firing, which means that I don't have any way to access the data, which is the actual objective.
Is there a bug here? Or am I missing something?