-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
location: add cellular support with extended location example #729
Conversation
Visit the preview URL for this PR (updated for commit 3b33bd3): https://golioth-firmware-sdk-doxygen-dev--pr729-location-cellu-joqlbjvz.web.app (expires Tue, 28 Jan 2025 19:03:35 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: a9993e61697a3983f3479e468bcb0b616f9a0578 |
c394b4a
to
0463d0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @mniestroj! The logic for coming WiFi and cellular is really clean.
examples/zephyr/location/dts/bindings/modem/golioth,cellular-playback.yaml
Outdated
Show resolved
Hide resolved
GOLIOTH_LOCATION_FLAG_* are not part of public API, so move them to private header instead. This file will contain more flags related implementation in the future, so it will make public header cleaner and easier to understand. Signed-off-by: Marcin Niestroj <[email protected]>
golioth_location_*_append() is designed in a way that it cannot be called interchangably for example with "cell" and "wifi" data. Instead one needs to be finished before the other can be started. Track which technologies (e.g. "cell" or "wifi") have been started and finished. Do not allow to restart whatever has been finished. Signed-off-by: Marcin Niestroj <[email protected]>
Both WiFi and cellular examples will have lots of shared code. Additionally technology-specific code will be rather minimal, so there is little reason to keep examples separate. Another benefit to have a combined version is the future use case of having both technologies (wifi and cellular) supported on single platform. Signed-off-by: Marcin Niestroj <[email protected]>
Introduce support for Golioth cellular location service. Signed-off-by: Marcin Niestroj <[email protected]>
Move generic location API calls from WiFi specific functions to main() function. This will allow to encode technology specific information independently from each other, while there will be just one request to Golioth backend. Signed-off-by: Marcin Niestroj <[email protected]>
It is not a good idea to constantly request WiFi scans. Instead, introduce 5s interval between those. Signed-off-by: Marcin Niestroj <[email protected]>
Allow to run example with disabled WiFi support. Signed-off-by: Marcin Niestroj <[email protected]>
Just enable WiFi location automatically whenever platform supports WiFi as wireless technology. Enable WiFi when GOLIOTH_WIFI_PLAYBACK is selected. Signed-off-by: Marcin Niestroj <[email protected]>
Extend sample with cellular network cell towers collected over the city trip. This is a playback with configurable speed (1x by default) to quickly see results over time during testing (e.g. on a Grafana map plugin). Signed-off-by: Marcin Niestroj <[email protected]>
Add nRF91 specific cellular tower information fetching and use when requesting location data. Use current cell only for now, as that is the only information provided with the tested modem and SIM card. Leave logs for neighbour cells enabled, so that extending this sample in the future is easy. Signed-off-by: Marcin Niestroj <[email protected]>
0463d0f
to
3b33bd3
Compare
Codecov ReportAttention: Patch coverage is
|
Introduce support for Golioth cellular location service.
Move
examples/zephyr/location/wifi/
toexamples/zephyr/location/
and extend it to supportcellular as well. Most of the code is shared between the two, so it will lower maintenance needed as
compared to having two separate examples. Additionally this gives the benefit to test (right now
only with
native_sim
) getting location with information from those two technologies combined.Supersedes: #717