November 15, 2018, 07:08:32 PM

Author Topic: Custom Digital Dashboards - ARM / Arduino - New Side Project  (Read 319 times)

Offline digitalsolo

  • Administrator
  • Top Fuel
  • Location: Fort Wayne, IN
  • Posts: 22280
  • View Gallery
    • View Profile
    • LS1FC.com
Custom Digital Dashboards - ARM / Arduino - New Side Project
« on: November 06, 2018, 11:07:16 AM »
Hey all,

So, some of you may remember a while ago when I made a little Arduino based CANbus controller to drive some little OLED gauges to display data from my AEM Infinity.    Well, since then, I've been looking at all of the custom gauge clusters that Holley, AEM and others have made and while they're neat, they A) don't fit my sizing needs, B) are expensive and C) are limited in what they can do.

So.... screw it, I'll do it myself because that's what I do.

Anywho, I bought a "Manga Screen 2" which is a little 5.9" 1080P HD touchscreen and a Raspberry Pi to beta test with.   I'd originally planned to use software called RealDash and interface it to CANbus via SPI on the Pi.  Unfortunately, they won't give me or sell me a Linux build, only Android, and integrating it with Android on the Pi is tedious and limited at best.   They also have a nice way to do that, but they won't sell me that either.   So... screw 'em, I'll build my own software.

Plan now (theoretical):

Use Raspberry Pi + Arduino for prototyping; I might move to NanoPC-T4 or similar later, with more horsepower.
Run "Automotive Grade Linux" OS on the hardware
Tie CANbus direct to SPI on the single board computer
Design interface in QT for gauges (step 1)
Design interface in QT for HVAC control (step 2)
Have a snack

Right now I'm just looking to make a little standalone display, which I think won't be too bad in QT.   Feed it data from SPI (serial) and boom, gauges.   Fully customizable, fancy, color, touchscreen gauges.    But since I've got a touchscreen now...   the stock HVAC controls that came with my AC kit are ugly and dumb.  I don't like them.    They just run some servos and crap, so I figure I can replace them with solid state bits either controlled directly from my single board computer (Pi or other) or via an Arduino that is controlled by the Pi.   Then I can take up less real-estate with the ugly controls, and not have to spend 400 dollars (dafuq?) on the nominally less ugly controls.   In the meantime, I'll just dangle these controls off to the side so that I can run HVAC while I develop it.

Anywho, that's the plan.  I'm not really planning on selling this, but everything I make is always open source, so if you're so inclined from a nerd standpoint, you'll be able to replicate this with modifications for your particular implementation.

FWIW, the tech in use here is basically what the OEMs are using for digital gauges and infotainment, so if I can find the time to learn it, it should be pretty powerful.   The nice thing is there are already frameworks for most of it, and odds are, the people designing this stuff at the OEs aren't magicians, so I think I can sort it out.

We'll see what I think of this post a year from now, hahaha.
Blake MF'ing McBride
1988 Mazda RX7 - Turbo LS1/T56/ProEFI/8.8/Not Slow...   sold.
1965 Mustang Coupe - TT Coyote, TR6060, modern brakes/suspension...  project car
2013 Focus ST3 - Stage 1 BPU

Offline Venom13132

Re: Custom Digital Dashboards - ARM / Arduino - New Side Project
« Reply #1 on: November 06, 2018, 03:23:29 PM »
sounds cool to me!
1995 RX-7 - LS1 T56, LS6 Intake, Gram Lights, Yokohama, K-Sport coilovers
2007 VW Touareg V10 TDi - 10 Cylinder Twin Turbo Diesel (Daily driver and tow vehicle)

Offline digitalsolo

  • Administrator
  • Top Fuel
  • Location: Fort Wayne, IN
  • Posts: 22280
  • View Gallery
    • View Profile
    • LS1FC.com
Re: Custom Digital Dashboards - ARM / Arduino - New Side Project
« Reply #2 on: November 06, 2018, 09:04:41 PM »
Thanks!   It's pretty nerdy, but I think the end results will be pretty cool.

