Page 2 of 4

Re: Avt 852 not working with vpwexplorer or older tuner cat programs help

Posted: Tue Jan 16, 2024 6:34 am
by kur4o
You can also use a serial port sniffer like eltima to see the actual communication between pc and tool.

Re: Avt 852 not working with vpwexplorer or older tuner cat programs help

Posted: Tue Jan 16, 2024 6:43 am
by antus
04colyZQ8 wrote: Sun Jan 14, 2024 1:01 am Also I don’t see that adding a case for the 853 would help? Because the 853 will still arrive at the same case 27, without modified code. And it should respond to all the same commands. So vpwexplorer so would only print 852 Instead of 853.
Each model returns a different reponse to the "AVT Reset" command. The differences tell PCMLibrary which model it is, and it changes its behavior just a little so that it works with supported models. It's not just that the command is responded to, its the content of the response. Get PCMHammer working first, then you can figure out how to build vpw explorer. I havn't built this, but I assume its in the project solution. If you get hammer building you can modify the error message to tell you what was in the byte that is being checked for 853.

If you want more help your going to need to post debug logs, just saying it doesn't work doesn't give us anything to see why.

Re: Avt 852 not working with vpwexplorer or older tuner cat programs help

Posted: Tue Jan 16, 2024 10:30 pm
by 04colyZQ8
Ok I’ll try to get some logs. The 853 responds exactly as the 852. So far as I can tell.

Re: Avt 852 not working with vpwexplorer or older tuner cat programs help

Posted: Wed Jan 17, 2024 11:24 am
by antus
Post a debug log of where it fails to init

Re: Avt 852 not working with vpwexplorer or older tuner cat programs help

Posted: Fri Jan 19, 2024 6:10 am
by 04colyZQ8
found source for vpw added debug line
Debug.WriteLine("Initializing " + this.ToString());

here is the log:

