pi-top / pi-top-Python-SDK

pi-top's Python SDK (pitop package)
Apache License 2.0
28 stars 4 forks source link

No IMU in PMA? #604

Closed miquelmassot closed 1 year ago

miquelmassot commented 1 year ago

Summary

I've got a Pi-Top [4] with the expansion plate and robotic kit. If I run

from pitop.pma.imu import IMU
imu = IMU()

I get:

Exception: This Expansion Plate doesn't have an IMU

Is this supposed to happen? According to the dealer and the documentation, it does have an IMU. Reference

This is the output of pi-top devices

pi@pi-top:~ $ pi-top devices
HUB ======================================================================================================================================================================================
pi-top [4] (v5.4)
PERIPHERALS ==============================================================================================================================================================================
[   ] pi-top [4] Foundation Plate 
[ ✓ ] pi-top [4] Expansion Plate (v22.1)
[   ] pi-top Touchscreen 
[   ] pi-top Keyboard 
[   ] pi-topPULSE 
[   ] pi-topSPEAKER (v1) - Left channel 
[   ] pi-topSPEAKER (v1) - Mono 
[   ] pi-topSPEAKER (v1) - Right channel 
[   ] pi-topSPEAKER (v2) 
[   ] pi-topPROTO+ 

Environment Information

pi@pi-top:~ $ uname -a
Linux pi-top 5.15.84-v7l+ #1613 SMP Thu Jan 5 12:01:26 GMT 2023 armv7l GNU/Linux
pi@pi-top:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:    11
Codename:   bullseye
pi@pi-top:~ $ python --version
Python 3.9.2
pi@pi-top:~ $ dpkg --list | grep pitop
ii  python3-pitop                        0.30.0-1                             all          pi-top Python 3 Library - Main
ii  python3-pitop-battery                0.30.0-1                             all          pi-top Python 3 Library - Battery
ii  python3-pitop-camera                 0.30.0-1                             all          pi-top Python 3 Library - Camera
ii  python3-pitop-cli                    0.30.0-1                             all          pi-top Python 3 Library - CLI
ii  python3-pitop-common                 0.30.0-1                             all          pi-top Python 3 Library - Common
ii  python3-pitop-core                   0.30.0-1                             all          pi-top Python 3 Library - Core
ii  python3-pitop-display                0.30.0-1                             all          pi-top Python 3 Library - Display
ii  python3-pitop-doc                    0.30.0-1                             all          pi-top Python 3 Library - Documentation and Examples
ii  python3-pitop-full                   0.30.0-1                             all          pi-top Python 3 Library - Complete
ii  python3-pitop-keyboard               0.30.0-1                             all          pi-top Python 3 Library - Keyboard
ii  python3-pitop-miniscreen             0.30.0-1                             all          pi-top Python 3 Library - Main
ii  python3-pitop-pma                    0.30.0-1                             all          pi-top Python 3 Library - PMA
ii  python3-pitop-processing             0.30.0-1                             all          pi-top Python 3 Library - Processing
ii  python3-pitop-robotics               0.30.0-1                             all          pi-top Python 3 Library - Robotics
ii  python3-pitop-simulation             0.30.0-1                             all          pi-top Python 3 Library - System
ii  python3-pitop-system                 0.30.0-1                             all          pi-top Python 3 Library - System
$ journalctl --unit=pt-firmware-updater --boot=0 --no-pager
-- Journal begins at Wed 2022-12-21 19:43:47 GMT, ends at Thu 2023-02-16 12:40:18 GMT. --
Feb 16 12:19:14 pi-top systemd[1]: Started pi-top device firmware updater daemon.
Feb 16 12:19:20 pi-top pt-firmware-checker[1208]: warning: pt4_hub - Firmware file '/usr/lib/python3/dist-packages/pt_fw_updater/bin/pt4_hub/pt4_hub-v5.3-sch8-release.bin' schematic version '8' does not match current device '9'. Skipping...
Feb 16 12:19:20 pi-top pt-firmware-checker[1208]: warning: pt4_hub - Firmware file '/usr/lib/python3/dist-packages/pt_fw_updater/bin/pt4_hub/pt4_hub-v5.4-sch8-release.bin' schematic version '8' does not match current device '9'. Skipping...
Feb 16 12:19:20 pi-top pt-firmware-checker[1208]: Latest firmware available is version 5.4
Feb 16 12:19:20 pi-top pt-firmware-checker[1208]: Running command: /usr/bin/pt-firmware-updater --path /usr/lib/python3/dist-packages/pt_fw_updater/bin/pt4_hub/pt4_hub-v5.4-sch9-release.bin --notify-user pt4_hub
Feb 16 12:19:25 pi-top /usr/bin/pt-firmware-updater[1527]: /usr/lib/python3/dist-packages/pt_fw_updater/bin/pt4_hub/pt4_hub-v5.4-sch9-release.bin is not a valid candidate firmware file
Feb 16 12:19:25 pi-top pt-firmware-checker[1208]: error: Command '['/usr/bin/pt-firmware-updater', '--path', '/usr/lib/python3/dist-packages/pt_fw_updater/bin/pt4_hub/pt4_hub-v5.4-sch9-release.bin', '--notify-user', 'pt4_hub']' returned non-zero exit status 1.
Feb 16 12:19:25 pi-top pt-firmware-checker[1208]: warning: pt4_hub error: Command '['/usr/bin/pt-firmware-updater', '--path', '/usr/lib/python3/dist-packages/pt_fw_updater/bin/pt4_hub/pt4_hub-v5.4-sch9-release.bin', '--notify-user', 'pt4_hub']' returned non-zero exit status 1.
Feb 16 12:19:25 pi-top pt-firmware-checker[1208]: warning: pt4_expansion_plate - Firmware file '/usr/lib/python3/dist-packages/pt_fw_updater/bin/pt4_expansion_plate/pt4_expansion_plate-v21.4-sch2-release.bin' schematic version '2' does not match current device '4'. Skipping...
Feb 16 12:19:25 pi-top pt-firmware-checker[1208]: warning: pt4_expansion_plate - Firmware file '/usr/lib/python3/dist-packages/pt_fw_updater/bin/pt4_expansion_plate/pt4_expansion_plate-v22.0-sch3-release.bin' schematic version '3' does not match current device '4'. Skipping...
Feb 16 12:19:25 pi-top pt-firmware-checker[1208]: warning: pt4_expansion_plate - Firmware file '/usr/lib/python3/dist-packages/pt_fw_updater/bin/pt4_expansion_plate/pt4_expansion_plate-v22.0-sch2-release.bin' schematic version '2' does not match current device '4'. Skipping...
miquelmassot commented 1 year ago