Some progress tonight:

1.  I have the 5.9" screen running at 1080p resolution (1920 x 1080).  It was previously running at 720x1280.
2.  I have touchscreen mapping correct.  It was rotated out of whack.
3.  I have the CANbus adapter working directly off the GPIO pins (general purpose Input/Output) and powered off of, the Raspberry Pi.
4.  I can sniff the TCP socket interface and read validate CANbus data directly off of it.   I'm using one of my little control boxes for relays to dump 3 frames over CANbus and validate that they format and fill correctly.   Everything works.

That means what is left is:

1.  Make bootup faster.   It's ~23 seconds right now.   I'd like to have that under 10, and preferrably under 5 seconds to drawing gauges.   ~15-20 seconds isn't the end of the world, but it's not as clean/professional as I want it.   QT fastboot can get me there, possibly on the Pi and definitely on the other SBCs.
2.  Make gauges to actually DO something with the CANbus data.   I may build data logging capability as well.
Blake MF'ing McBride
1988 Mazda RX7 - Turbo LS1/T56/ProEFI/8.8/Not Slow...   sold.
1965 Mustang Coupe - TT Coyote, TR6060, modern brakes/suspension...  project car
2013 Focus ST3 - Stage 1 BPU

Offline FC3S Murray

Re: Custom Digital Dashboards - ARM / Arduino - New Side Project
« Reply #3 on: November 06, 2018, 10:30:04 PM »
This is some seriously cool shit Blake. The unknown and unfamiliar always intrigue me....kinda like venturing through a haunted house. Scary exciting lol.
[smg id=9386 type=full align=center caption="82a12596 bbff 4215 91f6 83f370e7eb35 zpsdd7bd7b2"]

7 years and still running STRONG!

Offline Gunnytron

Re: Custom Digital Dashboards - ARM / Arduino - New Side Project
« Reply #4 on: November 07, 2018, 01:15:14 AM »
Sounds like some next level stuff is happening here. It will.be interesting to see the end result.
http://www.norotors.com/index.php?topic=12880.0
FD, LS1 running 220 3.90 Trickflow heads, Comp Ultra-gold Arc 1.72 Rockers, 7.550 BTR Pushrods, BTR Stage II NA Cam 227/234 .614"/.576" 113+2, ARP Head Bolts, BTR Platinum Springs, Ported FAST 90, NW 90mm TB, FAST 60lb Injectors, Textralia Clutch/Flywheel, T56, Cobra 3.55 Diff, Holley HP EFI, Racelogic TC.

Offline digitalsolo

  • Administrator
  • Top Fuel
  • Location: Fort Wayne, IN
  • Posts: 22280
  • View Gallery
    • View Profile
    • LS1FC.com
Re: Custom Digital Dashboards - ARM / Arduino - New Side Project
« Reply #5 on: November 08, 2018, 12:41:27 AM »
Well, one update.   Screw Qt.   Looking at writing this all as HTML5 instead.  :)
Blake MF'ing McBride
1988 Mazda RX7 - Turbo LS1/T56/ProEFI/8.8/Not Slow...   sold.
1965 Mustang Coupe - TT Coyote, TR6060, modern brakes/suspension...  project car
2013 Focus ST3 - Stage 1 BPU

Offline jwvand02

Re: Custom Digital Dashboards - ARM / Arduino - New Side Project
« Reply #6 on: November 08, 2018, 02:46:39 PM »
How do you get signal from sensors in the first place? IIRC, the Holley/AEM etc output CANBUS from their custom ECU solutions or require a separate module to convert resistive and voltage signals to CANBUS. Is the idea to still use the sensor module off the shelf?

Offline digitalsolo

  • Administrator
  • Top Fuel
  • Location: Fort Wayne, IN
  • Posts: 22280
  • View Gallery
    • View Profile
    • LS1FC.com
