-
Notifications
You must be signed in to change notification settings - Fork 22
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
invalid conversion from 'int' to 'libusb_hotplug_flag' #16
Comments
Did you try the install.sh script or are you manually building? |
Manually building |
I'd recommend the install script. You might be missing a package that is needed. You could even look at the packages the install script installs. The install script is in the dash directory after you clone that repo. The install script will build aasdk, Openauto, qt-gstreamer, and dash. What hardware and OS are you using? |
The install script uses apt (I think) and this, doesn't work |
Yeah, we haven't had any support for another OS outside of RPi OS and Ubuntu (debian based). I think I might be the only one to try Ubuntu 64bit 20.10 on the Pi4 with OpenDash. I got everything installed but I had to find a few packages that had different names due to those packages having a 64bit variant. You should check your libusb version against the package in debian based OS and see if what Arch has is the same or newer. I've never used Arch so I couldn't tell you without diving into it. Let us know what you find. Also, everything for dash is written to not require running as root. Only exception is when installing aasdk and Openauto to /usr/local directory with "sudo make install". If built using root, there can be issues when connecting your device for Openauto functionality. |
Like I said in the first post, I have libusb version 1.0.24. Not sure what version other distros are using but, Arch often adopts new things first. I did get it to work with the following patch, just casting to diff --git a/src/USB/USBHub.cpp b/src/USB/USBHub.cpp
index cc302d9..7898d48 100644
--- a/src/USB/USBHub.cpp
+++ b/src/USB/USBHub.cpp
@@ -49,7 +49,7 @@ void USBHub::start(Promise::Pointer promise)
if(self_ == nullptr)
{
self_ = this->shared_from_this();
- hotplugHandle_ = usbWrapper_.hotplugRegisterCallback(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, LIBUSB_HOTPLUG_NO_FLAGS, LIBUSB_HOTPLUG_MATCH_ANY, LIBUSB_HOTPLUG_MATCH_ANY,
+ hotplugHandle_ = usbWrapper_.hotplugRegisterCallback(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, (libusb_hotplug_flag)LIBUSB_HOTPLUG_NO_FLAGS, LIBUSB_HOTPLUG_MATCH_ANY, LIBUSB_HOTPLUG_MATCH_ANY,
LIBUSB_HOTPLUG_MATCH_ANY, reinterpret_cast<libusb_hotplug_callback_fn>(&USBHub::hotplugEventsHandler), reinterpret_cast<void*>(this));
}
}); installing things has not been a huge problem. The Arch scripts install things to a temp directory as fakeroot and then it's installed to |
Nice. It'll be good to document how to get it working on other distros. Hope everything else goes smooth. When you get to qt-gstreamer, perhaps Arch has it already for installation like Ubuntu. Instead of having to build it manually for the Pi. |
I ended up building dash with:
arch does have a qt-gstreamer package |
So you had to build qt-gstreamer then? Was that as intended or did you have to make adjustments? Are you using an official Raspberry Pi 7" touchscreen? If so, make sure you create the udev rules for the backlight. |
It was missing libraries without Not sure if I made some rules previously or added myself to the right group but, brightness works |
Awesome yeah that makes sense. Probably that you are in the right group. Just curious, Are you using 32bit or 64bit Arch? |
I'm using the 32 bit arch linux |
FWIW, in order to get the build to work on WSL I had to change apt to apt-get. I don't know of any reason why that can't be done across the board. |
@JesseMFrey how's the build running for you on Arch? |
I haven't tried but, switching from apt to apt-get shouldn't help because Arch uses pacman |
Should be easy enough to conditionalize the script for Arch and pacman |
I suppose that's possible. I guess I'd rather have an actual package built with dependencies |
Not sure I understand. This project doesn't have a prebuilt images so you have to build it yourself by running the install script. |
I get the following error when I try to compile aasdk:
In file included from /home/alarm/pkgbuilds/aasdk-git/src/aasdk-dash-git/include/aasdk/USB/IUSBWrapper.hpp:24, from /home/alarm/pkgbuilds/aasdk-git/src/aasdk-dash-git/src/USB/USBHub.cpp:20: /home/alarm/pkgbuilds/aasdk-git/src/aasdk-dash-git/src/USB/USBHub.cpp: In lambda function: /home/alarm/pkgbuilds/aasdk-git/src/aasdk-dash-git/src/USB/USBHub.cpp:52:103: error: invalid conversion from 'int' to 'libusb_hotplug_flag' [-fpermissive] 52 | hotplugHandle_ = usbWrapper_.hotplugRegisterCallback(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, LIBUSB_HOTPLUG_NO_FLAGS, LIBUSB_HOTPLUG_MATCH_ANY, LIBUSB_HOTPLUG_MATCH_ANY, | ^~~~~~~~~~~~~~~~~~~~~~~ | | | int In file included from /home/alarm/pkgbuilds/aasdk-git/src/aasdk-dash-git/src/USB/USBHub.cpp:20: /home/alarm/pkgbuilds/aasdk-git/src/aasdk-dash-git/include/aasdk/USB/IUSBWrapper.hpp:75:108: note: initializing argument 2 of 'virtual aasdk::usb::HotplugCallbackHandle aasdk::usb::IUSBWrapper::hotplugRegisterCallback(libusb_hotplug_event, libusb_hotplug_flag, int, int, int, libusb_hotplug_callback_fn, void*)' 75 | virtual HotplugCallbackHandle hotplugRegisterCallback(libusb_hotplug_event events, libusb_hotplug_flag flags, int vendor_id, int product_id, int dev_class, | ~~~~~~~~~~~~~~~~~~~~^~~~~ make[2]: *** [CMakeFiles/aasdk.dir/build.make:678: CMakeFiles/aasdk.dir/src/USB/USBHub.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/aasdk.dir/all] Error 2 make: *** [Makefile:136: all] Error 2
I have libusb version 1.0.24
The text was updated successfully, but these errors were encountered: