ShaderFallback / KindleOutlookCalendarWeather

standAlone
MIT License
50 stars 4 forks source link

关于其他机型的适配 #1

Closed wzqvip closed 1 year ago

wzqvip commented 1 year ago

我手里有一台KPW4,长款的像素比大概是1.8倍左右,我把程序内的绘图代码加入了(int(xxscale),int(yyscale)),这样就应该可以快速适配其他的设备,通过缩放的方式。 比如KPW4就是用xscale=1.8,yscale=1.8

实际运行的时候程序没有跑起来,log内容如下

Traceback (most recent call last):
  File "/mnt/us/extensions/KindleOutlookCalendarWeather/bin/WeatherStation.py", line 6, in <module>
    import feedparser
ModuleNotFoundError: No module named 'feedparser'

是一个库引起的报错。 log.log

不知道up对于这个方式和这个报错有什么想法

server=1之后,我从localhost没能成功显示内容,但是程序可以正常运行

2023-01-02 21:42:56   Update Init...
2023-01-02 21:42:56   Image Cache List 0 : c:/Users/Administrator/Desktop/KindleOutlookCalendarWeather-main/bin/nowTime2142.png
2023-01-02 21:42:56   Image Cache List 1 : c:/Users/Administrator/Desktop/KindleOutlookCalendarWeather-main/bin/nowTime2143.png
c:\Users\Administrator\Desktop\KindleOutlookCalendarWeather-main\bin\WeatherStation.py:532: DeprecationWarning: ROTATE_270 is deprecated and will be removed in Pillow 10 (2023-07-01). Use Transpose.ROTATE_270 instead.
  Himage = Himage.transpose(Image.ROTATE_270)
2023-01-02 21:42:56   Update Screen...ok

下面是修改后的程序,因为没能运行就先不提merge request了

WeatherStation.7z.zip

从sourcecode修改了屏幕显示的坐标,其他没有测试了。

ShaderFallback commented 1 year ago

1.这个插件报错貌似和运行方式有关系,你可以尝试登上ssh直接运行脚本 2.服务器模式我没测试过本地打开的方式,我当时是运行在NAS上.....

wzqvip commented 1 year ago

1.这个插件报错貌似和运行方式有关系,你可以尝试登上ssh直接运行脚本 2.服务器模式我没测试过本地打开的方式,我当时是运行在NAS上.....

服务器模式的话是用的常规80端口吗,我nas有其他web服务,用本地python/WSL运行后localhost提示是connectionrefused,没有成功。

ShaderFallback commented 1 year ago

你用主干代码应该就能跑起来了(什么都不用改,先跑起来再说), 之前有个读取配置问题,我刚改了

ShaderFallback commented 1 year ago

服务器模式就是用Python 内置的,端口你可以自己改, 590 行 def HtmlServer(): addr = GetHostIp() handler = http.server.SimpleHTTPRequestHandler httpd = socketserver.TCPServer((addr, 80), handler) print(GetTime()+"Html Server Start..." + addr) httpd.serve_forever()

wzqvip commented 1 year ago

你用主干代码应该就能跑起来了(什么都不用改,先跑起来再说), 之前有个读取配置问题,我刚改了

目前是跑release版本没问题,能运行起来了。

排版还有些问题,我稍后修改后或许会提request

[FBInk] Detected a Kindle PaperWhite 4 (0T6 -> 0x366 => Moonshine on Rex)
[FBInk] Enabled Kindle Rex platform quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 300 dpi
[FBInk] Variable fb info: 1072x1448, 8bpp @ rotation: 3 (Counter Clockwise, 270°)
[FBInk] Fixed fb info: ID is "mxc_epdc_fb", length of fb mem: 6782976 bytes & line length: 1088 bytes
[FBInk] Fontsize set to 24x24 (IBM base glyph size: 8x8)
[FBInk] Line length: 44 cols, Page size: 60 rows
[FBInk] Vertical fit isn't perfect, shifting rows down by 4 pixels
[FBInk] Pen colors set to #000000 for the foreground and #FFFFFF for the background
[FBInk] Detected a Kindle PaperWhite 4 (0T6 -> 0x366 => Moonshine on Rex)
[FBInk] Enabled Kindle Rex platform quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 300 dpi
[FBInk] Variable fb info: 1072x1448, 8bpp @ rotation: 3 (Counter Clockwise, 270°)
[FBInk] Fixed fb info: ID is "mxc_epdc_fb", length of fb mem: 6782976 bytes & line length: 1088 bytes
[FBInk] Fontsize set to 24x24 (IBM base glyph size: 8x8)
[FBInk] Line length: 44 cols, Page size: 60 rows
[FBInk] Vertical fit isn't perfect, shifting rows down by 4 pixels
[FBInk] Pen colors set to #000000 for the foreground and #FFFFFF for the background
2023-01-03 13:12:39   Update Init...
2023-01-03 13:12:40   Reset Update...ok
2023-01-03 13:12:40   Update Weather...ok
[FBInk] Detected a Kindle PaperWhite 4 (0T6 -> 0x366 => Moonshine on Rex)
[FBInk] Enabled Kindle Rex platform quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 300 dpi
[FBInk] Variable fb info: 1072x1448, 8bpp @ rotation: 3 (Counter Clockwise, 270°)
[FBInk] Fixed fb info: ID is "mxc_epdc_fb", length of fb mem: 6782976 bytes & line length: 1088 bytes
[FBInk] Fontsize set to 24x24 (IBM base glyph size: 8x8)
[FBInk] Line length: 44 cols, Page size: 60 rows
[FBInk] Vertical fit isn't perfect, shifting rows down by 4 pixels
[FBInk] Pen colors set to #000000 for the foreground and #FFFFFF for the background
Displaying image '/mnt/us/extensions/KindleOutlookCalendarWeather/bin/nowTime.png' @ column 0 + 0px, row 0 + 0px (scaling: 600x0, H align: 1, V align: 1, inverted: N, flattened: N, waveform: AUTO, HW dithering: PASSTHROUGH, SW dithered: N, nightmode: N, skip refresh: N)
2023-01-03 13:12:41   Update Screen...ok
wzqvip commented 1 year ago

服务器模式就是用Python 内置的,端口你可以自己改, 590 行 def HtmlServer(): addr = GetHostIp() handler = http.server.SimpleHTTPRequestHandler httpd = socketserver.TCPServer((addr, 80), handler) print(GetTime()+"Html Server Start..." + addr) httpd.serve_forever()

直接运行python文件就可以还是需要用unix运行start.sh

ShaderFallback commented 1 year ago

如果用服务器模式话,有Python环境就行了(我的NAS 是Windows.... 哈哈)