venari / timelapse

A set of tools/scripts to automate the taking and creation of timelapse videos and videos with a Raspberry Pi
MIT License
1 stars 0 forks source link

PiJuice not woorking in Bookworm? #78

Open leighghunt opened 8 months ago

leighghunt commented 8 months ago

Scripts not working in bookworm branch, and pijuice_cli fails with following error when going to Status page:

130 pi@sediment-pi-zero-2w-a:~$ pijuice_cli
Traceback (most recent call last):
  File "/usr/bin/pijuice_cli.py", line 2087, in <module>
    loop.run()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 287, in run
    self._run()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 385, in _run
    self.event_loop.run()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 790, in run
    self._loop()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 827, in _loop
    self._watch_files[fd]()
  File "/usr/lib/python3/dist-packages/urwid/raw_display.py", line 416, in <lambda>
    wrapper = lambda: self.parse_input(
                      ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/raw_display.py", line 515, in parse_input
    callback(processed, processed_codes)
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 412, in _update
    self.process_input(keys)
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 513, in process_input
    k = self._topmost_widget.keypress(self.screen_size, k)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/container.py", line 598, in keypress
    return self.top_w.keypress(self.top_w_size(size,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/container.py", line 1626, in keypress
    key = self.focus.keypress(tsize, key)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/container.py", line 2316, in keypress
    key = w.keypress((mc,) + size[1:], key)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/decoration.py", line 622, in keypress
    return self._original_widget.keypress(maxvals, key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/listbox.py", line 968, in keypress
    key = focus_widget.keypress((maxcol,),key)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/decoration.py", line 622, in keypress
    return self._original_widget.keypress(maxvals, key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/wimp.py", line 543, in keypress
    self._emit('click')
  File "/usr/lib/python3/dist-packages/urwid/widget.py", line 461, in _emit
    signals.emit_signal(self, name, self, *args)
  File "/usr/lib/python3/dist-packages/urwid/signals.py", line 265, in emit
    result |= self._call_callback(callback, user_arg, user_args, args)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/signals.py", line 295, in _call_callback
    return bool(callback(*args_to_pass))
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/pijuice_cli.py", line 1994, in item_chosen
    callback()
  File "/usr/bin/pijuice_cli.py", line 209, in __init__
    self.main()
  File "/usr/bin/pijuice_cli.py", line 269, in main
    status_args = self.get_status()
                  ^^^^^^^^^^^^^^^^^
  File "/usr/bin/pijuice_cli.py", line 215, in get_status
    status = pijuice.status.GetStatus().get('data', {})
             ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'status'
1 pi@sediment-pi-zero-2w-a:~$ 

PiJuice is indicating charging via LED. OS was recently reflashed to Bookworm.

leighghunt commented 8 months ago

Could be a 32/64 bit issue?

Comparing the 2 x 2W Pis:

pi@sediment-pi-zero-2w-b:~$ dpkg --print-architecture armhf

pi@sediment-pi-zero-2w-b:~$ uname -a Linux sediment-pi-zero-2w-b 6.1.21-v7+ #1642 SMP Mon Apr 3 17:20:52 BST 2023 armv7l GNU/Linux


- sediment-pi-zero-2w-a - bookeworm 64 bit, *NOT* working

pi@sediment-pi-zero-2w-a:~$ ls -la /usr/bin/pijuice* lrwxrwxrwx 1 root root 22 Feb 14 17:12 /usr/bin/pijuiceboot -> /usr/bin/pijuiceboot64 -rwxr-xr-x 1 root root 22732 Jan 30 2022 /usr/bin/pijuiceboot32 -rwxr-xr-x 1 root root 23904 Jan 31 2022 /usr/bin/pijuiceboot64 lrwxrwxrwx 1 root root 22 Feb 14 17:12 /usr/bin/pijuice_cli -> /usr/bin/pijuice_cli64 -rwsr-xr-x 1 pijuice pijuice 9096 Dec 18 2018 /usr/bin/pijuice_cli32 -rwsr-xr-x 1 pijuice pijuice 14872 Jan 31 2022 /usr/bin/pijuice_cli64 -rw-r--r-- 1 pijuice pijuice 101552 May 17 2021 /usr/bin/pijuice_cli.py -rwxr-xr-x 1 root root 11275 Jan 31 2022 /usr/bin/pijuice_log.py -rwxr-xr-x 1 root root 15664 Jan 31 2022 /usr/bin/pijuice_sys.py

pi@sediment-pi-zero-2w-a:~$ dpkg --print-architecture arm64

pi@sediment-pi-zero-2w-a:~$ uname -a Linux sediment-pi-zero-2w-a 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux

leighghunt commented 8 months ago

Looks like i2c wasn't enabled.

Enabled in raspi-config and everything OK again.

pi@sediment-pi-zero-2w-a:~$ ls -la /dev/i2c*
crw-rw---- 1 root i2c 89, 2 Feb 15 12:17 /dev/i2c-2

pi@sediment-pi-zero-2w-a:~$ i2cdetect -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory
Screenshot 2024-02-15 at 1 07 13 PM
pi@sediment-pi-zero-2w-a:~$ ls -la /dev/i2c*
crw-rw---- 1 root i2c 89, 1 Feb 15 13:07 /dev/i2c-1
crw-rw---- 1 root i2c 89, 2 Feb 15 12:17 /dev/i2c-2

pi@sediment-pi-zero-2w-a:~$ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- 14 -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
Screenshot 2024-02-15 at 1 07 46 PM
leighghunt commented 8 months ago

Another error in startup.sh.out...

AttributeError: 'Picamera2' object has no attribute '_preview'

Looks like this is caused by the lack of camera on this Pi.