Comments (3)
@archywelker I had the same error, and it might be because of the version of the libhidapi-dev
package you have installed. You can check this by running dpkg --list | grep hid
. In my case, I had version 0.11.2-1 installed using apt-get, but the latest one is 0.13.1. And hid_get_device_info
is pretty new API and available since 0.13. So, just update the package to the latest version, and you should be good to go!
Personally, I'm a newbie with all this apt-get
and cmake
stuff, and I didn't succeed in installing the latest version of the libhidapi-dev
package, anything newer than version 0.11.2-1. So, I decided to build libhidapi-dev
from source. Here are the steps to do it:
- First, download the source code from the hidapi repository. All the instructions on how to build a standalone package from the source code are available there.
- Install the
libudev-dev
andlibusb-1.0-0-dev
packages as it is said in the instructions provided in the repository's BUILD.md. - Build and install the standalone package according to the instructions in the BUILD.cmake.md file.
- Once hidapi is installed, you can build co2mon. To do so, adjust the CMake file in the repository to use the standalone package. Replace
pkg_search_module(HIDAPI REQUIRED hidapi-libusb hidapi)
withfind_package(hidapi REQUIRED)
. Then replacetarget_link_libraries(co2mon ${HIDAPI_LIBRARIES})
withtarget_link_libraries(co2mon PRIVATE hidapi::hidapi)
.
Without doubt not the best way, but it worked for me :)
from co2mon.
Solution by @Sencudra worked but i get an error
root@ubuntu:~/co2mon/build/co2mond# ./co2mond
hid_open: error
Unable to open CO2 device
hid_open: error
Yet i have my sensor plugged in
root@ubuntu:~/co2mon/build/co2mond# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 04d9:a052 Holtek Semiconductor, Inc. USB-zyTemp
Bus 001 Device 002: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Update:
It works using sudo ./co2mond
from co2mon.
Note that the dependency was introduced recently in #47 to auto-detect whether a decoding step is necessary.
You might find it easier to build from an older revision (git checkout f47ec3d7e72ad4b8bc163a515b6e66bd94a6b02e
) and run co2mond -n
if your device requires so.
from co2mon.
Related Issues (20)
- Выход из hibernate HOT 4
- Почему в README нет ссылки на co2meter.com? HOT 2
- Возможность: прочитать текущие значения и выйти HOT 5
- Missing install target in Makefile HOT 1
- Wrong libco2mon.so install path HOT 2
- Unversioned libco2mon.so HOT 1
- co2mond may get stuck and stop report values HOT 1
- Add a file for device status to datadir HOT 2
- Build on Debian jessie HOT 3
- cmake mac os None of the required 'hidapi-libusb;hidapi' found HOT 4
- warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
- Give ability to list USB devices
- cmake mac os None of the required 'hidapi-libusb;hidapi' HOT 6
- error message humanization HOT 2
- Unexpected data from device (data[4] = fb, want 0x0d) HOT 18
- Why does this only run as root? HOT 2
- -P option crashes when run from a systemd service
- MT8957s device via com port
- Arm compilation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from co2mon.