Instalare libiio pe Raspberry Pi: Diferență între versiuni
Sari la navigare
Sari la căutare
Fără descriere a modificării |
Fără descriere a modificării Etichetă: Anulare manuală |
||
| (Nu s-au afișat 23 de versiuni intermediare efectuate de același utilizator) | |||
| Linia 2: | Linia 2: | ||
==Instalare libiio pe Raspberry Pi== | ==Instalare libiio pe Raspberry Pi== | ||
===Descărcare libiio și pregătire=== | ===Descărcare libiio și pregătire=== | ||
Problemele care apar (lipsa librăriilor) sunt evidențiate în galben și vor fi tratate în capitolul următor. | |||
<syntaxhighlight lang=" | <syntaxhighlight lang="console" highlight="46,54,61,68,69,71"> | ||
git clone https://github.com/analogdevicesinc/libiio.git | tom@rpi-i2s:~/programare $ git clone https://github.com/analogdevicesinc/libiio.git | ||
Cloning into 'libiio'... | Cloning into 'libiio'... | ||
| Linia 14: | Linia 15: | ||
Resolving deltas: 100% (13821/13821), done. | Resolving deltas: 100% (13821/13821), done. | ||
cd libiio | tom@rpi-i2s:~/programare $ cd libiio/ | ||
mkdir build | tom@rpi-i2s:~/programare/libiio $ mkdir build | ||
cd build | tom@rpi-i2s:~/programare/libiio $ cd build/ | ||
cmake ../ | tom@rpi-i2s:~/programare/libiio/build $ cmake ../ | ||
-- cmake version: 3.18.4 | |||
-- The C compiler identification is GNU 10.2.1 | |||
-- Detecting C compiler ABI info | |||
-- Detecting C compiler ABI info - done | |||
-- Check for working C compiler: /usr/bin/cc - skipped | |||
-- Detecting C compile features | |||
-- Detecting C compile features - done | |||
-- Performing Test HAS_WPEDANTIC | |||
-- Performing Test HAS_WPEDANTIC - Success | |||
-- Performing Test HAS_WSHADOW | |||
-- Performing Test HAS_WSHADOW - Success | |||
-- Looking for strdup | |||
-- Looking for strdup - found | |||
-- Looking for strndup | |||
-- Looking for strndup - found | |||
-- Looking for strerror_r | |||
-- Looking for strerror_r - found | |||
-- Looking for strtok_r | |||
-- Looking for strtok_r - found | |||
-- Looking for newlocale | |||
-- Looking for newlocale - found | |||
-- Looking for in6addr_any | |||
-- Looking for in6addr_any - found | |||
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") | |||
-- Checking for module 'libusb-1.0' | |||
-- Found libusb-1.0, version 1.0.24 | |||
-- Looking for libusb_get_version | |||
-- Looking for libusb_get_version - found | |||
-- Found Git: /usr/bin/git (found version "2.30.2") | |||
CMake Error at CMakeLists.txt:474 (message): | |||
Unable to find libzstd dependency. | |||
If you want to disable ZSTD compression support, set WITH_ZSTD=OFF. | |||
-- Performing Test WITH_NETWORK_EVENTFD | |||
-- Performing Test WITH_NETWORK_EVENTFD - Success | |||
CMake Error at CMakeLists.txt:543 (message): | |||
Unable to find libavahi-common / libavahi-client dependencies. | |||
If you want to disable DNS-SD (ZeroConf) support, set HAVE_DNS_SD=OFF. | |||
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) | |||
CMake Error at CMakeLists.txt:579 (message): | |||
Unable to find libxml2 dependency. | |||
If you want to disable the XML backend, set WITH_XML_BACKEND=OFF. | |||
-- Looking for pthread_setname_np | |||
-- Looking for pthread_setname_np - found | |||
-- Could NOT find BISON (missing: BISON_EXECUTABLE) | |||
-- Could NOT find FLEX (missing: FLEX_EXECUTABLE) | |||
CMake Error at iiod/CMakeLists.txt:26 (flex_target): | |||
Unknown CMake command "flex_target". | |||
-- Configuring incomplete, errors occurred! | |||
See also "/home/tom/programare/libiio/build/CMakeFiles/CMakeOutput.log". | |||
</syntaxhighlight> | </syntaxhighlight> | ||
===Tratare erori și librării lipsă=== | ===Tratare erori și librării lipsă=== | ||
<syntaxhighlight lang="console"> | <syntaxhighlight lang="console"> | ||
tom@rpi-i2s:~/programare/libiio/build $ sudo apt install -y libzstd-dev | |||
tom@rpi-i2s:~/programare/libiio/build $ sudo apt install -y libavahi-client-dev | |||
tom@rpi-i2s:~/programare/libiio/build $ sudo apt install -y libxml2-dev | |||
tom@rpi-i2s:~/programare/libiio/build $ sudo apt install -y bison | |||
tom@rpi-i2s:~/programare/libiio/build $ sudo apt install -y flex | |||
tom@rpi-i2s:~/programare/libiio/build $ sudo apt install -y libaio1 | |||
tom@rpi-i2s:~/programare/libiio/build $ sudo apt install -y libaio-dev | |||
</syntaxhighlight> | |||
===Compilare=== | |||
<syntaxhighlight lang="console"> | |||
tom@rpi-i2s:~/programare/libiio/build $ make all | |||
Scanning dependencies of target iiod-responder | |||
[ 1%] Building C object CMakeFiles/iiod-responder.dir/iiod-responder.c.o | |||
... | |||
[ 98%] Building C object iiod/CMakeFiles/iiod.dir/dns-sd.c.o | |||
[100%] Linking C executable iiod | |||
[100%] Built target iiod | |||
tom@rpi-i2s:~/programare/libiio/build $ sudo make install | |||
[ 3%] Built target iiod-responder | |||
[ 7%] Built target iio-compat | |||
[ 50%] Built target iio | |||
[ 55%] Built target iio_tests_helper | |||
[ 58%] Built target iio_genxml | |||
[ 61%] Built target iio_stresstest | |||
[ 64%] Built target iio_info | |||
[ 67%] Built target iio_attr | |||
[ 70%] Built target iio_rwdev | |||
[ 73%] Built target iio_reg | |||
[ 76%] Built target iio_event | |||
[100%] Built target iiod | |||
Install the project... | |||
-- Install configuration: "RelWithDebInfo" | |||
-- Installing: /usr/lib/aarch64-linux-gnu/pkgconfig/libiio.pc | |||
-- Installing: /usr/lib/aarch64-linux-gnu/libiio.so.1.0 | |||
-- Installing: /usr/lib/aarch64-linux-gnu/libiio.so.1 | |||
-- Installing: /usr/lib/aarch64-linux-gnu/libiio.so | |||
-- Installing: /usr/include/iio/iio.h | |||
-- Installing: /usr/include/iio/iio-debug.h | |||
-- Installing: /usr/include/iio/iio-lock.h | |||
-- Installing: /usr/include/iio/iiod-client.h | |||
-- Installing: /usr/lib/aarch64-linux-gnu/libiio.so.0 | |||
-- Installing: /usr/bin/iio_genxml | |||
-- Installing: /usr/bin/iio_info | |||
-- Installing: /usr/bin/iio_attr | |||
-- Installing: /usr/bin/iio_rwdev | |||
-- Installing: /usr/bin/iio_reg | |||
-- Installing: /usr/bin/iio_event | |||
-- Installing: /usr/bin/iio_stresstest | |||
-- Installing: /lib/udev/rules.d/90-libiio.rules | |||
-- Installing: /usr/sbin/iiod | |||
-- Set runtime path of "/usr/sbin/iiod" to "" | |||
</syntaxhighlight> | </syntaxhighlight> | ||
După instalare, directorul build arată: | |||
<syntaxhighlight lang="console"> | |||
tom@rpi-i2s:~/programare/libiio/build $ ls -lsa | |||
total 1204 | |||
4 drwxr-xr-x 7 tom tom 4096 Mar 19 22:34 . | |||
4 drwxr-xr-x 17 tom tom 4096 Mar 19 22:24 .. | |||
4 -rw-r--r-- 1 tom tom 152 Mar 19 22:30 90-libiio.rules | |||
8 -rw-r--r-- 1 tom tom 4453 Mar 19 22:30 artifact_manifest.txt | |||
4 drwxr-xr-x 3 tom tom 4096 Mar 19 22:33 bindings | |||
28 -rw-r--r-- 1 tom tom 27733 Mar 19 22:33 CMakeCache.txt | |||
4 drwxr-xr-x 9 tom tom 4096 Mar 19 22:34 CMakeFiles | |||
8 -rw-r--r-- 1 tom tom 6872 Mar 19 22:33 cmake_install.cmake | |||
4 -rw-r--r-- 1 tom tom 3574 Mar 19 22:30 cmake_uninstall.cmake | |||
4 -rw-r--r-- 1 tom tom 1338 Mar 19 22:30 iio-config.h | |||
4 drwxr-xr-x 3 tom tom 4096 Mar 19 22:33 iiod | |||
4 -rw-r--r-- 1 root root 497 Mar 19 22:34 install_manifest.txt | |||
72 -rw-r--r-- 1 tom tom 72566 Mar 19 22:33 libiiod-responder.a | |||
4 -rw-r--r-- 1 tom tom 3386 Mar 19 22:30 libiio.iss | |||
4 -rw-r--r-- 1 tom tom 227 Mar 19 22:30 libiio.pc | |||
0 lrwxrwxrwx 1 tom tom 11 Mar 19 22:33 libiio.so -> libiio.so.1 | |||
176 -rwxr-xr-x 1 tom tom 177912 Mar 19 22:33 libiio.so.0 | |||
0 lrwxrwxrwx 1 tom tom 13 Mar 19 22:33 libiio.so.1 -> libiio.so.1.0 | |||
824 -rwxr-xr-x 1 tom tom 839800 Mar 19 22:33 libiio.so.1.0 | |||
32 -rw-r--r-- 1 tom tom 32741 Mar 19 22:33 Makefile | |||
4 drwxr-xr-x 3 tom tom 4096 Mar 19 22:33 man | |||
4 drwxr-xr-x 3 tom tom 4096 Mar 19 22:33 utils | |||
4 -rw-r--r-- 1 tom tom 13 Mar 19 22:33 .version | |||
</syntaxhighlight> | |||
===Verificare instalare=== | |||
În cazul de față am un Adalm Pluto conectat pe USB: | |||
<syntaxhighlight lang="console" highlight="9,26,28"> | |||
tom@rpi-i2s:~/programare/libiio/build $ iio_info | |||
iio_info version: 1.0 (git tag:0313659f) | |||
Libiio version: 1.0 (git tag: 0313659f) backends: local ip usb xml | |||
IIO context created with local backend. | |||
Backend version: 1.0 (git tag: 0313659f) | |||
Backend description string: Linux rpi-i2s 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 | |||
IIO context has 2 attributes: | |||
attr 0: local,kernel value: 6.1.21-v8+ | |||
attr 1: uri value: local: | |||
IIO context has 2 devices: | |||
hwmon0: cpu_thermal | |||
1 channels found: | |||
temp1: (input) | |||
2 channel-specific attributes found: | |||
attr 0: crit (temp1_crit) value: 110000 | |||
attr 1: input (temp1_input) value: 51608 | |||
No trigger on this device | |||
hwmon1: rpi_volt | |||
1 channels found: | |||
in0: (input) | |||
1 channel-specific attributes found: | |||
attr 0: lcrit_alarm (in0_lcrit_alarm) value: 0 | |||
No trigger on this device | |||
tom@rpi-i2s:~/programare/libiio/build $ iio_info -S | |||
Available contexts: | |||
0: 0456:b673 (Analog Devices Inc. PlutoSDR (ADALM-PLUTO)), serial=1044730a19970019030031006a5f7c113d [usb:1.3.5] | |||
1: (cpu_thermal,rpi_volt on Raspberry Pi 4 Model B Rev 1.4) [local:] | |||
2: 192.168.2.1 (v0.37), serial=ad9363a [ip:pluto.local] | |||
</syntaxhighlight> | |||
==Alte link-uri utile== | |||
* [https://wiki.analog.com/resources/tools-software/linux-software/libiio What is libiio?] | |||
* [https://ez.analog.com/adieducation/university-program/f/q-a/573056/installing-libad9361-from-source Installing libad9361 from source] | |||
* [https://pysdr.org/content/pluto.html PlutoSDR in Python] - Python și Pluto | |||
* [https://analogdevicesinc.github.io/libiio/v0.25/index.html Welcome to the libIIO] | |||
* [https://wiki.analog.com/resources/tools-software/linux-software/libiio/cmd_line IIO Command Line Tools] | |||
* [https://analogdevicesinc.github.io/pyadi-iio/guides/quick.html PyAdi-IIO] - Analog Devices Hardware Python Interfaces | |||
* [https://www.freecodecamp.org/news/symlink-tutorial-in-linux-how-to-create-and-remove-a-symbolic-link/ Symlink Tutorial in Linux] | |||
* [https://bic-berkeley.github.io/psych-214-fall-2016/using_pythonpath.html Using PYTHONPATH] | |||
Versiunea curentă din 23 martie 2025 16:17
Instalare libiio pe Raspberry Pi
Descărcare libiio și pregătire
Problemele care apar (lipsa librăriilor) sunt evidențiate în galben și vor fi tratate în capitolul următor.
tom@rpi-i2s:~/programare $ git clone https://github.com/analogdevicesinc/libiio.git
Cloning into 'libiio'...
remote: Enumerating objects: 20695, done.
remote: Counting objects: 100% (508/508), done.
remote: Compressing objects: 100% (276/276), done.
remote: Total 20695 (delta 346), reused 242 (delta 231), pack-reused 20187 (from 4)
Receiving objects: 100% (20695/20695), 20.65 MiB | 7.48 MiB/s, done.
Resolving deltas: 100% (13821/13821), done.
tom@rpi-i2s:~/programare $ cd libiio/
tom@rpi-i2s:~/programare/libiio $ mkdir build
tom@rpi-i2s:~/programare/libiio $ cd build/
tom@rpi-i2s:~/programare/libiio/build $ cmake ../
-- cmake version: 3.18.4
-- The C compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test HAS_WPEDANTIC
-- Performing Test HAS_WPEDANTIC - Success
-- Performing Test HAS_WSHADOW
-- Performing Test HAS_WSHADOW - Success
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strndup
-- Looking for strndup - found
-- Looking for strerror_r
-- Looking for strerror_r - found
-- Looking for strtok_r
-- Looking for strtok_r - found
-- Looking for newlocale
-- Looking for newlocale - found
-- Looking for in6addr_any
-- Looking for in6addr_any - found
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
-- Checking for module 'libusb-1.0'
-- Found libusb-1.0, version 1.0.24
-- Looking for libusb_get_version
-- Looking for libusb_get_version - found
-- Found Git: /usr/bin/git (found version "2.30.2")
CMake Error at CMakeLists.txt:474 (message):
Unable to find libzstd dependency.
If you want to disable ZSTD compression support, set WITH_ZSTD=OFF.
-- Performing Test WITH_NETWORK_EVENTFD
-- Performing Test WITH_NETWORK_EVENTFD - Success
CMake Error at CMakeLists.txt:543 (message):
Unable to find libavahi-common / libavahi-client dependencies.
If you want to disable DNS-SD (ZeroConf) support, set HAVE_DNS_SD=OFF.
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
CMake Error at CMakeLists.txt:579 (message):
Unable to find libxml2 dependency.
If you want to disable the XML backend, set WITH_XML_BACKEND=OFF.
-- Looking for pthread_setname_np
-- Looking for pthread_setname_np - found
-- Could NOT find BISON (missing: BISON_EXECUTABLE)
-- Could NOT find FLEX (missing: FLEX_EXECUTABLE)
CMake Error at iiod/CMakeLists.txt:26 (flex_target):
Unknown CMake command "flex_target".
-- Configuring incomplete, errors occurred!
See also "/home/tom/programare/libiio/build/CMakeFiles/CMakeOutput.log".
Tratare erori și librării lipsă
tom@rpi-i2s:~/programare/libiio/build $ sudo apt install -y libzstd-dev
tom@rpi-i2s:~/programare/libiio/build $ sudo apt install -y libavahi-client-dev
tom@rpi-i2s:~/programare/libiio/build $ sudo apt install -y libxml2-dev
tom@rpi-i2s:~/programare/libiio/build $ sudo apt install -y bison
tom@rpi-i2s:~/programare/libiio/build $ sudo apt install -y flex
tom@rpi-i2s:~/programare/libiio/build $ sudo apt install -y libaio1
tom@rpi-i2s:~/programare/libiio/build $ sudo apt install -y libaio-dev
Compilare
tom@rpi-i2s:~/programare/libiio/build $ make all
Scanning dependencies of target iiod-responder
[ 1%] Building C object CMakeFiles/iiod-responder.dir/iiod-responder.c.o
...
[ 98%] Building C object iiod/CMakeFiles/iiod.dir/dns-sd.c.o
[100%] Linking C executable iiod
[100%] Built target iiod
tom@rpi-i2s:~/programare/libiio/build $ sudo make install
[ 3%] Built target iiod-responder
[ 7%] Built target iio-compat
[ 50%] Built target iio
[ 55%] Built target iio_tests_helper
[ 58%] Built target iio_genxml
[ 61%] Built target iio_stresstest
[ 64%] Built target iio_info
[ 67%] Built target iio_attr
[ 70%] Built target iio_rwdev
[ 73%] Built target iio_reg
[ 76%] Built target iio_event
[100%] Built target iiod
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/lib/aarch64-linux-gnu/pkgconfig/libiio.pc
-- Installing: /usr/lib/aarch64-linux-gnu/libiio.so.1.0
-- Installing: /usr/lib/aarch64-linux-gnu/libiio.so.1
-- Installing: /usr/lib/aarch64-linux-gnu/libiio.so
-- Installing: /usr/include/iio/iio.h
-- Installing: /usr/include/iio/iio-debug.h
-- Installing: /usr/include/iio/iio-lock.h
-- Installing: /usr/include/iio/iiod-client.h
-- Installing: /usr/lib/aarch64-linux-gnu/libiio.so.0
-- Installing: /usr/bin/iio_genxml
-- Installing: /usr/bin/iio_info
-- Installing: /usr/bin/iio_attr
-- Installing: /usr/bin/iio_rwdev
-- Installing: /usr/bin/iio_reg
-- Installing: /usr/bin/iio_event
-- Installing: /usr/bin/iio_stresstest
-- Installing: /lib/udev/rules.d/90-libiio.rules
-- Installing: /usr/sbin/iiod
-- Set runtime path of "/usr/sbin/iiod" to ""
După instalare, directorul build arată:
tom@rpi-i2s:~/programare/libiio/build $ ls -lsa
total 1204
4 drwxr-xr-x 7 tom tom 4096 Mar 19 22:34 .
4 drwxr-xr-x 17 tom tom 4096 Mar 19 22:24 ..
4 -rw-r--r-- 1 tom tom 152 Mar 19 22:30 90-libiio.rules
8 -rw-r--r-- 1 tom tom 4453 Mar 19 22:30 artifact_manifest.txt
4 drwxr-xr-x 3 tom tom 4096 Mar 19 22:33 bindings
28 -rw-r--r-- 1 tom tom 27733 Mar 19 22:33 CMakeCache.txt
4 drwxr-xr-x 9 tom tom 4096 Mar 19 22:34 CMakeFiles
8 -rw-r--r-- 1 tom tom 6872 Mar 19 22:33 cmake_install.cmake
4 -rw-r--r-- 1 tom tom 3574 Mar 19 22:30 cmake_uninstall.cmake
4 -rw-r--r-- 1 tom tom 1338 Mar 19 22:30 iio-config.h
4 drwxr-xr-x 3 tom tom 4096 Mar 19 22:33 iiod
4 -rw-r--r-- 1 root root 497 Mar 19 22:34 install_manifest.txt
72 -rw-r--r-- 1 tom tom 72566 Mar 19 22:33 libiiod-responder.a
4 -rw-r--r-- 1 tom tom 3386 Mar 19 22:30 libiio.iss
4 -rw-r--r-- 1 tom tom 227 Mar 19 22:30 libiio.pc
0 lrwxrwxrwx 1 tom tom 11 Mar 19 22:33 libiio.so -> libiio.so.1
176 -rwxr-xr-x 1 tom tom 177912 Mar 19 22:33 libiio.so.0
0 lrwxrwxrwx 1 tom tom 13 Mar 19 22:33 libiio.so.1 -> libiio.so.1.0
824 -rwxr-xr-x 1 tom tom 839800 Mar 19 22:33 libiio.so.1.0
32 -rw-r--r-- 1 tom tom 32741 Mar 19 22:33 Makefile
4 drwxr-xr-x 3 tom tom 4096 Mar 19 22:33 man
4 drwxr-xr-x 3 tom tom 4096 Mar 19 22:33 utils
4 -rw-r--r-- 1 tom tom 13 Mar 19 22:33 .version
Verificare instalare
În cazul de față am un Adalm Pluto conectat pe USB:
tom@rpi-i2s:~/programare/libiio/build $ iio_info
iio_info version: 1.0 (git tag:0313659f)
Libiio version: 1.0 (git tag: 0313659f) backends: local ip usb xml
IIO context created with local backend.
Backend version: 1.0 (git tag: 0313659f)
Backend description string: Linux rpi-i2s 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64
IIO context has 2 attributes:
attr 0: local,kernel value: 6.1.21-v8+
attr 1: uri value: local:
IIO context has 2 devices:
hwmon0: cpu_thermal
1 channels found:
temp1: (input)
2 channel-specific attributes found:
attr 0: crit (temp1_crit) value: 110000
attr 1: input (temp1_input) value: 51608
No trigger on this device
hwmon1: rpi_volt
1 channels found:
in0: (input)
1 channel-specific attributes found:
attr 0: lcrit_alarm (in0_lcrit_alarm) value: 0
No trigger on this device
tom@rpi-i2s:~/programare/libiio/build $ iio_info -S
Available contexts:
0: 0456:b673 (Analog Devices Inc. PlutoSDR (ADALM-PLUTO)), serial=1044730a19970019030031006a5f7c113d [usb:1.3.5]
1: (cpu_thermal,rpi_volt on Raspberry Pi 4 Model B Rev 1.4) [local:]
2: 192.168.2.1 (v0.37), serial=ad9363a [ip:pluto.local]
Alte link-uri utile
- What is libiio?
- Installing libad9361 from source
- PlutoSDR in Python - Python și Pluto
- Welcome to the libIIO
- IIO Command Line Tools
- PyAdi-IIO - Analog Devices Hardware Python Interfaces
- Symlink Tutorial in Linux
- Using PYTHONPATH