PCM Hammer Release 020 Preview

They go by many names, P01, P10, P12, P59, E38, VPW, '0411 etc.
User avatar
joukoy
Posts: 398
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: PCM Hammer Release 020 Preview

Post by joukoy »

NSFW wrote:Thanks! I'll have to learn a bit more about how J2534 works. Apparently it stops listening for log messages after sending the 'device present' message.
I don't think so, should continue just fine.
At least in UniversalPatcher it does, but it uses (modified) J2534Dotnet library...
User avatar
joukoy
Posts: 398
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: PCM Hammer Release 020 Preview

Post by joukoy »

j2534Device.cs, line 158 set device filter to priority 6C messages.
If you send TesterPresent with priority 8C, pcm start sending meesages using same priority and they get filtered out.
Add another filter with 8C or change testerpresent to use 6C
User avatar
Gampy
Posts: 2332
Joined: Sat Dec 15, 2018 7:38 am

Re: PCM Hammer Release 020 Preview

Post by Gampy »

Definitely does work just by changing the Tester Priority from 8C to 6C ... Not that I needed to confirm that!

Edit: Or by adding an 8C filter ...
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
NSFW
Posts: 748
Joined: Fri Feb 02, 2018 3:13 pm

Re: PCM Hammer Release 020 Preview

Post by NSFW »

I just posted RC3.

I think this should fix J2534 logging, but I can't confirm that myself. Joukoy, if you could try again I'd appreciate that very much!

I still need someone with an AVT to confirm that logging works with those devices.

with RC3, you should get a stern warning before your first write, but after you do a successful read or test write (or a real write) you'll just get a simple confirmation prompt before each write.
Please don't PM me with technical questions - start a thread instead, and send me a link to it. That way I can answer in public, and help other people who have the same question. Thanks!
User avatar
NSFW
Posts: 748
Joined: Fri Feb 02, 2018 3:13 pm

Re: PCM Hammer Release 020 Preview

Post by NSFW »

I didn't see the replies here about changing the tool-present message from 8C to 6C until well after I posted RC3, but that's probably a better approach than what I tried.

I'll try that approach next, it would let me simplify some code elsewhere too.
Please don't PM me with technical questions - start a thread instead, and send me a link to it. That way I can answer in public, and help other people who have the same question. Thanks!
User avatar
Gampy
Posts: 2332
Joined: Sat Dec 15, 2018 7:38 am

Re: PCM Hammer Release 020 Preview

Post by Gampy »

Right or wrong I don't know, however I would add a second filter.

Copy the current filter (158-163 J2534Device.cs), change the 6C to 8C and be done with it ...
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
joukoy
Posts: 398
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: PCM Hammer Release 020 Preview

Post by joukoy »

RC3:

Code: Select all

[07.16.44.586]  PCM Logger
[07.16.44.595]  Initializing J2534 Device
[07.16.44.627]  Loaded DLL
[07.16.46.206]  Connected to the device.
[07.16.46.222]  Battery Voltage is: 13,932
[07.16.46.955]  Protocol Set
[07.16.47.002]  Device initialization complete.
[07.16.47.005]  ValidDeviceSelectedAsync started.
[07.16.47.017]  TX: 6C 10 F0 3C 0A
[07.16.49.049]  ReadMsgs OBDError: ERR_BUFFER_EMPTY
[07.16.49.051]  Sending 'test device present' notification.
[07.16.49.051]  TX: 8C FE F0 3F
[07.16.51.074]  ReadMsgs OBDError: ERR_BUFFER_EMPTY
[07.16.51.074]  Sending 'test device present' notification.
[07.16.51.074]  TX: 8C FE F0 3F
[07.16.53.097]  ReadMsgs OBDError: ERR_BUFFER_EMPTY
[07.16.53.097]  Sending 'test device present' notification.
[07.16.53.097]  TX: 8C FE F0 3F
[07.16.55.119]  ReadMsgs OBDError: ERR_BUFFER_EMPTY
[07.16.55.120]  Sending 'test device present' notification.
[07.16.55.121]  TX: 8C FE F0 3F
[07.16.57.138]  ReadMsgs OBDError: ERR_BUFFER_EMPTY
[07.16.57.138]  Receive timed out. Attempt #5, Timeout #5.
[07.16.57.139]  TX: 6C 10 F0 3C 0A
[07.16.59.159]  ReadMsgs OBDError: ERR_BUFFER_EMPTY
[07.16.59.159]  Sending 'test device present' notification.
[07.16.59.159]  TX: 8C FE F0 3F
[07.17.01.184]  ReadMsgs OBDError: ERR_BUFFER_EMPTY
[07.17.01.184]  Sending 'test device present' notification.
[07.17.01.185]  TX: 8C FE F0 3F
[07.17.03.210]  ReadMsgs OBDError: ERR_BUFFER_EMPTY
[07.17.03.210]  Sending 'test device present' notification.
[07.17.03.211]  TX: 8C FE F0 3F
[07.17.05.232]  ReadMsgs OBDError: ERR_BUFFER_EMPTY
[07.17.05.232]  Sending 'test device present' notification.
[07.17.05.232]  TX: 8C FE F0 3F
[07.17.07.259]  ReadMsgs OBDError: ERR_BUFFER_EMPTY
[07.17.07.259]  Receive timed out. Attempt #5, Timeout #5.
[07.17.07.307]  Device reset completed.
User avatar
joukoy
Posts: 398
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: PCM Hammer Release 020 Preview