PCM Logger
[03:02:12:029] Thursday, January 18 2024 @03:02:12:02
[03:02:12:030] Initializing AVT (838/842/852) on Select...
[03:02:12:031] Unable to initialize AVT (838/842/852) on Select...
[03:02:12:032] System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.ArgumentException: The given port name does not start with COM/com or does not resolve to a valid serial port.
Parameter name: portName
at System.IO.Ports.SerialStream..ctor(String portName, Int32 baudRate, Parity parity, Int32 dataBits, StopBits stopBits, Int32 readTimeout, Int32 writeTimeout, Handshake handshake, Boolean dtrEnable, Boolean rtsEnable, Boolean discardNull, Byte parityReplace)
at System.IO.Ports.SerialPort.Open()
at PcmHacking.StandardPort.PcmHacking.IPort.OpenAsync(PortConfiguration configuration) in C:\Users\jake_\Downloads\New folder\PcmHacks-develop\Apps\PcmLibraryWindowsForms\Ports\StandardPort.cs:line 70
at PcmHacking.AvtDevice.<Initialize>d__20.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at PcmHacking.Vehicle.<ResetConnection>d__29.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at PcmHacking.MainFormBase.<InitializeCurrentDevice>d__23.MoveNext() in C:\Users\jake_\Downloads\New folder\PcmHacks-develop\Apps\PcmLibraryWindowsForms\MainFormBase.cs:line 182
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.ArgumentException: The given port name does not start with COM/com or does not resolve to a valid serial port.
Parameter name: portName
at System.IO.Ports.SerialStream..ctor(String portName, Int32 baudRate, Parity parity, Int32 dataBits, StopBits stopBits, Int32 readTimeout, Int32 writeTimeout, Handshake handshake, Boolean dtrEnable, Boolean rtsEnable, Boolean discardNull, Byte parityReplace)
at System.IO.Ports.SerialPort.Open()
at PcmHacking.StandardPort.PcmHacking.IPort.OpenAsync(PortConfiguration configuration) in C:\Users\jake_\Downloads\New folder\PcmHacks-develop\Apps\PcmLibraryWindowsForms\Ports\StandardPort.cs:line 70
at PcmHacking.AvtDevice.<Initialize>d__20.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at PcmHacking.Vehicle.<ResetConnection>d__29.MoveNext()
---> (Inner Exception #0) System.ArgumentException: The given port name does not start with COM/com or does not resolve to a valid serial port.
Parameter name: portName
at System.IO.Ports.SerialStream..ctor(String portName, Int32 baudRate, Parity parity, Int32 dataBits, StopBits stopBits, Int32 readTimeout, Int32 writeTimeout, Handshake handshake, Boolean dtrEnable, Boolean rtsEnable, Boolean discardNull, Byte parityReplace)
at System.IO.Ports.SerialPort.Open()
at PcmHacking.StandardPort.PcmHacking.IPort.OpenAsync(PortConfiguration configuration) in C:\Users\jake_\Downloads\New folder\PcmHacks-develop\Apps\PcmLibraryWindowsForms\Ports\StandardPort.cs:line 70
at PcmHacking.AvtDevice.<Initialize>d__20.MoveNext()<---
<---

Re: Avt 852 not working with vpwexplorer or older tuner cat programs help

Posted: Fri Jan 19, 2024 6:20 am
by 04colyZQ8
the avtdevice.cs file from working universal patcher is very similar to the vpwexplorer avtdevice.cs that doesn't work!
this code is different could it be why?
public override bool Initialize(int BaudRate, J2534InitParameters j2534Init)

Re: Avt 852 not working with vpwexplorer or older tuner cat programs help

Posted: Fri Jan 19, 2024 6:44 am
by kur4o
It points to unable to open COM port, if pcmhammer doesn`t initialize baud that might be the reason it fails.
avt852 doesn`t care for baud, modded avt853 should have correct baud rate.

Re: Avt 852 not working with vpwexplorer or older tuner cat programs help

Posted: Fri Jan 19, 2024 7:04 am
by 04colyZQ8
[03:43:54:164] PCM Logger
[03:43:54:165] Thursday, January 18 2024 @03:43:54:14
[03:43:54:166] Initializing AVT (838/842/852) on COM4
[03:43:54:166] Sending 'reset' message.
[03:43:55:170] Waited 2seconds.. no data present
[03:43:55:171] AVT device not found or failed reset
[03:43:55:172] Unable to initialize AVT (838/842/852) on COM4

Sometimes I get this error log instead with the new cable

Re: Avt 852 not working with vpwexplorer or older tuner cat programs help

Posted: Fri Jan 19, 2024 7:07 am
by 04colyZQ8
[04:04:04:472] PCM Logger
[04:04:04:475] Thursday, January 18 2024 @04:04:04:45
[04:04:04:477] Initializing AVT (838/842/852) on COM4
[04:04:04:478] Initializing AVT (838/842/852) on COM4
[04:04:04:479] Sending 'reset' message.
[04:04:04:480] Sending 'reset' message.
[04:04:14:481] Trace: ReadAVTPacket
[04:04:14:485] Waited 2seconds.. no data present
[04:04:14:487] This is m Timeout
[04:04:14:489] AVT device not found or failed reset
[04:04:14:491] Unable to initialize AVT (838/842/852) on COM4

if I do it a few times I get this error I added this line This is m Timeout when I used the old cable it said 27, which is success of requesting the model on the 852 and 853. Seems like a we need to extend the timer I tried adding a zero to this: while (sw.ElapsedMilliseconds < 10000) it was 1000, didn't work.

code snippet

this.Logger.AddDebugMessage("Trace: ReadAVTPacket");
int length = 0;
bool status = true; // do we have a status byte? (we dont for some 9x init commands)
byte[] rx = new byte[2]; // we dont read more than 2 bytes at a time

// Get the first packet byte.
try
{
Stopwatch sw = new Stopwatch();
sw.Start();
while (sw.ElapsedMilliseconds < 10000)
{
if (await this.Port.GetReceiveQueueSize() > 0) { break;}
}
if (await this.Port.GetReceiveQueueSize() > 0)
{
await this.Port.Receive(rx, 0, 1);
}
else
{

Re: Avt 852 not working with vpwexplorer or older tuner cat programs help

Posted: Fri Jan 19, 2024 7:10 am
by 04colyZQ8
kur4o wrote: Fri Jan 19, 2024 6:44 am It points to unable to open COM port, if pcmhammer doesn`t initialize baud that might be the reason it fails.
avt852 doesn`t care for baud, modded avt853 should have correct baud rate.
I think it sets to 57600; here:

SerialPortConfiguration configuration = new SerialPortConfiguration();
configuration.BaudRate = 57600; // default RS232 speed for 838, 842. ignored by the USB 852.

which is fine cause I changed it to that