Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: NameError: global name 'messages' is not defined #73

Closed
scarabdesign opened this Issue Mar 8, 2017 · 3 comments

Comments

Projects
None yet
1 participant
@scarabdesign
Copy link

scarabdesign commented Mar 8, 2017

Getting the following error when checking OBD_COMPLIANCE:
Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "/usr/local/lib/python2.7/dist-packages/obd/async.py", line 218, in run r = super(Async, self).query(c, force=True) File "/usr/local/lib/python2.7/dist-packages/obd/obd.py", line 265, in query return cmd(messages) # compute a response object File "/usr/local/lib/python2.7/dist-packages/obd/OBDCommand.py", line 97, in __call__ r.value = self.decode(messages) File "/usr/local/lib/python2.7/dist-packages/obd/decoders.py", line 331, in obd_compliance d = messages[0].data NameError: global name 'messages' is not defined

Indeed, looking at the code, you appear to only pass in "_hex" (which is actually never used) and not a message argument at all.

@scarabdesign

This comment has been minimized.

Copy link
Author

scarabdesign commented Mar 8, 2017

Looks like this might be the same issue for FUEL_TYPE:
File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/obd/obd.py", line 265, in query return cmd(messages) # compute a response object File "/usr/local/lib/python2.7/dist-packages/obd/OBDCommand.py", line 97, in __call__ r.value = self.decode(messages) File "/usr/local/lib/python2.7/dist-packages/obd/decoders.py", line 343, in fuel_type d = messages[0].data NameError: global name 'messages' is not defined

@scarabdesign

This comment has been minimized.

Copy link
Author

scarabdesign commented Mar 8, 2017

I'm noticing that my version, which i installed with pip, is 0.6.1, whereas the master here on github seems to have corrected these issues. How can i use pip to install the master branch?

@scarabdesign

This comment has been minimized.

Copy link
Author

scarabdesign commented Mar 8, 2017

I seemed to get it resolved by:
sudo -H pip uninstall obd
sudo -H pip install git+git://github.com/brendan-w/python-OBD.git

Now my code is updated. It's unusual that the versions are different but tagged the same semver...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.