My current project is to create a compact, low cost unit for next season on the track.
For context, I'm coming from this stack currently:
CANBUS Source: 2016 BMW S1000XR
CANBUS bluetooth transceiver: Obdlink MX+
GPS / RC2: Arduino Mega, HC-06, MATEK M9N-5883 (UBLOX NEO-M9N 25Hz 4 GNSS), various sensors (wheel IR temps, 9 axis sensor fusion)
In my current setup, the Obdlink MX+ can approach 50hz+ on 5 monitored parameters (spread across 4 PIDs). Most of the PIDs on the bike fire every 10ms.
I'd like to get as close to the max rate of 100hz on all PIDs as possible with its replacement.
Based on the forum discussions, it looked like the DIY BLE build is the new direction for hardware development.
Accordingly, I built a Adafruit nrf52840 based DIY BLE device. With just canbus, I was getting ~15 hz update rate on the same 5 pids (which is inline with the listed rates that people are getting with the base code)
To try to get higher rates I started tweaking the code:
>Dropping the shouldnofity and marknotify checks (minimal speed increase)
>Changing the Advertising set interval to the minimum my phone can see (minimal speed increase)
>Taking the 7 individual bytes across 4 pids, storing them in vars as the packets come in, and advertising a single "composite" pid with all 7 bytes (stale or just updated) to minimize notifies + modifications on the phone side to accommodate. (~ rate increase to 35 hz)
So yeah after a couple rounds of experimentation I feel stuck: 35hz is much lower than I thought I would be able to get.
(excuse the ignorance incoming, very new to BLE / nrf52840)
Question 1: Is BLE the way to go for high speed (will I ever see speeds as high as 100hz)?
I'm thinking not, as some of what I am reading is that the minimum notify interval anyways for android is 7.5ms (where as, in testing with my actual android phone, I am unable to see anything with an advertising interval below 20ms)
Question 2: In timing the program, the majority of the delay is in the notify (anywhere from 0 - 50ms). Is this my phone being slow, the nrf52840, or BLE? Why is there so much variability?
Question 3: Is there a way to make a obdlink analog (for lack of term)? Can i use an arduino, mcp2515 and hc-06 to serial stream the 4-5 PIDs i need? I tried viewing the raw canbus from the obdlink with ATMA but kept gettings errors. Also don't have the right google term for the raw CANBUS bluetooth stream format. Is it just serial / hex / what is it?