Problem installing joulescope (command line) on RPI

Hi all,
I’m trying to install Joulescope command line on a RPi (64bit) following the instructions that Matt provided previously (Run in Raspberry pi #100). The installation works fine until I get to the final part where the system tries to install pyjls. I get the following message:

collecting pyjls>=0.4.2 (from joulescope)

Could not find a version that satisfies the requirement pyjls>=0.4.2 (from Joulescope) (from versions: 0.2.5, 0.2.6, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4)
No matching distributionfound for pyjls>=0.4.2 (from joulescope)

Any help would be much appreciated.
Luke

The most recent pyjls release is 0.4.3.

I have not tried Raspberry Pi installation in a while. Raspberry Pi is somewhat “special”. pywheels does not support aarch64, which is what you should be using. It does show that pyjls is available for python 3.9.

You can try installing from source. First, ensure that you are running at least python 3.8. 3.9 and 3.10 are preferred.

python3 -VV

I think that you can try to install from source without using a wheel:

python3 -m pip install -U pyjls --no-binary :all:

Does this command work? If not, can you post the full output?

Hi Matt,

Thanks for the quick reply. I was running python 3.7 but given your advice upgraded it to python 3.10.2 and set it as the default python3 version to use. I confirmed this by running python3 -VV. I also ran sudo update and sudo upgrade. I then followed the instructions as per your previous message. However, this time the install failed at the command “python3 -m venv ~/venv/joulescope”. See full output below.

pi@raspberrypi:~ $ sudo apt install git python3-pip python3-venv
Reading package lists… Done
Building dependency tree
Reading state information… Done
git is already the newest version (1:2.20.1-2+deb10u6).
python3-venv is already the newest version (3.7.3-1).
python3-pip is already the newest version (18.1-5+rpt1).
The following packages were automatically installed and are no longer required:
avahi-utils libc-ares2 libnode64 libuv1 nodejs nodejs-doc python-colorzero
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $ wget https://raw.githubusercontent.com/jetperch/pyjoulescope/master/99-joulescope.rules
–2023-01-24 09:37:26-- https://raw.githubusercontent.com/jetperch/pyjoulescope/master/99-joulescope.rules
Resolving raw.githubusercontent.com (raw.githubusercontent.com)… 2606:50c0:8003::154, 2606:50c0:8000::154, 2606:50c0:8001::154, …
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8003::154|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 1551 (1.5K) [text/plain]
Saving to: ‘99-joulescope.rules.2’

99-joulescope.rules.2 100%[========================================================>] 1.51K --.-KB/s in 0.003s

2023-01-24 09:37:27 (503 KB/s) - ‘99-joulescope.rules.2’ saved [1551/1551]

pi@raspberrypi:~ $ sudo cp 99-joulescope.rules /etc/udev/rules.d/
pi@raspberrypi:~ $ sudo udevadm control --reload-rules
pi@raspberrypi:~ $ python3 -m venv ~/venv/joulescope
Error: Command ‘[’/home/pi/venv/joulescope/bin/python3’, ‘-Im’, ‘ensurepip’, ‘–upgrade’, ‘–default-pip’]’ returned non-zero exit status 1.
pi@raspberrypi:~ $

The failure while trying to create a virtual environment has nothing to do with Joulescope software. Here are some things to try:

  1. Delete the ~/venv/joulescope directory first, and try again
  2. See StackOverflow. Maybe:
   sudo apt update
   sudo apt upgrade
   sudo apt install python3-venv

However, you may need to use:

sudo apt install python3.10 python3.10-pip python3.10-venv

if 3.10 is not the default installation.

  1. Post the results of the following commands:
    which python3
    which pip3
    python3 -VV
    pip3 freeze

Hi Matt,

Here is the output. Does this look correct?

pi@raspberrypi:~ $ rm -r ~/venv/joulescope
pi@raspberrypi:~ $ cd ~/venv/joulescope
bash: cd: /home/pi/venv/joulescope: No such file or directory
pi@raspberrypi:~ $ sudo apt update
Get:1 Index of /raspbian buster InRelease [15.0 kB]
Hit:2 Index of /debian buster InRelease
Fetched 15.0 kB in 1s (10.0 kB/s)
Reading package lists… Done
Building dependency tree
Reading state information… Done
All packages are up to date.
pi@raspberrypi:~ $ sudo apt upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following packages were automatically installed and are no longer required:
avahi-utils libc-ares2 libnode64 libuv1 nodejs nodejs-doc python-colorzero
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $ sudo apt install python3-venv
Reading package lists… Done
Building dependency tree
Reading state information… Done
python3-venv is already the newest version (3.7.3-1).
The following packages were automatically installed and are no longer required:
avahi-utils libc-ares2 libnode64 libuv1 nodejs nodejs-doc python-colorzero
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $ which python3
/usr/bin/python3
pi@raspberrypi:~ $ which pip3
/usr/bin/pip3
pi@raspberrypi:~ $ python3 -VV
Python 3.10.2 (main, Jan 24 2023, 09:13:00) [GCC 8.3.0]
pi@raspberrypi:~ $ pip3 freeze
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with ‘-m pip’ instead of running pip directly.
pi@raspberrypi:~ $

No, that definitely does not look right. pip3 freeze should display a whole list of the installed packages.

How did you install python3? With sudo apt install python3.10? If so, sudo apt install python3.10 python3.10-pip python3.10-venv may fix things. If not, you can try running things from the python3.10 installation, like this:

python3 -m pip freeze
python3 -m pip install venv
python3 -m venv ~/venv/joulescope

OK, thanks Matt, I appreciate the help. I’ll work on it and see how I go.

Hi Matt,

I’m making progress. I have updated to the latest default python (3.11.1) and have the venv and pip3 working. I tired installing Joulescope from source without using a wheel using the following command python3.11 -m pip install -U joulescope --no-binary :all: However, its just failing at the pyjoulescope driver.

I realise this is not a joulescope problem, but any thoughts you may have would be much appreciated.
Kind regards,
Luke

DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting joulescope
  Using cached joulescope-1.0.15.tar.gz (736 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /home/pi/venv/joulescope/lib/python3.11/site-packages (from joulescope) (1.24.1)
Collecting psutil
  Downloading psutil-5.9.4.tar.gz (485 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 485.8/485.8 kB 4.3 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: pyjls>=0.4.3 in /home/pi/venv/joulescope/lib/python3.11/site-packages (from joulescope) (0.4.3)
Collecting pyjoulescope-driver>=1.1.2
  Using cached pyjoulescope_driver-1.1.2.tar.gz (2.6 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting python-dateutil>=2.7.3
  Downloading python-dateutil-2.8.2.tar.gz (357 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 357.3/357.3 kB 4.0 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pymonocypher>=3.1.3
  Using cached pymonocypher-3.1.3.1.tar.gz (103 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting requests
  Using cached requests-2.28.2.tar.gz (108 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting six>=1.5
  Downloading six-1.16.0.tar.gz (34 kB)
  Preparing metadata (setup.py) ... done
Collecting charset-normalizer<4,>=2
  Using cached charset-normalizer-3.0.1.tar.gz (92 kB)
  Preparing metadata (setup.py) ... done
Collecting idna<4,>=2.5
  Using cached idna-3.4.tar.gz (183 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting urllib3<1.27,>=1.21.1
  Using cached urllib3-1.26.14.tar.gz (300 kB)
  Preparing metadata (setup.py) ... done
Collecting certifi>=2017.4.17
  Using cached certifi-2022.12.7.tar.gz (156 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: joulescope, pyjoulescope-driver, pymonocypher, python-dateutil, psutil, requests, idna
  Building wheel for joulescope (pyproject.toml) ... done
  Created wheel for joulescope: filename=joulescope-1.0.15-cp311-cp311-linux_armv7l.whl size=2236543 sha256=1679f4ca6712fcf97a2d36266803274025abde6ee53272fd1b3691efb30aba28
  Stored in directory: /home/pi/.cache/pip/wheels/a4/51/be/1c4b59ea98855d202a90df37d0725fafbd274fe30d9012a242
  Building wheel for pyjoulescope-driver (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for pyjoulescope-driver (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [97 lines of output]
      running bdist_wheel
      running build
      running build_py
      url_save(index.json, /home/pi/.joulescope_driver/program/index.json)
      url_save(sensor_fpga/js220_fpga_1_0_3.img, /home/pi/.joulescope_driver/program/sensor_fpga/js220_fpga_1_0_3.img)
      url_save(sensor_fpga/js220_fpga_1_0_3_CHANGELOG.md, /home/pi/.joulescope_driver/program/sensor_fpga/js220_fpga_1_0_3_CHANGELOG.md)
      url_save(sensor_fpga/js220_fpga_1_0_3.img, /home/pi/.joulescope_driver/program/sensor_fpga/js220_fpga_1_0_3.img)
      url_save(sensor_fpga/js220_fpga_1_0_3_CHANGELOG.md, /home/pi/.joulescope_driver/program/sensor_fpga/js220_fpga_1_0_3_CHANGELOG.md)
      url_save(sensor_fpga/js220_fpga_1_0_3.img, /home/pi/.joulescope_driver/program/sensor_fpga/js220_fpga_1_0_3.img)
      url_save(sensor_fpga/js220_fpga_1_0_3_CHANGELOG.md, /home/pi/.joulescope_driver/program/sensor_fpga/js220_fpga_1_0_3_CHANGELOG.md)
      url_save(ctrl_app/js220_ctrl_app_1_0_4.img, /home/pi/.joulescope_driver/program/ctrl_app/js220_ctrl_app_1_0_4.img)
      url_save(ctrl_app/js220_ctrl_app_1_0_4_CHANGELOG.md, /home/pi/.joulescope_driver/program/ctrl_app/js220_ctrl_app_1_0_4_CHANGELOG.md)
      url_save(ctrl_app/js220_ctrl_app_1_0_4.img, /home/pi/.joulescope_driver/program/ctrl_app/js220_ctrl_app_1_0_4.img)
      url_save(ctrl_app/js220_ctrl_app_1_0_4_CHANGELOG.md, /home/pi/.joulescope_driver/program/ctrl_app/js220_ctrl_app_1_0_4_CHANGELOG.md)
      url_save(ctrl_app/js220_ctrl_app_1_0_4.img, /home/pi/.joulescope_driver/program/ctrl_app/js220_ctrl_app_1_0_4.img)
      url_save(ctrl_app/js220_ctrl_app_1_0_4_CHANGELOG.md, /home/pi/.joulescope_driver/program/ctrl_app/js220_ctrl_app_1_0_4_CHANGELOG.md)
      url_save(ctrl_updater1/js220_ctrl_updater1_1_0_4.img, /home/pi/.joulescope_driver/program/ctrl_updater1/js220_ctrl_updater1_1_0_4.img)
      url_save(ctrl_updater1/js220_ctrl_updater1_1_0_4_CHANGELOG.md, /home/pi/.joulescope_driver/program/ctrl_updater1/js220_ctrl_updater1_1_0_4_CHANGELOG.md)
      url_save(ctrl_updater1/js220_ctrl_updater1_1_0_4.img, /home/pi/.joulescope_driver/program/ctrl_updater1/js220_ctrl_updater1_1_0_4.img)
      url_save(ctrl_updater1/js220_ctrl_updater1_1_0_4_CHANGELOG.md, /home/pi/.joulescope_driver/program/ctrl_updater1/js220_ctrl_updater1_1_0_4_CHANGELOG.md)
      url_save(ctrl_updater1/js220_ctrl_updater1_1_0_4.img, /home/pi/.joulescope_driver/program/ctrl_updater1/js220_ctrl_updater1_1_0_4.img)
      url_save(ctrl_updater1/js220_ctrl_updater1_1_0_4_CHANGELOG.md, /home/pi/.joulescope_driver/program/ctrl_updater1/js220_ctrl_updater1_1_0_4_CHANGELOG.md)
      url_save(ctrl_updater2/js220_ctrl_updater2_1_0_4.img, /home/pi/.joulescope_driver/program/ctrl_updater2/js220_ctrl_updater2_1_0_4.img)
      url_save(ctrl_updater2/js220_ctrl_updater2_1_0_4_CHANGELOG.md, /home/pi/.joulescope_driver/program/ctrl_updater2/js220_ctrl_updater2_1_0_4_CHANGELOG.md)
      url_save(ctrl_updater2/js220_ctrl_updater2_1_0_4.img, /home/pi/.joulescope_driver/program/ctrl_updater2/js220_ctrl_updater2_1_0_4.img)
      url_save(ctrl_updater2/js220_ctrl_updater2_1_0_4_CHANGELOG.md, /home/pi/.joulescope_driver/program/ctrl_updater2/js220_ctrl_updater2_1_0_4_CHANGELOG.md)
      url_save(ctrl_updater2/js220_ctrl_updater2_1_0_4.img, /home/pi/.joulescope_driver/program/ctrl_updater2/js220_ctrl_updater2_1_0_4.img)
      url_save(ctrl_updater2/js220_ctrl_updater2_1_0_4_CHANGELOG.md, /home/pi/.joulescope_driver/program/ctrl_updater2/js220_ctrl_updater2_1_0_4_CHANGELOG.md)
      creating build
      creating build/lib.linux-armv7l-cpython-311
      creating build/lib.linux-armv7l-cpython-311/pyjoulescope_driver
      copying pyjoulescope_driver/__main__.py -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver
      copying pyjoulescope_driver/program.py -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver
      copying pyjoulescope_driver/version.py -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver
      copying pyjoulescope_driver/release.py -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver
      copying pyjoulescope_driver/__init__.py -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver
      creating build/lib.linux-armv7l-cpython-311/pyjoulescope_driver/entry_points
      copying pyjoulescope_driver/entry_points/statistics.py -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver/entry_points
      copying pyjoulescope_driver/entry_points/info.py -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver/entry_points
      copying pyjoulescope_driver/entry_points/program.py -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver/entry_points
      copying pyjoulescope_driver/entry_points/threads.py -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver/entry_points
      copying pyjoulescope_driver/entry_points/__init__.py -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver/entry_points
      copying pyjoulescope_driver/entry_points/set_parameter.py -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver/entry_points
      copying pyjoulescope_driver/entry_points/scan.py -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver/entry_points
      creating build/lib.linux-armv7l-cpython-311/pyjoulescope_driver/test
      copying pyjoulescope_driver/test/test_release.py -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver/test
      copying pyjoulescope_driver/test/__init__.py -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver/test
      running egg_info
      writing pyjoulescope_driver.egg-info/PKG-INFO
      writing dependency_links to pyjoulescope_driver.egg-info/dependency_links.txt
      writing entry points to pyjoulescope_driver.egg-info/entry_points.txt
      writing requirements to pyjoulescope_driver.egg-info/requires.txt
      writing top-level names to pyjoulescope_driver.egg-info/top_level.txt
      reading manifest file 'pyjoulescope_driver.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE.txt'
      writing manifest file 'pyjoulescope_driver.egg-info/SOURCES.txt'
      copying pyjoulescope_driver/binding.c -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver
      copying pyjoulescope_driver/img_alpha.img -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver
      copying pyjoulescope_driver/img_beta.img -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver
      copying pyjoulescope_driver/img_stable.img -> build/lib.linux-armv7l-cpython-311/pyjoulescope_driver
      running build_ext
      building 'pyjoulescope_driver.binding' extension
      creating build/temp.linux-armv7l-cpython-311
      creating build/temp.linux-armv7l-cpython-311/pyjoulescope_driver
      creating build/temp.linux-armv7l-cpython-311/src
      creating build/temp.linux-armv7l-cpython-311/src/backend
      creating build/temp.linux-armv7l-cpython-311/src/backend/libusb
      creating build/temp.linux-armv7l-cpython-311/third-party
      creating build/temp.linux-armv7l-cpython-311/third-party/libusb
      creating build/temp.linux-armv7l-cpython-311/third-party/libusb/libusb
      creating build/temp.linux-armv7l-cpython-311/third-party/libusb/libusb/os
      creating build/temp.linux-armv7l-cpython-311/third-party/tinyprintf
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include_private -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/tinyprintf -I/tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/libusb -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/include/linux -I/home/pi/venv/joulescope/include -I/usr/local/include/python3.11 -c pyjoulescope_driver/binding.c -o build/temp.linux-armv7l-cpython-311/pyjoulescope_driver/binding.o
      In file included from /tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,
                       from /tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                       from /tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include/numpy/arrayobject.h:5,
                       from pyjoulescope_driver/binding.c:808:
      /tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
       #warning "Using deprecated NumPy API, disable it with " \
        ^~~~~~~
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include_private -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/tinyprintf -I/tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/libusb -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/include/linux -I/home/pi/venv/joulescope/include -I/usr/local/include/python3.11 -c src/backend/libusb/backend.c -o build/temp.linux-armv7l-cpython-311/src/backend/libusb/backend.o
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include_private -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/tinyprintf -I/tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/libusb -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/include/linux -I/home/pi/venv/joulescope/include -I/usr/local/include/python3.11 -c src/backend/libusb/msg_queue.c -o build/temp.linux-armv7l-cpython-311/src/backend/libusb/msg_queue.o
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include_private -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/tinyprintf -I/tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/libusb -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/include/linux -I/home/pi/venv/joulescope/include -I/usr/local/include/python3.11 -c src/backend/posix.c -o build/temp.linux-armv7l-cpython-311/src/backend/posix.o
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include_private -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/tinyprintf -I/tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/libusb -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/include/linux -I/home/pi/venv/joulescope/include -I/usr/local/include/python3.11 -c src/cstr.c -o build/temp.linux-armv7l-cpython-311/src/cstr.o
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include_private -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/tinyprintf -I/tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/libusb -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/include/linux -I/home/pi/venv/joulescope/include -I/usr/local/include/python3.11 -c src/devices.c -o build/temp.linux-armv7l-cpython-311/src/devices.o
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include_private -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/tinyprintf -I/tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/libusb -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/include/linux -I/home/pi/venv/joulescope/include -I/usr/local/include/python3.11 -c src/downsample.c -o build/temp.linux-armv7l-cpython-311/src/downsample.o
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include_private -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/tinyprintf -I/tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/libusb -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/include/linux -I/home/pi/venv/joulescope/include -I/usr/local/include/python3.11 -c src/error_code.c -o build/temp.linux-armv7l-cpython-311/src/error_code.o
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include_private -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/tinyprintf -I/tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/libusb -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/include/linux -I/home/pi/venv/joulescope/include -I/usr/local/include/python3.11 -c src/js110_cal.c -o build/temp.linux-armv7l-cpython-311/src/js110_cal.o
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include_private -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/tinyprintf -I/tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/libusb -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/include/linux -I/home/pi/venv/joulescope/include -I/usr/local/include/python3.11 -c src/js110_sample_processor.c -o build/temp.linux-armv7l-cpython-311/src/js110_sample_processor.o
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include_private -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/tinyprintf -I/tmp/pip-build-env-rg4zg25c/overlay/lib/python3.11/site-packages/numpy/core/include -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/libusb -I/tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/third-party/libusb/include/linux -I/home/pi/venv/joulescope/include -I/usr/local/include/python3.11 -c src/js110_stats.c -o build/temp.linux-armv7l-cpython-311/src/js110_stats.o
      In file included from /tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include_private/jsdrv_prv/js110_stats.h:25,
                       from src/js110_stats.c:17:
      /tmp/pip-install-lo4mml41/pyjoulescope-driver_e869b68fd1e6499680ce37f5a33a327c/include_private/js220_api.h:315:19: error: ‘__int128’ is not supported on this target
           __extension__ __int128 i128;
                         ^~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyjoulescope-driver
  Building wheel for pymonocypher (pyproject.toml) ... done
  Created wheel for pymonocypher: filename=pymonocypher-3.1.3.1-cp311-cp311-linux_armv7l.whl size=343727 sha256=f21706ab520b668f374056098e355c3a0a7b0ab79ead6e65e785fe826ca60f99
  Stored in directory: /home/pi/.cache/pip/wheels/94/e4/11/ab6d25b7bddc0b3b3b445804b5e14ff6d72ef353f1ba002825
  Building wheel for python-dateutil (pyproject.toml) ... done
  Created wheel for python-dateutil: filename=python_dateutil-2.8.2-py2.py3-none-any.whl size=247680 sha256=a4da299817f6562fe5b7c434fcf565fe37038ed6ccb354d81a81a655527e2cee
  Stored in directory: /home/pi/.cache/pip/wheels/4b/4f/2b/fc5c4bbea86f9e7fa9b1de2e051e90628202b85aeffb74420b
  Building wheel for psutil (pyproject.toml) ... done
  Created wheel for psutil: filename=psutil-5.9.4-cp311-abi3-linux_armv7l.whl size=285411 sha256=8accafa52d3eb5db2246983d34ca7ce4ee78e4381662dd008c2925a57524e4ac
  Stored in directory: /home/pi/.cache/pip/wheels/79/ad/06/6e11b57e4f7c9d053fecf79605b83e69ab2d1b6f75cec6b97b
  Building wheel for requests (pyproject.toml) ... done
  Created wheel for requests: filename=requests-2.28.2-py3-none-any.whl size=62821 sha256=a311c897dbe79901ebbd63dbdebee145868ea466d65854bfdb52f805dc5df8aa
  Stored in directory: /home/pi/.cache/pip/wheels/13/6d/be/fdf97c1d3f3fcc1a0d14d8693f8f2ed190e67898ae34e66641
  Building wheel for idna (pyproject.toml) ... done
  Created wheel for idna: filename=idna-3.4-py3-none-any.whl size=61539 sha256=073ba11c66b198dee32d2d6a472b82000b9fc8824ea5905e5a789b81862c9838
  Stored in directory: /home/pi/.cache/pip/wheels/73/14/5f/87e450624ca0598cd1347aaac250ba069435fdc821c99b0e3b
Successfully built joulescope pymonocypher python-dateutil psutil requests idna
Failed to build pyjoulescope-driver
ERROR: Could not build wheels for pyjoulescope-driver, which is required to install pyproject.toml-based projects

Based upon the error, I do not think that you are running a 64-bit OS. I just created a fresh install for the Raspberry Pi 4 (RP4), which worked. Here are the steps:

Created the SD image using a Windows 11 machine:

  1. Inserted 128 GB SanDisk Extreme PRO SD crd
  2. Downloaded and installed Raspberry Pi imager 1.7.3: Raspberry Pi OS – Raspberry Pi
    a. Choose OS → Raspberry PI OS (other) → Raspberry Pi OS (64-bit) released 2022-09-22
    b. Chose Storage → Selected SD card
    c. Write & wait

With the Raspberry Pi 4:

  1. Connect RP4 to mouse, keyboard, HDMI monitor, ethernet network
  2. Insert SD card into RP4
  3. Power on RP4 and performed first-time setup
    a. Selected “Update software” & waited…
  4. Open terminal
    a. python3 -VV → 3.9.2, which is old but fine
    b. sudo apt update && sudo apt upgrade
    c. sudo apt install -y libudev-dev
    d. wget https://github.com/jetperch/pyjoulescope/raw/main/99-joulescope.rules
    e. sudo mv 99-joulescope.rules /etc/udev/rules.d/
    f. sudo udevadm control --reload-rules
    g. python3 -m venv ~/venv/joulescope
    h. . ~/venv/joulescope/bin/activate
    i. pip3 install joulescope
    Wait - this step takes a long time as the RP4 64-bit must build all wheels.
    j. python3 -m joulescope capture out.jls
    k. CTRL-C to stop capture
    l. ls -al out.jls

Does this work for you?

Yes, that worked perfectly! Thanks.

Just one last question how do I install and run the downsample_logging.py program to this Rpi as I need to record some long term power consumption data for a device we are developing?

Thanks again,
Luke

Hi @LukeM - Great!

I think you need to just download downsample_logging.py to the RP4 and run it. Here is one way to do that with wget:

wget https://raw.githubusercontent.com/jetperch/pyjoulescope_examples/main/bin/downsample_logging.py

Then to run:

. ~/venv/joulescope/bin/activate
python3 downsample_logging.py

Press CTRL-C to end the capture. See the ~/Documents/joulescope/ directory for the output files.

See the downsample_logging.py file for documentation.

For command-line options, use:

python3 downsample_logging.py --help

Hi Matt,
Thanks for that. Everything now works perfectly. Thanks for taking the time to help us with this as I know it was a setup issue on my end and not a joulescope problem. Much appreciated.

BTW the Joulescope is an awesome tool for us. We normally use it in a windows environment as a quality control tool to check that our circuit boards are functioning correctly and now are using it for with dedicated RPis for long duration battery testing of our iot devices.

Kind regards,
Luke

1 Like

Excellent! The RP4 should work great for this.

If you decide to scale to multiple stations, you can also consider running Ubuntu on a small-form-factor PC, such as Intel NUCs. I like these over RP4 since they come with solid mechanicals and higher performance. The RP4, even with purchased enclosures, is not as nice. The RP4 also does not support the UI, while x64 machines do.

I hope everything goes smoothly, but if you run into any issues, please post!