More than 1Hz GPS/acc/OBD data sent to own backend/local data files

Hi! I mainly want to use the AutoPi hardware (running 2nd Edition 4G/LTE atm) to capture vehicle, accelerometer and GPS data. I want to get this data as often as possible, 10Hz would be very good. I still would like to rely on the AutoPi Core to get the updates and to utilize the base code. Since I have other use cases for the data than the ones found in My AutoPi I want to re-direct the data to my own backend, but for now it’s ok to simply store it in a local file that I later can retrieve using e.g. scp. Now to my question, how would you do this? The triggers in My AutoPi has the quickest interval of 1/s, which is too slow for me, how would you set this up? One idea was to have a custom module that was triggered every second/minute that collects the data in a while-loop during that interval and then dies or hands over to the next triggered instance, but this feels error prone. Please note that I don’t want to send all this data to your cloud as it will probably be very high loads for you guys. Thanks in advance!

1 Like

Hi @thoka,

From the advanced setting you can change the sampling frequency of the Accelerometer, its just a settings change.

You can also change the endpoint that the device send data to (Cloud API). Changing the endpoint will not change the connection with the AutoPi Cloud and you can still control the device from the Cloud. Its just the data that is send to your own endpoint.

Give it a go. It should work out of the box.

best
Peter

Hi @Peter,

I found the Hz of the accelerometer under Settings/Advanced/Accelerometer and noticed the that current value is 1.56Hz. But to get location at a greater frequency, e.g. 10/s, I found that you can only specify 1/s under “Tracking”. Is this max? Maybe the onboard GPS cannot supply positions more often?

Also, if it’s possible to get more decimals of the GPS locations that would be awesome (noticed that it was configurable for the accelerometer).

To be clear, what I really would like to have is more or less (pseudo code):
while {
ts = get_timestamp()
loc = get_gps_location()
acc = get_acc_value()
rpm = get_engine_rpm()
append_to_report({
ts: ts,
loc: loc,
acc: acc,
rpm: rpm
})
}

I.e. to collect those data points together as a package and send them together with timestamp to backend/local file (as often as possible).

Hi @thoka,

Unfortunately, the GPS is limited to max 1hz. This is per the hardware we use. Its not possible to get more decimals on the GPS, than what is already supplied.

With the Cloud endpoint change, the device will package the data you’ve configured in a similar format as you describe.

The device is able to do as you want, out of the box. Just configure the following:

  1. Setup the Cloud API endpoint to your own server
  2. Configure the Acc to the frequency you desire
  3. Create a logger to log the RPM

The data will be uploaded to your server in the interval specified under the Advanced Cloud settings. Under here you can configure the upload interval and batch size.

The data will be uploaded in a json format and should be easily parseable on your server side.

best
Peter

Awesome! I really like it when you use something and all your use-cases are more or less covered already without any custom modifications. I’m impressed!

If I would connect a third-party GPS module, e.g. Garmin GLO 2, that supports 10Hz. I would assume that to get those GPS positions instead I would need to create a custom module that reads from this dongle, right? Could I “replace” the GPS module within the AutoPi dongle with such an external GPS dongle and then supply better (more accurate) GPS positions to the already existing Tracking service as well?

For this example, how would you have a “while true” loop as a custom module collecting data continuously? Is it possible to create such a custom module from the UI?

Thank you very much for great support! :slight_smile:

1 Like

Hi @thoka,

In the upcomming relase of the Cloud, all services are made public. We have an underlying service called “tracking_manager”, which is in charge of the tracking and interface to the lower level components. If you want to add another GPS, then you can overwrite/change this service to use the new device instead. The “tracking_manager” service will be visible under “advanced->services”, when released.

It will be another couple of weeks until the release is ready and you will be notified upon login to the cloud.

best
Peter

Hi Peter,

Thanks, that sounds very interesting. What about my “while true” loop for fetching data more frequently? In the UI (https://my.autopi.io/#/settings) I’m only able to set the GPS frequency to 5s interval (0,2Hz) and the minimum interval for RPM seems to be 1s (Car Explorer/Loggers/RPM). I can probably live with the 1Hz GPS for now, but the acc and RPM readouts shouldn’t consume that much power at e.g. 5-10Hz afaik. Aren’t there any existing custom module/projects that works similar to this? Any other ideas? I have a lot of potential customers at the moment, and I really like the AutoPi concept, hence I would become very happy if I got this up and running using this hardware. :slight_smile:

Hi @thoka,

At the moment we’ve limited logging for GPS to 5 hz. Only business customers is allowed to log faster than this. We’ll open up for this in the next release.

Could you send an email to sales@autopi.io with your business case and problems? Then we’ll assist you from there on.

Best
Peter