Open source GM OBD2 flash tool using a ELM327 device

Posts: 204
Joined: Thu Dec 20, 2012 5:28 pm
Location: Melbourne

Re: Open source GM OBD2 flash tool using a ELM327 device

Postby Chuff » Wed May 16, 2018 4:34 pm

antus wrote:ATI returns an elm version (ficticious) and AT#1 returns the allpro version.

https://github.com/LegacyNsfw/PcmHacks/ ... ice.cs#L64


Thanks Antus, but I'm not wanting code to check the version, I'm trying to connect via a terminal/program so I can enter the commands in directly and get a response. Last time I did this I still had Windows PCs but now I only have Linux PCs and am unable to get to first base, connecting to the adapter. I'm using putty but either the host name or the connection parameters are incorrect as putty is unable to complete the connection.

Hope that makes sense.

Thanks.
˙ʎɐqǝ ɟɟo pɹɐoqʎǝʞ ǝsǝuıɥɔ ɐ ƃuıʎnq ɹoɟ ʇɥƃıɹ ǝɯ sǝʌɹǝs

Site Admin
User avatar
Posts: 5296
Joined: Sat Feb 28, 2009 8:34 pm

Re: Open source GM OBD2 flash tool using a ELM327 device

Postby antus » Wed May 16, 2018 7:00 pm

Yep i was linking to the code as you can read it like an instruction sheet. I didnt know putty existed on linux?

Anyway serial on linux is a giant pain.. as i found out when I tried to implement ALDL and set a custom baud rate. Its ancient standards, and hasnt really been cleaned up over time.

But if you know the device (from the kernel messages or journalctl output depending on linux era information sysvinit vs systemd) you should be able to do something like:

Code: Select all
stty -F /dev/ttyUSB0 sane


Then you should be able to type ATZ <enter> then AT#1<enter> and get the information.

Unlike ALDL this is a standard baud rate so it should work....

To set the speed use something like screen. Major distributions have screen out of the box or have it packaged.

Here is a test on my EL6 box. The interface is a stand alone FTDI interface, as this is a dev board which provides TTL serial, and does not have the FTDI built in.

From the kernel (end of the dmesg output) shows that the interface came up as /dev/ttyUSB1 (/dev/ttyUSB0 is an RS485 connection to my solar inverter in this case):

Code: Select all
usb 4-3: new full speed USB device number 3 using ohci_hcd
usb 4-3: New USB device found, idVendor=0403, idProduct=6001
usb 4-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 4-3: Product: FT232R USB UART
usb 4-3: Manufacturer: FTDI
usb 4-3: SerialNumber: A50285BI
usb 4-3: configuration #1 chosen from 1 choice
USB Serial support registered for FTDI USB Serial Device
ftdi_sio 4-3:1.0: FTDI USB Serial Device converter detected
usb 4-3: Detected FT232RL
usb 4-3: Number of endpoints 2
usb 4-3: Endpoint 1 MaxPacketSize 64
usb 4-3: Endpoint 2 MaxPacketSize 64
usb 4-3: Setting MaxPacketSize 64
usb 4-3: FTDI USB Serial Device converter now attached to ttyUSB1
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.5.0:USB FTDI Serial Converters Driver


Then run screen on the port (screen clears the terminal when it runs):

Code: Select all
[root@gemini ~]# screen /dev/ttyUSB1 115200


Then reset the device (first attempt fails because of some data that someone else had sent down the port), then reset the device and pull some info from it. "Ctrl+a" then "\" then "y" to quit and terminate screen.
Code: Select all
ATZ
?
>ATZ
ELM327 v2.1
>ATI
ELM327 v2.1
>AT#3
PWM wiring is OK
VPW wiring is OK
ISO9141/14230 wiring is OK
CAN wiring is OK
>AT#1
Copyright (c) 2009-2018 ObdDiag.Net
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
Have you read the FAQ? For lots of information and links to significant threads see here: viewtopic.php?f=7&t=1396

Posts: 49
Joined: Thu Sep 21, 2017 3:00 pm

Re: Open source GM OBD2 flash tool using a ELM327 device

Postby 160plus » Thu May 17, 2018 2:25 am

Since this is Elm/Allpro/Pcm Hammer related.... here is clip of Ls Droid Flash I am developing in parallel with the Pcm Hammer. I am using a modified Allpro Dev. board I modified with Bluetooth and this is being done in 4x mode.


Posts: 204
Joined: Thu Dec 20, 2012 5:28 pm
Location: Melbourne

Re: Open source GM OBD2 flash tool using a ELM327 device

Postby Chuff » Thu May 17, 2018 7:22 am

Thanks Antus,

For anyone who might be playing with Linux the commands Antus provided above allowed me to connect & interrogate the Allpro adapter but only after logging in as superuser (su) in the terminal session. Running the commands as a standard user or as sudo produces a "permission denied" error.

Running the commands in "screen" produced the following output which doesn't give me the firmware version:

ATZ
ELM327 v2.1
>AT#1
Copyright (c) 2009-2018 ObdDiag.Net
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>

