Tutorials

12
Mai
(0 votes)
Share

How to define an application configuration

Posted: Mai 12, 2016 By: Category: Tutorial Comment: 0 Read: 861 times
(0 votes)

In this tutorial we want to show how you can define an application configuration to save data to the sdcard and read them later over the webservice.

This feasture of the adapter is a pretty cool thing, because sometimes you just forget your smartphone or you want to use the adapter as a datalogger and read the data later. We call this an application configuration, where you can define, which data you want to save.

Prerequisite:

  • 12 V power supply either by a normal car with an OBD II connector, a 12V power supply or an OBD II Simulator
  • A caranea adapter either an OBD caranea adapter or a SUB-D caranea adapter
  • A Wi-Fi enabled device like a Smartphone or a Computer

So let's start and see how easy it easy to use the caranea technology

Power up your caranea Adapter with a 12V power device as you learned in the tutorial "How to connect to the caranea adapter".

Define an application configuration:

{
  "configurationname":
  "Application",
  "configuration": [
  {
     "identifier": "Driverslog",
     "parameter": "timestamp+speed+rpm+OBD-VIN",
     "frequency": "1000", //1000ms
     "storage": "yes",
     "maxSaveCycles":"5", // 5 save cycles
     "handling":"FIFO"
   }
  ]
}

This example will create an app called Driverslog, which reads timestamp, speed, rpm and the vin from the car. it reads those data each second and saves it on the sdcard. it saves a maximum of 5 data and then overwrites those data with the FIFO method.  You can add more applications to the adapter if you want, there is no limit.

Store the application configuration:

You need to store the file with the name "app.cong" in the same folder as the caranea advanced software is located. In our case we have to store the application configuration in the following folder with the following name:

/usr/local/src/CoreApplicationClass_Cross/app.conf

In this folder, you should find an example app configuration called app.conf.back

Read data from an application

To read out the data, you need to restart the adapter. You can do this by disconnect and connect the adapter from your power source. After powering up you can request your data by calling the following command in your browser:

http://192.168.189.99:9080/history?fields=Driverslog

The answer should look like this:

{
    "Driverslog":
    [
        {
            "timestamp": "Sun 15 May 2016 11:05:48",
            "speed": "80",
            "rpm": "480",
            "OBD-VIN": "WDX-SIM0019212345"
        },
        {
            "timestamp": "Sun 15 May 2016 11:05:44",
            "speed": "80",
            "rpm": "496",
            "OBD-VIN": "WDX-SIM0019212345"
        },
        {
            "timestamp": "Sun 15 May 2016 11:05:41",
            "speed": "80",
            "rpm": "480",
            "OBD-VIN": "WDX-SIM0019212345"
        },
        {
            "timestamp": "Sun 15 May 2016 11:05:37",
            "speed": "80",
            "rpm": "480",
            "OBD-VIN": "WDX-SIM0019212345"
        },
        {
            "timestamp": "Sun 15 May 2016 11:05:36",
            "speed": "80",
            "rpm": "480",
            "OBD-VIN": "WDX-SIM0019212345"
        }
    ]
}

Or like this:

If you get the same result, then you did everything right ;-) And hopefully you have seen, how easy it is to use the caranea adapter.

Attention:

If you use an application configuration, it is not possible to ask the adapter to read out the data in realtime anymore. You will get the following error message:

Last modified on Mai 15, 2016
Share This Post

caranea by Flycar Innovations
we connect your car

Bachforellenweg 18
60327 Frankfurt am Main

Lastest post from Twitter

Rechtl. Informationen