2004 to 2020 Mazda 3 Forum and Mazdaspeed 3 Forums banner

Custom Applications SDK - Write and deploy your own applications

4 reading
237K views 426 replies 112 participants last post by  Sid Meyer  
#1 · (Edited)
The Custom Application SDK for the Mazda Infotainment System

It's finally coming. Instead of figuring out each application individually, I created this minimalistic micro framework and runtime that allows you to write and deploy custom applications to the Mazda Infotainment System without the hassles.

It also comes with a 1:1 simulator that allows you to run and debug your applications locally without having to deploy to the Infotainment system.

This project is currently under heavy development but hey, we got an alpha release available. There is little documentation available at this point.

Please contribute if you have the time and the energy.

We have an active Trello board running for organization:

https://trello.com/b/rBEWRDdg/alpha-sprint

If you find CMU values that actually provide meaning, please add them here:

https://docs.google.com/spreadsheets/d/1lkVUzhLEMglb7eFglne1iDiJ5vKMpaoxXKW-7bSZ6Ws/edit#gid=0

---

IF YOU USE THIS IN YOUR CAR, PLEASE MAKE SURE YOU HAVE A FIRMWARE VERSION OF V55.x OR HIGHER INSTALLED

Earlier version might be compatible but have not been tested.

---

https://github.com/flyandi/mazda-custom-application-sdk

Download the Simulator:

OSX: https://github.com/flyandi/mazda-cu...plication-sdk/releases/download/0.0.1-alpha/casdk-simulator-0.0.1-alpha-osx.zip

Win: https://github.com/flyandi/mazda-cu...ication-sdk/releases/download/0.0.1-alpha/casdk-simulator-0.0.1-alpha-win32.zip

The runtime SDK with USB installers: https://github.com/flyandi/mazda-cu...azda-custom-application-sdk/releases/download/0.0.1-alpha/casdk-alpha-0.0.2.zip - also needed for the Simulator.

---

To get started:

1) Download the runtime SDK which contains the deploy images. Copy and paste the files in deploy/install to an USB stick, plug the stick on your infotainment and reboot your Infotainment system.

2) Download the Simulator

3) Follow the tutorial in the wiki page on GitHub

4) Copy the contents of the folder sdcard to an SDCard and reboot your system.

5) Enjoy your custom applications
 

Attachments

#400 · (Edited)
As I said in the BLE TPMS thread, I'm looking for a way to bring the Arduino/BLE board values to a CASDK app. MazdaRacerDude did it with the speedometer.sh (but that's standalone).

For the moment, my Arduino has values for oil sensor and oil pressure, later on I want to add TPMS. I also didn't find "boost" but I know it has a PID in the 124 Spider.

I'll look into the files you linked, much appreciated, thank you.
 
#403 ·
Disregard my last posts.

I am now – in theory* – able to have a CASDK app with a color picker that sends a message like "RGB (255,255,255)" to a microcontroller hooked to the USB. The [Arduino] (or something else) receives that RGB code and controls the LEDs accordingly.

* My problem at the moment is with the CASDK apps themselves. It seems like they are not always registered correctly. Right after installing them, I can see and open them but the next time I start the car, the apps are gone. Or rather: not displayed in the app menu. Weirdly, though, sometimes they're back. Still trying to figure that one out.
 
#404 ·
Disregard my last posts.

* My problem at the moment is with the CASDK apps themselves. It seems like they are not always registered correctly. Right after installing them, I can see and open them but the next time I start the car, the apps are gone. Or rather: not displayed in the app menu. Weirdly, though, sometimes they're back. Still trying to figure that one out.
Have you figured out why custom apps don't register correctly?
I've noticed that reboot (back +nav + Vol/mute) always fix this. But this is an annoying workaround.
 
#406 ·
Hi,

require('child_process').exec
as well as require('fs') definitions are accepted and work fine in standalone js scripts in Mazda system (run using node of course).

I can not make it run in CASDK app . (module not loaded error)

Is it possible to run native and other nodejs modules from within CASDK env?

If yes , how to configure?
 
#408 ·
@Trezdog44 - Torben has slightly different issue "my CASDK apps run in the simulator/debugger but when I load them onto the CMU, they worked initially one or two times, then sporadically and now I haven't seen them shown among the available apps anymore. ", in my case, CMU reboot can fix the issue - are you able to debug this issue?

@Torben - as to mapping between OBD-2 PIDs and CASDK - I don't think it is possible in sort of direct way.

CMU has ODB2 chip which is a kind of proxy. CASDK relies on smdb-read CMU app which reads selected ODB2 data like smdb-read -n vdm -e Drv1AvlFuelE, etc

So people say now; with AA tool and ODB2 interface in the socket, you can read any data via your mobile.

But, I do regret nobody investigated the possibilities of this CMU ODB2 chip. It would be so handy not to plug in all of these devices and just use CMU capabilities.
 
#409 ·
Well, in the first few days after installing, a reboot actually helped sometimes and the apps would show until the next boot.

Looking for a different solution in building a standalone app like Speedometer I found that Speedometer writes itself into a list of additional apps. I'm wondering if there might be a problem with Speedometer on one hand and actual custom CASDK apps (the delivered CASDK apps seem to be fine). So this weekend I'd like to try a few things in this direction.

Meanwhile I'm building two apps (TPMS and additional instruments for oil sensors) as standalone apps based on the Speedometer-App. If it turns out that the Speedometer-App is causing the issues I'll get rid of that, though, because the CASDK apps are already done and ready.
 
#412 · (Edited)
I'm really annoyed by the CASDK. I removed my app and put in a really simple app. Again, after the initial reboot, the app is there. The next boot it – along with all the other CASDK apps (vdd, tetris) – is not listed in the apps menu anymore.

app.test/app.js
Code:
/**
* Speedometer Application
*
* This is an implementation of the famous Speedometer by @serezhka
*/
CustomApplicationsHandler.register("app.test", new CustomApplication({
    require: {
        js: [],
        css: ['app.css'],
        images: {}
    },
    settings: {
        title: 'Test',
        statusbar: true,
        statusbarIcon: false,
        statusbarTitle: 'Test',
        hasLeftButton: false,
        hasMenuCaret: false,
        hasRightArc: false
    },
    created: function() {
        this.debugboxl = $("<div/>").attr("id", "debugboxl").appendTo(this.canvas);
        this.debug1 = $("<p/>").attr("id", "debugoiltemp").appendTo(this.debugboxl);
        this.debug2 = $("<p/>").attr("id", "debugoilpres").appendTo(this.debugboxl);
        this.debug3 = $("<p/>").attr("id", "debugcoolant").appendTo(this.debugboxl);
        this.debug4 = $("<p/>").attr("id", "debugouttemp").appendTo(this.debugboxl);
       
        this.debugboxr = $("<div/>").attr("id", "debugboxr").appendTo(this.canvas);
        this.debug5 = $("<p/>").attr("id", "tpms1").appendTo(this.debugboxr);
        this.debug5t = $("<span/>").attr("id", "tpms1t").appendTo(this.debug5);
        this.debug5p = $("<span/>").attr("id", "tpms1p").appendTo(this.debug5);
        this.debug6 = $("<p/>").attr("id", "tpms2").appendTo(this.debugboxr);
        this.debug6t = $("<span/>").attr("id", "tpms2t").appendTo(this.debug6);
        this.debug6p = $("<span/>").attr("id", "tpms2p").appendTo(this.debug6);
        this.debug7 = $("<p/>").attr("id", "tpms3").appendTo(this.debugboxr);
        this.debug7t = $("<span/>").attr("id", "tpms3t").appendTo(this.debug7);
        this.debug7p = $("<span/>").attr("id", "tpms3p").appendTo(this.debug7);
        this.debug8 = $("<p/>").attr("id", "tpms4").appendTo(this.debugboxr);
        this.debug8t = $("<span/>").attr("id", "tpms4t").appendTo(this.debug8);
        this.debug8p = $("<span/>").attr("id", "tpms4p").appendTo(this.debug8);
       
        this.canvas.find("#tpms1t").html("FL T: " + "x ");
        this.canvas.find("#tpms1p").html("P: " + "x");
        this.canvas.find("#tpms2t").html("FR T: " + "x ");
        this.canvas.find("#tpms2p").html("P: " + "x");
        this.canvas.find("#tpms3t").html("RL T: " + "x ");
        this.canvas.find("#tpms3p").html("P: " + "x");
        this.canvas.find("#tpms4t").html("RR T: " + "x ");
        this.canvas.find("#tpms4p").html("P: " + "x");
       
        /*DATA DEBUG*/
        this.subscribe(VehicleData.temperature.oil, function(value) {
            this.canvas.find("#debugoiltemp").html("Oiltemp: " + value);
        }.bind(this));
        this.subscribe(VehicleData.engine.oilpressure, function(value) {
            this.canvas.find("#debugoilpres").html("Oilpres: " + value);
        }.bind(this));
        this.subscribe(VehicleData.temperature.coolant, function(value) {
            this.canvas.find("#debugcoolant").html("Coolant: " + value + " (" + (value-40) + ")");
        }.bind(this));
        this.subscribe(VehicleData.temperature.outside, function(value) {
            this.canvas.find("#debugouttemp").html("outtemp: " + value + " (" + (value-40) + ")");
        }.bind(this));
       
        /* TPMS DEBUG */
        this.subscribe(VehicleData.tpms.fltemp, function(value) {
            this.canvas.find("#tpms1t").html("FL T: " + value + " ");
        }.bind(this));
        this.subscribe(VehicleData.tpms.flpres, function(value) {
            this.canvas.find("#tpms1p").html("P: " + value);
        }.bind(this));
       
        this.subscribe(VehicleData.tpms.frtemp, function(value) {
            this.canvas.find("#tpms2t").html("FR T: " + value + " ");
        }.bind(this));
        this.subscribe(VehicleData.tpms.frpres, function(value) {
            this.canvas.find("#tpms2p").html("P: " + value);
        }.bind(this));
       
        this.subscribe(VehicleData.tpms.rltemp, function(value) {
            this.canvas.find("#tpms3t").html("RL T: " + value + " ");
        }.bind(this));
        this.subscribe(VehicleData.tpms.rlpres, function(value) {
            this.canvas.find("#tpms3p").html("P: " + value);
        }.bind(this));
       
        this.subscribe(VehicleData.tpms.rrtemp, function(value) {
            this.canvas.find("#tpms4t").html("RR T: " + value + " ");
        }.bind(this));
        this.subscribe(VehicleData.tpms.rrpres, function(value) {
            this.canvas.find("#tpms4p").html("P: " + value);
        }.bind(this));

    },
    focused: function() {
    },
    lost: function() {
    },
   
    onControllerEvent: function(eventId) {
    }
}));

app.test/app.css
Code:
[app="app.test"] #debugboxl {
    position: absolute;
    display: block;
    top: 100px;
    left: 100px;
    width: 200px;
}
[app="app.test"] #debugboxl p {
    height: 25px;
    font-size: 16px;
    line-height: 19px;
    text-align: right;
}
[app="app.test"] #debugboxr {
    position: absolute;
    display: block;
    top: 100px;
    right: 100px;
    width: 200px;
}
[app="app.test"] #debugboxr p {
    height: 25px;
    font-size: 16px;
    line-height: 19px;
    text-align: left;
}

Oil values are saved by the Arduino as oil.out ("oiltemp: 28.8 oilpress: -0.00").
TPMS values are saved by the Arduino as tpms.out ("0: 0.0 0.00 1: 0.0 0.00 2: 0.0 0.00 3: 0.0 0.00").
I run both through the casdk scripts vdtXs.sh and then I get casdk-tpms and oil within casdk-vdt which are both run through the runtime.js so the values can be used like the other data (see above).

When the app is shown, all the values are correct.

Do you know of any reason why custom apps are only shown (initialized) on the first boot and why they are not shown (initialized?) later on? Any idea where to look for a hint/log or where to set something for debugging?


EDIT:
I'm also still wondering if there's a possiblity to query OBD2 PIDs via dbus-send like the GPS:
Code:
dbus-send --print-reply --address=unix:path=/tmp/dbus_service_socket --type=method_call --dest=com.jci.lds.data /com/jci/lds/data com.jci.lds.data.GetPosition > ${OUTPUT}-gps
The OBD2 PIDs are intake.manifold.pressure and intake.air.temperature. How would I known/learn how to address that?

Btw., I tried
Code:
qdbus
dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames
dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.Introspectable/Introspect
But it threw errors. Any idea what's wrong there?

Thanks a lot in advance.
 
#414 ·
Hi Torben,

great work - this looks amazing!

Some questions:
1. Where/how can we download this?
2. Is it possible to change the shown car (MX-5 ?) to another one (either via app menu, code or changing a jpg?)
3. Is it possible to change the language (via app menu or via code (where))?
4. You have to have TPMS Sensors at each tire, right? So this would not work for older models like the CX-5 KE (2012-2017), which uses the ABS sensor for TPMS and does not have TPMS Sensors at each tire.
5. Please tell us more about your project...
 
#415 ·
@Tristan-cx5 thanks.

1. At the moment it's a first running prototype. It's similar to Speedometer App and based on Herko's code. I was inspired by MazdaRacerDude's post here: Reading BluetoothTPMS (Tire pressure Monitoring) sensor...
2. Changing the car is on the To Do list (the app can identify the car itself), provided JPGs could be customized. The position of the tires in the app depends on the images and needs to be changed accordingly.
3. Language detection (also °C/°F and bar/psi) is also on the To Do list.
4. Yes, TPMS sensors are necessary. That's a big one:
Since the data isn't available to the infotainment system, I get the TPMS data from a microcontroller (Arduino Nano + CC1101 receiver) that is plugged into the USB socket of the infotainment system.
A protocol has to be installed for that communication. I'll add the CMU side with an installer.

5. Next steps:

  • The protocol doesn't know which sensor is on which wheel, so the app needs a setup screen or other way to change (and set!) the positions. I'm looking into selecting and pressing first one then another wheel to change the positions.
  • Add a function to change the normal pressure and also a range for when the app should (visibly) warn.
  • Add English, bar/psi and °C/°F support.
  • Add other images (this one's an Abarth 124 Spider).
  • It's running on FW 56.xxx but I also want to support 70.xxx. From what I've seen, some slight changes need to be made for that.
  • I need to figure out how to make an installer (tweaks.sh). At the moment I'm installing it via ssh.

Since this does not work with data from the ECU, you can install active TPMS sensors (need to be compatible with those on the MX-5 ND)* on old cars that do not actually have active TPMS and you get active TPMS at least on the screen (the car won't know).

* I'm not entirely sure if Mazda uses the same kind of TPMS sensors for their entire fleet?

Next up is an Additional Gauges App since I also connected two oil sensors to the microcontroller that deliver oil pressure and oil temperature (showing in Speedometer App, at the moment). And a track app with lap timer for the NĂĽrburgring.
 
#417 ·
@Tristan-cx5 thanks.

1. At the moment it's a first running prototype. It's similar to Speedometer App and based on Herko's code. I was inspired by MazdaRacerDude's post here: Reading BluetoothTPMS (Tire pressure Monitoring) sensor...
2. Changing the car is on the To Do list (the app can identify the car itself), provided JPGs could be customized. The position of the tires in the app depends on the images and needs to be changed accordingly.
3. Language detection (also °C/°F and bar/psi) is also on the To Do list.
4. Yes, TPMS sensors are necessary. That's a big one:
Since the data isn't available to the infotainment system, I get the TPMS data from a microcontroller (Arduino Nano + CC1101 receiver) that is plugged into the USB socket of the infotainment system.
A protocol has to be installed for that communication. I'll add the CMU side with an installer.

5. Next steps:

  • The protocol doesn't know which sensor is on which wheel, so the app needs a setup screen or other way to change (and set!) the positions. I'm looking into selecting and pressing first one then another wheel to change the positions.
  • Add a function to change the normal pressure and also a range for when the app should (visibly) warn.
  • Add English, bar/psi and °C/°F support.
  • Add other images (this one's an Abarth 124 Spider).
  • It's running on FW 56.xxx but I also want to support 70.xxx. From what I've seen, some slight changes need to be made for that.
  • I need to figure out how to make an installer (tweaks.sh). At the moment I'm installing it via ssh.
Since this does not work with data from the ECU, you can install active TPMS sensors (need to be compatible with those on the MX-5 ND)* on old cars that do not actually have active TPMS and you get active TPMS at least on the screen (the car won't know).

* I'm not entirely sure if Mazda uses the same kind of TPMS sensors for their entire fleet?

Next up is an Additional Gauges App since I also connected two oil sensors to the microcontroller that deliver oil pressure and oil temperature (showing in Speedometer App, at the moment). And a track app with lap timer for the NĂĽrburgring.
Can you share details of the sensor ? :)
 
#416 ·
Hi guys! Saw you did a lot of work on creating the Emulator and working on interesting applications. I searched for an ability to develop something useful for myself (maybe for somebody here too), and I already read the wiki at GitHub and the first few pages of this theme. But the main question for me is still actual: I have Mazda 6 with 59.00.545 EU N Infotainment. No tweaks, no additional apps I installed before. To install any additional App (the basic Hello world for the first time) by the instruction I need to do the following:
Copy the contents of the folder sdcard to an SDCard and reboot your system
will that be enough? Or I need some additional activation to do? Thanks in advance!
 
#421 ·
The Custom Application SDK for the Mazda Infotainment System

It's finally coming. Instead of figuring out each application individually, I created this minimalistic micro framework and runtime that allows you to write and deploy custom applications to the Mazda Infotainment System without the hassles.

It also comes with a 1:1 simulator that allows you to run and debug your applications locally without having to deploy to the Infotainment system.

This project is currently under heavy development but hey, we got an alpha release available. There is little documentation available at this point.

Please contribute if you have the time and the energy.

We have an active Trello board running for organization:

Trello

If you find CMU values that actually provide meaning, please add them here:

Google Sheets - create and edit spreadsheets online, for free.

---

IF YOU USE THIS IN YOUR CAR, PLEASE MAKE SURE YOU HAVE A FIRMWARE VERSION OF V55.x OR HIGHER INSTALLED

Earlier version might be compatible but have not been tested.

---

GitHub - flyandi/mazda-custom-application-sdk: A micro framework that allows you to write and deploy custom applications to the Mazda Infotainment System

Download the Simulator:

OSX: https://github.com/flyandi/mazda-cu...plication-sdk/releases/download/0.0.1-alpha/casdk-simulator-0.0.1-alpha-osx.zip

Win: https://github.com/flyandi/mazda-cu...ication-sdk/releases/download/0.0.1-alpha/casdk-simulator-0.0.1-alpha-win32.zip

The runtime SDK with USB installers: https://github.com/flyandi/mazda-cu...azda-custom-application-sdk/releases/download/0.0.1-alpha/casdk-alpha-0.0.2.zip - also needed for the Simulator.

---

To get started:

1) Download the runtime SDK which contains the deploy images. Copy and paste the files in deploy/install to an USB stick, plug the stick on your infotainment and reboot your Infotainment system.

2) Download the Simulator

3) Follow the tutorial in the wiki page on GitHub

