PiSupply / PaPiRus

Resources for PaPiRus ePaper eInk displays
https://www.pi-supply.com/product/papirus-epaper-eink-screen-hat-for-raspberry-pi/
Other
346 stars 88 forks source link

Lm75b support and script updates #103

Closed tvoverbeek closed 7 years ago

tvoverbeek commented 7 years ago

-Updated papirus-config using whiptail dialogs throughout. -Update papirus-setup to force user to specify screen size before starting the epd-fuse service. -Added LM75B support in epd.py, so the display updates use the actual temperature. -Added python read access to /dev/epd/error in epd.py

shawaj commented 7 years ago

The only thing I'm worried about is that the temperature sensor is not actually really reading the ambient temperature in the locality of the display. It's underneath the board and therefore reading really high (as the CPU is warming it up).

I'm not entirely sure how to handle this, without a hardware update?

What do you think @tvoverbeek @francesco-vannini ?

shawaj commented 7 years ago

papirus-buttons has an indent on the part:

+    if EPD_SIZE == 0.0:
+        print("Please select your screen size by running 'papirus-config'.")
+        sys.exit()

But the other scripts do not.

Is that intentional?

tvoverbeek commented 7 years ago

No, the indent should not be there. Fixed.

tvoverbeek commented 7 years ago

Regarding the temperature. Agreed the LM75B does not measure the screen temperature. I would guess it is a few degrees higher than the actual screen temperature. However, the code uses some wide temperature bands. See below extracted from V231_G2/epd.c in the repaper/gratis repository:

// convert a temperature in Celsius to // the scale factor for frame_*_repeat methods static int temperature_to_factor_10x(int temperature) { if (temperature <= -10) { return 170; } else if (temperature <= -5) { return 120; } else if (temperature <= 5) { return 80; } else if (temperature <= 10) { return 40; } else if (temperature <= 15) { return 30; } else if (temperature <= 20) { return 20; } else if (temperature <= 40) { return 10; } return 7; }

For normal use (temp between 20 and 40) the routine returns 10, above 40 it returns 7. I believe the temperature discrepancy between the LM75B and screen temperature should not cause much of a problem, but we get a better behavior for e.g. use outside in the cold.

shawaj commented 7 years ago

Looks good. Will test and merge next week but agreed on the temperature.

Will aim to put a smaller chip temp sensor ​on top of a future hardware revision so it's more accurate