This is what I hit:

https://github.com/pi-top/pi-top-Python-SDK/blob/13cf6d63e00a92024fc4306e62bedd356693332b/packages/pma/pitop/pma/imu_controller.py#L30

jcapona commented 1 year ago

Hi @miquelmassot; the older Expansion Plates had an IMU in it but the latest version (v4) doesn't. It seems that your unit is one of the latest; you can learn the hardware version of your Expansion Plate by running this code in a python interpreter:

from pitop.common.firmware_device import FirmwareDevice, FirmwareDeviceID
# make sure the Expansion Plate is attached to the pi-top
device = FirmwareDevice(FirmwareDeviceID.pt4_expansion_plate)
device.get_sch_hardware_version_major()
miquelmassot commented 1 year ago

Thanks for the clarification @jcapona.

This information does not show up in any manual, specsheet or datasheet. I bought the product believing its got the features stated in the product page.

I don't think the retailer will let me return the kits that are already opened. This issue is costing me time and effort in getting these kits up and running for teaching at the university.

Can I replace my v4 expansion boards with the older ones?

miquelmassot commented 1 year ago
Screenshot-from-2023-02-17-16-41-31
jcapona commented 1 year ago

@miquelmassot I've raised this issue with our customer support and they should have reached out to you by email to resolve it

miquelmassot commented 1 year ago

Thanks @jcapona, I'm in touch with support at the moment.