programming-the-iot / book-exercise-tasks

This repo is for issues / tasks ONLY. All programming and related exercises for each chapter of 'Programming the Internet of Things' are listed here.
Other
11 stars 12 forks source link

PIOT-CFG-04-001: Install and configure the Sense-Emu Sense HAT emulator for your platform #50

Open labbenchstudios opened 4 years ago

labbenchstudios commented 4 years ago

Description

Review the README

Estimated effort may vary greatly

Actions

Windows Notes

macOS Notes

Pisense v0.2 Notes

======================================================================
ERROR: testCheckEmulator (SenseHatEmulatorQuickTest.SenseHatEmulatorQuickTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/d/piot/piot-cda-solutions/src/test/python/programmingtheiot/part02/integration/emulated/SenseHatEmulatorQuickTest.py", line 53, in testCheckEmulator
    self.sh.screen.scroll_text(self.HELLO_WORLD_A)
  File "/mnt/d/piot/piot-wsl-venv/lib/python3.10/site-packages/pisense/screen.py", line 469, in scroll_text
    frames = [image_to_rgb565(frame) for frame in frames]
  File "/mnt/d/piot/piot-wsl-venv/lib/python3.10/site-packages/pisense/screen.py", line 469, in <listcomp>
    frames = [image_to_rgb565(frame) for frame in frames]
  File "/mnt/d/piot/piot-wsl-venv/lib/python3.10/site-packages/pisense/anim.py", line 219, in scroll_text
    img = draw_text(text, font, size, foreground, background,
  File "/mnt/d/piot/piot-wsl-venv/lib/python3.10/site-packages/pisense/anim.py", line 168, in draw_text
    width, height = draw.textlength(text, f, spacing=1)
TypeError: ImageDraw.textlength() got an unexpected keyword argument 'spacing'

Estimate

Tests

NOTE: Depending on how you install the emulator on your platform (along with GTK), you may need to run the EDA integration tests from the command line vs from within your IDE.

OK

Pradyumna369 commented 9 months ago

I installed gtk4 and got an error "Namespace Gdk not available for version 3.0" when testing sense_emu_gui. I believe gtk 3.0 version is to be present. Then I uninstalled gtk4 and installed gtk+3 and the sense emulator GUI got launched when running the test

labbenchstudios commented 9 months ago

Good catch. Just updated: changed 'gtk4' to 'gtk+3'.