Installing on ArchLinux on R-Pi3 (LibUSB Error)

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
Orionos
Posts: 6
Joined: Friday 15 December 2017 20:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Installing on ArchLinux on R-Pi3 (LibUSB Error)

Post by Orionos »

I want to run Domoticz on my Raspberry Pi 3 with Arch Linux.

First, I installed Arch following the ARMv7 instuctions here:
https://archlinuxarm.org/platforms/armv ... stallation

Next, I follow the instructions here:
https://www.domoticz.com/wiki/Preparing ... rch_Linux)

To install Domoticz, it redirects me to Install.txt here:
https://www.domoticz.com/wiki/Install.txt

This is where the problems start:
Pacman doesn't know zlib1g-dev.
Compiling OpenZWave works fine.
Running "cmake -DCMAKE_BUILD_TYPE=Release ." as stated will complain about a missing Python and OpenSSL.
Python can be installed with a simple pacman -S python.
However, OpenSSL won't cooperate.

This is what it returns:

Code: Select all

-- ###########################
-- Compiling Revision #8789
-- ###########################
-- Using builtin Mosquitto library
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY) (found version "1.1.0g")
-- Failed to find the openssl library, no TLS support
-- Python3 includes found at: /usr/include/python3.6m
-- Building with I2C support
-- Building with SPI support
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
  system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY) (found
  version "1.1.0g")
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.10/Modules/FindOpenSSL.cmake:379 (find_package_handle_standard_args)
  CMakeLists.txt:508 (find_package)


-- Configuring incomplete, errors occurred!
See also "/git/domoticz/CMakeFiles/CMakeOutput.log".
Can anybody help? I'm decent with Linux, but not good enough to fix this. But I'd really like to get this working.
Last edited by Orionos on Monday 01 January 2018 16:09, edited 2 times in total.
Orionos
Posts: 6
Joined: Friday 15 December 2017 20:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Installing on ArchLinux on R-Pi3 (OpenSSL Error)

Post by Orionos »

So since I was hoping to have someone knowledgeable respond by now, I have been anticipating the questions that could be asked.

So I installed a clean Raspbian Lite image, which just happens to be Raspbian Stretch. Since there's a Debian package, I was able to get it up quite fast. Up, but not running.

Turns out, I now have a good suspicion why I got my error on Arch. When I tried to run Domoticz on my clean, configured (minus the WiFi, my dongle keeps turning itself off), it wouldn't run with the following error:

Code: Select all

/home/pi/domoticz/domoticz: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
This one was easier to Google. Turns out, new distributions of Raspbian ship with libssl.so.1.0.2, not libssl.so.1.0.0. And Domoticz is apparently incapable of running on any version newer than 1.0.0.

So for Raspbian Stretch I had to add the Jessie repository and was then able to install the 1.0.0 version.

I remembered something about my Arch error that was annoying:

Code: Select all

(found version "1.1.0g")
So maybe it also has a newer version than is supported by Domoticz.

Either way, I would have expected more from the Domoticz peeps. If you can't work with a newer version of the library, at least update the procedure in the instructions. It's taken me days just to get it working. And I still don't have it how I want it. So this topic/request is not completed yet.
PandaFly
Posts: 1
Joined: Monday 18 December 2017 16:51
Target OS: Linux
Domoticz version:
Contact:

Re: Installing on ArchLinux on R-Pi3 (OpenSSL Error)

Post by PandaFly »

I'm on Arch Linux, not on a clean install and not on RPI. But for a temporary fix, i found this:

Code: Select all

cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_CRYPTO_LIBRARY=/usr/lib/libcrypto.so -DOPENSSL_SSL_LIBRARY=/usr/lib/libssl.so CMakeLists.txt
Make sure your path is correct for your ssl libs.
Orionos
Posts: 6
Joined: Friday 15 December 2017 20:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Installing on ArchLinux on R-Pi3 (LibUSB Error)

Post by Orionos »

Thank you, that did the trick!

Turns out CMAKE has a lot more issues finding stuff. From the CMakeLists.txt file I was able to deduce I needed to create a read-only directory for my Z-Wave device. But even though I can now add the device, it doesn't communicate with it, resulting in no information or errors in the interface.