Are there any other commands which would give me the firmware version?

Thanks.
˙ʎɐqǝ ɟɟo pɹɐoqʎǝʞ ǝsǝuıɥɔ ɐ ƃuıʎnq ɹoɟ ʇɥƃıɹ ǝɯ sǝʌɹǝs

Site Admin
User avatar
Posts: 5296
Joined: Sat Feb 28, 2009 8:34 pm

Re: Open source GM OBD2 flash tool using a ELM327 device

Postby antus » Thu May 17, 2018 8:36 am

From reading this AT@1 should do it https://github.com/ObdDiag-Net/allpro/b ... atcher.cpp

As for needing root (sudo access) that'll come down to the specifics of your distribution. The udev rules that create the /dev/ttyUSB files probably make them readable and writeable by a group. You can ls -l on the file in /dev/ and see, then you can probably add your user to the right group and then re-login to pickup the change to your profile. Run 'id' to see what groups your in.
Have you read the FAQ? For lots of information and links to significant threads see here: viewtopic.php?f=7&t=1396

Posts: 204
Joined: Thu Dec 20, 2012 5:28 pm
Location: Melbourne

Re: Open source GM OBD2 flash tool using a ELM327 device

Postby Chuff » Thu May 17, 2018 8:58 am

Thanks Antus,

AT@1 did it. Firmware version 1.19.
˙ʎɐqǝ ɟɟo pɹɐoqʎǝʞ ǝsǝuıɥɔ ɐ ƃuıʎnq ɹoɟ ʇɥƃıɹ ǝɯ sǝʌɹǝs

Site Admin
User avatar
Posts: 5296
Joined: Sat Feb 28, 2009 8:34 pm

Re: Open source GM OBD2 flash tool using a ELM327 device

Postby antus » Thu May 17, 2018 9:24 am

Looks like we'd better log that in the flash tool - was a good question.
Have you read the FAQ? For lots of information and links to significant threads see here: viewtopic.php?f=7&t=1396

Posts: 204
Joined: Thu Dec 20, 2012 5:28 pm
Location: Melbourne

Re: Open source GM OBD2 flash tool using a ELM327 device

Postby Chuff » Thu May 17, 2018 1:15 pm

Just a further update.

I've added my Linux user to the appropriate group to access the Allpro device as suggested by Antus and CuteCom is now connecting successfully. Still can't get Putty to connect but not fussed as CuteCom should do everything I need.

Thanks Antus. :thumbup:


Cutecom.png
Cutecom.png (67.1 KiB) Viewed 1051 times
˙ʎɐqǝ ɟɟo pɹɐoqʎǝʞ ǝsǝuıɥɔ ɐ ƃuıʎnq ɹoɟ ʇɥƃıɹ ǝɯ sǝʌɹǝs

User avatar
Posts: 53
Joined: Fri Feb 02, 2018 3:13 pm

Re: Open source GM OBD2 flash tool using a ELM327 device

Postby NSFW » Sun May 27, 2018 9:01 am

I got a full read in about 20 minutes using a Scantool SX, which I think is close to the best we'll get from that particular device. The next big milestones will be to get the AllPro from ObdDiag.net working, initially at the same 1x speed that the Scantool uses (should still be a little faster because it can transfer more data per request) and then at 4x speed (should be 4x faster of course).

Those are going to require changes to the firmware in the AllPro adapter, which Antus has already done some work on. In addition, redheadedod aims to get the Macchina M2 interface going. It kind of blows my mind that there is inexpensive hardware already in production with open-source firmware just waiting for some apps to come along. What a great time to be alive! With 4x speed and larger transfers, a full read should be under 5 minutes. And writes should be well under a minute since we'll typically only be writing to the segment that has the actual tuning data on it.

In the meantime I'm going to work on making the Windows app's communication more reliable, so that this will work with a PCM that's actually in a car just as well as it works with the one that's on my desk. My first attempt at reading the PCM in my Corvette ended with the dashboard lit up like a Chrismas tree and the engine not starting. :) It's all good now though, just had to cut power to the PCM to force it to reboot.

pcmhammerread.png
pcmhammerread.png (66.32 KiB) Viewed 905 times

Posts: 23
Joined: Wed Jul 05, 2017 8:30 am
Location: TX USA

Re: Open source GM OBD2 flash tool using a ELM327 device

Postby MudDuck514 » Sun May 27, 2018 12:36 pm

Hi all;

I see things are coming along fairly well.
I do have a question for the hardware developers - Tazzi and Thaniel in particular:
Have you had any luck trying to use a PIC Chip (I THINK most ELM-Based units use one)?
OR, trying an actual AVR (much like this onehttps://www.mictronics.de/projects/j1850-vpw-interface/) instead of an Arduino MEGA?
If it can work on an ATMEGA8, I don't see why a more powerful, yet widely available ATMEGA328 (such as the UNO uses) wouldn't work too!

Think how inexpensive it could be made if all you needed was a PC board with a handful of components.

Keep up the good work,

Mike.

PreviousNext

Return to Tool Development

Who is online

Users browsing this forum: No registered users and 3 guests