Re: Custom Digital Dashboards - ARM / Arduino - New Side Project
« Reply #7 on: November 08, 2018, 04:34:32 PM »
I'm getting data from the ECU, which talks to the sensors directly.    I can always add a little CANbus converter if I want to add more sensors though.
Blake MF'ing McBride
1988 Mazda RX7 - Turbo LS1/T56/ProEFI/8.8/Not Slow...   sold.
1965 Mustang Coupe - TT Coyote, TR6060, modern brakes/suspension...  project car
2013 Focus ST3 - Stage 1 BPU

Offline Chigliakus

  • Staged
  • Location: DFW
  • Posts: 259
  • '09 STi grocery getter -- '93 FD LS1/T56 money pit
  • View Gallery
    • View Profile
Re: Custom Digital Dashboards - ARM / Arduino - New Side Project
« Reply #8 on: November 08, 2018, 07:10:41 PM »
This is a cool project.  I'd have probably gone with GTK over Qt, HTML5 seems like the more difficult option to me.

Offline jwvand02

Re: Custom Digital Dashboards - ARM / Arduino - New Side Project
« Reply #9 on: November 09, 2018, 02:06:58 PM »
I'm getting data from the ECU, which talks to the sensors directly.    I can always add a little CANbus converter if I want to add more sensors though.

Is this for your mustang? What ECU?

Offline digitalsolo

  • Administrator
  • Top Fuel
  • Location: Fort Wayne, IN
  • Posts: 22280
  • View Gallery
    • View Profile
    • LS1FC.com
Re: Custom Digital Dashboards - ARM / Arduino - New Side Project
« Reply #10 on: November 10, 2018, 10:03:34 AM »
It is for my Mustang, yes.   ECU is AEM Infinity 10.

The python backend is pretty portable though, so building a conversion table for other ECUs isn't terribly difficult, as long as I can get a matrix of their CANbus.

As far as using HTML5 for the frontend, I know HTML, I didn't feel like the learning curve for Qt/others.  Plus they wanted 500 dollars/month to license the nicer dev tools.  :D
Blake MF'ing McBride
1988 Mazda RX7 - Turbo LS1/T56/ProEFI/8.8/Not Slow...   sold.
1965 Mustang Coupe - TT Coyote, TR6060, modern brakes/suspension...  project car
2013 Focus ST3 - Stage 1 BPU

Offline digitalsolo

  • Administrator
  • Top Fuel
  • Location: Fort Wayne, IN
  • Posts: 22280
  • View Gallery
    • View Profile
    • LS1FC.com
Re: Custom Digital Dashboards - ARM / Arduino - New Side Project
« Reply #11 on: November 12, 2018, 01:10:11 PM »
I lied.   Getting everything to work as responsively as I wanted in HTML5 was a fustercluck.

So, I'm learning Qt.   The Python backend fully processes the inputs and is easy to modify/extend for other ECUs.   It can also process the data to a .csv or other flat file format easily for data logging, so I may review what, for example, ProEFI does, and make a data logger output for those since they want like 800 dollars for one (dafuq?).