It complains that LibUSB wasn't found either.

So I performed the same trick by using

Code: Select all

-DLIBUSB_LIBRARY=/usr/lib/libusb-1.0.so -DLIBUSB_INCLUDEDIR=/usr/include
as well. Which resulted in an error about not finding usb.h at 73%.

Code: Select all

/opt/domoticz/hardware/TE923Tool.cpp:25:11: fatal error: usb.h: No such file or directory
  #include <usb.h>
           ^~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/domoticz.dir/build.make:3567: CMakeFiles/domoticz.dir/hardware/TE923Tool.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:72: CMakeFiles/domoticz.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
Reminds me of Gentoo on the R-Pi, constantly waiting for the compile to finish. I created a symlink called usb.h to the existing libusb.h file If this doesn't work, I'll try

Code: Select all

-DLIBUSB_INCLUDEDIR=/usr/include/libusb-1.0
After that, I'm lost again.

If anyone has any suggestions, please post them. I'm learning as I go. Either way, CMakeLists needs better hints (hint, hint, devs!).

When it finally works as designed, I'll create a post with all the steps in the right order for those who find themselves stuck as well.

Have a great 2018, everyone!
Orionos
Posts: 6
Joined: Friday 15 December 2017 20:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Installing on ArchLinux on R-Pi3 (LibUSB Error)

Post by Orionos »

Okay, I'm stuck again. Why aren't the instructions up to date?! I can't be the only one to run it on Arch, and yet even Google is at a loss.

I tried editing TE923Tool.cpp to turn usb.h into libusb.h.
I tried creating a symlink for libusb.h called usb.h.
I tried copying libusb.h to usb.h.
I tried creating a symlink for /usr/include/libusb-1.0 called /usr/include/libusb.
I tried linking CMAKE to both /usr/include and /usr/include/libusb-1.0.

None of these things work.

Code: Select all

/opt/domoticz/hardware/TE923Tool.cpp:25:11: fatal error: usb.h: No such file or directory
  #include <usb.h>
           ^~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/domoticz.dir/build.make:3567: CMakeFiles/domoticz.dir/hardware/TE923Tool.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:72: CMakeFiles/domoticz.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
Anyone? I really finally want to get this to work. I have a whole bunch of Z-Wave devices doing nothing right now.

EDIT: I installed libusb-compat and CMAKE found the libraries by itself and I'm now compiling again. Although I doubt this is the correct solution, at least it gets me another step on the path. I'm still hoping someone comes up with a better solution than enabling support for libusb<1.0 for a software build in 2017.

Nope, still fails:

Code: Select all