Post by joukoy »

Another note, still in J2534Device.cs:
ReadVoltage() should be after ConnectToProtocol()
And in ReadVoltage(), row 398, should use ChannelID instead of DeviceID

Code: Select all

 OBDError = J2534Port.Functions.ReadBatteryVoltage((int)ChannelID, ref VoltsAsInt);
Currently it works IF you have only one device in system (ChannelID = 0, DeviceID = 0)
But if DeviceID = 1 and ChannelID = 0, for example, ReadVoltage fails.
User avatar
Tazzi
Posts: 3550
Joined: Thu May 17, 2012 8:53 pm
cars: VE SS Ute
Location: WA
Contact:

Re: PCM Hammer Release 020 Preview

Post by Tazzi »

joukoy wrote:Another note, still in J2534Device.cs:
ReadVoltage() should be after ConnectToProtocol()
And in ReadVoltage(), row 398, should use ChannelID instead of DeviceID

Code: Select all

 OBDError = J2534Port.Functions.ReadBatteryVoltage((int)ChannelID, ref VoltsAsInt);
Currently it works IF you have only one device in system (ChannelID = 0, DeviceID = 0)
But if DeviceID = 1 and ChannelID = 0, for example, ReadVoltage fails.
Voltage should be checked before opening a protocol. No point opening a protocol if you know battery voltage is 0v ect. PCMHammer doesn't do that check, but its an easy check to put in.

Once voltage is confirmed to be acceptable, only then should a protocol be opened.

Your assumption is for reading pins when connected to a protocol, When reading battery voltage, you pass the device id.
Please see below snipit as per J2534 document:
J2534ReadVoltage.PNG
J2534ReadVoltage.PNG (26.02 KiB) Viewed 3241 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
joukoy
Posts: 398
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: PCM Hammer Release 020 Preview

Post by joukoy »

Tazzi wrote:
joukoy wrote:Another note, still in J2534Device.cs:
ReadVoltage() should be after ConnectToProtocol()
And in ReadVoltage(), row 398, should use ChannelID instead of DeviceID

Code: Select all

 OBDError = J2534Port.Functions.ReadBatteryVoltage((int)ChannelID, ref VoltsAsInt);
Currently it works IF you have only one device in system (ChannelID = 0, DeviceID = 0)
But if DeviceID = 1 and ChannelID = 0, for example, ReadVoltage fails.
Voltage should be checked before opening a protocol. No point opening a protocol if you know battery voltage is 0v ect. PCMHammer doesn't do that check, but its an easy check to put in.

Once voltage is confirmed to be acceptable, only then should a protocol be opened.

Your assumption is for reading pins when connected to a protocol, When reading battery voltage, you pass the device id.
Please see below snipit as per J2534 document:
J2534ReadVoltage.PNG
Ok, must be error in dotnet library. j2534-sharp uses DeviceID.
Thanks for correction.
Locked