Anywho, here's what I'm doing (and I'm NOT a developer, so feel free to tell me why this is dumb):

1.  I have an SPI CANbus transceiver on the Pi pins, built to a can0 socket on the Raspbian OS (this may get upgraded to a Rock3399 platform later, but Pi is fine for prototyping)
2.  I'm running a Python backend that uses Python CAN libraries to talk to the socket.  I'm running threads to dump the data into a receive queue for processing separately (order of operations doesn't matter for this)
3.  I'm running another thread in the Python app to read the queue and process the data and dump it into variables.

That's done already.   I can print the data live and see it, and all of it matches processed output per the AEM specs for the ECU.   Building other data input channels is cake, as is extending CANbus data.  I've spent about a year playing with CAN stuff on Arduino, and AVR code is pretty much C++, which isn't far off of Python, so I'm fairly confident in this, though I may kick it out to some definitions where I can to slim the code down later.

Next theory:

Build QML based dashboard, integrated into PyQt5 launched from the app above.
Take the processed data from CANbus and format it into JSON and dump that to QML application via connect (slots and signals)
Process that data out of the JSON form to update the values in the QML app

I have most of this working in skeleton form now, at 50ms intervals, but just dumping random numbers or time/date, but the concept seems possible.   Once I get the data into QML, it's really just a matter of making a pretty GUI and binding the variables to the various properties in the GUI to show the data.   I'm better at graphic design than I am at software development, so I'm actually somewhat looking forward to that portion, once I get the rest of this sorted.
Blake MF'ing McBride
1988 Mazda RX7 - Turbo LS1/T56/ProEFI/8.8/Not Slow...   sold.
1965 Mustang Coupe - TT Coyote, TR6060, modern brakes/suspension...  project car
2013 Focus ST3 - Stage 1 BPU

Offline digitalsolo

  • Administrator
  • Top Fuel
  • Location: Fort Wayne, IN
  • Posts: 22280
  • View Gallery
    • View Profile
    • LS1FC.com
Re: Custom Digital Dashboards - ARM / Arduino - New Side Project
« Reply #12 on: November 12, 2018, 04:23:22 PM »
So I had the day off today, and there's no one home but me, so coding day it is (along with building vent windows for the Mustang and cleaning the house).

I have have my application converting CANbus data (live) into JSON formatted strings, populating only data that is received (so if the ECU doesn't send frame "X", frame "X" isn't processed).  The application then opens a QT QML application (one small demo gauge right now) and then pukes the JSON data to the name, very, very quickly (because right now I'm just proving I can dump the data real time).

Next up is figuring out how to read the JSON data and assign it to various values, real time, in the QML application.   Once that works, I can then start figuring out how to make a pretty/functional UI, but that's honestly fairly secondary right now, as that's the part that's well documented online.   CAN -> SPI -> socket -> Python -> JSON -> QML -> display, very, very quickly is less documented, though I've found a lot of people that tried and gave up in the past.   I'm not one to give up easily.  :P
Blake MF'ing McBride
1988 Mazda RX7 - Turbo LS1/T56/ProEFI/8.8/Not Slow...   sold.
1965 Mustang Coupe - TT Coyote, TR6060, modern brakes/suspension...  project car
2013 Focus ST3 - Stage 1 BPU

Offline digitalsolo

  • Administrator
  • Top Fuel
  • Location: Fort Wayne, IN
  • Posts: 22280
  • View Gallery
    • View Profile
    • LS1FC.com
Re: Custom Digital Dashboards - ARM / Arduino - New Side Project
« Reply #13 on: November 12, 2018, 09:15:34 PM »
And one more update....    javascript parsing of JSON data in QML (passed and managed via connections/signals) functions and draws.     JIT scheduler for QML doesn't seem to work in Raspbian though, so gauge animations are slow.  That's a bummer.   The PoC is good though, so the system can actually work, which is what I was aiming to prove here.

Now I need to either fix the JIT scheduler, or get a prototyping board that can compile Qt/QML functionality with the JIT scheduler working so that bindings and animations run properly.
Blake MF'ing McBride
1988 Mazda RX7 - Turbo LS1/T56/ProEFI/8.8/Not Slow...   sold.
1965 Mustang Coupe - TT Coyote, TR6060, modern brakes/suspension...  project car
2013 Focus ST3 - Stage 1 BPU

Offline Exidous

Re: Custom Digital Dashboards - ARM / Arduino - New Side Project
« Reply #14 on: November 13, 2018, 10:06:15 PM »
I know this is way early in development but....

For the FD folks. Would it be possible to drive 5 screens...? I've been trying to think of how they would be addressed. Could they be combined as one display and each screen uses it's own pixel V/H location within a combined resolution?

There are a good few screens out there that could work. Mostly from old mobile devices I think. Especially non curved samsungs with oled and Sony with ips.

Cost aside, would an Intel nuc/compute stick or similar work? They can be had to boot very fast. Under 10sec and plenty of power for our/your needs.
« Last Edit: November 13, 2018, 10:25:38 PM by Exidous »
94 BB SBE LS1 Full Mamo top, MS3ProU with TC, RONIN 8.8 and another custom dual 2.5" stainless exhaust. Too loud, need bigger muffler....