[ 48%] Linking CXX executable domoticz
CMakeFiles/domoticz.dir/hardware/VolcraftCO20.cpp.o: In function `read_one_sensor(usb_device*, unsigned short&)':
VolcraftCO20.cpp:(.text+0x8c): undefined reference to `usb_open'
VolcraftCO20.cpp:(.text+0xac): undefined reference to `usb_get_driver_np'
VolcraftCO20.cpp:(.text+0xc0): undefined reference to `usb_claim_interface'
VolcraftCO20.cpp:(.text+0xe4): undefined reference to `usb_interrupt_write'
VolcraftCO20.cpp:(.text+0x104): undefined reference to `usb_interrupt_read'
VolcraftCO20.cpp:(.text+0x128): undefined reference to `usb_interrupt_read'
VolcraftCO20.cpp:(.text+0x13c): undefined reference to `usb_release_interface'
VolcraftCO20.cpp:(.text+0x154): undefined reference to `usb_close'
VolcraftCO20.cpp:(.text+0x1a0): undefined reference to `usb_detach_kernel_driver_np'
VolcraftCO20.cpp:(.text+0x1f0): undefined reference to `usb_interrupt_read'
CMakeFiles/domoticz.dir/hardware/VolcraftCO20.cpp.o: In function `CVolcraftCO20::GetSensorDetails()':
VolcraftCO20.cpp:(.text+0x674): undefined reference to `usb_init'
VolcraftCO20.cpp:(.text+0x67c): undefined reference to `usb_set_debug'
VolcraftCO20.cpp:(.text+0x680): undefined reference to `usb_find_busses'
VolcraftCO20.cpp:(.text+0x684): undefined reference to `usb_find_devices'
VolcraftCO20.cpp:(.text+0x690): undefined reference to `usb_get_busses'
CMakeFiles/domoticz.dir/hardware/TE923Tool.cpp.o: In function `CTE923Tool::find_te923()':
TE923Tool.cpp:(.text+0x4): undefined reference to `usb_find_busses'
TE923Tool.cpp:(.text+0x8): undefined reference to `usb_find_devices'
TE923Tool.cpp:(.text+0xc): undefined reference to `usb_get_busses'
CMakeFiles/domoticz.dir/hardware/TE923Tool.cpp.o: In function `CTE923Tool::CTE923Tool()':
TE923Tool.cpp:(.text+0x88): undefined reference to `usb_init'
CMakeFiles/domoticz.dir/hardware/TE923Tool.cpp.o: In function `CTE923Tool::~CTE923Tool()':
TE923Tool.cpp:(.text+0xac): undefined reference to `usb_release_interface'
TE923Tool.cpp:(.text+0xb4): undefined reference to `usb_close'
CMakeFiles/domoticz.dir/hardware/TE923Tool.cpp.o: In function `CTE923Tool::OpenDevice()':
TE923Tool.cpp:(.text+0xe4): undefined reference to `usb_find_busses'
TE923Tool.cpp:(.text+0xe8): undefined reference to `usb_find_devices'
TE923Tool.cpp:(.text+0xec): undefined reference to `usb_get_busses'
TE923Tool.cpp:(.text+0x130): undefined reference to `usb_open'
TE923Tool.cpp:(.text+0x150): undefined reference to `usb_get_driver_np'
TE923Tool.cpp:(.text+0x164): undefined reference to `usb_set_configuration'
TE923Tool.cpp:(.text+0x178): undefined reference to `usb_claim_interface'
TE923Tool.cpp:(.text+0x18c): undefined reference to `usb_set_altinterface'
TE923Tool.cpp:(.text+0x214): undefined reference to `usb_detach_kernel_driver_np'
CMakeFiles/domoticz.dir/hardware/TE923Tool.cpp.o: In function `CTE923Tool::CloseDevice()':
TE923Tool.cpp:(.text+0x2bc): undefined reference to `usb_release_interface'
TE923Tool.cpp:(.text+0x2c4): undefined reference to `usb_close'
CMakeFiles/domoticz.dir/hardware/TE923Tool.cpp.o: In function `CTE923Tool::read_from_te923(int, unsigned char*)':
TE923Tool.cpp:(.text+0x978): undefined reference to `usb_control_msg'
TE923Tool.cpp:(.text+0x9b4): undefined reference to `usb_interrupt_read'
CMakeFiles/domoticz.dir/hardware/TE923Tool.cpp.o: In function `CTE923Tool::get_te923_lifedata(Te923DataSet_t*)':
TE923Tool.cpp:(.text+0xb34): undefined reference to `usb_control_msg'
TE923Tool.cpp:(.text+0xb6c): undefined reference to `usb_interrupt_read'
CMakeFiles/domoticz.dir/hardware/TE923Tool.cpp.o: In function `CTE923Tool::get_te923_devstate(Te923DevSet_t*)':
TE923Tool.cpp:(.text+0xd58): undefined reference to `usb_control_msg'
TE923Tool.cpp:(.text+0xd88): undefined reference to `usb_interrupt_read'
TE923Tool.cpp:(.text+0xefc): undefined reference to `usb_control_msg'
TE923Tool.cpp:(.text+0xf2c): undefined reference to `usb_interrupt_read'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/domoticz.dir/build.make:5915: domoticz] Error 1
make[1]: *** [CMakeFiles/Makefile2:72: CMakeFiles/domoticz.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
What's worse, is that it works on a VM. Unfortunately, no ARM VM's to test it on.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest