Active Topics

 



Notices


Reply
Thread Tools
m750's Avatar
Posts: 249 | Thanked: 345 times | Joined on Aug 2010 @ Italy
#71
OK @vanous, please try this version of obd_io.py
Added more sleep time in two parts of the file.
__________________
maxcpu : change cpu's clock with a TAP!
savecpu : overheating control for overclocked n900.
shaketowake2 : Enable/Disable wake up/rest by shaking.
tilt2control : control mediaplayer by tilting your n900.
gpstracker-c : easy handle your gpstracker tk102.
pyOBD for maemo (OBD-II cars diagnostic)

Last edited by m750; 2012-02-18 at 12:52.
 
Posts: 36 | Thanked: 19 times | Joined on Feb 2011
#72
EDIT: posted before your file. will test now.

i don't think that only timeouts will sort this...
i have tried to remove the second resultreading and extend the timeouts below, but no luck:

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


#UNABLE TO CONNECT
#SEARCHING...............


             if ready=="SEARCHING...":
                time.sleep(2)
it reads consequentially, so the SEARCHING... is still in the buffer, or not? So we have to skip it... alghout i would think that this is exactly what happens in the if ready="SEARCHING..."
 
Posts: 36 | Thanked: 19 times | Joined on Feb 2011
#73
@m750:

here is my version of the file: obd_io.zip

timing didn't do this. after SEARCHING... appears, we need to read the buffer again. the timing still might need some tweaks, now i connect on first try in toyota, on second try in peugeot.
 

The Following User Says Thank You to vanous For This Useful Post:
m750's Avatar
Posts: 249 | Thanked: 345 times | Joined on Aug 2010 @ Italy
#74
Yes, i never had encountered this problem (slowly answer from ECU) and I did not realize that in the original source code threre was not a second reading point.
Thank you @Vanous!
I will made immediately a new release that, in addition to other small changes, adds this.

[EDIT:]
pyobd 0.9.2-13 in extras-devel.

Last edited by m750; 2012-02-18 at 14:57.
 

The Following 3 Users Say Thank You to m750 For This Useful Post:
Posts: 36 | Thanked: 19 times | Joined on Feb 2011
#75
Originally Posted by m750 View Post
pyobd 0.9.2-13 in extras-devel.
thank you!

i have tested this version, but as you uncommented the line 123 again, it hangs with OK after AT SP 0 send it. I am now working on fixing it.

what i don't understand is, how can the program constantly perform get_result() with no issue, but with the at sp 0 it stops while reading the buffer...

i will let you know.

EDIT:

ok, i think i now understand it.

the echo off (ate0) most probably takes care of clearing the buffer in such a way, that once you read it, it is empty.

this means, that what happens at the begging of the init process (something i don't understand how can happen) is that you send a command and read the response several times. but after you send echo off, this cannot happen anymore, once you read the buffer, it is empty.

which means, the at sp0 response needs to be collected into variable and then printed as many times as needed:


self.send_command("at sp 0")
time.sleep(0.5)
atsp_response=self.get_result()
print atsp_response
wx.PostEvent(self._notify_window, DebugEvent([2,"atsp0 response: " + atsp_response ]))


btw. in the wx.PostEvent i tried to print is with %s, but it didn't work for me...

please apply and release, thank you.

Last edited by vanous; 2012-02-18 at 16:09.
 

The Following 2 Users Say Thank You to vanous For This Useful Post:
m750's Avatar
Posts: 249 | Thanked: 345 times | Joined on Aug 2010 @ Italy
#76
remove the line

print self.get_result()

after :
self.send_command("at sp 0")
time.sleep(0.3)
print self.get_result() <---- this line
__________________
maxcpu : change cpu's clock with a TAP!
savecpu : overheating control for overclocked n900.
shaketowake2 : Enable/Disable wake up/rest by shaking.
tilt2control : control mediaplayer by tilting your n900.
gpstracker-c : easy handle your gpstracker tk102.
pyOBD for maemo (OBD-II cars diagnostic)

Last edited by m750; 2012-02-18 at 16:17.
 
Posts: 36 | Thanked: 19 times | Joined on Feb 2011
#77
Originally Posted by m750 View Post
remove the line

print self.get_result()

after
self.send_command("at sp 0")
time.sleep(0.3)
print self.get_result()
cross posting please read above.
 

The Following User Says Thank You to vanous For This Useful Post:
m750's Avatar
Posts: 249 | Thanked: 345 times | Joined on Aug 2010 @ Italy
#78
version 0.9.2-14 in extras-devel
Thank you @vanous for your collaboration.
__________________
maxcpu : change cpu's clock with a TAP!
savecpu : overheating control for overclocked n900.
shaketowake2 : Enable/Disable wake up/rest by shaking.
tilt2control : control mediaplayer by tilting your n900.
gpstracker-c : easy handle your gpstracker tk102.
pyOBD for maemo (OBD-II cars diagnostic)
 

The Following 2 Users Say Thank You to m750 For This Useful Post:
Posts: 36 | Thanked: 19 times | Joined on Feb 2011
#79
thank you for the update. tested it and it works 100%.

do you have any plans to commit upstream?

two ideas:

i actually don't like the idea of turning BT off when pyobd exits. i am surprised there is no resource subscribe/unsubscribe model in maemo? this means - you request BT and get it, then you release it and the service is kept on/off depending on other subscribers...
at least we should detect if BT was on/off before pyobd as turning it off is just a bad practice. i use BT all the time in the car for handsfree, if pyobd turns it off for me, this is bad.

i am looking for a dial widget in wxwidgets, so we could implement some visually appealing tabs in the interface, like speed/rpms/temp , do you know of any, or do we have to animate it ourselves via canvas/html drawing?
EDIT:
found it:
http://xoomer.virgilio.it/infinity77...peedMeter.html

Last edited by vanous; 2012-02-19 at 14:16.
 

The Following User Says Thank You to vanous For This Useful Post:
m750's Avatar
Posts: 249 | Thanked: 345 times | Joined on Aug 2010 @ Italy
#80
Thanks for testing.

BT switching (not or yes) is already in my thoughts. I can do something very simple:
- If you exit via the menu (File -> exit) it is turned off;
- If you exit by closing the app (x), it is not disabled;
Or I will put this option in a configuration file (changeable or not via menu).
I'll see what I can do.

For graphics, at least for now, I'm not going to venture.
 
Reply


 
Forum Jump


All times are GMT. The time now is 02:49.