Skip to content

Commit 49d777c

Browse files
authored
Merge pull request #328 from mathoudebine/feature/315-support-for-35-screen-from-kipye
2 parents a681cc9 + 85cad86 commit 49d777c

15 files changed

+272
-71
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ Supported operating systems : macOS, Windows, Linux (incl. Raspberry Pi), basica
2323
| <img src="res/docs/turing.webp"/> | <img src="res/docs/xuanfang.webp"/> | <img src="res/docs/turing5inch.png"/> |
2424
| also improperly called "revision A" by the resellers | revision B & flagship (with backplate & RGB LEDs) | basic support (no video or storage for now) |
2525

26-
|[UsbPCMonitor 3.5" / 5"](https://aliexpress.com/item/1005003931363455.html) |
27-
|-----------------------------------------------------------------------------------------------------|
28-
| <img src="res/docs/UsbPCMonitor_5inch.webp" width="30%" height="30%"/> |
29-
| Unknown manufacturer, visually similar to Turing 3.5" / 5". Original software is `UsbPCMonitor.exe` |
26+
|[UsbPCMonitor 3.5" / 5"](https://aliexpress.com/item/1005003931363455.html) |[Kipye Qiye Smart Display 3.5"](https://www.aliexpress.us/item/3256803899049957.html) |
27+
|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
28+
| <img src="res/docs/UsbPCMonitor_5inch.webp" width="60%" height="60%"/> | <img src="res/docs/kipye-qiye-35.webp" width="60%" height="60%"/> |
29+
| Unknown manufacturer, visually similar to Turing 3.5" / 5". Original software is `UsbPCMonitor.exe` | Front panel has an engraved inscription "奇叶智显" Qiye Zhixian (Qiye Smart Display) |
3030

3131
### [> What is my smart screen model?](https://github.com/mathoudebine/turing-smart-screen-python/wiki/Hardware-revisions)
3232

@@ -42,10 +42,10 @@ If you haven't received your screen yet but want to start developing your theme
4242
| <img src="res/docs/turing8inch.jpg"/> | <img src="res/docs/turing2inch.webp"/> | <img src="res/docs/fuldho_3.5.jpg"/> |
4343
| Very similar protocol than the 5". [Support planned in a future version.](https://github.com/mathoudebine/turing-smart-screen-python/issues/264) | Very similar protocol than the 5". [Support planned in a future version.](https://github.com/mathoudebine/turing-smart-screen-python/issues/264) | Managed with [proprietary Windows software `SmartMonitor.exe`](https://smartdisplay.lanzouo.com/b04jvavkb). Cannot be supported by this project: [see here](https://github.com/mathoudebine/turing-smart-screen-python/discussions/298). Use alternative library https://github.com/braewoods/hidss |
4444

45-
|_[SmartCool Lcd](https://aliexpress.com/item/1005005443609423.html) / [GeekTeches AD35](https://aliexpress.com/item/1005004858688084.html) / AIDA64 / AX206_ |_[Kipye Qiye Smart Display 3.5"](https://www.aliexpress.us/item/3256803899049957.html)_ |
46-
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
47-
| <img src="res/docs/ax206.jpg" width="30%" height="30%" /> <img src="res/docs/geekteches_ad35.jpg" width="30%" height="30%" /> <img src="res/docs/smartcool_lcd.webp" width="30%" height="30%" /> | <img src="res/docs/kipye-35.webp"/> |
48-
| Not supported. Produced by multiple manufacturers, all use the same [Appotech AX206 hacked photo frame firmware](https://github.com/dreamlayers/dpf-ax). Supported by AIDA64 and lcd4linux | Front panel has an engraved inscription "奇叶智显" Qiye Zhixian (Qiye Smart Display). Display should be compatible with this project. [Support planned in a future version.](https://github.com/mathoudebine/turing-smart-screen-python/issues/315) |
45+
|_[SmartCool Lcd](https://aliexpress.com/item/1005005443609423.html) / [GeekTeches AD35](https://aliexpress.com/item/1005004858688084.html) / AIDA64 / AX206_ |
46+
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
47+
| <img src="res/docs/ax206.jpg" width="30%" height="30%" /> <img src="res/docs/geekteches_ad35.jpg" width="30%" height="30%" /> <img src="res/docs/smartcool_lcd.webp" width="30%" height="30%" /> |
48+
| Not supported. Produced by multiple manufacturers, all use the same [Appotech AX206 hacked photo frame firmware](https://github.com/dreamlayers/dpf-ax). Supported by AIDA64 and lcd4linux |
4949

5050
## How to start
5151

config.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ config:
2727
WLO: "" # Wi-Fi Card
2828

2929
display:
30-
# Display revision: A for Turing 3.5" and UsbPCMonitor 3.5"/5", B for Xuanfang 3.5" (inc. flagship), C for Turing 5"
31-
# Use SIMU for 3.5" simulated LCD (image written in screencap.png) or SIMU5 for 5" simulated LCD
32-
# To identify your revision: https://github.com/mathoudebine/turing-smart-screen-python/wiki/Hardware-revisions
30+
# Display revision:
31+
# - A for Turing 3.5" and UsbPCMonitor 3.5"/5"
32+
# - B for Xuanfang 3.5" (inc. flagship)
33+
# - C for Turing 5"
34+
# - D for Kipye Qiye Smart Display 3.5"
35+
# - SIMU for 3.5" simulated LCD (image written in screencap.png)
36+
# - SIMU5 for 5" simulated LCD
37+
# To identify your smart screen: https://github.com/mathoudebine/turing-smart-screen-python/wiki/Hardware-revisions
3338
REVISION: A
3439

3540
# Display Brightness

configure.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
TURING_MODEL = "Turing Smart Screen"
6161
USBPCMONITOR_MODEL = "UsbPCMonitor"
6262
XUANFANG_MODEL = "XuanFang rev. B & flagship"
63+
KIPYE_MODEL = "Kipye Qiye Smart Display"
6364
SIMULATED_MODEL = "Simulated screen"
6465

6566
SIZE_3_5_INCH = "3.5\""
@@ -70,22 +71,22 @@
7071
size_list = (SIZE_3_5_INCH, SIZE_5_INCH)
7172

7273
# Maps between config.yaml values and GUI description
73-
# revision_to_model_map = {'A': TURING_MODEL, 'B': XUANFANG_MODEL, 'C': TURING_MODEL, 'SIMU': SIMULATED_MODEL,
74-
# 'SIMU5': SIMULATED_MODEL}
7574
revision_and_size_to_model_map = {
7675
('A', SIZE_3_5_INCH): TURING_MODEL, # Can also be UsbPCMonitor 3.5, does not matter since protocol is the same
7776
('A', SIZE_5_INCH): USBPCMONITOR_MODEL,
7877
('B', SIZE_3_5_INCH): XUANFANG_MODEL,
7978
('C', SIZE_5_INCH): TURING_MODEL,
79+
('D', SIZE_3_5_INCH): KIPYE_MODEL,
8080
('SIMU', SIZE_3_5_INCH): SIMULATED_MODEL,
8181
('SIMU5', SIZE_5_INCH): SIMULATED_MODEL,
8282
}
8383
model_and_size_to_revision_map = {
8484
(TURING_MODEL, SIZE_3_5_INCH): 'A',
85-
(TURING_MODEL, SIZE_5_INCH): 'C',
8685
(USBPCMONITOR_MODEL, SIZE_3_5_INCH): 'A',
8786
(USBPCMONITOR_MODEL, SIZE_5_INCH): 'A',
8887
(XUANFANG_MODEL, SIZE_3_5_INCH): 'B',
88+
(TURING_MODEL, SIZE_5_INCH): 'C',
89+
(KIPYE_MODEL, SIZE_3_5_INCH): 'D',
8990
(SIMULATED_MODEL, SIZE_3_5_INCH): 'SIMU',
9091
(SIMULATED_MODEL, SIZE_5_INCH): 'SIMU5',
9192
}

library/display.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from library.lcd.lcd_comm_rev_a import LcdCommRevA
2424
from library.lcd.lcd_comm_rev_b import LcdCommRevB
2525
from library.lcd.lcd_comm_rev_c import LcdCommRevC
26+
from library.lcd.lcd_comm_rev_d import LcdCommRevD
2627
from library.lcd.lcd_simulated import LcdSimulated
2728
from library.log import logger
2829

@@ -45,14 +46,6 @@ def _get_theme_orientation() -> Orientation:
4546
return Orientation.REVERSE_LANDSCAPE
4647
else:
4748
return Orientation.LANDSCAPE
48-
elif config.THEME_DATA["display"]["DISPLAY_ORIENTATION"] == 'reverse_portrait':
49-
logger.warn("'reverse_portrait' is deprecated as DISPLAY_ORIENTATION value in the theme."
50-
"Use 'portrait' instead, and use DISPLAY_REVERSE in config.yaml to reverse orientation.")
51-
return Orientation.REVERSE_PORTRAIT
52-
elif config.THEME_DATA["display"]["DISPLAY_ORIENTATION"] == 'reverse_landscape':
53-
logger.warn("'reverse_landscape' is deprecated as DISPLAY_ORIENTATION value in the theme."
54-
"Use 'landscape' instead, and use DISPLAY_REVERSE in config.yaml to reverse orientation.")
55-
return Orientation.REVERSE_LANDSCAPE
5649
else:
5750
logger.warning("Orientation '", config.THEME_DATA["display"]["DISPLAY_ORIENTATION"],
5851
"' unknown, using portrait")
@@ -71,6 +64,9 @@ def __init__(self):
7164
elif config.CONFIG_DATA["display"]["REVISION"] == "C":
7265
self.lcd = LcdCommRevC(com_port=config.CONFIG_DATA['config']['COM_PORT'],
7366
update_queue=config.update_queue)
67+
elif config.CONFIG_DATA["display"]["REVISION"] == "D":
68+
self.lcd = LcdCommRevD(com_port=config.CONFIG_DATA['config']['COM_PORT'],
69+
update_queue=config.update_queue)
7470
elif config.CONFIG_DATA["display"]["REVISION"] == "SIMU":
7571
self.lcd = LcdSimulated(display_width=320,
7672
display_height=480)

library/lcd/lcd_comm_rev_a.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ def SetBrightness(self, level: int = 25):
151151
self.SendCommand(Command.SET_BRIGHTNESS, level_absolute, 0, 0, 0)
152152

153153
def SetOrientation(self, orientation: Orientation = Orientation.PORTRAIT):
154-
self.orientation = orientation
155154
width = self.get_width()
156155
height = self.get_height()
157156
x = 0

library/lcd/lcd_comm_rev_b.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ def InitializeComm(self):
141141
self._hello()
142142

143143
def Reset(self):
144-
# HW revision B does not implement a command to reset it
145-
pass
144+
# HW revision B does not implement a command to reset it: clear display instead
145+
self.Clear()
146146

147147
def Clear(self):
148-
# This hardware does not implement a Clear command: display a blank image on the whole screen
148+
# HW revision B does not implement a Clear command: display a blank image on the whole screen
149149
# Force an orientation in case the screen is currently configured with one different from the theme
150150
backup_orientation = self.orientation
151151
self.SetOrientation(orientation=Orientation.PORTRAIT)
@@ -186,7 +186,7 @@ def SetBackplateLedColor(self, led_color: Tuple[int, int, int] = (255, 255, 255)
186186
else:
187187
logger.info("Only HW revision 'flagship' supports backplate LED color setting")
188188

189-
def SetOrientation(self, orientation: Orientation = Orientation.PORTRAIT, new_width: int = 320, new_height: int = 480):
189+
def SetOrientation(self, orientation: Orientation = Orientation.PORTRAIT):
190190
# In revision B, basic orientations (portrait / landscape) are managed by the display
191191
# The reverse orientations (reverse portrait / reverse landscape) are software-managed
192192
self.orientation = orientation
@@ -223,6 +223,7 @@ def DisplayPILImage(
223223
(x0, y0) = (x, y)
224224
(x1, y1) = (x + image_width - 1, y + image_height - 1)
225225
else:
226+
# Reverse landscape/portrait orientations are software-managed: get new coordinates
226227
(x0, y0) = (self.get_width() - x - image_width, self.get_height() - y - image_height)
227228
(x1, y1) = (self.get_width() - x - 1, self.get_height() - y - 1)
228229

library/lcd/lcd_comm_rev_c.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def _send_command(self, cmd: Command, payload: bytearray = None, padding: Paddin
168168
message = bytearray()
169169

170170
if cmd != Command.SEND_PAYLOAD:
171-
message = cmd.value
171+
message = bytearray(cmd.value)
172172

173173
# logger.debug("Command: {}".format(cmd.name))
174174

@@ -213,6 +213,7 @@ def InitializeComm(self):
213213

214214
def Reset(self):
215215
logger.info("Display reset (COM port may change)...")
216+
# Reset command bypasses queue because it is run when queue threads are not yet started
216217
self._send_command(Command.RESTART, bypass_queue=True)
217218
self.closeSerial()
218219
# Wait for display reset then reconnect

0 commit comments

Comments
 (0)