2004 to 2016 Mazda 3 Forum and Mazdaspeed 3 Forums banner

401 - 416 of 416 Posts

·
Registered
Joined
·
33 Posts
Hi,
i was thinking about an app for the display. I thinkg that is not so difficult to implement. A sort of color picker (color palette) that can allow to chose a color and send that color to an arduino (wemos d1 mini) over wifi and turn on the ambient lights inside the car. What do you think about?
If we find a way to replicate MazdaRacerDude's libusb connection via m3 toolchain (which is a bottleneck I'm working on for two other applications), that could be possible.
The second bottleneck then is the question, can a CASDK app write a oneliner to "/tmp/mnt/data_persist/dev/bin/"? Then the app could allow you to pick a color, store the color code in that oneliner file and the microcontroller at the usb plug could look for a change every second, read the color code and drive RGB LEDs.

For that first problem, we'd need someone who could help/explain how to flash that code from MazdaRacerDude onto a RedBear Duo or Arduino Due (should work, it also has a ARM Cortex-M3 chip). Or if possible, other (easier?) ways, maybe even on other microcontroller boards?
 

·
Registered
Joined
·
33 Posts
Hi,
i was thinking about an app for the display. I thinkg that is not so difficult to implement. A sort of color picker (color palette) that can allow to chose a color and send that color to an arduino (wemos d1 mini) over wifi and turn on the ambient lights inside the car. What do you think about?
Look at this ... https://www.youtube.com/watch?v=7Dv70ci-MOw&t=64s:laugh2:
Can someone implement this stuff? :)
Cheers
@Festercluck @xenosap1en @flyandi @Trezdog44
I'm trying to figure this out but I could use a little help:

a) CASDK apps are running on node.js so I should be able to use child_process to send a bash command, right?
Code:
var exec = require('child_process').exec;
var cmd = '/tmp/mnt/data_persist/dev/bin/usb_comm_script -s LED -p RED='+red+' -p GREEN='+green+' -p BLUE='+blue;
exec(cmd, function(error, stdout, stderr) {
// command output is in stdout
});
b) I wanted to use <input type="range"> and I can use the wheel to select them and change the values, but I'm not sure about touch functionality. I seem to be unable to put an eventListener onto elements.
 

·
Registered
Joined
·
33 Posts
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.
 

·
Registered
Joined
·
24 Posts
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.
 

·
Registered
Joined
·
24 Posts
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?
 

·
Registered
Joined
·
33 Posts
@jupiter95 Well, 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.


Well here are the scripts getting the values and writing them to temp files: https://github.com/Trevelopment/MZD-AIO/tree/master/app/files/tweaks/casdk/scripts
this one watches them all: https://github.com/Trevelopment/MZD-AIO/blob/master/app/files/tweaks/casdk/resources/aio/autorun/mzd-casdk.start
and here are the subscription handlers so the values can be accessed by the JavaScript code: https://github.com/Trevelopment/MZD-AIO/blob/f3f9049cfc804014a912a601a962a573170becfe/app/files/tweaks/casdk/resources/aio/mzd-casdk/runtime/runtime.js#L1253

So I don't know what you are looking for but I tried to include every possible available value table that could be read.
So, the OBD-2 PIDs for Mazda 3 and MX-5 ND TPMS info are known, finally. How do these numerical PIDs translate to the IDs that are polled by CASDK? Can the CASDK handle OBD-2 PIDs like "222A05"? Because all I see in CASDK are non-numerical IDs like "VehicleSpeed" or "Drv1AvlFuelE".

(Can't test at the moment, since the car's in storage during winter.)

Thx
 

·
Registered
Joined
·
24 Posts
@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.
 

·
Registered
Joined
·
33 Posts
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.
 

·
Registered
Joined
·
17 Posts
Hi all,

I'm looking to implement Waze open source app on my mazda 2017 multimedia system.
using this forum i did it with Android Auto and it works great, however, I would like it to be independent and not require the phone, only hotspot for internet connection.
Is it possible at all?


Thanks in advance!
 

·
Registered
Joined
·
33 Posts
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.
 

·
Registered
Joined
·
1,202 Posts
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...
 

·
Registered
Joined
·
33 Posts
@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.
 

·
Registered
Joined
·
1 Posts
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!
 
401 - 416 of 416 Posts
Top