OBDX Development - Developer Tools and Suggestions

Programs / Tools / Scripts
User avatar
Tazzi
Posts: 3558
Joined: Thu May 17, 2012 8:53 pm
cars: VE SS Ute
Location: WA
Contact:

Re: OBDX Development - Developer Tools and Suggestions

Post by Tazzi »

Thanks for that Ken, might set up in a virtual machine to do that so I dont mess with my PC.

It doesnt help that I am not using a regular installer signature (one produced by Microsoft) or from other big vendors like AdvancedInstaller ect, simply because they are unable to modify the XML if it is already present. I could just replace it, which I believe is what the VX Nano installer does, but that then just frustrates technicians.

I have also just thrown together a basic application to enable/disable debug logs, and to also allow uploading the logs for review as I am sure I am going to need that. Other then that, there is not really any other settings that need to be modified.
Your Local Aussie Reverse Engineer
Contact for Software/Hardware development and Reverse Engineering
Site:https://www.envyouscustoms.com
Mob:+61406 140 726
Image
User avatar
Tazzi
Posts: 3558
Joined: Thu May 17, 2012 8:53 pm
cars: VE SS Ute
Location: WA
Contact:

Re: OBDX Development - Developer Tools and Suggestions

Post by Tazzi »

Just for reference and so I can check this later, attached in a J2534 log using the MDI for flashing the VY P01 ECU on the bench.
You can actually see in the log that the tool also tries to connect to CANBus after selecting a LS1 engine computer for programming, same thing I have seen with D-PDU.


Anyways, last line from the engine computer to indicate its received the last block is at: 11:21:35.974
The PCM then appears to auto reboot and live data flows through, SPS then polls the readmsg request for about 3 seconds before sending 6C FE F0 28 00

So, when at 4x.. there is around a 3second gap where the OBDX Pro VT does no receive anything.
Now... I wonder if I can make the DLL detect how long it has gone without a successful read when in 4x mode. Could possibly make it trigger going into 1x mode automatically after waiting say.. 2seconds? Since at no point does it wait around long.

Yeah that might work.. if can set a global variable for when a frame is not found when in 4x mode.. then every subsequent request will then compare current time against original time, after X time has elapsed, it will then switch to 1x mode.
Its the best way I can think of for now.
Your Local Aussie Reverse Engineer
Contact for Software/Hardware development and Reverse Engineering
Site:https://www.envyouscustoms.com
Mob:+61406 140 726
Image
User avatar
Tazzi
Posts: 3558
Joined: Thu May 17, 2012 8:53 pm
cars: VE SS Ute
Location: WA
Contact:

Re: OBDX Development - Developer Tools and Suggestions

Post by Tazzi »

And we have success!

The RXD message there is the last block response from the ECU.

From there, we recieve our first PassthuRead request when still in 4x. The timer starts at that first request and then switches to 1x at around the 1:53:20 mark.
At 1:53:21, we then have SPS write the disable chatter command which it does get a response, which confirms we switched to 1x successfully.

So... this technically solves the 4x issue!! Woohoo!!

I currently have the switch set to 2seconds of recieving nothing, but will nudge that to 1.5seconds. I say that simple because if the disable chatter command is sent before it switches to 1x, it fails and tries to reload the flash again.

Code: Select all

1:53:18 PM Thursday, 21 April 2022  : RX Message: 6CF010 76 00 86
1:53:18 PM Thursday, 21 April 2022  : msg return success
1:53:18 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 0
  Num Msgs: 1
1:53:19 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:19 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 0
  Num Msgs: 1
1:53:19 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:19 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 0
  Num Msgs: 1
1:53:19 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:19 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 0
  Num Msgs: 1
1:53:19 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:20 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 0
  Num Msgs: 1
1:53:20 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:20 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 0
  Num Msgs: 1
1:53:20 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:20 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 0
  Num Msgs: 1
1:53:20 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:21 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 0
  Num Msgs: 1
1:53:21 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:21 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 0
  Num Msgs: 1
1:53:21 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:21 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 0
  Num Msgs: 1
1:53:21 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:21 PM Thursday, 21 April 2022  : PassThruWriteMsgs Called
1:53:21 PM Thursday, 21 April 2022  : Sending: 6CFEF0  28 00
1:53:21 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:21 PM Thursday, 21 April 2022  : RX Message: 6CF010 68 00
1:53:21 PM Thursday, 21 April 2022  : msg return success
1:53:21 PM Thursday, 21 April 2022  : PassThruWriteMsgs Called
1:53:21 PM Thursday, 21 April 2022  : Sending: 8CFEF0  3F
1:53:21 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:21 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:21 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:22 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:22 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:22 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:22 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:22 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:22 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:22 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:22 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:22 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:22 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:22 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:22 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:22 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:22 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:22 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:22 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:22 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:22 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:22 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:22 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:23 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:23 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:23 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:23 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:23 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:23 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:23 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:23 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:23 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:23 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:23 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:23 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:23 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:23 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:23 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:23 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:23 PM Thursday, 21 April 2022  : Empty buff 1 return
1:53:23 PM Thursday, 21 April 2022  : PassThruWriteMsgs Called
1:53:23 PM Thursday, 21 April 2022  : Sending: 6C10F0  3B 01 00 36 47 31 59 4B
1:53:23 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
  Num Msgs: 1
1:53:23 PM Thursday, 21 April 2022  : RX Message: 6CF010 7B 01
1:53:23 PM Thursday, 21 April 2022  : msg return success
1:53:23 PM Thursday, 21 April 2022  : PassThruWriteMsgs Called
1:53:23 PM Thursday, 21 April 2022  : Sending: 6C10F0  3B 02 34 32 46 33 34 4C
1:53:23 PM Thursday, 21 April 2022  : PassThruReadMsgs Called:  timeout: 100
Your Local Aussie Reverse Engineer
Contact for Software/Hardware development and Reverse Engineering
Site:https://www.envyouscustoms.com
Mob:+61406 140 726
Image
User avatar
Tazzi
Posts: 3558
Joined: Thu May 17, 2012 8:53 pm
cars: VE SS Ute
Location: WA
Contact:

Re: OBDX Development - Developer Tools and Suggestions

Post by Tazzi »

Next discovery is understanding the whole mask and filter situation.

After seeing canbus and ALDL, I can now see what they are doing.

Even though the SAE indicates that you are to use the exact filter/mask size, GM coders basically just set it up so it will do one of the three things:
1) Filter Priority only (1 byte)
2) Filter Priority and destination (2 byte)
3) Filter priority, destination and source (3 byte)
4) as above but uses 4 bytes, because they are idiots - must force byte length as 3 here.

The way its designed is you build your unsigned integer in a loop.. so along the lines of
for (int i=; i<length;i++) mask+= array<<((8*(length-1)-i);

That way if would work for any length of bytes used for both mask and pattern (ID).

So I have seen SPS use all 4 options above. Only one that needs attention is when it requests to use 4 bytes since you can only filter a max of 3 for VPW.

SPS actually sets both mask and filter to 0 when its flashing, I guess its to detect other modules interrupting.

I have now completed a couple dozen plus writes now using the new 4x to 1x switch coding.. so I would say thats ready to be part of initial release.
Your Local Aussie Reverse Engineer
Contact for Software/Hardware development and Reverse Engineering
Site:https://www.envyouscustoms.com
Mob:+61406 140 726
Image
User avatar
Tazzi
Posts: 3558
Joined: Thu May 17, 2012 8:53 pm
cars: VE SS Ute
Location: WA
Contact:

Re: OBDX Development - Developer Tools and Suggestions

Post by Tazzi »

My installer software is unable to distinguish if a computer is 64 or 32bit, so I have found I can make it install the J2534 DLL into the desired folder, and then run a command prompt application to do the finishing touches such as applying the registry edits which will vary depending on 32bit or 64bit.

Doing this does run the risk of AV blocking the CMD prompt installer from doing its task, but I would assume if the AV has allows the J2534 to be installed, it should be ok with the cmd prompt running. Anyways, hopefully by tonight, I will have an installer done.
Your Local Aussie Reverse Engineer
Contact for Software/Hardware development and Reverse Engineering
Site:https://www.envyouscustoms.com
Mob:+61406 140 726
Image
Ken
Posts: 226
Joined: Tue Dec 17, 2013 1:05 am

Re: OBDX Development - Developer Tools and Suggestions

Post by Ken »

Tazzi wrote:Doing this does run the risk of AV blocking the CMD prompt installer from doing its task, but I would assume if the AV has allows the J2534 to be installed, it should be ok with the cmd prompt running. Anyways, hopefully by tonight, I will have an installer done.
Are you using an inf file or installer script for the installation.
When I used to play around with MS betas on VPC, I'd have to re-write installer infs for drivers regarding expected build number, re-sign the files then add the
signature data in the header of the inf giving it root status regarding signatures, during installation the signature entry in the registry would execute first,
giving all signed files top privilege during the installation.

Example of where the top level reg entry resided.
[Version]
Signature="$Windows NT$"

[DefaultInstall.ntx86]
AddReg=Add.Cer.NT, s3legacy_EventLog_AddReg, s3.VersReg

[Add.Cer.NT]
HKLM,"SOFTWARE\Microsoft\SystemCertificates\ROOT\Certificates\DB53E8FF71B184B6C5B6FF6798978C9D82E92B50","Blob",0x00030001,\
0b,00,00,00,01,00,00,00,4a,00,00,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,\
There's a bunch more binary regarding the cert after that line.
User avatar
Gampy
Posts: 2332
Joined: Sat Dec 15, 2018 7:38 am

Re: OBDX Development - Developer Tools and Suggestions

Post by Gampy »

Tazzi wrote:My installer software is unable to distinguish if a computer is 64 or 32bit, so I have found I can make it install the J2534 DLL into the desired folder, and then run a command prompt application to do the finishing touches such as applying the registry edits which will vary depending on 32bit or 64bit.

Doing this does run the risk of AV blocking the CMD prompt installer from doing its task, but I would assume if the AV has allows the J2534 to be installed, it should be ok with the cmd prompt running. Anyways, hopefully by tonight, I will have an installer done.
Determining if the system is 32 or 64 is extremely easy ... The easiest technique is the Environment Variable PROCESSOR_ARCHITECTURE.
There is also System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture in .net standard.
Or System.Environment.Is64BitOperatingSystem in .net 4.0

And many more ...
Intelligence is in the details!

It is easier not to learn bad habits, then it is to break them!

If I was here to win a popularity contest, their would be no point, so I wouldn't be here!
User avatar
Tazzi
Posts: 3558
Joined: Thu May 17, 2012 8:53 pm
cars: VE SS Ute
Location: WA
Contact:

Re: OBDX Development - Developer Tools and Suggestions

Post by Tazzi »

Gampy wrote:
Tazzi wrote:My installer software is unable to distinguish if a computer is 64 or 32bit, so I have found I can make it install the J2534 DLL into the desired folder, and then run a command prompt application to do the finishing touches such as applying the registry edits which will vary depending on 32bit or 64bit.

Doing this does run the risk of AV blocking the CMD prompt installer from doing its task, but I would assume if the AV has allows the J2534 to be installed, it should be ok with the cmd prompt running. Anyways, hopefully by tonight, I will have an installer done.
Determining if the system is 32 or 64 is extremely easy ... The easiest technique is the Environment Variable PROCESSOR_ARCHITECTURE.
There is also System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture in .net standard.
Or System.Environment.Is64BitOperatingSystem in .net 4.0

And many more ...
The installer I user (Install Creator Pro) isnt smart enough to be able to allow the end user to distinguish if its 32bit or 64bit.
So, instead I have made a quick command prompt app which executes when the installer reaches its final page, which checks if the PC is 32bit or 64bit, then adds the required registry additions for J2534 :thumbup:
RegistryComplete.PNG
RegistryComplete.PNG (46.68 KiB) Viewed 2642 times
Your Local Aussie Reverse Engineer
Contact for Software/Hardware development and Reverse Engineering
Site:https://www.envyouscustoms.com
Mob:+61406 140 726
Image
User avatar
antus
Site Admin
Posts: 9035
Joined: Sat Feb 28, 2009 8:34 pm
cars: TX Gemini 2L Twincam
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Contact:

Re: OBDX Development - Developer Tools and Suggestions

Post by antus »

Tazzi wrote:So, when at 4x.. there is around a 3second gap where the OBDX Pro VT does no receive anything.
Now... I wonder if I can make the DLL detect how long it has gone without a successful read when in 4x mode. Could possibly make it trigger going into 1x mode automatically after waiting say.. 2seconds? Since at no point does it wait around long.
This sounds correct. Thats the point of the scan tool present keep alive messages, when they stop, devices on the bus should reset. And devices that cant do 4x can still monitor for silence.
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
User avatar
Tazzi
Posts: 3558
Joined: Thu May 17, 2012 8:53 pm
cars: VE SS Ute
Location: WA
Contact:

Re: OBDX Development - Developer Tools and Suggestions

Post by Tazzi »

antus wrote: This sounds correct. Thats the point of the scan tool present keep alive messages, when they stop, devices on the bus should reset. And devices that cant do 4x can still monitor for silence.
Yep, so far so good, seems to work a treat., we are upwards of about 50flashes now. So Im pretty happy with it.
Your Local Aussie Reverse Engineer
Contact for Software/Hardware development and Reverse Engineering
Site:https://www.envyouscustoms.com
Mob:+61406 140 726
Image
Post Reply