Page 3 of 109

Re: ELM327 Software Development

Posted: Sat Sep 21, 2013 2:22 pm
by Tazzi
delcowizzid wrote:desktop PC no luck its had usb issues so may not be your fault and laptop sadly doesnt have .net v4
Ill see if I cant drop the required net framework.

But it worked on a "elm emulator" and also a couple trial diagnostic OBD2 software's (was sending back false replies). God damn.. wonder if someone has one on gumtree I can pick up today haha.

Re: ELM327 Software Development

Posted: Sat Sep 21, 2013 2:27 pm
by delcowizzid
haha dont stress on my behalf LOL but you keep posting ill keep testing :D

Re: ELM327 Software Development

Posted: Sat Sep 21, 2013 4:58 pm
by Tazzi
haha yeah, its just frustrating when things "should" work, but dont because of a silly mistake!

The serialport settings im current using are:

Code: Select all

 SerialPort1.BaudRate = ComboBoxBaudRate.SelectedItem
        SerialPort1.PortName = ComboBoxCom.SelectedItem
        SerialPort1.DataBits = 8
        SerialPort1.Handshake = IO.Ports.Handshake.None
        SerialPort1.NewLine = vbCr
        SerialPort1.Parity = IO.Ports.Parity.None
        SerialPort1.StopBits = IO.Ports.StopBits.One
        SerialPort1.ReadTimeout = 1000
which Im fairly certain are the settings I want since they were working.

And the elm327 code reader im using is:

Code: Select all

 Public Function DetectElmDeviceGetResponse(SentFrame As String)
        Dim ReceivedFrame As String = ""
        Dim Counts2Exit As Integer = 0
        Do 'do until exited
            Try
                'if there is something there.. read it!
                ReceivedFrame = SerialPort1.ReadLine 'Read Message!
                If ReceivedFrame <> SentFrame Then 'check if received frame matches sent.. ignore if so
                    If ReceivedFrame.Contains("SEARCHING...") Then 'ignore.. move onto next
                        'ignore this
                    ElseIf ReceivedFrame.Contains("NO DATA") Then 'ELm says no response.. fail! Shouldnt happen since gtting Elm info!
                        Return "Failed"
                    Else
                        Return ReceivedFrame 'hopefully out response
                    End If
                End If
            Catch ex As TimeoutException 'if nothings available, timout after 1 second.
                Counts2Exit += 1
                If Counts2Exit = 5 Then 'fail after timeout 4times
                    SetRichTextBox_ThreadSafe("Timed Out!", RichTextBoxReceive)
                    Return "Failed"
                Else
                    SetRichTextBox_ThreadSafe("Timed out.. Searching again.." & Counts2Exit, RichTextBoxReceive)
                End If
            End Try
        Loop
    End Function
Attached is another version, added another connection button on the right, try setting the comport/baud and click the "connect" on the right. That one will display everything that shows up over serialport, will display byte by byte.. so if the elm actually responds.. it will definitely show up there.. else theres something wrong! The elm will display "?" if it doesnt understand the command of the command is unfinished.

Unfortunately couldn't change the framework requirements.

Re: ELM327 Software Development

Posted: Sat Sep 21, 2013 6:42 pm
by Tazzi
Done some snooping on what other "working" applications have been doing.. have developed my self a "fake elm" device lol.

Received if the software requesting.. and sent is our false reply:

Code: Select all

Received: ?
Sent: ELM327 v1.5
Received: ATZ
Sent: ELM327 v1.5
Received: ATE0
Sent: OK
Received: ATL0
Sent: OK
Received: ATRV
Sent: 12.3V
Received: ATSP 2
Sent: OK
Received: 01 00
Sent: 41 00 BE 1F B8 10
Received: ATH1
Sent: OK
Received: 01 00
Sent: 68 F1 10 41 00 BE 1F B8 10
Received: ATSH 68 6A F1
Sent: OK
Received: 09 02
Received: 09 02
Received: 09 02
Received: 09 02
Received: 01 00
Sent: 68 F1 10 41 00 BE 1F B8 10
Received: AT@1
Received: AT@1
Received: AT@1
Received: AT@1
Received: 01 00
Sent: 68 F1 10 41 00 BE 1F B8 10
Received: 01 00
Sent: 68 F1 10 41 00 BE 1F B8 10
Received: 01 00
So if I can do all this.. the simply detect elm should definitely work! lol
Will need to put a check in for ">", that might be the problem.

Re: ELM327 Software Development

Posted: Sat Sep 21, 2013 9:55 pm
by delcowizzid
i get a crash when using that 2nd connect button on right winxp lol

Re: ELM327 Software Development

Posted: Sat Sep 21, 2013 10:06 pm
by Tazzi
delcowizzid wrote:i get a crash when using that 2nd connect button on right winxp lol
Lol, have you set the comport and Baud? Dont click connect below those, only the connect to the right.

I havent put much error handling in to it. Iff you click the connect button bellow the comport and baud, then itll probably crash if you click the one on the right too haha.

Re: ELM327 Software Development

Posted: Sun Sep 22, 2013 11:47 am
by Tazzi
Well, works correctly if I mimic a elm or use one of the various emulators online which are specifically made for software development. Not sure why its not working with a proper cable :thumbdown:
Image

Re: ELM327 Software Development

Posted: Sun Sep 22, 2013 1:11 pm
by delcowizzid
dont trust my cable and usb LOL its chinese and only works with one software program only.ill see if i can update .net i just never plug my tuning laptop to the internet LOL

Re: ELM327 Software Development

Posted: Sun Sep 22, 2013 2:49 pm
by Tazzi
Yeah but itll probably be a cheap knock off chinese elm that ill be using too. Even if there knock offs, it should always display "ELM327" when reset or command ATZ is sent to it. I make it search for just "ELM". Not should whats happening really!

Re: ELM327 Software Development

Posted: Sun Sep 22, 2013 3:02 pm
by Charlescrown
I am trying it with a genuine Elmscan5 and it just crashes