Can a LM Add-on be used to receive proprietary sensor data ?

Started by barbudor, August 20, 2024, 19:33:31

0 Members and 1 Guest are viewing this topic.

barbudor

Hello

As I explained here : https://forum.locusmap.eu/index.php?topic=9031
I just purchased an Orbea Rise eMTB using a Shimano motor which has a BLE connection.
But this is using a proprietary protocol.

Would an add-on able to manage that proprietary connection and push sensor data to Locus Map in order to
- record those sensor in the track and get those data in the exported GPX
- make the data available to dashboard display

The type of data I'm would like to record are both standard ones like speed and cadence, but also not so standard such as the assistance mode (eco, trail, boost), the assistance level (%), the battery level, ...

I can already record those in a separated application (STride), but it would be nicer to use only 1 app and to be able to have also a single dashboard with both the map and some technical data (battery !!!)

Thanks

Menion

Hello barbudor,
very good question, thanks for it.

It is something we discussed in the team some time ago > to allow external devs to create and add-on that will supply data from external sensors. It make sense > we are pretty small team, so we are unable to cover all possible devices around the world.

Anyway, how to do it?

There is an option to leave the whole system in the hands of developers and only receive and handle new data from their add-ons. This is the approach we use for our Android Wear watches, where watches may record a heart rate that is sent back to the Locus Map app over undocumented API. This approach may be done for various other data, not just heart rate.

It is easy to do on my side, anyway is it correct? Because for example in your case, you will need to deal with the whole Bluetooth system in the background > it is quite a complex task to make it correctly. Also, such connections won't be aware of the app life-cycle, so for example automatic connecting and disconnecting during track recording won't work. And creating API that will somehow use apps Bluetooth system and add-ons data-reading system ... hmm :o

So my proposal for now

First option - if you or anyone other wants to deal with Bluetooth/ANT/etc on your own and just supply data to Locus Map, I may prepare an intent-based method for requested data fields.

The second option - I offer direct integration of any sensor into the app, anyway here is necessary to write to me all the information needed for this. UUID of services, characteristics, and specifications of what is inside ...

The third option - it is from my point of view really really complex task (but doable) and I do not have enough free time for this for now, sorry.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

barbudor

Thanks a lot @menion for your constructive approach

As you understand, the protocol is proprietary and need to be reverse enginneered
Which also rules out option 2 as it would put Locus at risk of a cease and desist suit from Shimano. They did it with bike GPS manufacturer Hammerhead who exactly did that. As of today, only Garmin is license.

So the method must keep the Shimano related code outside of Locus.

An separate app/service could handle that and call an Locus API that would be in no way related Shimano.

So 1st part for me is to investigate the protocol.
Then I will have to learn Android programming  :D

Would you see that as a reason able approach ?


Still, the author from the STunlock and STride apps haven't seem to receive such C&D order but better safe than sorry.
  •  

Menion

Thanks for taking care of the Locus Map legality, appreciate it.

And yes, solution no 1. should of course work. It just requires quite a lot of work on your side. It still should be possible to react to for example enabled/disabled track recording in the Locus Map, so the add-on may be clever and automatic. It just needs the Bluetooth logic. I wrote all around BT on my own, but maybe there exists a library that simplifies it, do not know.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •