[Feature Request] OsmAnd to InfiniTime Navigation App #2387

Closed
opened 2021-09-03 16:56:02 +00:00 by TimoVersemann · 40 comments

OsmAnd Navigation Information are not pared to the InfiniTime Navigation App, that would be very nice feature. I did a reasearch on how it could be done, but I can't code, but maybe somebody is inspired by this :)

InfiniTime site is "solved"

@JF made a custom ble service and documented it well:

https://github.com/JF002/InfiniTime/blob/develop/doc/ble.md
The following custom services are implemented in InfiniTime:

 * Music Service :             00000000-78fc-48fe-8e23-433b3a1942d0
 * Navigation Service :        00010000-78fc-48fe-8e23-433b3a1942d0

https://github.com/JF002/InfiniTime/blob/develop/doc/NavigationService.md

This Navgiation Service has 4 UUIDs which you can directly adress with nrfConnect on Android and are displayed in the Infinitime Navigation App (see picture attached)

Flags (UUID 00010001-78fc-48fe-8e23-433b3a1942d0)

Upcoming icon name narrative (string)

  • arrive
  • arrive-left
  • arrive-right

Narrative (UUID 00010002-78fc-48fe-8e23-433b3a1942d0)

extual description of instruction manDist (string)

Man Dist (UUID 00010003-78fc-48fe-8e23-433b3a1942d0)

(string) - Manouvre Distance, the distance to the upcoming change progress

Progress (UUID 00010004-78fc-48fe-8e23-433b3a1942d0)

(uint8) - Percent complete of total route, value 0-100

edit: I corrected the UUIDs as it's done in PR522

This works by manualy adressing in nrfConnect on Android.

The InfiniTime Navigation App until now only works with pure Maps app on a Linux (phone) connected via Amazfish. I think the implementation in Amazfit was only/primarly done with perspective to Infinitime: 16b9ec71e1/daemon/src/navigationinterface.cpp

The Actual InfiTimeNavigationApp Code: 16b9ec71e1/daemon/src/navigationinterface.cpp

Research on the Gadgetbridge Site

Taking the logic of ble Music Service

As it is also a custom ble service as the navigation servcie, definded in:
app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pinetime/PineTimeJFConstants.java

