View Single Post
Posts: 36 | Thanked: 19 times | Joined on Feb 2011
#69
The reply from AT SP 0, or AT SP0 is always OK:

ATZ
LM327 v1.4
ATE0
AT SP 0
OK
SEARCHING... 1 00 98 3B 00 11


this is from pyobd, if i add at sp 0 and wait for its result. it hangs, although at sp 0 returns OK.

Code:
Searching for BT dev...
 -Found device: CHX (00:11:12:19:11:33)
    Found BT SPP dev
/dev/rfcomm0
Send: atz
ELM327 v1.4
self.state: 1
Send: ate0
ate0
Send: at sp 0
OK
when changed it to at sp0, it remains the same and hangs after OK again:

Code:
Send: atz
ELM327 v1.4
self.state: 1
Send: ate0
ate0
Send: at sp0
OK
so what i had to do was to comment out the awaiting for response, like this:

Code:
          self.send_command("at sp0")  # init II
             time.sleep(0.5)
             #print self.get_result()
             #wx.PostEvent(self._notify_window, DebugEvent([2,"ate0 response:" + self.get_result()]))
But, this wasn't enough. The program then hanged on SEARCHING, look here:

Code:
Send: atz
ELM327 v1.4
self.state: 1
Send: ate0
ate0
Send: at sp0
Send: 0100
SEARCHING...
so i added second reply fetching after 0100 being sent, like this:

Code:
             self.send_command("0100")
             time.sleep(0.2)
             ready = self.get_result()
             print ready
             time.sleep(1.2)
             wx.PostEvent(self._notify_window, DebugEvent([2,"0100 response1:" + ready]))

             time.sleep(0.2)
             ready = self.get_result()
             print ready
             time.sleep(1.2)
             wx.PostEvent(self._notify_window, DebugEvent([2,"0100 response1:" + ready]))
this produces:


Code:
Send: atz
ELM327 v1.4
self.state: 1
Send: ate0
ate0
Send: at sp0
Send: 0100
SEARCHING...
UNABLE TO CONNECT
Send: atz
ELM327 v1.4
self.state: 1
Send: ate0
ate0
Send: at sp0
Send: 0100
SEARCHING...
41 00 98 3B 00 11 
Now: 41 00 98 3B 00 11 
sensor: 0
Send: 0100
data: 41 00 98 3B 00 11 
CODE: 4100983B0011
obd_sensors.hex_to_bistring(str): 983B0011
Sensor:              Supported PIDs 1
sensor: 32
Send: 0120

Last edited by vanous; 2012-02-18 at 12:32.
 

The Following 3 Users Say Thank You to vanous For This Useful Post: