Sat Jun 16 17:01:56 2018 user.info weewx[3596]: engine: Initializing weewx version 3.8.0
Sat Jun 16 17:01:56 2018 user.info weewx[3596]: engine: Using Python 2.7.15 (default, Jun 13 2018, 10:54:45) [GCC 7.3.0]
Sat Jun 16 17:01:56 2018 user.info weewx[3596]: engine: Platform Linux-4.14.48-mips-with-glibc2.0
Sat Jun 16 17:01:56 2018 user.info weewx[3596]: engine: Locale is 'C.UTF-8;C;C;C;C;C'
Sat Jun 16 17:01:56 2018 user.info weewx[3596]: engine: Using configuration file /home/weewx/weewx.conf
Sat Jun 16 17:01:56 2018 user.info weewx[3596]: engine: Loading station type FineOffsetUSB (weewx.drivers.fousb)
Sat Jun 16 17:01:57 2018 user.info weewx[3596]: fousb: driver version is 1.9
Sat Jun 16 17:01:57 2018 user.info weewx[3596]: fousb: polling mode is PERIODIC
Sat Jun 16 17:01:57 2018 user.info weewx[3596]: fousb: polling interval is 60
Sat Jun 16 17:01:58 2018 user.err weewx[3596]: import of driver failed: No backend available (<class 'usb.core.NoBackendError'>)
Sat Jun 16 17:01:58 2018 user.crit weewx[3596]: engine: Unable to load driver: No backend available
Sat Jun 16 17:01:58 2018 user.crit weewx[3596]: **** Exiting...
Sat Jun 16 17:01:58 2018 user.err weewx[3596]: import of driver failed: No backend available (<class 'usb.core.NoBackendError'>)
Sat Jun 16 17:01:58 2018 user.crit weewx[3596]: engine: Unable to load driver: No backend available
Sat Jun 16 17:01:58 2018 user.crit weewx[3596]: **** Exiting...
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
root@LEDE:/# python -c "import usb; print usb.__version__"
1.0.0
root@LEDE:/#
Yes, I'm following that topic in parallel
root@LEDE:/home/weewx# find /usr/lib -name "libusb*"
root@LEDE:/home/weewx# find /usr/lib -name "libusb*" -print
root@LEDE:/home/weewx#
root@LEDE:/usr/lib# ls -al libusb*
lrwxrwxrwx 1 root root 19 Jun 17 10:24 libusb-0.1.so.4 -> libusb-0.1.so.4.4.4
-rwxr-xr-x 1 root root 12503 Jun 14 06:22 libusb-0.1.so.4.4.4
lrwxrwxrwx 1 root root 19 Jun 17 05:29 libusb-1.0.so -> libusb-1.0.so.0.1.0
lrwxrwxrwx 1 root root 19 Jun 17 05:29 libusb-1.0.so.0 -> libusb-1.0.so.0.1.0
-rwxr-xr-x 1 root root 49795 Jun 14 05:52 libusb-1.0.so.0.1.0
root@LEDE:/usr/lib#
--
root@LEDE:/usr/lib# PYUSB_DEBUG="debug" python -c "import usb; usb.busses()"
2018-06-17 16:53:02,351 ERROR:usb.libloader:'Libusb 1' could not be found
2018-06-17 16:53:02,356 ERROR:usb.backend.libusb1:Error loading libusb 1.0 backend
2018-06-17 16:53:02,409 ERROR:usb.libloader:'OpenUSB library' could not be found
2018-06-17 16:53:02,413 ERROR:usb.backend.openusb:Error loading OpenUSB backend
2018-06-17 16:53:02,561 ERROR:usb.libloader:'Libusb 0' could not be found
2018-06-17 16:53:02,565 ERROR:usb.backend.libusb0:Error loading libusb 0.1 backend
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/usb/legacy.py", line 353, in busses
sorted(core.find(find_all=True), key=lambda d: d.bus),
File "/usr/lib/python2.7/site-packages/usb/core.py", line 1263, in find
raise NoBackendError('No backend available')
usb.core.NoBackendError: No backend available
root@LEDE:/usr/lib#
Then to fix error with backend driver missing you need to help the
/home/weewx/bin/weewx/drivers/wmr200.py driver file find the installed
usb driver:
import usb
import usb.backend.libusb1
backend = usb.backend.libusb1.get_backend(find_library=lambda x: "/usr/lib/libusb-1.0.so")
import usb
import weewx.drivers
import usb
import usb.backend.libusb1
backend = usb.backend.libusb1.get_backend(find_library=lambda x: "/usr/lib/libus
import weewx.drivers
root@LEDE:~# python
Python 2.7.15 (default, Jun 13 2018, 10:54:45)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes.util import find_library
>>> print find_library('usb-1.0')
None
>>> print find_library('usb-0.1')
None
>>> import usb.core
>>> print usb.core.find()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/usb/core.py", line 1263, in find
raise NoBackendError('No backend available')
usb.core.NoBackendError: No backend available
>>>
# required packages:
sudo apt-get install python-configobj
sudo apt-get install python-cheetah
sudo apt-get install python-imaging
# required if hardware is serial or USB:
sudo apt-get install python-serial
sudo apt-get install python-usb
# required packages:
sudo apt-get install python-configobj
sudo apt-get install python-cheetah
sudo apt-get install Pillow
# required if hardware is serial or USB:
sudo apt-get install python-serial
sudo apt-get install python-usb
Thanks. You didn't run one of the tests, but it appears that the version of find_library() on your version of OpenWRT is not working. Let's confirm by running the missing test:python>>> from ctypes.util import find_library
root@LEDE:~# python
Python 2.7.15 (default, Jun 13 2018, 10:54:45)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes.util import find_library
>>> print find_library('c')
None
Assuming this fails (returns None), then the problem is find_library().
If it is, then find_library() depends on running the system command ldconfig in order to find the library. Confirm that you have ldconfig, and that libusb is in its cache:which ldconfigldconfig -p | grep usb
root@LEDE:~# which ldconfig
root@LEDE:~# ldconfig -p | grep usb
-ash: ldconfig: not found
root@LEDE:~# opkg install ldconfig
Unknown package 'ldconfig'.
Collected errors:
* opkg_install_cmd: Cannot install package ldconfig.
root@LEDE:~#
OpenWrt SNAPSHOT, r7200-2f3c5fe
Gary
--
Gary