FreeEMS-Tuner Development Diary - Comments

Aaron Barnes' wxPython based FreeEMS tuning tool. No longer maintained and out of date with the protocol requirements.
User avatar
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 - Comments

Post by sry_not4sale »

You wanna buy my old laptop?? lmao

So now I have a 3 dead laptops in my stable.

Toshiba Tecra M2 laptop I brought new (plus some ram) around 4 years ago, lost a few HDDs, headphone jack got smashed (so had to use a usb sound card) but other than that worked great until 6-9 months ago when it would crash if you bumped the screen. Missing the down arrow key lol

Asus EEEpc 701 with linux. Great little thing, should have spent another $200 and got the larger screen version tho! Missing some keys and a couple of weeks ago the d/c jack at the back of the laptop broke :( Under warranty so will take it back this week hopefully!

Toshiba Tecra S1 laptop. Brought second hand after my M2 died, figured it lastest so long I should get another Toshiba! D/c jack died just after I brought it, found out its soldered to the m/b. Pulled it apart and bent some things and worked great again. Now after 6 or so months I closed the lid and unplugged to move and it locked up, screen went black. Now when you turn it on it just checks the drives and stalls with a black screen. Had it apart, starting it with minimum hardware, different combinations to try get it going. Sometimes it comes up, seems intermittant and related to the screen wiring. Fucking Toshibas!!!

So going to buy a different brand of laptop now, and not second hand again. Prob not going to have it plugged in at work any more either, I think 14 hours use a day is alot of the reason these things are dying.

Will be my primary development laptop, take it on the train. Want to find a light/small laptop, but still big enough to use. Needs to have a screen that is good in bright conditions, needs to be Linux compatible of course, d/c jack seperate to motherboard lol

Any suggestions on what to get?
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
User avatar
BenFenner
LQFP144 - On Top Of The Game
Posts: 360
Joined: Wed Jul 09, 2008 3:15 pm

Re: FreeEMS-Tuner Development Diary - Comments

Post by BenFenner »

sry_not4sale wrote:d/c jack seperate to motherboard lol
I had about a million suggestions until you dropped that bomb. Good luck! :roll:
User avatar
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 - Comments

Post by sry_not4sale »

Well, thats preferred but I am open to suggestions of laptops with sturdy looking connections :)
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: FreeEMS-Tuner Development Diary - Comments

Post by Fred »

I'd buy me EEE again, 1000 linux 40 ssd 1gig ram etc, good little machine, well worth the zero hassle factor.

bit pricey though for a cheapy... but still...

if you get one, get a thick rubber bag for it. mines a bit cracked and shagged after 3 months... but i have dropped it 4 times from 1.5 meters onto its corners on concrete ...

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!
User avatar
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 - Comments

Post by sry_not4sale »

Got a desktop PC for now, ubuntu 8.10, 19" lcd, dual core, noisy arse ps2 keyboard ftw
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: FreeEMS-Tuner Development Diary - Comments

Post by Fred »

Sweet, looking forward to your next push. I know I said I'd get my half of the deal done tonight, but I had a busy day and needed to do this presentation tonight... now I need sleep so I don't suck in front of 40 odd important people.

Hopefully Valentines day doesn't screw up my weekend too much...

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!
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: FreeEMS-Tuner Development Diary - Comments

Post by Fred »

Looking forward to trying out my two branch options a bit later. I'll be sure to post any issues here, OR, I could put them on mantis, OR I could do both. Let me know what you want. Thanks again for the supreme effort you are putting in there :-)

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!
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: FreeEMS-Tuner Development Diary - Comments

Post by Fred »

If you send me the test packet and the result from it I can probably tell you what it is and isn't doing :-)

Might test in the morning, just saw a movie with too much ocean and sky. Too busy sulking like a girl right now. Early night tonight I think.

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!
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: FreeEMS-Tuner Development Diary - Comments

Post by Fred »

Feedback, datalogs still max cpu, 50% python, 40% X, 10% system

IE, stop flogging my console with packet rx and processed :

Code: Select all

00:50:07 comms.handleReceivedPackets    DEBUG BasicDatalog packet received and processed 
00:50:07 comms.handleReceivedPackets    DEBUG BasicDatalog packet received and processed 
00:50:07 comms.handleReceivedPackets    DEBUG BasicDatalog packet received and processed 
00:50:07 comms.handleReceivedPackets    DEBUG BasicDatalog packet received and processed 
It's great that you are doing it, this is the default though :-) I wanna know if that doesn't happen. You could suggest changing the log level, but last time I tried that didn't work ;-)

Same for these :

Code: Select all

00:50:07 comms.handleReceivedPackets    DEBUG AsyncError packet received and processed 

Although that should probably get output somewhere with it's number and message, but not just that it was received, do both at once.

I am getting :

Code: Select all

#define payloadLengthTypeMismatch		0x4004
#define payloadLengthHeaderMismatch		0x4005
#define invalidPayloadID				0x4006
Those errors. The funny thing is that I only get some when I have RPM input which makes me think "bug in my code" though not sure how/why... I could load up the 36-1 code now and see if that makes the issue go away. There are definitely issues in yours though.

Code: Select all

00:50:08 comms.default.receive          ERROR processReceiveBuffer could not parse buffer. Found a start byte mid-way though packet 
No packet was attached! If this was for real, I would want to see the packet contents to find out what went wrong. I don't think it was for real though.

Code: Select all

00:50:08 comms.default.receive          ERROR processReceiveBuffer could not parse buffer. Checksum is incorrect! Provided: 0, generated: 155 
Again, no packet. It would be nice to know why these are happening be it your fault or mine :-)

One thing that is obviously missing considering the verbosity of these logs is something like :

"Received garbage between packets, dropping..."

You should be doing that a LOT with the byte 0xAA that I spuriously place in front of many packets frequency dependently. This is something else that I don't want to know about, provided the rest works well.

-------------------------------------------------------------------------

It seems to me that you aren't layering your processing properly. Trying to do it all at once in one place or something?

Your logic should be in layers :

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

Packetise stream into chunks :

receive stream watching for start byte and silently dropping all bytes until one is found.

put bytes into single shot buffer of 4200 bytes length until you find a stop byte (this length is worst case for fully escaped packet raw)

once you find a stop byte, place packet on queue and start looking again

If you find a start byte in the middle, print error, print packet received thus far and drop it

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

Then per raw packet you should :

strip out escapes and check the checksum

Do NOT be tempted to do more than this, it is a natural discreet step.

print error with packet contents for bad checksums

place OK checksums on another queue

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

Then per processed packet you should :

check validity of header vs body and place into a data structure of approx 2100 in total length

print error with packet contents for stuff that doesn't check out properly

place OK packets on appropriate queue or queues for further processing by specific code.

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

If you keep it modular and discreet like this you can eliminate bugs. These receive bugs have been around for quite a while now :-)

http://www.extremeprogramming.org/rules/optimize.html

We need it to work 100% before we go making it fast :-)

It doesn't even make sense to try to do any of those aspects at the same time as for each one you are relying on the result of the previous one to perform your work.

*********************************************************

Question, is your logging using the binary strings? or the slow python strings? or what?

Logging is the bottle neck right now despite the errors.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

idea : if you want to know when you do those basic tasks right, print a single specific char out for each time with no newline. This will significantly reduce load on X from scrolling the large xterm and still provide debug info in the short term while we need it.

how about :

'.' for datalog packets
'*' for leading garbage

debug should be a printed out line with my string
error should be a printed out line with my code and matching string

yes, it would mean legit messages were displaced to the right, but its a temp measure and the best of several evils.

Thoughts?

I'm thinking debug is getting ditched in favour of error packets and custom mapping files for the gui.

GASP :-)

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!
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: FreeEMS-Tuner Development Diary - Comments

Post by Fred »

OK, those comments were all about the master branch...

I assume all the new work is on the devtrunk branch?

devtrunk got me this : http://i260.photobucket.com/albums/ii15 ... 5-2-09.png

So I couldn't do much. The gui was frozen and clicking the close box did nothing. Ctrl C to the rescue.

Looks like it's dumping ALL bytes to the console?

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!
Post Reply