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

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

0 Members and 3 Guests are viewing this topic.

hoschilo

  •  

Andrew Heard

Wow - excellent research & development. Bravo. But needing 2 phones is a show stopper.
4.35 GOLD user ID:c7d47597a
  •  

Menion

Uff, this was harder than I expected.

@hoschilo

Here are the docs for a new Locsu API 0.10.0
https://github.com/asamm/locus-api/blob/master/docs/android/guides/adapter-apps/README.md

You'll of course need a new Locus Map Beta version > tomorrow.

This one is a big. Locus Map now handle all BT/USB connection logic. Add-ons only deal with the basic definition of parameters and the parsing of received data, nothing more. I'm sure, AI, thanks to the docs do a valid migration to the new system. Check also new sample app > there is clearly visible how easy is it and how it works.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  
    The following users thanked this post: MartinQ

hoschilo

@Menion:

I wanted to reach out and say thank you for your hard work — genuinely. Your quick response today and the announcement of the Sensor Adapter API 0.10.0 completely changed the trajectory of what I'm building, and in the best possible way.                                                                                                                                                                                     
                                                                                                                                                                                                         
                                                                                                                                                                                                         
With Locus now owning the BLE connection, the "middleman-phone" disappears entirely. Locus on a single device connects directly to the universal display, and our adapter just parses the raw frames. We already have the Brose protocol partially reverse-engineered:                                                                                                                                               
                                                                                                                                                                                                         
  - TEL frame (7×/sec): speed, cadence, battery, assist mode, odometer                                                                                                                                   
  - SEC frame (protobuf, triggered every 2s): motor power, rider power, estimated range                                                                                                                   
                                                                                                                                                                                                         
We've already prepared the adapter — BroseAdapterService, locus_adapter.xml, BroseProtocol.kt — and it's waiting for your Beta to go live tomorrow.                                                     
                                                                                                                                                                                                         
The plan / outlook                                                                                                                                                                                               
                                                                                                                                                                                                         
We intend (after testing) to publish this as an open-source Locus addon on GitHub (locus-brose-adapter) and on Google Play, so the broader Brose motor community can benefit. Is there anything I must consider by publishing an addon from your viewepoint. Brose powers bikes from Scott, Raleigh, Pinarello, Moustache, and others. If you'd like to feature it in the Locus Store or link to it from documentation, we'd be honoured.                                             
                                                                                                                                                                                                         
One open question                                                                                                                                                                                       
                                                                                                                                                                                                         
The HRM sample works without a scanFilter because Locus recognises the standard BT SIG Heart Rate Service UUID. Our Brose motor uses a custom service UUID (31be2300-d927-11e9-8a34-2a2ae2dbcce4). Is there an attribute in <deviceType> or <characteristic> to declare the service UUID for scanning — so Locus can find Brose motors by service UUID rather than by device name prefix?                     
                                                                                                                                                                                                         
Thank you again for this API — it's exactly the right architecture.
  •  

Menion

Hi,
perfect it works!

Some recommended info for publishing is written here.

About filtering by UUID > understand. Add scanServiceUuid="31be2300-d927-11e9-8a34-2a2ae2dbcce4" on your <deviceType> (and drop scanFilter since Brose doesn't need name matching). This will use the native BLE scan filter on the service UUID in the next Beta version.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

MartinQ

Quote from: Menion on May 28, 2026, 08:48:00Here are the docs for a new Locsu API 0.10.0
https://github.com/asamm/locus-api/blob/master/docs/android/guides/adapter-apps/README.md
Very interesting! I have a Shimano EP8 EMTB and would like to log at least battery level.
As explained above, Shimano does not release the protocol details, but there are a number of reverse engineering attempts out there. A quick look with nRF connect reveals that the SC-EM800 publishes battery percentage as standard BLE characteristic and more info in a custom one, which is more or less straightforward to decode.
So it looks that I'll have Claude do an adapter app for me - any thoughts?
  •  

barbudor

I have an Orbea Rise with a Shimano EP8
I tested it today and I confirm it works natively with the new feature
I can natively add speed, cadence, battery level to my dashboard
So no need to code 😂

Thanks @menion
  •  

MartinQ

I also did a very quick check in the cellar. Battery works, but support level only shows "OFF" or unknown. Will have to test on a real ride.
Interestingly, I just have started collecting data for reverse engineering using nRF connect and had Claude write a parser for it. Great news that no longer seems necessary!
  •  

barbudor

For reference, topic I opened regarding eBike battery and assist mode not exported on GPX
https://forum.locusmap.eu/index.php?topic=9681.0
  •