diff --git a/install.sh b/install.sh index c10aefe..2a6a7e6 100755 --- a/install.sh +++ b/install.sh @@ -25,6 +25,9 @@ if [ "$?" != "0" ]; then exit fi +echo "Running updates, this might take a few minutes..." +pikvm-update + # Fix banner echo "" echo "Updating the banner..." diff --git a/lib/waveshare_epd/100x100.bmp b/lib/100x100.bmp similarity index 100% rename from lib/waveshare_epd/100x100.bmp rename to lib/100x100.bmp diff --git a/lib/waveshare_epd/2in13.bmp b/lib/2in13.bmp similarity index 100% rename from lib/waveshare_epd/2in13.bmp rename to lib/2in13.bmp diff --git a/lib/waveshare_epd/Font.ttc b/lib/Font.ttc similarity index 100% rename from lib/waveshare_epd/Font.ttc rename to lib/Font.ttc diff --git a/lib/waveshare_epd/__init__.py b/lib/waveshare_epd/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lib/waveshare_epd/__pycache__/__init__.cpython-312.pyc b/lib/waveshare_epd/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..281beff Binary files /dev/null and b/lib/waveshare_epd/__pycache__/__init__.cpython-312.pyc differ diff --git a/lib/waveshare_epd/__pycache__/epd2in13_V4.cpython-312.pyc b/lib/waveshare_epd/__pycache__/epd2in13_V4.cpython-312.pyc new file mode 100644 index 0000000..36a8fe9 Binary files /dev/null and b/lib/waveshare_epd/__pycache__/epd2in13_V4.cpython-312.pyc differ diff --git a/lib/waveshare_epd/__pycache__/epdconfig.cpython-312.pyc b/lib/waveshare_epd/__pycache__/epdconfig.cpython-312.pyc new file mode 100644 index 0000000..33b18ec Binary files /dev/null and b/lib/waveshare_epd/__pycache__/epdconfig.cpython-312.pyc differ diff --git a/lib/waveshare_epd/epd2in13_V4.py b/lib/waveshare_epd/epd2in13_V4.py index 84d6646..a28f640 100644 --- a/lib/waveshare_epd/epd2in13_V4.py +++ b/lib/waveshare_epd/epd2in13_V4.py @@ -45,6 +45,7 @@ class EPD: self.cs_pin = epdconfig.CS_PIN self.width = EPD_WIDTH self.height = EPD_HEIGHT + print('init complete') ''' function :Hardware reset diff --git a/bin/display.py b/src/display.py similarity index 90% rename from bin/display.py rename to src/display.py index 2ca78ae..e56c8e0 100755 --- a/bin/display.py +++ b/src/display.py @@ -1,9 +1,10 @@ #!/usr/bin/python + # -*- coding:utf-8 -*- import sys import os -picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic') libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib') + if os.path.exists(libdir): sys.path.append(libdir) @@ -21,12 +22,14 @@ try: epd = epd2in13_V4.EPD() logging.info("init and Clear") epd.init() + epd.Clear(0xFF) # Drawing on the image - font15 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 15) - font24 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 24) - + print(os.path.join(libdir, 'Font.ttc')) + font15 = ImageFont.truetype(os.path.join(libdir, 'Font.ttc'), 15) + font24 = ImageFont.truetype(os.path.join(libdir, 'Font.ttc'), 24) + print('fonts done') if 1: logging.info("E-paper refresh") epd.init() @@ -51,7 +54,7 @@ try: # read bmp file logging.info("2.read bmp file...") - image = Image.open(os.path.join(picdir, '2in13.bmp')) + image = Image.open(os.path.join(libdir, '2in13.bmp')) epd.display(epd.getbuffer(image)) time.sleep(2) @@ -59,7 +62,7 @@ try: logging.info("3.read bmp file on window...") # epd.Clear(0xFF) image1 = Image.new('1', (epd.height, epd.width), 255) # 255: clear the frame - bmp = Image.open(os.path.join(picdir, '100x100.bmp')) + bmp = Image.open(os.path.join(libdir, '100x100.bmp')) image1.paste(bmp, (2,2)) epd.display(epd.getbuffer(image1)) time.sleep(2) @@ -89,7 +92,7 @@ try: # read bmp file logging.info("2.read bmp file...") - image = Image.open(os.path.join(picdir, '2in13.bmp')) + image = Image.open(os.path.join(libdir, '2in13.bmp')) epd.display_fast(epd.getbuffer(image)) time.sleep(2) @@ -97,7 +100,7 @@ try: logging.info("3.read bmp file on window...") # epd.Clear(0xFF) image1 = Image.new('1', (epd.height, epd.width), 255) # 255: clear the frame - bmp = Image.open(os.path.join(picdir, '100x100.bmp')) + bmp = Image.open(os.path.join(libdir, '100x100.bmp')) image1.paste(bmp, (2,2)) epd.display_fast(epd.getbuffer(image1)) time.sleep(2) @@ -130,4 +133,4 @@ except IOError as e: except KeyboardInterrupt: logging.info("ctrl + c:") epd2in13_V4.epdconfig.module_exit(cleanup=True) - exit() \ No newline at end of file + exit()