Closed pkempe closed 10 years ago
Can you try changing the line "core = td.TelldusCore()" in td_list_controllers.py to core = td.TelldusCore('TelldusCore')
If that doesn't work, try this instead: core = td.TelldusCore('/Library/Frameworks/TelldusCore.framework/TelldusCore')
The first one makes no difference, but the latter gets around the dlopen errors at least. The script runs a bit farther, but there's another error coming:
patrik@iceman:/Volumes/home/tellcore-py-master/bin$ python td_list_controllers
Traceback (most recent call last):
File "td_list_controllers", line 25, in <module>
TYPES[controller.type], controller.name, controller.serial,
File "/Library/Python/2.7/site-packages/tellcore/telldus.py", line 349, in __getattr__
raise AttributeError(name)
AttributeError: name
As a side note, changing the corresponding lines in td_sensors
and td_event_tracer
makes them work without errors.
Thanks for testing.
I will update the code to use that library on mac os x by default. Then I will fix the script to handle controllers without a name set.
Could you please also test if it works with /TelldusCore.framework/TelldusCore ?
Tried swapping line
core = td.TelldusCore('/Library/Frameworks/TelldusCore.framework/TelldusCore')
for
core = td.TelldusCore('/TelldusCore.framework/TelldusCore')
with the following results:
patrik@iceman:/Volumes/home/tellcore-py-master/bin$ python td_event_tracer
Traceback (most recent call last):
File "td_event_tracer", line 93, in <module>
core = td.TelldusCore('/TelldusCore.framework/TelldusCore')
File "/Library/Python/2.7/site-packages/tellcore/telldus.py", line 55, in __init__
self.lib = Library(library_path)
File "/Library/Python/2.7/site-packages/tellcore/library.py", line 305, in __init__
lib = DllLoader.LoadLibrary(name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 443 in LoadLibrary
return self._dlltype(name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/TelldusCore.framework/TelldusCore, 6): image not found
Please try pulling the latest changes and see if it works now.
The framework loading bit still fails (the error message is the same as before):
OSError: dlopen(libtelldus-core.so.2, 6): image not found
but the unnamed controller stuff is OK. After manually changing the line in td_list_controllers
to what worked in your previous suggestion (core = td.TelldusCore('/Library/Frameworks/TelldusCore.framework/TelldusCore')
I get proper output.
What output does this command give: python -c 'import platform; print platform.system()'
patrik@iceman:/Volumes/home/tellcore-py/bin$ python -c 'import platform; print platform.system()'
Darwin
What about: python -c 'import tellcore.library; print tellcore.library.LIBRARY_NAME'
patrik@iceman:/Volumes/home/tellcore-py/bin$ python -c 'import tellcore.library; print tellcore.library.LIBRARY_NAME'
libtelldus-core.so.2
And this: python -c 'import tellcore.library; print tellcore.library'
patrik@iceman:/Volumes/home/tellcore-py/bin$ python -c 'import tellcore.library; print tellcore.library'
<module 'tellcore.library' from '/Library/Python/2.7/site-packages/tellcore/library.pyc'>
What if you run: PYTHONPATH=Volumes/home/tellcore-py python -c 'import tellcore.library; print tellcore.library.LIBRARY_NAME'
patrik@iceman:/Volumes/home/tellcore-py/bin$ PYTHONPATH=Volumes/home/tellcore-py python -c 'import tellcore.library; print tellcore.library.LIBRARY_NAME'
libtelldus-core.so.2
I missed the first / in PYTHONPATH, it should have been: PYTHONPATH=/Volumes/home/tellcore-py python -c 'import tellcore.library; print tellcore.library.LIBRARY_NAME'
patrik@iceman:/Volumes/home/tellcore-py/bin$ PYTHONPATH=/Volumes/home/tellcore-py python -c 'import tellcore.library; print tellcore.library.LIBRARY_NAME'
/Library/Frameworks/TelldusCore.framework/TelldusCore
This should work then: PYTHONPATH=/Volumes/home/tellcore-py ./td_list_controllers
Looks like you have an older version installed. Could that be right?
Ouch, very sorry. I just pulled the latest version from the repo and forgot to build and install. It all works now...
Perfect. Thanks for reporting and testing!
You're welcome!
Building and installing and works on Mac OS X 10.9, but when trying to invoke the example script td_list_controllers I get the following output:
I have TelldusCenter 2.1.2beta installed, and can run
tdtool
just fine.