4) Copy the contents of the folder sdcard to an SDCard and reboot your system.

5) Enjoy your custom applications
PLEASE HELP ME.

When i put in the npm install -g casdk in my terminal

It keeps saying npm: command not found..

Am i doing something wrong?
 
#423 ·
I cannot deploy custom app,
I do is
1. I copied content from "casdk-alpha-0.0.2.zip" in folder /deploy/install to USB stick and reboot (I press button back + mute + NAV)
2. I copied folder app that me wrote 'app.yyy' to SDCard '/app/app.yyy'
3. I added 'app.yyy' in array in /apps/app.js of SDCard

what did i miss ?
 
#424 ·
Hi,

first of all I want to say: congratulations for such a good idea to develop possibility to have custom apps, awesome!

I started wondering if there is a way to write own very simple app with one screen which can read and show as a value, bar etc calculated values from custom PIDs. I plug in ELM327 OBD reader and in NodeMCU on ESP32 with BT I have used following (part of code) to get readings from custom PID 22042C

temp = vlink.processPID(34, 1068, 4, 4, 1, 0); // PID 22042C, Equation: ((A*256)+B)/628
if (vlink.nb_rx_state == ELM_SUCCESS)
{
D = vlink.responseByte_0;
C = vlink.responseByte_1;
B = vlink.responseByte_2;
A = vlink.responseByte_3;
PM_ACC_calc = ((C*256)+D)/655.00;


Is is a way to get such as a readings in app and show a value on a screen?
 
#427 ·
I started wondering if there is a way to write own very simple app with one screen which can read and show as a value, bar etc calculated values from custom PIDs. I plug in ELM327 OBD reader and in NodeMCU on ESP32 with BT I have used following (part of code) to get readings from custom PID 22042C

Is is a way to get such as a readings in app and show a value on a screen?
Check out Speedometer tweak sources. Some data can be obtained via dbus-send and smdb-read utilities and send to websocket.
 
#426 ·
Is it possible to extract the existing FM app and view the source from an update file such as "cmu150_ADR_74.00.324A_update.up" or is anyone able to supply the source?
Yes, it is easy. .up file is a zip archive with password protection. You can find the password on the Internet or ask me.
JS part of the app is identical in different FW versions and different regions.