FreeEMS-Tuner Development Diary - Don't Post!
- sry_not4sale
- LQFP144 - On Top Of The Game
- Posts: 568
- Joined: Mon Mar 31, 2008 12:47 am
- Location: New Zealand, land of the long white burnout
- Contact:
Re: FreeEMS-Tuner Development Diary - Don't Post!
Code to decode and display datalog packets in realtime interface:
721dc65ef0cb41c4b38a4b4e6e9e34b65e783409
All data is assumed to be an unsigned int, is displayed raw and unprocessed (except for averaging the two values received).
721dc65ef0cb41c4b38a4b4e6e9e34b65e783409
All data is assumed to be an unsigned int, is displayed raw and unprocessed (except for averaging the two values received).
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
165hp @ 6psi standard - fastest production car in japan Oct 82
- sry_not4sale
- LQFP144 - On Top Of The Game
- Posts: 568
- Joined: Mon Mar 31, 2008 12:47 am
- Location: New Zealand, land of the long white burnout
- Contact:
Re: FreeEMS-Tuner Development Diary - Don't Post!
Had a tinker with Link's latest tuning software... got some ideas
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
165hp @ 6psi standard - fastest production car in japan Oct 82
- sry_not4sale
- LQFP144 - On Top Of The Game
- Posts: 568
- Joined: Mon Mar 31, 2008 12:47 am
- Location: New Zealand, land of the long white burnout
- Contact:
Re: FreeEMS-Tuner Development Diary - Don't Post!
Did some work on some serial issues, not sure if they are restricted to the way Fred stuff has stuff set up or not. Will have to get my board running to see!
Also, been working on data logging - seems the bug in the tracker was a bit out-of-date, so fixing the code will be tonights job!
New data log spec:
http://tuner.freeems.org/ticket/7
Also, been working on data logging - seems the bug in the tracker was a bit out-of-date, so fixing the code will be tonights job!
New data log spec:
http://tuner.freeems.org/ticket/7
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
165hp @ 6psi standard - fastest production car in japan Oct 82
- sry_not4sale
- LQFP144 - On Top Of The Game
- Posts: 568
- Joined: Mon Mar 31, 2008 12:47 am
- Location: New Zealand, land of the long white burnout
- Contact:
Re: FreeEMS-Tuner Development Diary - Don't Post!
Datalogging now works with the lastest firmware code!
Also made leaps and bounds on the table tuning code - should load from the ecu and display in the grid soon! Updating cells is then a trivial patch.
Also made leaps and bounds on the table tuning code - should load from the ecu and display in the grid soon! Updating cells is then a trivial patch.
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
165hp @ 6psi standard - fastest production car in japan Oct 82
- sry_not4sale
- LQFP144 - On Top Of The Game
- Posts: 568
- Joined: Mon Mar 31, 2008 12:47 am
- Location: New Zealand, land of the long white burnout
- Contact:
Re: FreeEMS-Tuner Development Diary - Don't Post!
Finally managed to push my latest changes to github.
Double start and end bytes caused by a bug in the firmware now are ignored by the Tuner - so now for the first time the Tuner processes streaming data logs over serial with no errors All packets decode without issue!
Also, I have improved the real time data tab to format values in a more user readable manner.
Double start and end bytes caused by a bug in the firmware now are ignored by the Tuner - so now for the first time the Tuner processes streaming data logs over serial with no errors All packets decode without issue!
Also, I have improved the real time data tab to format values in a more user readable manner.
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
165hp @ 6psi standard - fastest production car in japan Oct 82
- sry_not4sale
- LQFP144 - On Top Of The Game
- Posts: 568
- Joined: Mon Mar 31, 2008 12:47 am
- Location: New Zealand, land of the long white burnout
- Contact:
Re: FreeEMS-Tuner Development Diary - Don't Post!
Got some important bugs fixed over the last few days...
The comms File based input plug-in now splits the input file into chunks, and sleeps between each to better replicate a real Serial connection. (The sleeps also prevent it saturating your cpu)
Fixed a pesky bug in the receive code which was causing the thread to lose part packets (the _process() method was reseting the serial cache after it had found all complete packets).
Made any modifying of the serial cache locked so it is absolutely thread safe.
Fixed a crash on empty packets (e.g. start byte followed by an end byte).
Now we have an issue with the gui thread not being able to keep up with the serial data, and because of this the gui updates get backed up. I am going to change the logic so the gui is updated x times a second with the latest data, which should fix this.
The comms File based input plug-in now splits the input file into chunks, and sleeps between each to better replicate a real Serial connection. (The sleeps also prevent it saturating your cpu)
Fixed a pesky bug in the receive code which was causing the thread to lose part packets (the _process() method was reseting the serial cache after it had found all complete packets).
Made any modifying of the serial cache locked so it is absolutely thread safe.
Fixed a crash on empty packets (e.g. start byte followed by an end byte).
Now we have an issue with the gui thread not being able to keep up with the serial data, and because of this the gui updates get backed up. I am going to change the logic so the gui is updated x times a second with the latest data, which should fix this.
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
165hp @ 6psi standard - fastest production car in japan Oct 82
- sry_not4sale
- LQFP144 - On Top Of The Game
- Posts: 568
- Joined: Mon Mar 31, 2008 12:47 am
- Location: New Zealand, land of the long white burnout
- Contact:
Re: FreeEMS-Tuner Development Diary - Don't Post!
Sooo....
Lots of empty packets happening due to the double start/end bytes bug, so changed the exception type to IgnorableParsingException - so they aren't logged.
Also, added a timer to the realtime vars gui - hope this fixes your problems fred! It will now only update the gui every x milliseconds, and only if a datalog packet has been received since the last update. Default is every 1/10 a second, but it is configurable in the config file (check your config.default.ini file for details).
Currently the gui thread is handling both the data log packet parsing, and the updating of the gui. I need to either setup worker threads to offload the parsing to, or move this into the receive thread as it is pretty low-level stuff. Either way I need to get it out of the gui code, and into something more comms orientated - as this data won't just be used in the tab.
Added support for bootstrap files, simply add one called bootstrap.py - and it will be called on startup before anything else.
And lastly, (hopefully) fixed the Windows bug walkercam found with Windows serial port identifiers - wonder if he can confirm it's fixed for me?
Lots of empty packets happening due to the double start/end bytes bug, so changed the exception type to IgnorableParsingException - so they aren't logged.
Also, added a timer to the realtime vars gui - hope this fixes your problems fred! It will now only update the gui every x milliseconds, and only if a datalog packet has been received since the last update. Default is every 1/10 a second, but it is configurable in the config file (check your config.default.ini file for details).
Currently the gui thread is handling both the data log packet parsing, and the updating of the gui. I need to either setup worker threads to offload the parsing to, or move this into the receive thread as it is pretty low-level stuff. Either way I need to get it out of the gui code, and into something more comms orientated - as this data won't just be used in the tab.
Added support for bootstrap files, simply add one called bootstrap.py - and it will be called on startup before anything else.
And lastly, (hopefully) fixed the Windows bug walkercam found with Windows serial port identifiers - wonder if he can confirm it's fixed for me?
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
165hp @ 6psi standard - fastest production car in japan Oct 82
- sry_not4sale
- LQFP144 - On Top Of The Game
- Posts: 568
- Joined: Mon Mar 31, 2008 12:47 am
- Location: New Zealand, land of the long white burnout
- Contact:
Re: FreeEMS-Tuner Development Diary - Don't Post!
Just uploaded working code for loading a table and displaying it in the tuning table
Have some value displaying tweaks to make, but it works!
Cell updating in the next day or two.
Cheers!
Have some value displaying tweaks to make, but it works!
Cell updating in the next day or two.
Cheers!
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
165hp @ 6psi standard - fastest production car in japan Oct 82
- sry_not4sale
- LQFP144 - On Top Of The Game
- Posts: 568
- Joined: Mon Mar 31, 2008 12:47 am
- Location: New Zealand, land of the long white burnout
- Contact:
Re: FreeEMS-Tuner Development Diary - Don't Post!
After some battling with wxPython to get currently selected cell information, and some toing-and-froing - we have cell tuning!
You can now select a cell, and using the j/k keys - decrement/increment the cell's value. Each time the cell is updated a packet is sent to the ecu updating the table cell stored in ram.
The cells are set read-only, as I could not get a handle on the wxpython cell editors. But the j/k keys update and refresh the displayed values so that is fine for now.
I think I will update the code so that after 500milliseconds of no adjustments, it sends the new value to the ecu. Or something similar, cos it is going to be sending a lot of packets.
Also, the datalogging backend requires a bit of a rewrite. It needs to live somewhere other than the gui thread, and needs to be a bit more low-level in the protocol code so I can use it do highlight the current cell in the tuning table.
Latest code:
http://github.com/srynot4sale/freeems-t ... s/devtrunk
Or get notified of commits via twitter!
http://twitter.com/FreeEmsTuner
You can now select a cell, and using the j/k keys - decrement/increment the cell's value. Each time the cell is updated a packet is sent to the ecu updating the table cell stored in ram.
The cells are set read-only, as I could not get a handle on the wxpython cell editors. But the j/k keys update and refresh the displayed values so that is fine for now.
I think I will update the code so that after 500milliseconds of no adjustments, it sends the new value to the ecu. Or something similar, cos it is going to be sending a lot of packets.
Also, the datalogging backend requires a bit of a rewrite. It needs to live somewhere other than the gui thread, and needs to be a bit more low-level in the protocol code so I can use it do highlight the current cell in the tuning table.
Latest code:
http://github.com/srynot4sale/freeems-t ... s/devtrunk
Or get notified of commits via twitter!
http://twitter.com/FreeEmsTuner
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
165hp @ 6psi standard - fastest production car in japan Oct 82
Re: FreeEMS-Tuner Development Diary - Don't Post!
Keep up the good work man! I really appreciate your efforts!! We're on the home straight now, for sure :-)
Fred.
Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!