Zed Diagnostic Software - roll your own

Discussion in 'Non Technical' started by Vader, Jun 23, 2009.

  1. Vader

    Vader Just another guy

    Ok, so now I am beginning to understand why Android is left out sometimes.

    My first choice with Android development (AGK) doesn't support Serial Ports, so no joy there. (1st choice because I already own it.)

    My second choice (MonoDevelop) is the most expensive of the options I am aware of. However, get this - if you want to work with Serial Ports, you have to create your own custom version of Linux and re-compile it. :eek: Ok, so that isn't going to happen, not for Android development for certain.

    So, now my third choice allows me to use BASIC instead of C#, which I was steering away from. Only because I am now a C# developer, but after using BASIC since 1984, I think I can handle it. (Yes, that was 19 eighty four for all you young-uns out there :))

    So, I will use the trial and re-write the Comms library I have just developed, and see how it works.

    Unfortunately it means I will have two seperate code bases, which means I have to add features and fix bugs in two code sets, but it's better than spending weeks having to learn Java.

    Downloading now...
     
  2. Turbo Z

    Turbo Z Speed Freak

    Well done on what you've done so far.

    I feel you'd save yourself a lot of time going down the Java route. If you know C# already, just throw out the platform dependent Windows API stuff and you've basically got Java anyway. That'd set you up for a easy integration to Android too.
     
  3. Vader

    Vader Just another guy

    And so here is a poll to allow me to move forward...

    http://www.aus300zx.com/forum/showthread.php?t=322393

    The good news is that I got a job offer today, so I will be buying the necessary software and hardware anyway. yay!

    Edit: The other good news is that I will start the Android version within the next couple of days :)
     
    Last edited: Dec 20, 2012
  4. black baz

    black baz black 'n blue Bazemy

    congrats on your job offer ... that must be one hell of a relief.

    following your thread/work with great interest .. top stuff.
     
  5. Vader

    Vader Just another guy

    OT but hey it's my thread so what the hell :p.

    The job offer is conditional on the government actually giving the go ahead for it. (Government department)

    Who in their right mind starts advertising and interviewing for a job that hasn't been approved? :mad:

    Hopefully everything goes as planned.
     
  6. QLDZDR

    QLDZDR ID=David

    Good luck with the job.

    Android version? what will the Hardware interface be?
    I see hardware like this for $25?
    [​IMG]
    but Android would need a bluetooth interface???
     
  7. I've delt with similar... when private companies are vying for govt contracts, they will pull people and their resumes in to bid for the work.

    Don't get discouraged, but I would continue looking for a job while waiting for them...

    Good luck!
     
  8. Vader

    Vader Just another guy

    Where can you get those for $25? I was going to get something VERY similar, but they were advertised for $75.

    Edit: Ok, so I think I mis-read the title. This is a consult interface that works via USB. I'll post up the product link I know of.

    Edit 2:
    Here it is... a Bluetooth consult interface that should also work with any device. *should* - no guarantees of course. I'm going to contact them to see if they will do a GB.

    [​IMG]
     
  9. QLDZDR

    QLDZDR ID=David

    I put all the info and link in a thread.
    Slick pencil told me that he bought one.
     
  10. Vader

    Vader Just another guy

    Apparently they will do something for a GB, but no details as yet.

    They offered another option (not worth going into) which I declined.

    At this stage I am probably just going to buy one at full price.
     
  11. QLDZDR

    QLDZDR ID=David

    there is no mention of software on the website for the bluetooth adapter.
    This software product looks cheap enough to try if anyone buys this adapter.

    NikoZ is a diagnostic app which helps you monitor your engine. You can read and clear stored fault codes and also view values from different sensors that provide the ECU (and now you too) with information.

    Please, read the FAQ page BEFORE you buy!

    http://www.atri.se/NikoZ/faq.html
    tags: 200SX 300ZX Skyline
     
  12. Vader

    Vader Just another guy

    99% of anyone on this forum that are at all interested in Android and diagnostics already know about this app.

    I suggest you search for this stuff before you post it as new info.
     
  13. Vader

    Vader Just another guy

    Ok, so this is my progress update...

    [The remainder of this post is technical, however I have tried to keep it easy to follow]

    I have decided to rewrite a whole bunch of code to make the class easier to use.

    Please note that all sample projects and code will be provided in both C# and VB.Net

    Here are some examples...

    Create instance of class:
    Comms.ECU ECU = new Comms.ECU(new System.IO.Ports.SerialPort("COMM1"));

    Connect to ECU:
    ECU.Connect();

    Retrieve ECU Partnumber (string Partnumber):
    ECU.PartNumber

    Reset current fault codes:
    ECU.ResetCodes();

    Retrieve list of fault codes from set 1:
    ECU.ReadDTC(1);

    Retrieve list of fault codes from set 2:
    ECU.ReadDTC(2);

    Retrieve list of fault codes from set 3:
    ECU.ReadDTC(3);

    Faults are returned as a List<of ECU.Fault>



    Properties of each fault are:
    • Code
    • Description
    • Recommendation
    • Priority
    • Order
    • Applicability
    This data could be used in any number of ways to not only give the description of a DTC, but to also assist in trouble-shooting the problem.


    [I am considering adding a reference, however the actual reference depends upon the FSM in use. For example, my 1992 FSM has different page numbers to a 1990 FSM]

    Reading sensor data.
    Note: This is where I have been focusing my time today. The idea was that even though I had working code, it wasn't working very well, especially if you wanted to retrieve multiple sensor data. Thus I had to get it working in an easier fashion. I think I have now done that.

    The method to read Sensor data, is not surprisingly called ReadSensors(). It returns a List<of SensorData>.

    To use it, you first have to create a List to store the data:
    List<SensorData> Sensors = newList<SensorData>();

    Then, call the method and fill the List:
    Sensors = ECU.ReadSensors();

    NOTE: The above call will fail as you have to supply at least one SENSOR to read.

    For example:
    Sensors = ECU.ReadSensors([SIZE=2][COLOR=#2b91af]ECU[/COLOR][/SIZE].[SIZE=2][COLOR=#2b91af]SENSOR[/COLOR][/SIZE].CAS)

    The maximum number of sensors you can specify in the one call is 20. Here is how you would call three:
    Sensors = ECU.ReadSensors([SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ECU[/COLOR][/SIZE][/COLOR][/SIZE].[SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]SENSOR[/COLOR][/SIZE][/COLOR][/SIZE].CAS, [SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ECU[/COLOR][/SIZE][/COLOR][/SIZE].[SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]SENSOR[/COLOR][/SIZE][/COLOR][/SIZE].CAS_Ref, [SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ECU[/COLOR][/SIZE][/COLOR][/SIZE].[SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]SENSOR[/COLOR][/SIZE][/COLOR][/SIZE].InjectorTime_LH)

    To read one, you could specify any of the following:
    Sensors = ECU.ReadSensors([SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ECU[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2].[/SIZE][/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]SENSOR[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2].[SIZE=2][SIZE=2]Coolant_Temp[/SIZE][/SIZE])[/SIZE][/SIZE]
    Sensors = ECU.ReadSensors([SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ECU[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2].[/SIZE][/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]SENSOR[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2].O2_LH)[/SIZE][/SIZE]
    Sensors = ECU.ReadSensors([SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ECU[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2].[/SIZE][/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]SENSOR[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2].IgnitionTiming)[/SIZE][/SIZE]
    Sensors = ECU.ReadSensors([SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ECU[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2].[/SIZE][/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]SENSOR[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2].FuelTemp)[/SIZE][/SIZE]
    Sensors = ECU.ReadSensors([SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ECU[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2].[/SIZE][/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]SENSOR[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2].Speed)[/SIZE][/SIZE]

    (Of course all 18 Z32 sensors are available)




    Each sensor will have the following data returned:
    • Name
    • Data
    • Unit
    For example, specifying ECU.[SIZE=2][COLOR=#2b91af]SENSOR[/COLOR][/SIZE].CAS, you would get something like the following returned: "CAS", 1200.0, "RPM".

    This data would then be used in a graphing application to populate the title ("CAS"), the value (1200.0) and the unit of measure ("RPM").

    The next step I am to perform is to build a simple graphic application that will display some of these sensors in a graphical manner.

    I know this is a departure from the Comms layer coding, but is necessary to ensure I can read data sufficiently well (i.e. fast enough) to allow graphing, which I expect most developers will want to do (including me).

    EDIT:
    I forgot to mention that I am also creating lots of diagnostic information that is used to debug any issues.
    For example, here is the debugging data when reading the Vehicle Speed (SENSOR.Speed):
    =======Command Start========
    # Command: Speed
    # Parameters...
    # Retrieve Data: True
    # Ignore NULL: False
    -----------Sent-> 0x5A (90)
    -----------Sent-> 0xB (11)
    # Waiting for 2 byte(s) #
    <-Received------- 0xA5 (165)
    <-Received------- 0xB (11)
    -----------Sent-> 0xF0 (240)
    # Waiting for 1 byte(s) #
    <-Received------- 0xFF (255)
    # Waiting for 1 byte(s) #
    <-Received------- 0x1 (1)
    # Waiting for 1 byte(s) #
    <-Received------- 0x0 (0)
    -----------Sent-> 0x30 (48)
    # Stop sent-----> ^^
    # Port cleared #
    # Result: 0

    I hope the above hasn't been too technical or boring for you to understand where I am at.
     
  14. Vader

    Vader Just another guy

    Another setback :(

    My serial Consult has just died (well, I think so as it is really hot and I can't connect to it).

    So... I just bought a bluetooth Consult adapter and I will see how well that works. Just gotta wait for the postman.
     
  15. QLDZDR

    QLDZDR ID=David

    Am I in the doghouse? [​IMG]

    I posted my last comment via smart phone LOL.
    I should qualify that the part that I have highlighted (which didn't highlight last time) is the referred info from the Bluetooth hardware company, (their words not mine) when I asked if they provided any test/diag software with their hardware
    (ie, to test their hardware so I would know it was working if I bought it, while waiting for your inVaderZed app) I didn't get back to this thread to edit my comment.

    NikoZ is a diagnostic app which helps you monitor your engine. You can read and clear stored fault codes and also view values from different sensors that provide the ECU (and now you too) with information.

    Please, read the FAQ page BEFORE you buy!

    http://www.atri.se/NikoZ/faq.html
    tags: 200SX 300ZX Skyline


    IMO, if anyone wanted to buy the $75 hardware, they could buy the cheap NikoZ just so they know it works, while waiting for your app.
    No reason to wait. More test pilots for you :br:
     
  16. Vader

    Vader Just another guy

    I have the ConsultBT adapter now - just getting my head around working with Android...
     
  17. Wasgood

    Wasgood New Member

    There was some code for diagnostic software for a linux PC awhile back.

    It was coded in Objective C, which I can't understand.
     
  18. Vader

    Vader Just another guy

    Ok, so I think I have a handle on Android dev. Finally.

    I can initiate comms with the ECU and get the correct reply (I think :eek:)

    The REALLY great news is that using my phone I can talk to the ECU through the ConsultBT adapter, but my Windows PC can't do the same thing.
    Lol, I don't care about Windows right now - this is all about Android!

    I'll see if I can get back to this tomorrow afternoon - it's starting to get a little exciting :cool: :eek: :zlove:
     
  19. Madcow

    Madcow Active Member

    I might be barking up the wrong tree on this one...


    But you said you could make changes to the ROM but only temp?

    Does the mean that if i was on a dyno, making changes to the rom as i went, I could then find the tune that works with my setup, then copy the tune that was done on the dyno, and have it burnt onto another chip?
     
  20. stumagoo

    stumagoo Active Member

    I believe this is correct for some of the current systems available.
     

Share This Page