Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
Jeroen Oudshoorn
2023-11-29 16:00:06 +01:00
parent 45273f6883
commit ee9aaac711
8 changed files with 11 additions and 14 deletions

View File

@ -1 +1 @@
__version__ = '2.5.5' __version__ = '2.5.6'

View File

@ -9,7 +9,7 @@ from time import sleep
import pwnagotchi import pwnagotchi
requests.adapters.DEFAULT_RETRIES = 5 # increase retries number requests.adapters.DEFAULT_RETRIES = 5 # increase retries number
ping_timeout = 180 ping_timeout = 180
ping_interval = 15 ping_interval = 15

View File

@ -130,7 +130,7 @@ def install(display, update):
logging.info("[update] stopping %s ..." % update['service']) logging.info("[update] stopping %s ..." % update['service'])
os.system("service %s stop" % update['service']) os.system("service %s stop" % update['service'])
os.system("mv %s %s" % (source_path, dest_path)) shutil.move(source_path, dest_path)
os.chmod("/usr/local/bin/%s" % name, 0o755) os.chmod("/usr/local/bin/%s" % name, 0o755)
logging.info("[update] restarting %s ..." % update['service']) logging.info("[update] restarting %s ..." % update['service'])
os.system("service %s start" % update['service']) os.system("service %s start" % update['service'])

View File

@ -56,7 +56,7 @@ def display_for(config):
return Waveshare27inch(config) return Waveshare27inch(config)
elif config['ui']['display']['type'] == 'waveshare27inchv2': elif config['ui']['display']['type'] == 'waveshare27inchv2':
return Waveshare27inchv2(config) return Waveshare27inchV2(config)
elif config['ui']['display']['type'] == 'waveshare29inch': elif config['ui']['display']['type'] == 'waveshare29inch':
return Waveshare29inch(config) return Waveshare29inch(config)

View File

@ -32,11 +32,12 @@ import logging
from . import epdconfig from . import epdconfig
# Display resolution # Display resolution
EPD_WIDTH = 122 EPD_WIDTH = 122
EPD_HEIGHT = 250 EPD_HEIGHT = 250
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class EPD: class EPD:
def __init__(self): def __init__(self):
self.reset_pin = epdconfig.RST_PIN self.reset_pin = epdconfig.RST_PIN

View File

@ -4,6 +4,7 @@ import pwnagotchi.ui.fonts as fonts
from pwnagotchi.ui.hw.base import DisplayImpl from pwnagotchi.ui.hw.base import DisplayImpl
from PIL import Image from PIL import Image
class Waveshare213bV4(DisplayImpl): class Waveshare213bV4(DisplayImpl):
def __init__(self, config): def __init__(self, config):
super(Waveshare213bV4, self).__init__(config, 'waveshare213inb_v4') super(Waveshare213bV4, self).__init__(config, 'waveshare213inb_v4')

View File

@ -2,7 +2,7 @@ import logging
import pwnagotchi.ui.fonts as fonts import pwnagotchi.ui.fonts as fonts
from pwnagotchi.ui.hw.base import DisplayImpl from pwnagotchi.ui.hw.base import DisplayImpl
from PIL import Image
class WaveshareV4(DisplayImpl): class WaveshareV4(DisplayImpl):
def __init__(self, config): def __init__(self, config):
@ -31,8 +31,6 @@ class WaveshareV4(DisplayImpl):
} }
return self._layout return self._layout
def initialize(self): def initialize(self):
logging.info("initializing waveshare v4 display") logging.info("initializing waveshare v4 display")
from pwnagotchi.ui.hw.libs.waveshare.v4.epd2in13_V4 import EPD from pwnagotchi.ui.hw.libs.waveshare.v4.epd2in13_V4 import EPD
@ -40,11 +38,9 @@ class WaveshareV4(DisplayImpl):
self._display.init() self._display.init()
self._display.Clear(0xFF) self._display.Clear(0xFF)
def render(self, canvas): def render(self, canvas):
buf = self._display.getbuffer(canvas) buf = self._display.getbuffer(canvas)
self._display.displayPartial(buf) self._display.displayPartial(buf)
def clear(self): def clear(self):
self._display.Clear(0xFF) self._display.Clear(0xFF)

View File

@ -89,8 +89,7 @@ def main():
parser = argparse.ArgumentParser(description="This program emulates\ parser = argparse.ArgumentParser(description="This program emulates\
the pwnagotchi display") the pwnagotchi display")
parser.add_argument('--displays', help="Which displays to use.", nargs="+", default=["waveshare_2"]) parser.add_argument('--displays', help="Which displays to use.", nargs="+", default=["waveshare_2"])
parser.add_argument('--lang', help="Language to use", parser.add_argument('--lang', help="Language to use", default="en")
default="en")
parser.add_argument('--output', help="Path to output image (PNG)", default="preview.png") parser.add_argument('--output', help="Path to output image (PNG)", default="preview.png")
parser.add_argument('--show-peer', dest="showpeer", help="This options will show a dummy peer", action="store_true") parser.add_argument('--show-peer', dest="showpeer", help="This options will show a dummy peer", action="store_true")
parser.add_argument('--xmargin', help="Add X-Margin", type=int, default=5) parser.add_argument('--xmargin', help="Add X-Margin", type=int, default=5)