public class PineTimeJFConstants {
public static final UUID UUID_SERVICE_MUSIC_CONTROL = UUID.fromString("00000000-78fc-48fe-8e23-433b3a1942d0");

public static final UUID UUID_CHARACTERISTICS_MUSIC_EVENT = UUID.fromString("00000001-78fc-48fe-8e23-433b3a1942d0");

Only Mention of the UUID_CHARACTERISTICS_MUSIC_ARTIST is in:

app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pinetime/PineTimeJFSupport.java L464ff.

@Override
public void onSetMusicInfo(MusicSpec musicSpec) {
    try {
        TransactionBuilder builder = performInitialized("send playback info");

        if (musicSpec.album != null && !musicSpec.album.equals(lastAlbum)) {
            lastAlbum = musicSpec.album;
            safeWriteToCharacteristic(builder, PineTimeJFConstants.UUID_CHARACTERISTICS_MUSIC_ALBUM, musicSpec.album.getBytes());

Starting from OsmAnd mentions

The other side to investigate the Problem is comming from OsmAnd mentioning in Gadgetbridge Repo, this leads to "GENERIC_NAVIGATION" class or what ever it is. My understanding ends here...

Gadgetbridge/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/PebbleReceiver.java L87f.

 else if ("OsmAnd".equals(sender)) {
 notificationSpec.type = NotificationType.GENERIC_NAVIGATION;

So maybe on of you brave gadgetbridge devs is able to find a solution for this?! Cheers and thanks

OsmAnd Navigation Information are not pared to the InfiniTime Navigation App, that would be very nice feature. I did a reasearch on how it could be done, but I can't code, but maybe somebody is inspired by this :) ## InfiniTime site is "solved" @JF made a custom ble service and documented it well: https://github.com/JF002/InfiniTime/blob/develop/doc/ble.md The following custom services are implemented in InfiniTime: * Music Service : 00000000-78fc-48fe-8e23-433b3a1942d0 * Navigation Service : 00010000-78fc-48fe-8e23-433b3a1942d0 https://github.com/JF002/InfiniTime/blob/develop/doc/NavigationService.md This Navgiation Service has 4 UUIDs which you can directly adress with nrfConnect on Android and are displayed in the Infinitime Navigation App (see picture attached) ### Flags (UUID 00010001-78fc-48fe-8e23-433b3a1942d0) Upcoming icon name narrative (string) - arrive - arrive-left - arrive-right ### Narrative (UUID 00010002-78fc-48fe-8e23-433b3a1942d0) extual description of instruction manDist (string) ### Man Dist (UUID 00010003-78fc-48fe-8e23-433b3a1942d0) (string) - Manouvre Distance, the distance to the upcoming change progress ### Progress (UUID 00010004-78fc-48fe-8e23-433b3a1942d0) (uint8) - Percent complete of total route, value 0-100 edit: I corrected the UUIDs as it's done in [PR522](https://github.com/InfiniTimeOrg/InfiniTime/pull/522) This works by manualy adressing in nrfConnect on Android. The InfiniTime Navigation App until now only works with **pure Maps app on a Linux (phone) connected via Amazfish**. I think the implementation in Amazfit was only/primarly done with perspective to Infinitime: https://github.com/piggz/harbour-amazfish/blob/16b9ec71e1adc1052e6e7d4e23ffea6c10396320/daemon/src/navigationinterface.cpp The Actual **InfiTimeNavigationApp Code**: https://github.com/piggz/harbour-amazfish/blob/16b9ec71e1adc1052e6e7d4e23ffea6c10396320/daemon/src/navigationinterface.cpp ## Research on the Gadgetbridge Site ### Taking the logic of ble Music Service As it is also a custom ble service as the navigation servcie, definded in: app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pinetime/PineTimeJFConstants.java public class PineTimeJFConstants { public static final UUID UUID_SERVICE_MUSIC_CONTROL = UUID.fromString("00000000-78fc-48fe-8e23-433b3a1942d0"); public static final UUID UUID_CHARACTERISTICS_MUSIC_EVENT = UUID.fromString("00000001-78fc-48fe-8e23-433b3a1942d0"); Only Mention of the UUID_CHARACTERISTICS_MUSIC_ARTIST is in: ### app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pinetime/PineTimeJFSupport.java L464ff. @Override public void onSetMusicInfo(MusicSpec musicSpec) { try { TransactionBuilder builder = performInitialized("send playback info"); if (musicSpec.album != null && !musicSpec.album.equals(lastAlbum)) { lastAlbum = musicSpec.album; safeWriteToCharacteristic(builder, PineTimeJFConstants.UUID_CHARACTERISTICS_MUSIC_ALBUM, musicSpec.album.getBytes()); ### Starting from OsmAnd mentions The other side to investigate the Problem is comming from OsmAnd mentioning in Gadgetbridge Repo, this leads to "GENERIC_NAVIGATION" class or what ever it is. My understanding ends here... Gadgetbridge/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/PebbleReceiver.java L87f. else if ("OsmAnd".equals(sender)) { notificationSpec.type = NotificationType.GENERIC_NAVIGATION; ------------------------- So maybe on of you brave gadgetbridge devs is able to find a solution for this?! Cheers and thanks
Owner

Ideally, someone with a PineTime is needed for this.

Ideally, someone with a PineTime is needed for this.
vanous added the
device pinetime infinitime
label 2021-09-22 08:35:17 +00:00
Owner

I have a pinetime,

how do you think we can get the information from Osmand?

The best way would be a Gadgetbridge "plugin" for Osmand, scraping that from notifications is not feasable since everything is translated already.

I have a pinetime, how do you think we can get the information from Osmand? The best way would be a Gadgetbridge "plugin" for Osmand, scraping that from notifications is not feasable since everything is translated already.

I guess the OSMand part should be scrutinized (maybe they already send some broadcasts) then filed as a FR.

I guess the OSMand part should be scrutinized (maybe they already send some broadcasts) then filed as a FR.
Owner

@ildar

There are pebble broadcasts but those are also tranlated texts.

Yeah, working on the osmand side would be best

@ildar There are pebble broadcasts but those are also tranlated texts. Yeah, working on the osmand side would be best
Author

Thanks for your engagement! I try to gather Information I found about the OsmAnd Side:

OsmAnd does have a AIDL / API - Demostuff here

The methods for API Subscription for "next_turn_type" and (no_speak_)next_turn_distance have been added in this commit

I can see the values as snapshots in the OsmAnd API Demo App (installed via Aurora Store ) Screenshots are Attached. You can check the "Simulate Navigation" in the OsmAnd Navigation Menu to get realtime changing values...

You get next_turn_distance as an Integer that could be used for Man Dist (UID c7e60004-78fc-48fe-8e23-433b3a1942d0). You would need to fetch the unit somewhere as InfiniNav takes the distance as a String with unit...

Also you get next_turn_type that could be translated into the Flags (UUID c7e60002-78fc-48fe-8e23-433b3a1942d0)
The Outputs are mainly "TR" for turn right or "TL" for rurn left.
~~You also get derivate of xyzL or xyzR for sharper turns. I saw "TSHR" and "KR" - somehow I can not found the dictionary/list (?) of these values/variables(?) in OsmAnd Doku/Repo. ~~
Edith: Overall there aare 14 Turn Types that kann be matched with the list of existing Icons in the InfiNav App described here.

next_turn_name could be used as Narrative (UUID c7e60003-78fc-48fe-8e23-433b3a1942d0). That's actualy not how the Service was intended by @JF002 but to me as a cyclist the name of the street I have to turn into is very valuable. As intended a text like "turn right" under the a big Symbol showing turn right seems to be a useless redundancy and a waste of rare screen estate. Also it would keep the code simple as it could be simply token from the API maybe just with a Limiter to roundabout 30 or 35 Characters that should fit in the 2 lines... I can't finde Information "turn right" especial with it's local translation "rechts abbiegen" (GER) in the API. It could be scraped from the Notification/pebble in the language of the User, but It would need more code...

For the Progress (UUID c7e60001=5-78fc-48fe-8e23-433b3a1942d0) I have no inspiration looking at the API resoult, but maybe a initialRelease don't need's it ;)

This may be all bullshit to you as I just have a very abstract understanding of coding and how Gadgetbride and the hole Android thing works... But Maybe it's a inspiaration for you.
If there are bullshit jobs to do like creating synopsis of listes for the Flags or so tell me...

Thanks for your engagement! I try to gather Information I found about the OsmAnd Side: OsmAnd does have a [AIDL / API](https://docs.osmand.net/ru/main@latest/development/build-osmand/osmand-api) - [Demostuff here](https://github.com/osmandapp/osmand-api-demo) The methods for API Subscription for "next_turn_type" and (no_speak_)next_turn_distance have been added in [this commit](https://github.com/osmandapp/OsmAnd/commit/d014c7a8419ef7caa24ffe94669ceed1e279ae88) I can see the values as snapshots in the [OsmAnd API Demo](https://play.google.com/store/apps/details?id=net.osmand.osmandapidemo&hl=de&gl=US) App (installed via [Aurora Store](https://f-droid.org/de/packages/com.aurora.store/) ) Screenshots are Attached. You can check the "Simulate Navigation" in the OsmAnd Navigation Menu to get realtime changing values... You get **next_turn_distance** as an Integer that could be used for **Man Dist** (UID c7e60004-78fc-48fe-8e23-433b3a1942d0). You would need to fetch the unit somewhere as InfiniNav takes the distance as a String with unit... Also you get **next_turn_type** that could be translated into the **Flags** (UUID c7e60002-78fc-48fe-8e23-433b3a1942d0) The Outputs are mainly "TR" for turn right or "TL" for rurn left. ~~You also get derivate of xyzL or xyzR for sharper turns. I saw "TSHR" and "KR" - somehow I can not found the dictionary/list (?) of these values/variables(?) in OsmAnd Doku/Repo. ~~ Edith: Overall there aare [14 Turn Types](https://github.com/osmandapp/OsmAnd/blob/master/OsmAnd-java/src/main/java/net/osmand/router/TurnType.java) that kann be matched with the list of existing Icons in the InfiNav App [described here](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/doc/NavigationService.md). **next_turn_name** could be used as **Narrative** (UUID c7e60003-78fc-48fe-8e23-433b3a1942d0). That's actualy not how the Service was intended by @JF002 but to me as a cyclist the name of the street I have to turn into is very valuable. As intended a text like "turn right" under the a big Symbol showing turn right seems to be a useless redundancy and a waste of rare screen estate. Also it would keep the code simple as it could be simply token from the API maybe just with a Limiter to roundabout 30 or 35 Characters that should fit in the 2 lines... I can't finde Information "turn right" especial with it's local translation "rechts abbiegen" (GER) in the API. It could be scraped from the Notification/pebble in the language of the User, but It would need more code... For the **Progress** (UUID c7e60001=5-78fc-48fe-8e23-433b3a1942d0) I have no inspiration looking at the API resoult, but maybe a initialRelease don't need's it ;) This may be all bullshit to you as I just have a very abstract understanding of coding and how Gadgetbride and the hole Android thing works... But Maybe it's a inspiaration for you. If there are bullshit jobs to do like creating synopsis of listes for the Flags or so tell me...

Is there anything a non-(C|C++|Java)-programmer could do to help the devs toward getting this implemented, at least in the kind of initial version (that is, without progress support) outlined by Timo?

Is there anything a non-(C|C++|Java)-programmer could do to help the devs toward getting this implemented, at least in the kind of initial version (that is, without progress support) outlined by Timo?
Owner

@TimoVersemann

Thank you this is very interesting, does not sound like bullshit - I really want to have a look, as soon as time allows.

@TimoVersemann Thank you this is very interesting, does not sound like bullshit - I really want to have a look, as soon as time allows.
Owner

Umm, ok I had a look.

This should be doable but I have some doubts:

  • We are supposed to link in a binary distribution .aar file for the aidl "sdk" 8777f591c3/OsmAnd-api-sample/app/build.gradle (L50) . Apart from the size (2MB!) it is an anti-feature for F-Droid and for me personally.

  • Osmand says "No License issues" but how is this possible if the code is GPLv3?

  • I would like to just copy out the aidl stuff we need, not get the 2MB binary blob, this would have to stay GPLv3 if I am not mistaken

Umm, ok I had a look. This should be doable but I have some doubts: - We are supposed to link in a binary distribution .aar file for the aidl "sdk" https://github.com/osmandapp/osmand-api-demo/blob/8777f591c39d48a3b3dc3042c62a0d63c21a8afb/OsmAnd-api-sample/app/build.gradle#L50 . Apart from the size (2MB!) it is an anti-feature for F-Droid and for me personally. - Osmand says "No License issues" but how is this possible if the code is GPLv3? - I would like to just copy out the aidl stuff we need, not get the 2MB binary blob, this would have to stay GPLv3 if I am not mistaken
Owner

I created a branch named osmand-experiments and it actually works.

I copied in all the aidl stuff from osmand instead of using the binary aar,
maybe a lot could be stripped since we are only interested in naviagtion updates for now.

This only logs the distance to the destination, and there is nothing sent to a device, but it is a poc.

I created a branch named osmand-experiments and it actually works. I copied in all the aidl stuff from osmand instead of using the binary aar, maybe a lot could be stripped since we are only interested in naviagtion updates for now. This only logs the distance to the destination, and there is nothing sent to a device, but it is a poc.
Owner

@TimoVersemann

Umm, were does next_turn_name come from? I did not find how I could subscribe to that...

@TimoVersemann Umm, were does next_turn_name come from? I did not find how I could subscribe to that...
Owner

I guess this comes from the GET_INFO intent api? Maybe we can only use that? Would save tons of aidl and java code if we can also get the next turn distace with intents instead of using the service interface.

I guess this comes from the GET_INFO intent api? Maybe we can only use that? Would save tons of aidl and java code if we can also get the next turn distace with intents instead of using the service interface.
Author

All suggestet Things are from the "Get Info" Information I found via the GUI App OsmAnd API Demo (directlink to .APK) - see the Screenshots in my prior post.

Loking to the readme.md I assume this "Get Info" the GET_INFO as a part of the Intent Api and its OsmAndHelper.java and not of the AIDL Api and its OsmAndAidlHelper.java

All suggestet Things are from the "Get Info" Information I found via the GUI App [OsmAnd API Demo (directlink to .APK)](https://download.osmand.net/latest-night-build/OsmAnd-api-sample.apk) - see the Screenshots in my prior post. Loking to the [readme.md](https://github.com/osmandapp/osmand-api-demo/tree/master/OsmAnd-api-sample) I assume this "Get Info" the GET_INFO as a part of the Intent Api and its [OsmAndHelper.java](https://github.com/osmandapp/osmand-api-demo/blob/master/OsmAnd-api-sample/app/src/main/java/net/osmand/osmandapidemo/OsmAndHelper.java) and not of the AIDL Api and its [OsmAndAidlHelper.java](https://github.com/osmandapp/osmand-api-demo/blob/master/OsmAnd-api-sample/app/src/main/java/net/osmand/osmandapidemo/OsmAndAidlHelper.java)
Author

I did a synopsis of the possible turn_types and Icons of InfiniNav that could correspond to it. The Icons are as .svg in the folder InfiniTime/src/displayapp/icons/navigation/unique/
The turn types are defined in: https://github.com/osmandapp/OsmAnd/blob/master/OsmAnd-java/src/main/java/net/osmand/router/TurnType.java

OsmAnd TurnType InfiniNav Flag Preview Comment
T continue
TL turn-left
TSLL turn-slight-left
TSHL turn-sharp-left
TR turn-right
TSLR turn-slight-right
TSHR turn-sharp-right
KL fork-slight-left OsmAnds keeping L / R corresponds IMHO best to the forking L / R of the Icon Set
KR fork-slight-right
TU uturn
TRU uturn is this a U-Turn for left-hand driving?!
OFFR close
RNDB roundabout
RNDB1 roundabout-sharp-right OsmAnd delivers the RNDB with the Number of the acutal Exit. As a suggestion I collected all variations of InfiniNav Roundabout Exits and suggested theme here. They may differ from reality
RNDB2 roundabout-right OsmAnds GUI solution withe the Actual number shown in the Icon would be to prefer. This Icons with Numbers would ne be created and integrated into InfiTime Repo... (A sample of the OsmAnd GUI is attached)
RNDB3 roundabout-slight-right
RNDB4 roundabout-straight
RNDB5 roundabout-slight-left
RNDB6 roundabout-left
RNDB7 roundabout-sharp-left
RNLB roundabout This is a Roundabout feft-hand driving?!
This would also need the +exitOut derivats and the Icons would significantly differ from reality
I did a synopsis of the possible turn_types and Icons of InfiniNav that could correspond to it. The Icons are as .svg in the folder [InfiniTime/src/displayapp/icons/navigation/unique/](https://github.com/InfiniTimeOrg/InfiniTime/tree/develop/src/displayapp/icons/navigation/unique/ ) The turn types are defined in: https://github.com/osmandapp/OsmAnd/blob/master/OsmAnd-java/src/main/java/net/osmand/router/TurnType.java | OsmAnd TurnType | InfiniNav Flag | Preview | Comment | | - | ---- | ---- | --- | | T | continue | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/f41aaad6836ae348d1b5b084b4533b636f516b93/src/displayapp/icons/navigation/continue.svg) | | | TL | turn-left | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/turn_left.svg) | | | TSLL | turn-slight-left | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/turn_slight_left.svg) | | | TSHL | turn-sharp-left | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/turn_sharp_left.svg) | | | TR | turn-right | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/turn_right.svg) | | | TSLR | turn-slight-right | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/turn_slight_right.svg) | | | TSHR | turn-sharp-right | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/turn_sharp_right.svg) | | | KL | fork-slight-left | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/fork_slight_left.svg) | OsmAnds keeping L / R corresponds IMHO best to the forking L / R of the Icon Set | | KR | fork-slight-right | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/fork_slight_right.svg) | | | TU | uturn | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/uturn.svg) | | | TRU | uturn | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/uturn.svg) | is this a U-Turn for left-hand driving?! | | OFFR | close | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/close.svg) | | | RNDB | roundabout | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/roundabout.svg) | | | RNDB1 | roundabout-sharp-right | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/roundabout_sharp_right.svg) | OsmAnd delivers the RNDB with the Number of the acutal Exit. As a suggestion I collected all variations of InfiniNav Roundabout Exits and suggested theme here. They may differ from reality | | RNDB2 | roundabout-right | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/roundabout_right.svg) | OsmAnds GUI solution withe the Actual number shown in the Icon would be to prefer. This Icons with Numbers would ne be created and integrated into InfiTime Repo... (A sample of the OsmAnd GUI is attached) | | RNDB3 | roundabout-slight-right | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/roundabout_slight_right.svg) | | | RNDB4 | roundabout-straight | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/roundabout_straight.svg) | | | RNDB5 | roundabout-slight-left | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/roundabout_slight_left.svg) | | | RNDB6 | roundabout-left | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/roundabout_left.svg) | | | RNDB7 | roundabout-sharp-left | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/roundabout_sharp_left.svg) | | | RNLB | roundabout | ![](https://raw.githubusercontent.com/InfiniTimeOrg/InfiniTime/ab7c6e162f82674d176466d361b1f87a0d55cf4a/src/displayapp/icons/navigation/roundabout.svg) | This is a Roundabout feft-hand driving?!<br />This would also need the +exitOut derivats and the Icons would significantly differ from reality |
Owner

Thanks,

yes it seems that unfortunatly one has to use the Intent API instead of aidl. I have no clue why they send distance and turn updates but no information about the current/next location name.

The Intent API seems to be designed this way:

An intent contains an url which sould be "viewed", the result is then returned by calling an activity

8777f591c3/OsmAnd-api-sample/app/src/main/java/net/osmand/osmandapidemo/OsmAndHelper.java (L535)

Data is then processed here

8777f591c3/OsmAnd-api-sample/app/src/main/java/net/osmand/osmandapidemo/MainActivity.kt (L1239)

I doubt we can do it that way with a background service. But I will try.

Thanks, yes it seems that unfortunatly one has to use the Intent API instead of aidl. I have no clue why they send distance and turn updates but no information about the current/next location name. The Intent API seems to be designed this way: An intent contains an url which sould be "viewed", the result is then returned by calling an activity https://github.com/osmandapp/osmand-api-demo/blob/8777f591c39d48a3b3dc3042c62a0d63c21a8afb/OsmAnd-api-sample/app/src/main/java/net/osmand/osmandapidemo/OsmAndHelper.java#L535 Data is then processed here https://github.com/osmandapp/osmand-api-demo/blob/8777f591c39d48a3b3dc3042c62a0d63c21a8afb/OsmAnd-api-sample/app/src/main/java/net/osmand/osmandapidemo/MainActivity.kt#L1239 I doubt we can do it that way with a background service. But I will try.
Owner

I played around and I think the best way to go would be to use the aidl api and get turn/distance and "voice output"

This would result i

2021-10-20 14:32:23.035 5604-5805/nodomain.freeyourgadget.gadgetbridge E/nodomain.freeyourgadget.gadgetbridge.externalevents.OsmandEventReceiver: played: links abbiegen auf die  Motzener Straße
2021-10-20 14:32:26.032 5604-5805/nodomain.freeyourgadget.gadgetbridge E/nodomain.freeyourgadget.gadgetbridge.externalevents.OsmandEventReceiver: Distance: 658 turnType: 10

should work somehow

I played around and I think the best way to go would be to use the aidl api and get turn/distance and "voice output" This would result i ``` 2021-10-20 14:32:23.035 5604-5805/nodomain.freeyourgadget.gadgetbridge E/nodomain.freeyourgadget.gadgetbridge.externalevents.OsmandEventReceiver: played: links abbiegen auf die Motzener Straße 2021-10-20 14:32:26.032 5604-5805/nodomain.freeyourgadget.gadgetbridge E/nodomain.freeyourgadget.gadgetbridge.externalevents.OsmandEventReceiver: Distance: 658 turnType: 10 ``` should work somehow
Owner

@TimoVersemann

Have it working somehome, there are some problems:

  • The navigation text is often so long that the green number (remaining distance to turn) is drawn above the text.

  • I do not know whether I got all mappings right.

Code is in the osmand-experiments branch. All checked in.

@TimoVersemann Have it working somehome, there are some problems: - The navigation text is often so long that the green number (remaining distance to turn) is drawn above the text. - I do not know whether I got all mappings right. Code is in the osmand-experiments branch. All checked in.
Owner

Wow, this is very awesome!

Wow, this is very awesome!

Wow, that's exceedingly awesome! I'm taking it that it's not so easy to beta-test this, though?

Wow, that's _exceedingly_ awesome! I'm taking it that it's not so easy to beta-test this, though?
Author

@ashimokawa Sounds great.

@sixtyfive I think you have to checkout the osmand-experiments branch and then you can compile it if you have setup the Android SDK Stuff properly.
https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Developer-Documentation

I failed on that yesterday will try this feedback and give feedback.

Thanks anyway!

@ashimokawa Sounds great. @sixtyfive I think you have to checkout the osmand-experiments branch and then you can compile it if you have setup the Android SDK Stuff properly. https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Developer-Documentation I failed on that yesterday will try this feedback and give feedback. Thanks anyway!

Would it be possible to also add Organic Maps support?

OSMAnd and Organic Maps are the two biggest, if not the only popular, choices for FOSS maps based off OSM, and to offer users the choice of power (OSMAnd) and ease (Organic Maps) when using their PineTime would be great.

I can't see API documentation anywhere but you could probably contact them - they have a GitHub, email and a Telegram group

Would it be possible to also add Organic Maps support? OSMAnd and Organic Maps are the two biggest, if not the only popular, choices for FOSS maps based off OSM, and to offer users the choice of power (OSMAnd) and ease (Organic Maps) when using their PineTime would be great. I can't see API documentation anywhere but you could probably contact them - they have a [GitHub](https://github.com/organicmaps/organicmaps), [email](hello@organicmaps.app) and a [Telegram group](https://t.me/OrganicMaps)
Contributor

@greenprocyon_ That's really a separate issue you should open, if you want to keep track of it.

@greenprocyon_ That's really a separate issue you should open, if you want to keep track of it.
Contributor

First of all, thank you very much for this crucial contribution and integration of OsmAnd via Gadgetbridge into InfiniTime Navigation as it is a killer app for me! I use it everyday :)

I successfully compiled the osmand-experiments branch and would like to share my experience:

  • Navigation instructions are shown in the display and provide the best orientation.
  • Arrow pictures are also shown above the instructions. Unfortunately they are not very reliable as osmand still shows the arrow picture grayed out when they aren't valid any more. But the InfiniTime application does't change the color or updates the display. So the text is the better orientation. I am not sure what is the best way to fix this.
  • Long distances in a straight direction (e.g. 800m just straight) are described in text instructions, but the arrow picture still shows a right or left direction, but not a straight one. Here I am also not sure
    what is the best way to fix this.

What I changed in the InfiniTime navigation app:

  • I just positioned the arrow picture at the very top and the distance (green number) at the very bottom. The text instructions are positioned inbetween centered. Thereby I never experienced any overlapping and it gives a good overview.
  • I added a short vibration on each new text instruction or arrow picture. As the distance often changes it doesn't cause any vibration. Thereby, I get notified on new navigation instructions.
  • If anybody is interested I can share the code (only minor changes).

What I changed in the Gadgetbridge app:

  • As PineTime firmware updates produced errors with the osmand-experiments branch, I merged it to the highest Gadgetbridge Tag 0.9.8 (and before I did tag 0.66.0 which also worked). Thereby, the update problems were fixed and the merge was possible with only 2 minor conflict changes which were fixed in less then 5 minutes.

I would be glad if the development regarding optimization of the navigation feature will keep going (e.g. straight arrow picture and grayed out pictures) and would be glad to support (e.g. by testing).

First of all, thank you very much for this crucial contribution and integration of OsmAnd via Gadgetbridge into InfiniTime Navigation as it is a killer app for me! I use it everyday :) I successfully compiled the osmand-experiments branch and would like to share my experience: * Navigation instructions are shown in the display and provide the best orientation. * Arrow pictures are also shown above the instructions. Unfortunately they are not very reliable as osmand still shows the arrow picture grayed out when they aren't valid any more. But the InfiniTime application does't change the color or updates the display. So the text is the better orientation. I am not sure what is the best way to fix this. * Long distances in a straight direction (e.g. 800m just straight) are described in text instructions, but the arrow picture still shows a right or left direction, but not a straight one. Here I am also not sure what is the best way to fix this. What I changed in the InfiniTime navigation app: * I just positioned the arrow picture at the very top and the distance (green number) at the very bottom. The text instructions are positioned inbetween centered. Thereby I never experienced any overlapping and it gives a good overview. * I added a short vibration on each new text instruction or arrow picture. As the distance often changes it doesn't cause any vibration. Thereby, I get notified on new navigation instructions. * If anybody is interested I can share the code (only minor changes). What I changed in the Gadgetbridge app: * As PineTime firmware updates produced errors with the osmand-experiments branch, I merged it to the highest Gadgetbridge Tag 0.9.8 (and before I did tag 0.66.0 which also worked). Thereby, the update problems were fixed and the merge was possible with only 2 minor conflict changes which were fixed in less then 5 minutes. I would be glad if the development regarding optimization of the navigation feature will keep going (e.g. straight arrow picture and grayed out pictures) and would be glad to support (e.g. by testing).
Contributor

I just realized that there was a typo in the "continue" turn. By fixing it the navigation icon for straight direction is updated :)

I did a pull request for this minor change: #2628

I just realized that there was a typo in the "continue" turn. By fixing it the navigation icon for straight direction is updated :) I did a pull request for this minor change: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2628

Hi Ernst,

this sounds very interesting, especially the added vibration function for changes. Are all the changes you described available in your fork? If not, could you create a branch containing those changes? It would be great if I could use your solution directly without the need to do any merges manually.

Hi Ernst, this sounds very interesting, especially the added vibration function for changes. Are all the changes you described available in your fork? If not, could you create a branch containing those changes? It would be great if I could use your solution directly without the need to do any merges manually.
Contributor

@timoja45: Actually, the vibration was added to the "Navigation App" of the "InfiniTime firmware" (see pull request https://github.com/InfiniTimeOrg/InfiniTime/pull/1068).

The Gadgetbridge modifications only consider the fixed turn image for continue (see pull request above). I created a branch "osmand-experiments-0.66.0" with the merge of those modifications to the up to date version 0.66.0: https://codeberg.org/ernst/Gadgetbridge/src/branch/osmand-experiments-0.66.0. Thereby, OsmAnd is supported, straight navigation images are shown and firmware updates are working :)

@timoja45: Actually, the vibration was added to the "Navigation App" of the "InfiniTime firmware" (see pull request https://github.com/InfiniTimeOrg/InfiniTime/pull/1068). The Gadgetbridge modifications only consider the fixed turn image for continue (see pull request above). I created a branch "osmand-experiments-0.66.0" with the merge of those modifications to the up to date version 0.66.0: https://codeberg.org/ernst/Gadgetbridge/src/branch/osmand-experiments-0.66.0. Thereby, OsmAnd is supported, straight navigation images are shown and firmware updates are working :)
Contributor

Update: My pull request was approved and merged into the official branch osmand-experiments. Furthermore @ashimokawa rebased the branch to master. Thereby, it is now up to date so that firmware updates should also work here :)

Update: My pull request was approved and merged into the official branch osmand-experiments. Furthermore @ashimokawa rebased the branch to master. Thereby, it is now up to date so that firmware updates should also work here :)

Hi @ernst, could you maybe upload the modified build of the InfiniTime firmware? I would be very interested, but I didn't want to set up the development environment just to build the firmware with the added vibration.

Hi @ernst, could you maybe upload the modified build of the InfiniTime firmware? I would be very interested, but I didn't want to set up the development environment just to build the firmware with the added vibration.
Owner

FYI, I rebased with master after the huge mutli-device support merge.

FYI, I rebased with master after the huge mutli-device support merge.
Contributor

Hi @timoja45 ,

attached you find:

  • current InfiniTime firmware release 1.11.0 with my changes
  • current Gadgetbridge osmand-experiments branch as apk (git commit short ref: b5ea9a4 from 2022-08-06)

I tested both and it worked :)

It is still not perfect, but at least OsmAnd instructions are displayed on the watch.

Hi @timoja45 , attached you find: - current InfiniTime firmware release 1.11.0 with [my changes](https://github.com/InfiniTimeOrg/InfiniTime/pull/1068) - current Gadgetbridge osmand-experiments branch as apk (git commit short ref: b5ea9a4 from 2022-08-06) I tested both and it worked :) It is still not perfect, but at least OsmAnd instructions are displayed on the watch.
Member

This looks great to me, and it's really good to see this implemented in a multi-device way. I'd love to add this to the Bangle.js watch support libraries too.

What are the chances of this getting merged? Is there anything blocking it?

Also: I'd been experimenting with getting Google Maps navigation data by passing through 'local' notifications (#1827), but I think it's too hacky. As far as I can tell there's no Google Maps API, but is there interest in me attempting to add a Google Maps notification parser to Gadgetbridge that would call onSetNavigationInfo? It would vary on language but we could enable the parser for languages where we knew it'd work correctly?

This looks great to me, and it's really good to see this implemented in a multi-device way. I'd love to add this to the Bangle.js watch support libraries too. What are the chances of this getting merged? Is there anything blocking it? Also: I'd been experimenting with getting Google Maps navigation data by passing through 'local' notifications (https://codeberg.org/Freeyourgadget/Gadgetbridge/issues/1827), but I think it's too hacky. As far as I can tell there's no Google Maps API, but is there interest in me attempting to add a Google Maps notification parser to Gadgetbridge that would call `onSetNavigationInfo`? It would vary on language but we could enable the parser for languages where we knew it'd work correctly?
Member

@vanous @ashimokawa do you have any thoughts on whether this could be merged? It would make a great base for navigation on Bangle.js as well

@vanous @ashimokawa do you have any thoughts on whether this could be merged? It would make a great base for navigation on Bangle.js as well
Owner

@vanous @ashimokawa do you have any thoughts on whether this could be merged? It would make a great base for navigation on Bangle.js as well

I am sorry, i am just having too much on my plate lately to be able to look at anything.

> @vanous @ashimokawa do you have any thoughts on whether this could be merged? It would make a great base for navigation on Bangle.js as well I am sorry, i am just having too much on my plate lately to be able to look at anything.
Owner

@gfwilliams

Did another rebase.

And I reverted changes done by @cpfeiffer (importing binary stuff)

We have some ways to continue here:

  1. release as is with my back-then imported and patched osmand code import, basically I tried to import only needed files and stripped a bit code - there could be more removed I guess

  2. add osmand as a submodule (huge) and then somehow build what we need - how?

Whatever way we choose, some apk size comparison should be done.

@gfwilliams Did another rebase. And I reverted changes done by @cpfeiffer (importing binary stuff) We have some ways to continue here: 1) release as is with my back-then imported and patched osmand code import, basically I tried to import only needed files and stripped a bit code - there could be more removed I guess 2) add osmand as a submodule (huge) and then somehow build what we need - how? Whatever way we choose, some apk size comparison should be done.
Member

Great, thanks!

Wow, I see what you mean though. That diff is huge. I guess there's always the concern that OsmAnd may change something at some point and break it too?

I don't know enough about it really, but OsmAnd as a submodule doesn't sound great either.

I guess one option is to submit a PR to OsmAnd that would allow it to push navigation directions as Intents? Would that work?

Or what if for now I did a branch with just the onSetNavigationInfo additions, and then added a parser for Google Maps and OsmAnd notifications that would then call that.

While it's not ideal (and potentially it'd need modifications to support other languages), we could probably support Navigation for 90% of Gadgetbridge users' languages pretty quick, with minimal extra overhead.

Great, thanks! Wow, I see what you mean though. That diff is huge. I guess there's always the concern that OsmAnd may change something at some point and break it too? I don't know enough about it really, but OsmAnd as a submodule doesn't sound great either. I guess one option is to submit a PR to OsmAnd that would allow it to push navigation directions as Intents? Would that work? Or what if for now I did a branch with just the `onSetNavigationInfo` additions, and then added a parser for Google Maps and OsmAnd notifications that would then call that. While it's not ideal (and potentially it'd need modifications to support other languages), we could probably support Navigation for 90% of Gadgetbridge users' languages pretty quick, with minimal extra overhead.
@ashimokawa Could you delete https://codeberg.org/Freeyourgadget/Gadgetbridge/src/branch/osmand-experiments/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/AbstractDeviceSupport.java#L551? It contains ``` <<<<<<< HEAD ```

Hi everyone, for my personal use, I build and release on GitHub a Gadgetbridge apk from the osmand-experiments branch after Gadgetbridge releases a new version.
If anyone wants to try it, it is available at https://github.com/schklom/Gadgetbridge-osm.

In the interest of transparency, I do it by:

  1. mirroring this repository soon after when Gadgetbridge releases a new version (link to the GitHub Action)
  2. merging to master branch
  3. building and releasing the apk to GitHub (link to the GitHub Action)

Obtainium makes it very convenient to update once in a while.
I'm not affiliated with any project, I just thought it might be useful some people here.

Hi everyone, for my personal use, I build and release on GitHub a Gadgetbridge apk from the `osmand-experiments` branch after Gadgetbridge releases a new version. If anyone wants to try it, it is available at https://github.com/schklom/Gadgetbridge-osm. In the interest of transparency, I do it by: 1. mirroring this repository soon after when Gadgetbridge releases a new version ([link to the GitHub Action](https://github.com/schklom/Mirror-workflows/blob/main/.github/workflows/Gadgetbridge%20repo%20sync.yml)) 2. merging to `master` branch 3. building and releasing the apk to GitHub ([link to the GitHub Action](https://github.com/schklom/Mirror-workflows/blob/main/.github/workflows/Gadgetbridge%20repo%20sync.yml)) [Obtainium](https://github.com/ImranR98/Obtainium) makes it very convenient to update once in a while. I'm not affiliated with any project, I just thought it might be useful some people here.
Owner

@schklom

I rebased and fixed the <<< HEAD

@schklom I rebased and fixed the <<< HEAD
Member

Just to add, I now have a branch which uses just onSetNavigationInfo and then parses the local notifications from Google Maps (which would otherwise have been ignored) to fill it: cc8f02834a

Is this something I might be able to contribute back? Having to parse the notification (especially checking the image to get the action) is a bit hacky, but it does work, doesn't use many resources and I think having Google Maps navigation would be useful to others too.

Potentially a similar method could be used for OSMAnd as well? While not ideal it may actually be less of a headache to maintain than all the AIDL stuff?

It's not tested but it should also work alongside the PineTime handler from the osmand-experiments branch.

Just to add, I now have a branch which uses just onSetNavigationInfo and then parses the local notifications from Google Maps (which would otherwise have been ignored) to fill it: https://codeberg.org/gfwilliams/Gadgetbridge/commit/cc8f02834ab94d6b2c9aee2c35f48fd18c22552a Is this something I might be able to contribute back? Having to parse the notification (especially checking the image to get the action) is a bit hacky, but it does work, doesn't use many resources and I think having Google Maps navigation would be useful to others too. Potentially a similar method could be used for OSMAnd as well? While not ideal it may actually be less of a headache to maintain than all the AIDL stuff? It's not tested but it should also work alongside the PineTime handler from the osmand-experiments branch.
Member

Looks like this (or something based on it) is now in the master branch - I've created a PR at #3136

Looks like this (or something based on it) is now in the `master` branch - I've created a PR at https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3136
Member

Yup - the osmand-experiments branch was merged to master with a stripped down version of the AIDL interface.

I think we can close this issue.

Yup - the `osmand-experiments` branch was merged to master with a stripped down version of the AIDL interface. I think we can close this issue.
Sign in to join this conversation.
No Milestone
No Assignees
12 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Freeyourgadget/Gadgetbridge#2387
No description provided.