RegisterSearchFAQMemberlistUsergroupsLog in
Reply to topic Page 1 of 1
MegaJolt linux tuner program anyone?
Author Message
Reply with quote
Post MegaJolt linux tuner program anyone? 
i'm a happy owner of an early MJLJ v4, installed in my rambler roadster. solved all problems and opened up the engine. i recommend MJ to everyone.

my one sore point is that there is only a Windows version of the tuner program. i've begun coding a tuner in Processing so i can use my little linux laptop. (Processing is a programming environment similar to Arduino. it's bulky, slow and sort of annoying but it's nicely open, cross-platform and my tuner will be a script you can modify).

has anyone done this yet? i've looked hard and long, and can find nothing.

i'm not waiting however. i'll test code by this weekend. i'm only coding the 10 x 10 matrix of advance numbers, and the global stuff. it wll auto-discover the USB device and identify it as MJ (i've long had code for this). what i won't do is anything particularly graphical, that's not my skill set. (embedded code and electronics is...)

View user's profile Send private message Send e-mail
Reply with quote
i have it working on the bench, with a really crappy MJLJ simulator. easier than sitting in the car working on display crap.

i know fairly well how the MJLJ works, but i have some questions:

**** expected serial communication behavior: what should i expect/test for regarding response times, delays, etc. my general approach is to flush my input buffer, send the command, delay 50 mS, slurp up all bytes (not characters) into a buffer until 100 mS timeout, count them, and see if it's the correct number. i'm not super happy with this method... i have a lot of experience with error-tolerant asynchronous serial I/O handling so i'm not scared.

***** regarding some values returned by the C command, GET IGNITION CONFIGURATION.

Advance Correction Bins (bytes 129..138)


Advance Correction Values (bytes 139..148)

do i need to worry about these values so far as display goes? i realize the MJ calcs advance as described in the manual, but do i need to reflect any of that calc on the screen? or can they just be editable bins (10 each)?

here's a screen shot. its not pretty, but the window is resizeable. uses Processing 3.x. i made an excreble MJ simulator from an Uno that just responds to commands with fixed byte responses. i'm only using it to shake out the interface and rough flow, then i'll sit in my car with the real box and make it work. i intend to make it save and load files compatible with the Windows tuner program. i'm lazy; i'd otherwise like to only include feetch that *I* need, just the basics, no shift light, aux inputs, etc.

it should work as-is on windows, macintosh, and debian linux. it auto-discovers serial devices, then opens them one by one and issues a VERSION command, to see if it gets the right response.

the GREEN cursor is the live cursor, eg. current rpm/load bin. the black rectangle is the edit bin, it moves via arrow keys. hitting ENTER on a bin highlights it RED, for editing. backspace, digits, up-arrow (increment) down-arrow (decrement) work. ENTER again ends edit. that's all working. everything is dynamic, realtime data driven, no blocking, etc.

i added some COPY COLUMN (left, right) commands. and increment/decrement all cells.

i'll put the adv correct bins in a row below the matrix.


View user's profile Send private message Send e-mail
Reply with quote
oh and what are the version command return values? I assume v4 returns "4" as major. but how do i use it to indicate compatibility? will the new /E return major=4? is there a map of features vs. versions somewhere?

View user's profile Send private message Send e-mail
Reply with quote
Post OK! silence! lol 
so i have it substantially working: discovers serial device, reliably fetches MJ data conservatively, via a state machine. gets advance bins, bin labels, etc from MJ. saves to file, loads from file, and it loads the distribution Windows tuner files fine. real-time display of runtime data (RPM, load "cursor") as well as edit-cell.

what's missing at the moment is write config to MJ, write flash, etc. i'll poke around the read-only stuff to make sure all's well and then add write-config etc.

being lazy, i'm only going to implement my needs, which is basically the advance bin stuff needed for spark timing tuning. global stuff, cylinder count, MAP/TPS mode, revLimit etc, i have no plans to add, but it would not be hard. however those datums are loaded/saved in files and fetched from MJ (and will be written to) so even now, changing them with a text editor works.

i will eventually (...) put this up on github, but in the mean time if anyone wants it, message or email me.

View user's profile Send private message Send e-mail
Reply with quote
Hi, sorry I missed this earlier, was down with the flu.

Looks like a great start! If you want to provide it as open source, we can host it on our github and make you an admin of the repository.

The current Megajolt app is written in wxWidgets, and should cross-compile to Linux as well as OS X. We migrated to Kivy for future app work (RaceCapture) as Python was much easier to work with than C++.

Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum