diff --git a/.gitignore b/.gitignore index f1b17c8..8d6aad0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +*/__pycache__ */readdatafile */writedatafile diff --git a/pythonscript/.gitignore b/pythonscript/.gitignore deleted file mode 100644 index bee8a64..0000000 --- a/pythonscript/.gitignore +++ /dev/null @@ -1 +0,0 @@ -__pycache__ diff --git a/pythonscript/argon-config b/pythonscript/Latest/argon-config similarity index 100% rename from pythonscript/argon-config rename to pythonscript/Latest/argon-config diff --git a/pythonscript/argon-uninstall.sh b/pythonscript/Latest/argon-uninstall.sh similarity index 100% rename from pythonscript/argon-uninstall.sh rename to pythonscript/Latest/argon-uninstall.sh diff --git a/pythonscript/argon-versioninfo.sh b/pythonscript/Latest/argon-versioninfo.sh similarity index 100% rename from pythonscript/argon-versioninfo.sh rename to pythonscript/Latest/argon-versioninfo.sh diff --git a/pythonscript/argon40.png b/pythonscript/Latest/argon40.png similarity index 100% rename from pythonscript/argon40.png rename to pythonscript/Latest/argon40.png diff --git a/pythonscript/argondashboard.py b/pythonscript/Latest/argondashboard.py similarity index 100% rename from pythonscript/argondashboard.py rename to pythonscript/Latest/argondashboard.py diff --git a/pythonscript/argononeup-eepromconfig.py b/pythonscript/Latest/argononeup-eepromconfig.py similarity index 100% rename from pythonscript/argononeup-eepromconfig.py rename to pythonscript/Latest/argononeup-eepromconfig.py diff --git a/pythonscript/argononeup.sh b/pythonscript/Latest/argononeup.sh similarity index 100% rename from pythonscript/argononeup.sh rename to pythonscript/Latest/argononeup.sh diff --git a/pythonscript/argononeupd.py b/pythonscript/Latest/argononeupd.py similarity index 100% rename from pythonscript/argononeupd.py rename to pythonscript/Latest/argononeupd.py diff --git a/pythonscript/argonpowerbutton.py b/pythonscript/Latest/argonpowerbutton.py similarity index 100% rename from pythonscript/argonpowerbutton.py rename to pythonscript/Latest/argonpowerbutton.py diff --git a/pythonscript/argonregister.py b/pythonscript/Latest/argonregister.py similarity index 100% rename from pythonscript/argonregister.py rename to pythonscript/Latest/argonregister.py diff --git a/pythonscript/argonsysinfo.py b/pythonscript/Latest/argonsysinfo.py similarity index 100% rename from pythonscript/argonsysinfo.py rename to pythonscript/Latest/argonsysinfo.py diff --git a/pythonscript/original_beta/argon-config b/pythonscript/original_beta/argon-config new file mode 100755 index 0000000..2577844 --- /dev/null +++ b/pythonscript/original_beta/argon-config @@ -0,0 +1,57 @@ +#!/bin/bash +echo "--------------------------" +echo "Argon Configuration Tool" +/etc/argon/argon-versioninfo.sh simple +echo "--------------------------" +get_number () { + read curnumber + if [ -z "$curnumber" ] + then + echo "-2" + return + elif [[ $curnumber =~ ^[+-]?[0-9]+$ ]] + then + if [ $curnumber -lt 0 ] + then + echo "-1" + return + elif [ $curnumber -gt 100 ] + then + echo "-1" + return + fi + echo $curnumber + return + fi + echo "-1" + return +} + +mainloopflag=1 +while [ $mainloopflag -eq 1 ] +do + echo + echo "Choose Option:" + echo " 1. Get Battery Status" + echo " 2. Dashboard" + echo " 3. Uninstall" + echo "" + echo " 0. Exit" + echo -n "Enter Number (0-3):" + newmode=$( get_number ) + if [ $newmode -eq 0 ] + then + echo "Thank you." + mainloopflag=0 + elif [ $newmode -eq 1 ] + then + sudo /usr/bin/python3 /etc/argon/argononeupd.py GETBATTERY + elif [ $newmode -eq 2 ] + then + sudo /usr/bin/python3 /etc/argon/argondashboard.py + elif [ $newmode -eq 3 ] + then + /etc/argon/argon-uninstall.sh + mainloopflag=0 + fi +done diff --git a/pythonscript/original_beta/argon-uninstall.sh b/pythonscript/original_beta/argon-uninstall.sh new file mode 100755 index 0000000..e296951 --- /dev/null +++ b/pythonscript/original_beta/argon-uninstall.sh @@ -0,0 +1,146 @@ +#!/bin/bash +echo "----------------------" +echo " Argon Uninstall Tool" +echo "----------------------" +echo -n "Press Y to continue:" +read -n 1 confirm +echo +if [ "$confirm" = "y" ] +then + confirm="Y" +fi + +if [ "$confirm" != "Y" ] +then + echo "Cancelled" + exit +fi + +destfoldername=$USERNAME +if [ -z "$destfoldername" ] +then + destfoldername=$USER +fi +if [ "$destfoldername" = "root" ] +then + destfoldername="" +fi +if [ -z "$destfoldername" ] +then + destfoldername="pi" +fi + + +shortcutfile="/home/$destfoldername/Desktop/argonone-config.desktop" +if [ -f "$shortcutfile" ]; then + sudo rm $shortcutfile + if [ -f "/usr/share/pixmaps/ar1config.png" ]; then + sudo rm /usr/share/pixmaps/ar1config.png + fi + if [ -f "/usr/share/pixmaps/argoneon.png" ]; then + sudo rm /usr/share/pixmaps/argoneon.png + fi +fi +shortcutfile="/home/$destfoldername/Desktop/argononeup.desktop" +if [ -f "$shortcutfile" ]; then + sudo rm $shortcutfile +fi + +INSTALLATIONFOLDER=/etc/argon + +argononefanscript=$INSTALLATIONFOLDER/argononed.py + +if [ -f $argononefanscript ]; then + sudo systemctl stop argononed.service + sudo systemctl disable argononed.service + + # Turn off the fan + /usr/bin/python3 $argononefanscript FANOFF + + # Remove files + sudo rm /lib/systemd/system/argononed.service +fi + +argononeupscript=$INSTALLATIONFOLDER/argononeupd.py +if [ -f $argononeupscript ]; then + sudo systemctl stop argononeupd.service + sudo systemctl disable argononeupd.service + + # Remove files + sudo rm /lib/systemd/system/argononeupd.service +fi + +# Remove RTC if any +argoneonrtcscript=$INSTALLATIONFOLDER/argoneond.py +if [ -f "$argoneonrtcscript" ] +then + # Disable Services + sudo systemctl stop argoneond.service + sudo systemctl disable argoneond.service + + # No need for sudo + /usr/bin/python3 $argoneonrtcscript CLEAN + /usr/bin/python3 $argoneonrtcscript SHUTDOWN + + # Remove files + sudo rm /lib/systemd/system/argoneond.service +fi + +# Remove UPS daemon if any +argononeupsscript=$INSTALLATIONFOLDER/argononeupsd.py +if [ -f "$argononeupsscript" ] +then + #sudo rmmod argonbatteryicon + # Disable Services + sudo systemctl stop argononeupsd.service + sudo systemctl disable argononeupsd.service + + sudo systemctl stop argonupsrtcd.service + sudo systemctl disable argonupsrtcd.service + + # Remove files + sudo rm /lib/systemd/system/argononeupsd.service + sudo rm /lib/systemd/system/argonupsrtcd.service + + find "/home" -maxdepth 1 -type d | while read line; do + shortcutfile="$line/Desktop/argonone-ups.desktop" + if [ -f "$shortcutfile" ]; then + sudo rm $shortcutfile + fi + done +fi + +if [ -f "/usr/bin/argon-config" ] +then + sudo rm /usr/bin/argon-config +fi + +if [ -f "/usr/bin/argonone-config" ] +then + sudo rm /usr/bin/argonone-config + sudo rm /usr/bin/argonone-uninstall +fi + + +if [ -f "/usr/bin/argonone-ir" ] +then + sudo rm /usr/bin/argonone-ir +fi + +# Delete config files +for configfile in argonunits argononed argononed-hdd argoneonrtc argoneonoled argonupsrtc +do + if [ -f "/etc/${configfile}.conf" ] + then + sudo rm "/etc/${configfile}.conf" + fi +done + + + +sudo rm /lib/systemd/system-shutdown/argon-shutdown.sh + +sudo rm -R -f $INSTALLATIONFOLDER + +echo "Removed Argon Services." +echo "Cleanup will complete after restarting the device." diff --git a/pythonscript/original_beta/argon-versioninfo.sh b/pythonscript/original_beta/argon-versioninfo.sh new file mode 100755 index 0000000..11cfafd --- /dev/null +++ b/pythonscript/original_beta/argon-versioninfo.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +VERSIONINFO="2507001" + +echo "Version $VERSIONINFO" +if [ -z "$1" ] +then + echo + echo "We acknowledge the valuable feedback of the following:" + echo "ghalfacree, NHHiker" + echo + echo "Feel free to join the discussions at https://forum.argon40.com" + echo +fi diff --git a/pythonscript/original_beta/argon40.png b/pythonscript/original_beta/argon40.png new file mode 100644 index 0000000..e69de29 diff --git a/argondashboard.py b/pythonscript/original_beta/argondashboard.py old mode 100755 new mode 100644 similarity index 97% rename from argondashboard.py rename to pythonscript/original_beta/argondashboard.py index 73f98d5..d5c4032 --- a/argondashboard.py +++ b/pythonscript/original_beta/argondashboard.py @@ -129,18 +129,16 @@ def displayramcpu(stdscr, refcpu, rowstart, colstart): def displaytempfan(stdscr, rowstart, colstart): - print( f"displaytempfan( {stdscr}, {rowstart}, {colstart} )" ) try: outputlist = [] try: - if bus is not None: - fanspeed = argonregister_getfanspeed(bus) + if busobj is not None: + fanspeed = argonregister_getfanspeed(busobj) fanspeedstr = "Off" if fanspeed > 0: fanspeedstr = str(fanspeed)+"%" outputlist.append({"title": "Fan ", "value": fanspeedstr}) except: - outputlist.append( {"title":"Fan ", "value": 'Error!'}) pass # Todo load from config temperature = "C" diff --git a/pythonscript/original_beta/argononeup-eepromconfig.py b/pythonscript/original_beta/argononeup-eepromconfig.py new file mode 100755 index 0000000..d7c486f --- /dev/null +++ b/pythonscript/original_beta/argononeup-eepromconfig.py @@ -0,0 +1,568 @@ +#!/usr/bin/env python3 + +# Based on /usr/bin/rpi-eeprom-config of bookworm +""" +rpi-eeprom-config +""" + +import argparse +import atexit +import os +import subprocess +import string +import struct +import sys +import tempfile +import time + +VALID_IMAGE_SIZES = [512 * 1024, 2 * 1024 * 1024] + +BOOTCONF_TXT = 'bootconf.txt' +BOOTCONF_SIG = 'bootconf.sig' +PUBKEY_BIN = 'pubkey.bin' + +# Each section starts with a magic number followed by a 32 bit offset to the +# next section (big-endian). +# The number, order and size of the sections depends on the bootloader version +# but the following mask can be used to test for section headers and skip +# unknown data. +# +# The last 4KB of the EEPROM image is reserved for internal use by the +# bootloader and may be overwritten during the update process. +MAGIC = 0x55aaf00f +PAD_MAGIC = 0x55aafeef +MAGIC_MASK = 0xfffff00f +FILE_MAGIC = 0x55aaf11f # id for modifiable files +FILE_HDR_LEN = 20 +FILENAME_LEN = 12 +TEMP_DIR = None + +# Modifiable files are stored in a single 4K erasable sector. +# The max content 4076 bytes because of the file header. +ERASE_ALIGN_SIZE = 4096 +MAX_FILE_SIZE = ERASE_ALIGN_SIZE - FILE_HDR_LEN + +DEBUG = False + +# BEGIN: Argon40 added methods +def argon_rpisupported(): + # bcm2711 = pi4, bcm2712 = pi5 + return rpi5() + +def argon_edit_config(): + # modified/stripped version of edit_config + + config_src = '' + # If there is a pending update then use the configuration from + # that in order to support incremental updates. Otherwise, + # use the current EEPROM configuration. + bootfs = shell_cmd(['rpi-eeprom-update', '-b']).rstrip() + pending = os.path.join(bootfs, 'pieeprom.upd') + if os.path.exists(pending): + config_src = pending + image = BootloaderImage(pending) + current_config = image.get_file(BOOTCONF_TXT).decode('utf-8') + else: + current_config, config_src = read_current_config() + + # Add PSU Mas Current etc if not yet set + foundnewsetting = 0 + addsetting="\nPSU_MAX_CURRENT=5000" + current_config_lines = current_config.splitlines() + new_config = current_config + lineidx = 0 + while lineidx < len(current_config_lines): + current_config_pair = current_config_lines[lineidx].split("=") + newsetting = "" + if current_config_pair[0] == "PSU_MAX_CURRENT": + newsetting = "PSU_MAX_CURRENT=5000" + + if newsetting != "": + addsetting = addsetting.replace("\n"+newsetting,"",1) + if current_config_lines[lineidx] != newsetting: + foundnewsetting = foundnewsetting + 1 + new_config = new_config.replace(current_config_lines[lineidx], newsetting, 1) + + lineidx = lineidx + 1 + + if addsetting != "": + # Append additional settings after [all] + new_config = new_config.replace("[all]", "[all]"+addsetting, 1) + foundnewsetting = foundnewsetting + 1 + + if foundnewsetting == 0: + # Already configured + print("EEPROM settings up to date") + sys.exit(0) + + # Skipped editor and write new config to temp file + create_tempdir() + tmp_conf = os.path.join(TEMP_DIR, 'boot.conf') + out = open(tmp_conf, 'w') + out.write(new_config) + out.close() + + # Apply updates + + apply_update(tmp_conf, None, config_src) + +# END: Argon40 added methods + + +def debug(s): + if DEBUG: + sys.stderr.write(s + '\n') + + +def rpi4(): + compatible_path = "/sys/firmware/devicetree/base/compatible" + if os.path.exists(compatible_path): + with open(compatible_path, "rb") as f: + compatible = f.read().decode('utf-8') + if "bcm2711" in compatible: + return True + return False + +def rpi5(): + compatible_path = "/sys/firmware/devicetree/base/compatible" + if os.path.exists(compatible_path): + with open(compatible_path, "rb") as f: + compatible = f.read().decode('utf-8') + if "bcm2712" in compatible: + return True + return False + +def exit_handler(): + """ + Delete any temporary files. + """ + if TEMP_DIR is not None and os.path.exists(TEMP_DIR): + tmp_image = os.path.join(TEMP_DIR, 'pieeprom.upd') + if os.path.exists(tmp_image): + os.remove(tmp_image) + tmp_conf = os.path.join(TEMP_DIR, 'boot.conf') + if os.path.exists(tmp_conf): + os.remove(tmp_conf) + os.rmdir(TEMP_DIR) + +def create_tempdir(): + global TEMP_DIR + if TEMP_DIR is None: + TEMP_DIR = tempfile.mkdtemp() + +def pemtobin(infile): + """ + Converts an RSA public key into the format expected by the bootloader. + """ + # Import the package here to make this a weak dependency. + from Cryptodome.PublicKey import RSA + + arr = bytearray() + f = open(infile,'r') + key = RSA.importKey(f.read()) + + if key.size_in_bits() != 2048: + raise Exception("RSA key size must be 2048") + + # Export N and E in little endian format + arr.extend(key.n.to_bytes(256, byteorder='little')) + arr.extend(key.e.to_bytes(8, byteorder='little')) + return arr + +def exit_error(msg): + """ + Trapped a fatal error, output message to stderr and exit with non-zero + return code. + """ + sys.stderr.write("ERROR: %s\n" % msg) + sys.exit(1) + +def shell_cmd(args): + """ + Executes a shell command waits for completion returning STDOUT. If an + error occurs then exit and output the subprocess stdout, stderr messages + for debug. + """ + start = time.time() + arg_str = ' '.join(args) + result = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + + while time.time() - start < 5: + if result.poll() is not None: + break + + if result.poll() is None: + exit_error("%s timeout" % arg_str) + + if result.returncode != 0: + exit_error("%s failed: %d\n %s\n %s\n" % + (arg_str, result.returncode, result.stdout.read(), result.stderr.read())) + else: + return result.stdout.read().decode('utf-8') + +def get_latest_eeprom(): + """ + Returns the path of the latest EEPROM image file if it exists. + """ + latest = shell_cmd(['rpi-eeprom-update', '-l']).rstrip() + if not os.path.exists(latest): + exit_error("EEPROM image '%s' not found" % latest) + return latest + +def apply_update(config, eeprom=None, config_src=None): + """ + Applies the config file to the latest available EEPROM image and spawns + rpi-eeprom-update to schedule the update at the next reboot. + """ + if eeprom is not None: + eeprom_image = eeprom + else: + eeprom_image = get_latest_eeprom() + create_tempdir() + + # Replace the contents of bootconf.txt with the contents of the config file + tmp_update = os.path.join(TEMP_DIR, 'pieeprom.upd') + image = BootloaderImage(eeprom_image, tmp_update) + image.update_file(config, BOOTCONF_TXT) + image.write() + + config_str = open(config).read() + if config_src is None: + config_src = '' + sys.stdout.write("Updating bootloader EEPROM\n image: %s\nconfig_src: %s\nconfig: %s\n%s\n%s\n%s\n" % + (eeprom_image, config_src, config, '#' * 80, config_str, '#' * 80)) + + sys.stdout.write("\n*** To cancel this update run 'sudo rpi-eeprom-update -r' ***\n\n") + + # Ignore APT package checksums so that this doesn't fail when used + # with EEPROMs with configs delivered outside of APT. + # The checksums are really just a safety check for automatic updates. + args = ['rpi-eeprom-update', '-d', '-i', '-f', tmp_update] + resp = shell_cmd(args) + sys.stdout.write(resp) + +def edit_config(eeprom=None): + """ + Implements something like 'git commit' for editing EEPROM configs. + """ + # Default to nano if $EDITOR is not defined. + editor = 'nano' + if 'EDITOR' in os.environ: + editor = os.environ['EDITOR'] + + config_src = '' + # If there is a pending update then use the configuration from + # that in order to support incremental updates. Otherwise, + # use the current EEPROM configuration. + bootfs = shell_cmd(['rpi-eeprom-update', '-b']).rstrip() + pending = os.path.join(bootfs, 'pieeprom.upd') + if os.path.exists(pending): + config_src = pending + image = BootloaderImage(pending) + current_config = image.get_file(BOOTCONF_TXT).decode('utf-8') + else: + current_config, config_src = read_current_config() + + create_tempdir() + tmp_conf = os.path.join(TEMP_DIR, 'boot.conf') + out = open(tmp_conf, 'w') + out.write(current_config) + out.close() + cmd = "\'%s\' \'%s\'" % (editor, tmp_conf) + result = os.system(cmd) + if result != 0: + exit_error("Aborting update because \'%s\' exited with code %d." % (cmd, result)) + + new_config = open(tmp_conf, 'r').read() + if len(new_config.splitlines()) < 2: + exit_error("Aborting update because \'%s\' appears to be empty." % tmp_conf) + apply_update(tmp_conf, eeprom, config_src) + +def read_current_config(): + """ + Reads the configuration used by the current bootloader. + """ + fw_base = "/sys/firmware/devicetree/base/" + nvmem_base = "/sys/bus/nvmem/devices/" + + if os.path.exists(fw_base + "/aliases/blconfig"): + with open(fw_base + "/aliases/blconfig", "rb") as f: + nvmem_ofnode_path = fw_base + f.read().decode('utf-8') + for d in os.listdir(nvmem_base): + if os.path.realpath(nvmem_base + d + "/of_node") in os.path.normpath(nvmem_ofnode_path): + return (open(nvmem_base + d + "/nvmem", "rb").read().decode('utf-8'), "blconfig device") + + return (shell_cmd(['vcgencmd', 'bootloader_config']), "vcgencmd bootloader_config") + +class ImageSection: + def __init__(self, magic, offset, length, filename=''): + self.magic = magic + self.offset = offset + self.length = length + self.filename = filename + debug("ImageSection %x offset %d length %d %s" % (magic, offset, length, filename)) + +class BootloaderImage(object): + def __init__(self, filename, output=None): + """ + Instantiates a Bootloader image writer with a source eeprom (filename) + and optionally an output filename. + """ + self._filename = filename + self._sections = [] + self._image_size = 0 + try: + self._bytes = bytearray(open(filename, 'rb').read()) + except IOError as err: + exit_error("Failed to read \'%s\'\n%s\n" % (filename, str(err))) + self._out = None + if output is not None: + self._out = open(output, 'wb') + + self._image_size = len(self._bytes) + if self._image_size not in VALID_IMAGE_SIZES: + exit_error("%s: Expected size %d bytes actual size %d bytes" % + (filename, self._image_size, len(self._bytes))) + self.parse() + + def parse(self): + """ + Builds a table of offsets to the different sections in the EEPROM. + """ + offset = 0 + magic = 0 + while offset < self._image_size: + magic, length = struct.unpack_from('>LL', self._bytes, offset) + if magic == 0x0 or magic == 0xffffffff: + break # EOF + elif (magic & MAGIC_MASK) != MAGIC: + raise Exception('EEPROM is corrupted %x %x %x' % (magic, magic & MAGIC_MASK, MAGIC)) + + filename = '' + if magic == FILE_MAGIC: # Found a file + # Discard trailing null characters used to pad filename + filename = self._bytes[offset + 8: offset + FILE_HDR_LEN].decode('utf-8').replace('\0', '') + debug("section at %d length %d magic %08x %s" % (offset, length, magic, filename)) + self._sections.append(ImageSection(magic, offset, length, filename)) + + offset += 8 + length # length + type + offset = (offset + 7) & ~7 + + def find_file(self, filename): + """ + Returns the offset, length and whether this is the last section in the + EEPROM for a modifiable file within the image. + """ + offset = -1 + length = -1 + is_last = False + + next_offset = self._image_size - ERASE_ALIGN_SIZE # Don't create padding inside the bootloader scratch page + for i in range(0, len(self._sections)): + s = self._sections[i] + if s.magic == FILE_MAGIC and s.filename == filename: + is_last = (i == len(self._sections) - 1) + offset = s.offset + length = s.length + break + + # Find the start of the next non padding section + i += 1 + while i < len(self._sections): + if self._sections[i].magic == PAD_MAGIC: + i += 1 + else: + next_offset = self._sections[i].offset + break + ret = (offset, length, is_last, next_offset) + debug('%s offset %d length %d is-last %d next %d' % (filename, ret[0], ret[1], ret[2], ret[3])) + return ret + + def update(self, src_bytes, dst_filename): + """ + Replaces a modifiable file with specified byte array. + """ + hdr_offset, length, is_last, next_offset = self.find_file(dst_filename) + update_len = len(src_bytes) + FILE_HDR_LEN + + if hdr_offset + update_len > self._image_size - ERASE_ALIGN_SIZE: + raise Exception('No space available - image past EOF.') + + if hdr_offset < 0: + raise Exception('Update target %s not found' % dst_filename) + + if hdr_offset + update_len > next_offset: + raise Exception('Update %d bytes is larger than section size %d' % (update_len, next_offset - hdr_offset)) + + new_len = len(src_bytes) + FILENAME_LEN + 4 + struct.pack_into('>L', self._bytes, hdr_offset + 4, new_len) + struct.pack_into(("%ds" % len(src_bytes)), self._bytes, + hdr_offset + 4 + FILE_HDR_LEN, src_bytes) + + # If the new file is smaller than the old file then set any old + # data which is now unused to all ones (erase value) + pad_start = hdr_offset + 4 + FILE_HDR_LEN + len(src_bytes) + + # Add padding up to 8-byte boundary + while pad_start % 8 != 0: + struct.pack_into('B', self._bytes, pad_start, 0xff) + pad_start += 1 + + # Create a padding section unless the padding size is smaller than the + # size of a section head. Padding is allowed in the last section but + # by convention bootconf.txt is the last section and there's no need to + # pad to the end of the sector. This also ensures that the loopback + # config read/write tests produce identical binaries. + pad_bytes = next_offset - pad_start + if pad_bytes > 8 and not is_last: + pad_bytes -= 8 + struct.pack_into('>i', self._bytes, pad_start, PAD_MAGIC) + pad_start += 4 + struct.pack_into('>i', self._bytes, pad_start, pad_bytes) + pad_start += 4 + + debug("pad %d" % pad_bytes) + pad = 0 + while pad < pad_bytes: + struct.pack_into('B', self._bytes, pad_start + pad, 0xff) + pad = pad + 1 + + def update_key(self, src_pem, dst_filename): + """ + Replaces the specified public key entry with the public key values extracted + from the source PEM file. + """ + pubkey_bytes = pemtobin(src_pem) + self.update(pubkey_bytes, dst_filename) + + def update_file(self, src_filename, dst_filename): + """ + Replaces the contents of dst_filename in the EEPROM with the contents of src_file. + """ + src_bytes = open(src_filename, 'rb').read() + if len(src_bytes) > MAX_FILE_SIZE: + raise Exception("src file %s is too large (%d bytes). The maximum size is %d bytes." + % (src_filename, len(src_bytes), MAX_FILE_SIZE)) + self.update(src_bytes, dst_filename) + + def write(self): + """ + Writes the updated EEPROM image to stdout or the specified output file. + """ + if self._out is not None: + self._out.write(self._bytes) + self._out.close() + else: + if hasattr(sys.stdout, 'buffer'): + sys.stdout.buffer.write(self._bytes) + else: + sys.stdout.write(self._bytes) + + def get_file(self, filename): + hdr_offset, length, is_last, next_offset = self.find_file(filename) + offset = hdr_offset + 4 + FILE_HDR_LEN + file_bytes = self._bytes[offset:offset+length-FILENAME_LEN-4] + return file_bytes + + def extract_files(self): + for i in range(0, len(self._sections)): + s = self._sections[i] + if s.magic == FILE_MAGIC: + file_bytes = self.get_file(s.filename) + open(s.filename, 'wb').write(file_bytes) + + def read(self): + config_bytes = self.get_file('bootconf.txt') + if self._out is not None: + self._out.write(config_bytes) + self._out.close() + else: + if hasattr(sys.stdout, 'buffer'): + sys.stdout.buffer.write(config_bytes) + else: + sys.stdout.write(config_bytes) + +def main(): + """ + Utility for reading and writing the configuration file in the + Raspberry Pi bootloader EEPROM image. + """ + description = """\ +Bootloader EEPROM configuration tool for the Raspberry Pi 4 and Raspberry Pi 5. +Operating modes: + +1. Outputs the current bootloader configuration to STDOUT if no arguments are + specified OR the given output file if --out is specified. + + rpi-eeprom-config [--out boot.conf] + +2. Extracts the configuration file from the given 'eeprom' file and outputs + the result to STDOUT or the output file if --output is specified. + + rpi-eeprom-config pieeprom.bin [--out boot.conf] + +3. Writes a new EEPROM image replacing the configuration file with the contents + of the file specified by --config. + + rpi-eeprom-config --config boot.conf --out newimage.bin pieeprom.bin + + The new image file can be installed via rpi-eeprom-update + rpi-eeprom-update -d -f newimage.bin + +4. Applies a given config file to an EEPROM image and invokes rpi-eeprom-update + to schedule an update of the bootloader when the system is rebooted. + + Since this command launches rpi-eeprom-update to schedule the EEPROM update + it must be run as root. + + sudo rpi-eeprom-config --apply boot.conf [pieeprom.bin] + + If the 'eeprom' argument is not specified then the latest available image + is selected by calling 'rpi-eeprom-update -l'. + +5. The '--edit' parameter behaves the same as '--apply' except that instead of + applying a predefined configuration file a text editor is launched with the + contents of the current EEPROM configuration. + + Since this command launches rpi-eeprom-update to schedule the EEPROM update + it must be run as root. + + The configuration file will be taken from: + * The blconfig reserved memory nvmem device + * The cached bootloader configuration 'vcgencmd bootloader_config' + * The current pending update - typically /boot/pieeprom.upd + + sudo -E rpi-eeprom-config --edit [pieeprom.bin] + + To cancel the pending update run 'sudo rpi-eeprom-update -r' + + The default text editor is nano and may be overridden by setting the 'EDITOR' + environment variable and passing '-E' to 'sudo' to preserve the environment. + +6. Signing the bootloader config file. + Updates an EEPROM binary with a signed config file (created by rpi-eeprom-digest) plus + the corresponding RSA public key. + + Requires Python Cryptodomex libraries and OpenSSL. To install on Raspberry Pi OS run:- + sudo apt install openssl python-pip + sudo python3 -m pip install cryptodomex + + rpi-eeprom-digest -k private.pem -i bootconf.txt -o bootconf.sig + rpi-eeprom-config --config bootconf.txt --digest bootconf.sig --pubkey public.pem --out pieeprom-signed.bin pieeprom.bin + + Currently, the signing process is a separate step so can't be used with the --edit or --apply modes. + + +See 'rpi-eeprom-update -h' for more information about the available EEPROM images. +""" + + if os.getuid() != 0: + exit_error("Please run as root") + elif not argon_rpisupported(): + # Skip + sys.exit(0) + argon_edit_config() + +if __name__ == '__main__': + atexit.register(exit_handler) + main() diff --git a/pythonscript/original_beta/argononeupd.py b/pythonscript/original_beta/argononeupd.py new file mode 100644 index 0000000..68b0d2d --- /dev/null +++ b/pythonscript/original_beta/argononeupd.py @@ -0,0 +1,506 @@ +#!/usr/bin/python3 + +# +# This script monitor battery via ic2 and keyboard events. +# +# Additional comments are found in each function below +# +# + + +from evdev import InputDevice, categorize, ecodes +import subprocess + + +import sys +import os +import time + +from threading import Thread +from queue import Queue + +sys.path.append("/etc/argon/") +from argonregister import * + +# Initialize I2C Bus +bus = argonregister_initializebusobj() + +# Constants +ADDR_BATTERY = 0x64 + +UPS_LOGFILE="/dev/shm/upslog.txt" + + +################### +# Utilty Functions +################### + +# Debug Logger +def debuglog(typestr, logstr): + try: + DEBUGFILE="/dev/shm/argononeupdebuglog.txt" + + tmpstrpadding = " " + + with open(DEBUGFILE, "a") as txt_file: + txt_file.write("["+time.asctime(time.localtime(time.time()))+"] "+typestr.upper()+" "+logstr.strip().replace("\n","\n"+tmpstrpadding)+"\n") + except: + pass + + +# System Notifcation +def notifymessage(message, iscritical): + if not isinstance(message, str) or len(message.strip()) == 0: + return + + wftype="notify" + if iscritical: + wftype="critical" + os.system("export SUDO_UID=1000; wfpanelctl "+wftype+" \""+message+"\"") + os.system("export DISPLAY=:0.0; lxpanelctl notify \""+message+"\"") + + +############# +# Battery +############# +REG_CONTROL = 0x08 +REG_SOCALERT = 0x0b +REG_PROFILE = 0x10 +REG_ICSTATE = 0xA7 + + + +def battery_restart(): + # Set to active mode + try: + maxretry = 3 + while maxretry > 0: + maxretry = maxretry - 1 + + # Restart + bus.write_byte_data(ADDR_BATTERY, REG_CONTROL, 0x30) + time.sleep(0.5) + # Activate + bus.write_byte_data(ADDR_BATTERY, REG_CONTROL, 0x00) + time.sleep(0.5) + + # Wait for Ready Status + maxwaitsecs = 5 + while maxwaitsecs > 0: + tmpval = bus.read_byte_data(ADDR_BATTERY, REG_ICSTATE) + if (tmpval&0x0C) != 0: + debuglog("battery-activate", "Activated Successfully") + return 0 + time.sleep(1) + maxwaitsecs = maxwaitsecs - 1 + + + debuglog("battery-activate", "Failed to activate") + return 2 + except Exception as e: + try: + debuglog("battery-activateerror", str(e)) + except: + debuglog("battery-activateerror", "Activation Failed") + return 1 + + +def battery_getstatus(restartifnotactive): + try: + tmpval = bus.read_byte_data(ADDR_BATTERY, REG_CONTROL) + if tmpval != 0: + if restartifnotactive == True: + tmpval = battery_restart() + + if tmpval != 0: + debuglog("battery-status", "Inactive "+str(tmpval)) + return 2 + + tmpval = bus.read_byte_data(ADDR_BATTERY, REG_SOCALERT) + if (tmpval&0x80) == 0: + debuglog("battery-status", "Profile not ready "+str(tmpval)) + return 3 + + # OK + #debuglog("battery-status", "OK") + return 0 + except Exception as e: + try: + debuglog("battery-status-error", str(e)) + except: + debuglog("battery-status-error", "Battery Status Failed") + + return 1 + +def battery_checkupdateprofile(): + try: + REG_GPIOCONFIG = 0x0A + + PROFILE_DATALIST = [0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0xAA,0xBE,0xC6,0xB8,0xAE,0xC2,0x98,0x82,0xFF,0xFF,0xCA,0x98,0x75,0x63,0x55,0x4E,0x4C,0x49,0x98,0x88,0xDC,0x34,0xDB,0xD3,0xD4,0xD3,0xD0,0xCE,0xCB,0xBB,0xE7,0xA2,0xC2,0xC4,0xAE,0x96,0x89,0x80,0x74,0x67,0x63,0x71,0x8E,0x9F,0x85,0x6F,0x3B,0x20,0x00,0xAB,0x10,0x00,0xB0,0x73,0x00,0x00,0x00,0x64,0x08,0xD3,0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAC] + + PROFILE_LEN = len(PROFILE_DATALIST) + + # Try to compare profile if battery is active + tmpidx = 0 + + tmpval = battery_getstatus(True) + if tmpval == 0: + # Status OK, check profile + tmpidx = 0 + while tmpidx < PROFILE_LEN: + tmpval = bus.read_byte_data(ADDR_BATTERY, REG_PROFILE+tmpidx) + if tmpval != PROFILE_DATALIST[tmpidx]: + debuglog("battery-profile-error", "Mismatch") + break + tmpidx = tmpidx + 1 + + if tmpidx == PROFILE_LEN: + # Matched + return 0 + else: + debuglog("battery-profile", "Status Error "+str(tmpval)+", will attempt to update") + + # needs update + debuglog("battery-profile", "Updating...") + + # Device Sleep state + + # Restart + bus.write_byte_data(ADDR_BATTERY, REG_CONTROL, 0x30) + time.sleep(0.5) + # Sleep + bus.write_byte_data(ADDR_BATTERY, REG_CONTROL, 0xF0) + time.sleep(0.5) + + # Write Profile + tmpidx = 0 + while tmpidx < PROFILE_LEN: + bus.write_byte_data(ADDR_BATTERY, REG_PROFILE+tmpidx, PROFILE_DATALIST[tmpidx]) + tmpidx = tmpidx + 1 + + debuglog("battery-profile", "Profile Updated,Restarting...") + + # Set Update Flag + bus.write_byte_data(ADDR_BATTERY, REG_SOCALERT, 0x80) + time.sleep(0.5) + + # Close Interrupts + bus.write_byte_data(ADDR_BATTERY, REG_GPIOCONFIG, 0) + time.sleep(0.5) + + # Restart Battery + tmpval = battery_restart() + if tmpval == 0: + debuglog("battery-profile", "Update Completed") + return 0 + + debuglog("battery-profile", "Unable to restart") + return 3 + except Exception as e: + try: + debuglog("battery-profile-error", str(e)) + except: + debuglog("battery-profile-error", "Battery Profile Check/Update Failed") + + return 1 + + + +def battery_getpercent(): + # State of Charge (SOC) + try: + SOC_HIGH_REG = 0x04 + + socpercent = bus.read_byte_data(ADDR_BATTERY, SOC_HIGH_REG) + if socpercent > 100: + return 100 + elif socpercent > 0: + return socpercent + + # Support Fraction percent + #SOC_LOW_REG = 0x05 + #soc_low = bus.read_byte_data(ADDR_BATTERY, SOC_LOW_REG) + #socpercentfloat = socpercent + (soc_low / 256.0) + #if socpercentfloat > 100.0: + # return 100.0 + #elif socpercentfloat > 0.0: + # return socpercentfloat + + except Exception as e: + try: + debuglog("battery-percenterror", str(e)) + except: + debuglog("battery-percenterror", "Read Battery Failed") + + return 0 + + +def battery_isplugged(): + # State of Charge (SOC) + try: + CURRENT_HIGH_REG = 0x0E + + current_high = bus.read_byte_data(ADDR_BATTERY, CURRENT_HIGH_REG) + + if (current_high & 0x80) > 0: + return 1 + + #CURRENT_LOW_REG = 0x0F + #R_SENSE = 10.0 + #current_low = bus.read_byte_data(ADDR_BATTERY, CURRENT_LOW_REG) + #raw_current = int.from_bytes([current_high, current_low], byteorder='big', signed=True) + #current = (52.4 * raw_current) / (32768 * R_SENSE) + + + except Exception as e: + try: + debuglog("battery-chargingerror", str(e)) + except: + debuglog("battery-chargingerror", "Read Charging Failed") + + return 0 + +def battery_loadlogdata(): + # status, version, time, schedule + outobj = {} + try: + fp = open(UPS_LOGFILE, "r") + logdata = fp.read() + alllines = logdata.split("\n") + ctr = 0 + while ctr < len(alllines): + tmpval = alllines[ctr].strip() + curinfo = tmpval.split(":") + if len(curinfo) > 1: + tmpattrib = curinfo[0].lower().split(" ") + # The rest are assumed to be value + outobj[tmpattrib[0]] = tmpval[(len(curinfo[0])+1):].strip() + ctr = ctr + 1 + except OSError: + pass + + return outobj + +def battery_check(readq): + CMDSTARTBYTE=0xfe + CMDCONTROLBYTECOUNT=3 + CHECKSTATUSLOOPFREQ=50 + + CMDsendrequest = [ 0xfe, 0, 0, 0xfe, 0xfe, 0, 0, 0xfe, 0, 0, 0] + + lastcmdtime="" + loopCtr = CHECKSTATUSLOOPFREQ + sendcmdid = -1 + + debuglog("battery", "Starting") + + updatedesktopicon("Argon ONE UP", "/etc/argon/argon40.png") + + maxretry = 5 + while maxretry > 0: + try: + if battery_checkupdateprofile() == 0: + break + except Exception as mainerr: + try: + debuglog("battery-mainerror", str(mainerr)) + except: + debuglog("battery-mainerror", "Error") + # Give time before retry + time.sleep(10) + maxretry = maxretry - 1 + + while maxretry > 0: # Outer loop; maxretry never decrements so infinite + qdata = "" + if readq.empty() == False: + qdata = readq.get() + + if battery_getstatus(True) != 0: + # Give time before retry + time.sleep(3) + continue + + prevnotifymsg = "" + previconfile = "" + statusstr = "" + + needsupdate=False + device_battery=0 + device_charging=0 + + while True: # Command loop + try: + if sendcmdid < 0: + cmddatastr = "" + + if cmddatastr == "": + if loopCtr >= CHECKSTATUSLOOPFREQ: + # Check Battery Status + sendcmdid = 0 + loopCtr = 0 + else: + loopCtr = loopCtr + 1 + if (loopCtr&1) == 0: + sendcmdid = 0 # Check Battery Status + + if sendcmdid == 0: + tmp_battery = battery_getpercent() + tmp_charging = battery_isplugged() + + if tmp_charging != device_charging or tmp_battery!=device_battery: + device_battery=tmp_battery + device_charging=tmp_charging + tmpiconfile = "/etc/argon/ups/" + needsupdate=True + curnotifymsg = "" + curnotifycritical = False + + if device_charging == 0: + if device_battery>99: + statusstr = "Charged" + else: + statusstr = "Charging" + curnotifymsg = statusstr + tmpiconfile = tmpiconfile+"charge_"+str(device_battery) + else: + statusstr = "Battery" + tmpiconfile = tmpiconfile+"discharge_"+str(device_battery) + + if device_battery > 50: + curnotifymsg="Battery Mode" + elif device_battery > 20: + curnotifymsg="50%% Battery" + elif device_battery > 10: + curnotifymsg="20%% Battery" + else: + curnotifymsg="Low Battery" + curnotifycritical=True + + tmpiconfile = tmpiconfile + ".png" + statusstr = statusstr + " " + str(device_battery)+"%" + + # Add/update desktop icons too; add check to minimize write + if previconfile != tmpiconfile: + updatedesktopicon(statusstr, tmpiconfile) + previconfile = tmpiconfile + + # Send notification if necessary + if prevnotifymsg != curnotifymsg: + notifymessage(curnotifymsg, curnotifycritical) + + prevnotifymsg = curnotifymsg + + + sendcmdid=-1 + + if needsupdate==True: + # Log File + otherstr = "" + with open(UPS_LOGFILE, "w") as txt_file: + txt_file.write("Status as of: "+time.asctime(time.localtime(time.time()))+"\n Power:"+statusstr+"\n"+otherstr) + + needsupdate=False + + except Exception as e: + try: + debuglog("battery-error", str(e)) + except: + debuglog("battery-error", "Error") + break + time.sleep(3) + +def updatedesktopicon(statusstr, tmpiconfile): + try: + icontitle = "Argon ONE UP" + tmp = os.popen("find /home -maxdepth 1 -type d").read() + alllines = tmp.split("\n") + for curfolder in alllines: + if curfolder == "/home" or curfolder == "": + continue + #debuglog("desktop-update-path", curfolder) + #debuglog("desktop-update-text", statusstr) + #debuglog("desktop-update-icon", tmpiconfile) + with open(curfolder+"/Desktop/argononeup.desktop", "w") as txt_file: + txt_file.write("[Desktop Entry]\nName="+icontitle+"\nComment="+statusstr+"\nIcon="+tmpiconfile+"\nExec=lxterminal --working-directory="+curfolder+"/ -t \"Argon ONE UP\" -e \"/etc/argon/argon-config\"\nType=Application\nEncoding=UTF-8\nTerminal=false\nCategories=None;\n") + except Exception as desktope: + #pass + try: + debuglog("desktop-update-error", str(desktope)) + except: + debuglog("desktop-update-error", "Error") + +def keyboardevent_check(readq): + while True: + # Fixed? + device = InputDevice('/dev/input/event13') + + try: + # Get current level + curbrightness = 50 + try: + output = subprocess.check_output(["ddcutil", "getvcp", "10"], text=True) + curbrightness = int(output.split("=")[-1].split()[0]) + except Exception as einit: + try: + debuglog("keyboard-initerro", str(einit)) + except: + debuglog("keyboard-initerro", "Error getting base value") + + # Device Input loop + for event in device.read_loop(): + if event.type == ecodes.EV_KEY: + key_event = categorize(event) + + if event.value == 1: + adjustval = 0 + if key_event.keycode == "KEY_BRIGHTNESSDOWN": + adjustval = -10 + elif key_event.keycode == "KEY_BRIGHTNESSUP": + adjustval = 10 + + if adjustval != 0: + # Adjust brightness + tmpval = max(10, min(100, curbrightness + adjustval)) + if tmpval != curbrightness: + debuglog("keyboard-brightness", str(curbrightness)+"% to "+str(tmpval)+"%") + + subprocess.run(["ddcutil", "setvcp", "10", str(tmpval)], check=True) + + notifymessage("Brightness: "+str(tmpval)+"%", False) + + curbrightness = tmpval + + except Exception as e: + try: + debuglog("keyboard-mainerror", str(e)) + except: + debuglog("keyboard-mainerror", "Error") + finally: + device.close() + +if len(sys.argv) > 1: + cmd = sys.argv[1].upper() + if cmd == "GETBATTERY": + outobj = battery_loadlogdata() + try: + print(outobj["power"]) + except: + print("Error retrieving battery status") + elif cmd == "RESETBATTERY": + battery_checkupdateprofile() + + elif cmd == "SERVICE": + # Starts the power button and temperature monitor threads + try: + ipcq = Queue() + if len(sys.argv) > 2: + cmd = sys.argv[2].upper() + t1 = Thread(target = battery_check, args =(ipcq, )) + t2 = Thread(target = keyboardevent_check, args =(ipcq, )) + + t1.start() + t2.start() + + ipcq.join() + except Exception: + sys.exit(1) diff --git a/pythonscript/original_beta/argonregister.py b/pythonscript/original_beta/argonregister.py new file mode 100644 index 0000000..edd9c1d --- /dev/null +++ b/pythonscript/original_beta/argonregister.py @@ -0,0 +1,74 @@ +#!/usr/bin/python3 + +# +# Argon Register Helper methods +# Same as argonregister, but no support for new register commands +# + +import time +import smbus + +# I2C Addresses +ADDR_ARGONONEFAN=0x1a +ADDR_ARGONONEREG=ADDR_ARGONONEFAN + +# ARGONONEREG Addresses +ADDR_ARGONONEREG_DUTYCYCLE=0x80 +ADDR_ARGONONEREG_FW=0x81 +ADDR_ARGONONEREG_IR=0x82 +ADDR_ARGONONEREG_CTRL=0x86 + +# Initialize bus +def argonregister_initializebusobj(): + try: + return smbus.SMBus(1) + except Exception: + try: + # Older version + return smbus.SMBus(0) + except Exception: + print("Unable to detect i2c") + return None + + +# Checks if the FW supports control registers +def argonregister_checksupport(busobj): + return False + +def argonregister_getbyte(busobj, address): + if busobj is None: + return 0 + return busobj.read_byte_data(ADDR_ARGONONEREG, address) + +def argonregister_setbyte(busobj, address, bytevalue): + if busobj is None: + return + busobj.write_byte_data(ADDR_ARGONONEREG,address,bytevalue) + time.sleep(1) + +def argonregister_getfanspeed(busobj, regsupport=None): + return 0 + +def argonregister_setfanspeed(busobj, newspeed, regsupport=None): + if busobj is None: + return + + if newspeed > 100: + newspeed = 100 + elif newspeed < 0: + newspeed = 0 + + busobj.write_byte(ADDR_ARGONONEFAN,newspeed) + time.sleep(1) + +def argonregister_signalpoweroff(busobj): + if busobj is None: + return + + busobj.write_byte(ADDR_ARGONONEFAN,0xFF) + +def argonregister_setircode(busobj, vallist): + if busobj is None: + return + + busobj.write_i2c_block_data(ADDR_ARGONONEREG, ADDR_ARGONONEREG_IR, vallist) diff --git a/pythonscript/original_beta/argonsysinfo.py b/pythonscript/original_beta/argonsysinfo.py new file mode 100644 index 0000000..102f2e5 --- /dev/null +++ b/pythonscript/original_beta/argonsysinfo.py @@ -0,0 +1,394 @@ +#!/usr/bin/python3 + +# +# Misc methods to retrieve system information. +# + +import os +import time +import socket + +def argonsysinfo_listcpuusage(sleepsec = 1): + outputlist = [] + curusage_a = argonsysinfo_getcpuusagesnapshot() + time.sleep(sleepsec) + curusage_b = argonsysinfo_getcpuusagesnapshot() + + for cpuname in curusage_a: + if cpuname == "cpu": + continue + if curusage_a[cpuname]["total"] == curusage_b[cpuname]["total"]: + outputlist.append({"title": cpuname, "value": "0%"}) + else: + total = curusage_b[cpuname]["total"]-curusage_a[cpuname]["total"] + idle = curusage_b[cpuname]["idle"]-curusage_a[cpuname]["idle"] + outputlist.append({"title": cpuname, "value": int(100*(total-idle)/(total))}) + return outputlist + +def argonsysinfo_getcpuusagesnapshot(): + cpupercent = {} + errorflag = False + try: + cpuctr = 0 + # user, nice, system, idle, iowait, irc, softirq, steal, guest, guest nice + tempfp = open("/proc/stat", "r") + alllines = tempfp.readlines() + for temp in alllines: + temp = temp.replace('\t', ' ') + temp = temp.strip() + while temp.find(" ") >= 0: + temp = temp.replace(" ", " ") + if len(temp) < 3: + cpuctr = cpuctr +1 + continue + + checkname = temp[0:3] + if checkname == "cpu": + infolist = temp.split(" ") + idle = 0 + total = 0 + colctr = 1 + while colctr < len(infolist): + curval = int(infolist[colctr]) + if colctr == 4 or colctr == 5: + idle = idle + curval + total = total + curval + colctr = colctr + 1 + if total > 0: + cpupercent[infolist[0]] = {"total": total, "idle": idle} + cpuctr = cpuctr +1 + + tempfp.close() + except IOError: + errorflag = True + return cpupercent + + +def argonsysinfo_liststoragetotal(): + outputlist = [] + ramtotal = 0 + errorflag = False + + try: + hddctr = 0 + tempfp = open("/proc/partitions", "r") + alllines = tempfp.readlines() + + for temp in alllines: + temp = temp.replace('\t', ' ') + temp = temp.strip() + while temp.find(" ") >= 0: + temp = temp.replace(" ", " ") + infolist = temp.split(" ") + if len(infolist) >= 4: + # Check if header + if infolist[3] != "name": + parttype = infolist[3][0:3] + if parttype == "ram": + ramtotal = ramtotal + int(infolist[2]) + elif parttype[0:2] == "sd" or parttype[0:2] == "hd": + lastchar = infolist[3][-1] + if lastchar.isdigit() == False: + outputlist.append({"title": infolist[3], "value": argonsysinfo_kbstr(int(infolist[2]))}) + else: + # SD Cards + lastchar = infolist[3][-2] + if lastchar[0] != "p": + outputlist.append({"title": infolist[3], "value": argonsysinfo_kbstr(int(infolist[2]))}) + + tempfp.close() + #outputlist.append({"title": "ram", "value": argonsysinfo_kbstr(ramtotal)}) + except IOError: + errorflag = True + return outputlist + +def argonsysinfo_getram(): + totalram = 0 + totalfree = 0 + tempfp = open("/proc/meminfo", "r") + alllines = tempfp.readlines() + + for temp in alllines: + temp = temp.replace('\t', ' ') + temp = temp.strip() + while temp.find(" ") >= 0: + temp = temp.replace(" ", " ") + infolist = temp.split(" ") + if len(infolist) >= 2: + if infolist[0] == "MemTotal:": + totalram = int(infolist[1]) + elif infolist[0] == "MemFree:": + totalfree = totalfree + int(infolist[1]) + elif infolist[0] == "Buffers:": + totalfree = totalfree + int(infolist[1]) + elif infolist[0] == "Cached:": + totalfree = totalfree + int(infolist[1]) + if totalram == 0: + return "0%" + return [str(int(100*totalfree/totalram))+"%", str((totalram+512*1024)>>20)+"GB"] + +def argonsysinfo_getcputemp(): + try: + tempfp = open("/sys/class/thermal/thermal_zone0/temp", "r") + temp = tempfp.readline() + tempfp.close() + #cval = temp/1000 + #fval = 32+9*temp/5000 + return float(int(temp)/1000) + except IOError: + return 0 + + +def argonsysinfo_getmaxhddtemp(): + maxtempval = 0 + try: + hddtempobj = argonsysinfo_gethddtemp() + for curdev in hddtempobj: + if hddtempobj[curdev] > maxtempval: + maxtempval = hddtempobj[curdev] + return maxtempval + except: + return maxtempval + +def argonsysinfo_gethddtemp(): + # May 2022: Used smartctl, hddtemp is not available on some platforms + hddtempcmd = "/usr/sbin/smartctl" + if os.path.exists(hddtempcmd) == False: + # Fallback for now + hddtempcmd = "/usr/sbin/hddtemp" + + outputobj = {} + if os.path.exists(hddtempcmd): + try: + tmp = os.popen("lsblk | grep -e '0 disk' | awk '{print $1}'").read() + alllines = tmp.split("\n") + for curdev in alllines: + if curdev[0:2] == "sd" or curdev[0:2] == "hd": + tempval = argonsysinfo_getdevhddtemp(hddtempcmd,curdev) + if tempval > 0: + outputobj[curdev] = tempval + return outputobj + except: + return outputobj + return outputobj + +def argonsysinfo_getdevhddtemp(hddtempcmd, curdev): + cmdstr = "" + if hddtempcmd == "/usr/sbin/hddtemp": + cmdstr = "/usr/sbin/hddtemp -n sata:/dev/"+curdev + elif hddtempcmd == "/usr/sbin/smartctl": + cmdstr = "/usr/sbin/smartctl -d sat -A /dev/"+curdev+" | grep Temperature_Celsius | awk '{print $10}'" + + tempval = 0 + if len(cmdstr) > 0: + try: + temperaturestr = os.popen(cmdstr+" 2>&1").read() + tempval = float(temperaturestr) + except: + tempval = -1 + + return tempval + +def argonsysinfo_getip(): + ipaddr = "" + st = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + try: + # Connect to nonexistent device + st.connect(('254.255.255.255', 1)) + ipaddr = st.getsockname()[0] + except Exception: + ipaddr = 'N/A' + finally: + st.close() + return ipaddr + + +def argonsysinfo_getrootdev(): + tmp = os.popen('mount').read() + alllines = tmp.split("\n") + + for temp in alllines: + temp = temp.replace('\t', ' ') + temp = temp.strip() + while temp.find(" ") >= 0: + temp = temp.replace(" ", " ") + infolist = temp.split(" ") + if len(infolist) >= 3: + + if infolist[2] == "/": + return infolist[0] + return "" + +def argonsysinfo_listhddusage(): + outputobj = {} + raidlist = argonsysinfo_listraid() + raiddevlist = [] + raidctr = 0 + while raidctr < len(raidlist['raidlist']): + raiddevlist.append(raidlist['raidlist'][raidctr]['title']) + # TODO: May need to use different method for each raid type (i.e. check raidlist['raidlist'][raidctr]['value']) + #outputobj[raidlist['raidlist'][raidctr]['title']] = {"used":int(raidlist['raidlist'][raidctr]['info']['used']), "total":int(raidlist['raidlist'][raidctr]['info']['size'])} + raidctr = raidctr + 1 + + rootdev = argonsysinfo_getrootdev() + + tmp = os.popen('df').read() + alllines = tmp.split("\n") + + for temp in alllines: + temp = temp.replace('\t', ' ') + temp = temp.strip() + while temp.find(" ") >= 0: + temp = temp.replace(" ", " ") + infolist = temp.split(" ") + if len(infolist) >= 6: + if infolist[1] == "Size": + continue + if len(infolist[0]) < 5: + continue + elif infolist[0][0:5] != "/dev/": + continue + curdev = infolist[0] + if curdev == "/dev/root" and rootdev != "": + curdev = rootdev + tmpidx = curdev.rfind("/") + if tmpidx >= 0: + curdev = curdev[tmpidx+1:] + + if curdev in raidlist['hddlist']: + # Skip devices that are part of a RAID setup + continue + elif curdev in raiddevlist: + # Skip RAID ID that already have size data + # (use df information otherwise) + if curdev in outputobj: + continue + elif curdev[0:2] == "sd" or curdev[0:2] == "hd": + curdev = curdev[0:-1] + else: + curdev = curdev[0:-2] + + # Aggregate values (i.e. sda1, sda2 to sda) + if curdev in outputobj: + outputobj[curdev] = {"used":outputobj[curdev]['used']+int(infolist[2]), "total":outputobj[curdev]['total']+int(infolist[1])} + else: + outputobj[curdev] = {"used":int(infolist[2]), "total":int(infolist[1])} + + return outputobj + +def argonsysinfo_kbstr(kbval, wholenumbers = True): + remainder = 0 + suffixidx = 0 + suffixlist = ["KB", "MB", "GB", "TB"] + while kbval > 1023 and suffixidx < len(suffixlist): + remainder = kbval & 1023 + kbval = kbval >> 10 + suffixidx = suffixidx + 1 + + #return str(kbval)+"."+str(remainder) + suffixlist[suffixidx] + remainderstr = "" + if kbval < 100 and wholenumbers == False: + remainder = int((remainder+50)/100) + if remainder > 0: + remainderstr = "."+str(remainder) + elif remainder >= 500: + kbval = kbval + 1 + return str(kbval)+remainderstr + suffixlist[suffixidx] + +def argonsysinfo_listraid(): + hddlist = [] + outputlist = [] + # cat /proc/mdstat + # multiple mdxx from mdstat + # mdadm -D /dev/md1 + + ramtotal = 0 + errorflag = False + try: + hddctr = 0 + tempfp = open("/proc/mdstat", "r") + alllines = tempfp.readlines() + for temp in alllines: + temp = temp.replace('\t', ' ') + temp = temp.strip() + while temp.find(" ") >= 0: + temp = temp.replace(" ", " ") + infolist = temp.split(" ") + if len(infolist) >= 4: + + # Check if raid info + if infolist[0] != "Personalities" and infolist[1] == ":": + devname = infolist[0] + raidtype = infolist[3] + #raidstatus = infolist[2] + hddctr = 4 + while hddctr < len(infolist): + tmpdevname = infolist[hddctr] + tmpidx = tmpdevname.find("[") + if tmpidx >= 0: + tmpdevname = tmpdevname[0:tmpidx] + hddlist.append(tmpdevname) + hddctr = hddctr + 1 + devdetail = argonsysinfo_getraiddetail(devname) + outputlist.append({"title": devname, "value": raidtype, "info": devdetail}) + + tempfp.close() + except IOError: + # No raid + errorflag = True + + return {"raidlist": outputlist, "hddlist": hddlist} + + +def argonsysinfo_getraiddetail(devname): + state = "" + raidtype = "" + size = 0 + used = 0 + total = 0 + working = 0 + active = 0 + failed = 0 + spare = 0 + rebuildstat = "" + tmp = os.popen('mdadm -D /dev/'+devname).read() + alllines = tmp.split("\n") + + for temp in alllines: + temp = temp.replace('\t', ' ') + temp = temp.strip() + while temp.find(" ") >= 0: + temp = temp.replace(" ", " ") + infolist = temp.split(" : ") + if len(infolist) == 2: + if infolist[0].lower() == "raid level": + raidtype = infolist[1] + elif infolist[0].lower() == "array size": + tmpidx = infolist[1].find(" ") + if tmpidx > 0: + size = (infolist[1][0:tmpidx]) + elif infolist[0].lower() == "used dev size": + tmpidx = infolist[1].find(" ") + if tmpidx > 0: + used = (infolist[1][0:tmpidx]) + elif infolist[0].lower() == "state": + tmpidx = infolist[1].rfind(" ") + if tmpidx > 0: + state = (infolist[1][tmpidx+1:]) + else: + state = infolist[1] + elif infolist[0].lower() == "total devices": + total = infolist[1] + elif infolist[0].lower() == "active devices": + active = infolist[1] + elif infolist[0].lower() == "working devices": + working = infolist[1] + elif infolist[0].lower() == "failed devices": + failed = infolist[1] + elif infolist[0].lower() == "spare devices": + spare = infolist[1] + elif infolist[0].lower() == "rebuild status": + tmpidx = infolist[1].find("%") + if tmpidx > 0: + rebuildstat = (infolist[1][0:tmpidx])+"%" + return {"state": state, "raidtype": raidtype, "size": int(size), "used": int(used), "devices": int(total), "active": int(active), "working": int(working), "failed": int(failed), "spare": int(spare), "rebuildstat": rebuildstat} \ No newline at end of file diff --git a/pythonscript/original_beta/ups/charge_0.png b/pythonscript/original_beta/ups/charge_0.png new file mode 100644 index 0000000..23a72a9 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_0.png differ diff --git a/pythonscript/original_beta/ups/charge_1.png b/pythonscript/original_beta/ups/charge_1.png new file mode 100644 index 0000000..f9a8827 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_1.png differ diff --git a/pythonscript/original_beta/ups/charge_10.png b/pythonscript/original_beta/ups/charge_10.png new file mode 100644 index 0000000..1bfdd1c Binary files /dev/null and b/pythonscript/original_beta/ups/charge_10.png differ diff --git a/pythonscript/original_beta/ups/charge_100.png b/pythonscript/original_beta/ups/charge_100.png new file mode 100644 index 0000000..13f8e7b Binary files /dev/null and b/pythonscript/original_beta/ups/charge_100.png differ diff --git a/pythonscript/original_beta/ups/charge_11.png b/pythonscript/original_beta/ups/charge_11.png new file mode 100644 index 0000000..1a77eea Binary files /dev/null and b/pythonscript/original_beta/ups/charge_11.png differ diff --git a/pythonscript/original_beta/ups/charge_12.png b/pythonscript/original_beta/ups/charge_12.png new file mode 100644 index 0000000..154d28f Binary files /dev/null and b/pythonscript/original_beta/ups/charge_12.png differ diff --git a/pythonscript/original_beta/ups/charge_13.png b/pythonscript/original_beta/ups/charge_13.png new file mode 100644 index 0000000..ad7efcc Binary files /dev/null and b/pythonscript/original_beta/ups/charge_13.png differ diff --git a/pythonscript/original_beta/ups/charge_14.png b/pythonscript/original_beta/ups/charge_14.png new file mode 100644 index 0000000..adbcad5 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_14.png differ diff --git a/pythonscript/original_beta/ups/charge_15.png b/pythonscript/original_beta/ups/charge_15.png new file mode 100644 index 0000000..edcad92 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_15.png differ diff --git a/pythonscript/original_beta/ups/charge_16.png b/pythonscript/original_beta/ups/charge_16.png new file mode 100644 index 0000000..689b9e0 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_16.png differ diff --git a/pythonscript/original_beta/ups/charge_17.png b/pythonscript/original_beta/ups/charge_17.png new file mode 100644 index 0000000..42cb749 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_17.png differ diff --git a/pythonscript/original_beta/ups/charge_18.png b/pythonscript/original_beta/ups/charge_18.png new file mode 100644 index 0000000..7a34bc2 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_18.png differ diff --git a/pythonscript/original_beta/ups/charge_19.png b/pythonscript/original_beta/ups/charge_19.png new file mode 100644 index 0000000..fc16475 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_19.png differ diff --git a/pythonscript/original_beta/ups/charge_2.png b/pythonscript/original_beta/ups/charge_2.png new file mode 100644 index 0000000..0f7b6d8 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_2.png differ diff --git a/pythonscript/original_beta/ups/charge_20.png b/pythonscript/original_beta/ups/charge_20.png new file mode 100644 index 0000000..6b2be49 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_20.png differ diff --git a/pythonscript/original_beta/ups/charge_21.png b/pythonscript/original_beta/ups/charge_21.png new file mode 100644 index 0000000..fcb4b7d Binary files /dev/null and b/pythonscript/original_beta/ups/charge_21.png differ diff --git a/pythonscript/original_beta/ups/charge_22.png b/pythonscript/original_beta/ups/charge_22.png new file mode 100644 index 0000000..d82869d Binary files /dev/null and b/pythonscript/original_beta/ups/charge_22.png differ diff --git a/pythonscript/original_beta/ups/charge_23.png b/pythonscript/original_beta/ups/charge_23.png new file mode 100644 index 0000000..d4f1759 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_23.png differ diff --git a/pythonscript/original_beta/ups/charge_24.png b/pythonscript/original_beta/ups/charge_24.png new file mode 100644 index 0000000..a7c6edc Binary files /dev/null and b/pythonscript/original_beta/ups/charge_24.png differ diff --git a/pythonscript/original_beta/ups/charge_25.png b/pythonscript/original_beta/ups/charge_25.png new file mode 100644 index 0000000..25306fe Binary files /dev/null and b/pythonscript/original_beta/ups/charge_25.png differ diff --git a/pythonscript/original_beta/ups/charge_26.png b/pythonscript/original_beta/ups/charge_26.png new file mode 100644 index 0000000..956ec9b Binary files /dev/null and b/pythonscript/original_beta/ups/charge_26.png differ diff --git a/pythonscript/original_beta/ups/charge_27.png b/pythonscript/original_beta/ups/charge_27.png new file mode 100644 index 0000000..f248199 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_27.png differ diff --git a/pythonscript/original_beta/ups/charge_28.png b/pythonscript/original_beta/ups/charge_28.png new file mode 100644 index 0000000..ac42a41 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_28.png differ diff --git a/pythonscript/original_beta/ups/charge_29.png b/pythonscript/original_beta/ups/charge_29.png new file mode 100644 index 0000000..c334547 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_29.png differ diff --git a/pythonscript/original_beta/ups/charge_3.png b/pythonscript/original_beta/ups/charge_3.png new file mode 100644 index 0000000..700783a Binary files /dev/null and b/pythonscript/original_beta/ups/charge_3.png differ diff --git a/pythonscript/original_beta/ups/charge_30.png b/pythonscript/original_beta/ups/charge_30.png new file mode 100644 index 0000000..fcc7c31 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_30.png differ diff --git a/pythonscript/original_beta/ups/charge_31.png b/pythonscript/original_beta/ups/charge_31.png new file mode 100644 index 0000000..696292d Binary files /dev/null and b/pythonscript/original_beta/ups/charge_31.png differ diff --git a/pythonscript/original_beta/ups/charge_32.png b/pythonscript/original_beta/ups/charge_32.png new file mode 100644 index 0000000..2a38059 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_32.png differ diff --git a/pythonscript/original_beta/ups/charge_33.png b/pythonscript/original_beta/ups/charge_33.png new file mode 100644 index 0000000..be993d3 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_33.png differ diff --git a/pythonscript/original_beta/ups/charge_34.png b/pythonscript/original_beta/ups/charge_34.png new file mode 100644 index 0000000..5156b38 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_34.png differ diff --git a/pythonscript/original_beta/ups/charge_35.png b/pythonscript/original_beta/ups/charge_35.png new file mode 100644 index 0000000..eab498c Binary files /dev/null and b/pythonscript/original_beta/ups/charge_35.png differ diff --git a/pythonscript/original_beta/ups/charge_36.png b/pythonscript/original_beta/ups/charge_36.png new file mode 100644 index 0000000..b8b5bc3 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_36.png differ diff --git a/pythonscript/original_beta/ups/charge_37.png b/pythonscript/original_beta/ups/charge_37.png new file mode 100644 index 0000000..0358b8a Binary files /dev/null and b/pythonscript/original_beta/ups/charge_37.png differ diff --git a/pythonscript/original_beta/ups/charge_38.png b/pythonscript/original_beta/ups/charge_38.png new file mode 100644 index 0000000..b24e946 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_38.png differ diff --git a/pythonscript/original_beta/ups/charge_39.png b/pythonscript/original_beta/ups/charge_39.png new file mode 100644 index 0000000..01ba4f5 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_39.png differ diff --git a/pythonscript/original_beta/ups/charge_4.png b/pythonscript/original_beta/ups/charge_4.png new file mode 100644 index 0000000..7b6d1c7 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_4.png differ diff --git a/pythonscript/original_beta/ups/charge_40.png b/pythonscript/original_beta/ups/charge_40.png new file mode 100644 index 0000000..bc0762b Binary files /dev/null and b/pythonscript/original_beta/ups/charge_40.png differ diff --git a/pythonscript/original_beta/ups/charge_41.png b/pythonscript/original_beta/ups/charge_41.png new file mode 100644 index 0000000..c94d76e Binary files /dev/null and b/pythonscript/original_beta/ups/charge_41.png differ diff --git a/pythonscript/original_beta/ups/charge_42.png b/pythonscript/original_beta/ups/charge_42.png new file mode 100644 index 0000000..7e54c8f Binary files /dev/null and b/pythonscript/original_beta/ups/charge_42.png differ diff --git a/pythonscript/original_beta/ups/charge_43.png b/pythonscript/original_beta/ups/charge_43.png new file mode 100644 index 0000000..e0cd9b3 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_43.png differ diff --git a/pythonscript/original_beta/ups/charge_44.png b/pythonscript/original_beta/ups/charge_44.png new file mode 100644 index 0000000..0379bf2 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_44.png differ diff --git a/pythonscript/original_beta/ups/charge_45.png b/pythonscript/original_beta/ups/charge_45.png new file mode 100644 index 0000000..dba5182 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_45.png differ diff --git a/pythonscript/original_beta/ups/charge_46.png b/pythonscript/original_beta/ups/charge_46.png new file mode 100644 index 0000000..1bb422c Binary files /dev/null and b/pythonscript/original_beta/ups/charge_46.png differ diff --git a/pythonscript/original_beta/ups/charge_47.png b/pythonscript/original_beta/ups/charge_47.png new file mode 100644 index 0000000..b9549bc Binary files /dev/null and b/pythonscript/original_beta/ups/charge_47.png differ diff --git a/pythonscript/original_beta/ups/charge_48.png b/pythonscript/original_beta/ups/charge_48.png new file mode 100644 index 0000000..d6ca870 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_48.png differ diff --git a/pythonscript/original_beta/ups/charge_49.png b/pythonscript/original_beta/ups/charge_49.png new file mode 100644 index 0000000..ba13975 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_49.png differ diff --git a/pythonscript/original_beta/ups/charge_5.png b/pythonscript/original_beta/ups/charge_5.png new file mode 100644 index 0000000..67a7337 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_5.png differ diff --git a/pythonscript/original_beta/ups/charge_50.png b/pythonscript/original_beta/ups/charge_50.png new file mode 100644 index 0000000..5763b85 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_50.png differ diff --git a/pythonscript/original_beta/ups/charge_51.png b/pythonscript/original_beta/ups/charge_51.png new file mode 100644 index 0000000..9216df2 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_51.png differ diff --git a/pythonscript/original_beta/ups/charge_52.png b/pythonscript/original_beta/ups/charge_52.png new file mode 100644 index 0000000..f18c40b Binary files /dev/null and b/pythonscript/original_beta/ups/charge_52.png differ diff --git a/pythonscript/original_beta/ups/charge_53.png b/pythonscript/original_beta/ups/charge_53.png new file mode 100644 index 0000000..d063dad Binary files /dev/null and b/pythonscript/original_beta/ups/charge_53.png differ diff --git a/pythonscript/original_beta/ups/charge_54.png b/pythonscript/original_beta/ups/charge_54.png new file mode 100644 index 0000000..9565378 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_54.png differ diff --git a/pythonscript/original_beta/ups/charge_55.png b/pythonscript/original_beta/ups/charge_55.png new file mode 100644 index 0000000..b38760e Binary files /dev/null and b/pythonscript/original_beta/ups/charge_55.png differ diff --git a/pythonscript/original_beta/ups/charge_56.png b/pythonscript/original_beta/ups/charge_56.png new file mode 100644 index 0000000..375db21 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_56.png differ diff --git a/pythonscript/original_beta/ups/charge_57.png b/pythonscript/original_beta/ups/charge_57.png new file mode 100644 index 0000000..768103c Binary files /dev/null and b/pythonscript/original_beta/ups/charge_57.png differ diff --git a/pythonscript/original_beta/ups/charge_58.png b/pythonscript/original_beta/ups/charge_58.png new file mode 100644 index 0000000..413c040 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_58.png differ diff --git a/pythonscript/original_beta/ups/charge_59.png b/pythonscript/original_beta/ups/charge_59.png new file mode 100644 index 0000000..176c8e5 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_59.png differ diff --git a/pythonscript/original_beta/ups/charge_6.png b/pythonscript/original_beta/ups/charge_6.png new file mode 100644 index 0000000..d3a4c1f Binary files /dev/null and b/pythonscript/original_beta/ups/charge_6.png differ diff --git a/pythonscript/original_beta/ups/charge_60.png b/pythonscript/original_beta/ups/charge_60.png new file mode 100644 index 0000000..ec4e5c2 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_60.png differ diff --git a/pythonscript/original_beta/ups/charge_61.png b/pythonscript/original_beta/ups/charge_61.png new file mode 100644 index 0000000..5b37ad7 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_61.png differ diff --git a/pythonscript/original_beta/ups/charge_62.png b/pythonscript/original_beta/ups/charge_62.png new file mode 100644 index 0000000..fe3f525 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_62.png differ diff --git a/pythonscript/original_beta/ups/charge_63.png b/pythonscript/original_beta/ups/charge_63.png new file mode 100644 index 0000000..979c57b Binary files /dev/null and b/pythonscript/original_beta/ups/charge_63.png differ diff --git a/pythonscript/original_beta/ups/charge_64.png b/pythonscript/original_beta/ups/charge_64.png new file mode 100644 index 0000000..4338286 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_64.png differ diff --git a/pythonscript/original_beta/ups/charge_65.png b/pythonscript/original_beta/ups/charge_65.png new file mode 100644 index 0000000..3b46b51 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_65.png differ diff --git a/pythonscript/original_beta/ups/charge_66.png b/pythonscript/original_beta/ups/charge_66.png new file mode 100644 index 0000000..7349984 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_66.png differ diff --git a/pythonscript/original_beta/ups/charge_67.png b/pythonscript/original_beta/ups/charge_67.png new file mode 100644 index 0000000..7ec7d82 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_67.png differ diff --git a/pythonscript/original_beta/ups/charge_68.png b/pythonscript/original_beta/ups/charge_68.png new file mode 100644 index 0000000..c9537ac Binary files /dev/null and b/pythonscript/original_beta/ups/charge_68.png differ diff --git a/pythonscript/original_beta/ups/charge_69.png b/pythonscript/original_beta/ups/charge_69.png new file mode 100644 index 0000000..8ef5fda Binary files /dev/null and b/pythonscript/original_beta/ups/charge_69.png differ diff --git a/pythonscript/original_beta/ups/charge_7.png b/pythonscript/original_beta/ups/charge_7.png new file mode 100644 index 0000000..74f291e Binary files /dev/null and b/pythonscript/original_beta/ups/charge_7.png differ diff --git a/pythonscript/original_beta/ups/charge_70.png b/pythonscript/original_beta/ups/charge_70.png new file mode 100644 index 0000000..c0a37ed Binary files /dev/null and b/pythonscript/original_beta/ups/charge_70.png differ diff --git a/pythonscript/original_beta/ups/charge_71.png b/pythonscript/original_beta/ups/charge_71.png new file mode 100644 index 0000000..ec81919 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_71.png differ diff --git a/pythonscript/original_beta/ups/charge_72.png b/pythonscript/original_beta/ups/charge_72.png new file mode 100644 index 0000000..ef15dc3 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_72.png differ diff --git a/pythonscript/original_beta/ups/charge_73.png b/pythonscript/original_beta/ups/charge_73.png new file mode 100644 index 0000000..ed8ce78 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_73.png differ diff --git a/pythonscript/original_beta/ups/charge_74.png b/pythonscript/original_beta/ups/charge_74.png new file mode 100644 index 0000000..8158b78 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_74.png differ diff --git a/pythonscript/original_beta/ups/charge_75.png b/pythonscript/original_beta/ups/charge_75.png new file mode 100644 index 0000000..52bfa33 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_75.png differ diff --git a/pythonscript/original_beta/ups/charge_76.png b/pythonscript/original_beta/ups/charge_76.png new file mode 100644 index 0000000..5936d04 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_76.png differ diff --git a/pythonscript/original_beta/ups/charge_77.png b/pythonscript/original_beta/ups/charge_77.png new file mode 100644 index 0000000..c1bddac Binary files /dev/null and b/pythonscript/original_beta/ups/charge_77.png differ diff --git a/pythonscript/original_beta/ups/charge_78.png b/pythonscript/original_beta/ups/charge_78.png new file mode 100644 index 0000000..cc7a791 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_78.png differ diff --git a/pythonscript/original_beta/ups/charge_79.png b/pythonscript/original_beta/ups/charge_79.png new file mode 100644 index 0000000..bddca01 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_79.png differ diff --git a/pythonscript/original_beta/ups/charge_8.png b/pythonscript/original_beta/ups/charge_8.png new file mode 100644 index 0000000..cdcea70 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_8.png differ diff --git a/pythonscript/original_beta/ups/charge_80.png b/pythonscript/original_beta/ups/charge_80.png new file mode 100644 index 0000000..0ae3eab Binary files /dev/null and b/pythonscript/original_beta/ups/charge_80.png differ diff --git a/pythonscript/original_beta/ups/charge_81.png b/pythonscript/original_beta/ups/charge_81.png new file mode 100644 index 0000000..373c905 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_81.png differ diff --git a/pythonscript/original_beta/ups/charge_82.png b/pythonscript/original_beta/ups/charge_82.png new file mode 100644 index 0000000..523b7c3 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_82.png differ diff --git a/pythonscript/original_beta/ups/charge_83.png b/pythonscript/original_beta/ups/charge_83.png new file mode 100644 index 0000000..d082067 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_83.png differ diff --git a/pythonscript/original_beta/ups/charge_84.png b/pythonscript/original_beta/ups/charge_84.png new file mode 100644 index 0000000..ac590a1 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_84.png differ diff --git a/pythonscript/original_beta/ups/charge_85.png b/pythonscript/original_beta/ups/charge_85.png new file mode 100644 index 0000000..da3ec15 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_85.png differ diff --git a/pythonscript/original_beta/ups/charge_86.png b/pythonscript/original_beta/ups/charge_86.png new file mode 100644 index 0000000..a188d2d Binary files /dev/null and b/pythonscript/original_beta/ups/charge_86.png differ diff --git a/pythonscript/original_beta/ups/charge_87.png b/pythonscript/original_beta/ups/charge_87.png new file mode 100644 index 0000000..ca0a478 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_87.png differ diff --git a/pythonscript/original_beta/ups/charge_88.png b/pythonscript/original_beta/ups/charge_88.png new file mode 100644 index 0000000..2065265 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_88.png differ diff --git a/pythonscript/original_beta/ups/charge_89.png b/pythonscript/original_beta/ups/charge_89.png new file mode 100644 index 0000000..a63ed06 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_89.png differ diff --git a/pythonscript/original_beta/ups/charge_9.png b/pythonscript/original_beta/ups/charge_9.png new file mode 100644 index 0000000..1f8b895 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_9.png differ diff --git a/pythonscript/original_beta/ups/charge_90.png b/pythonscript/original_beta/ups/charge_90.png new file mode 100644 index 0000000..082c4b7 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_90.png differ diff --git a/pythonscript/original_beta/ups/charge_91.png b/pythonscript/original_beta/ups/charge_91.png new file mode 100644 index 0000000..8b30deb Binary files /dev/null and b/pythonscript/original_beta/ups/charge_91.png differ diff --git a/pythonscript/original_beta/ups/charge_92.png b/pythonscript/original_beta/ups/charge_92.png new file mode 100644 index 0000000..dbae546 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_92.png differ diff --git a/pythonscript/original_beta/ups/charge_93.png b/pythonscript/original_beta/ups/charge_93.png new file mode 100644 index 0000000..34c9ecc Binary files /dev/null and b/pythonscript/original_beta/ups/charge_93.png differ diff --git a/pythonscript/original_beta/ups/charge_94.png b/pythonscript/original_beta/ups/charge_94.png new file mode 100644 index 0000000..1995846 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_94.png differ diff --git a/pythonscript/original_beta/ups/charge_95.png b/pythonscript/original_beta/ups/charge_95.png new file mode 100644 index 0000000..1b8e1c2 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_95.png differ diff --git a/pythonscript/original_beta/ups/charge_96.png b/pythonscript/original_beta/ups/charge_96.png new file mode 100644 index 0000000..97504da Binary files /dev/null and b/pythonscript/original_beta/ups/charge_96.png differ diff --git a/pythonscript/original_beta/ups/charge_97.png b/pythonscript/original_beta/ups/charge_97.png new file mode 100644 index 0000000..25b2176 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_97.png differ diff --git a/pythonscript/original_beta/ups/charge_98.png b/pythonscript/original_beta/ups/charge_98.png new file mode 100644 index 0000000..12cf1c9 Binary files /dev/null and b/pythonscript/original_beta/ups/charge_98.png differ diff --git a/pythonscript/original_beta/ups/charge_99.png b/pythonscript/original_beta/ups/charge_99.png new file mode 100644 index 0000000..657554a Binary files /dev/null and b/pythonscript/original_beta/ups/charge_99.png differ diff --git a/pythonscript/original_beta/ups/discharge_0.png b/pythonscript/original_beta/ups/discharge_0.png new file mode 100644 index 0000000..a30674c Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_0.png differ diff --git a/pythonscript/original_beta/ups/discharge_1.png b/pythonscript/original_beta/ups/discharge_1.png new file mode 100644 index 0000000..35f3f7a Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_1.png differ diff --git a/pythonscript/original_beta/ups/discharge_10.png b/pythonscript/original_beta/ups/discharge_10.png new file mode 100644 index 0000000..16448a5 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_10.png differ diff --git a/pythonscript/original_beta/ups/discharge_100.png b/pythonscript/original_beta/ups/discharge_100.png new file mode 100644 index 0000000..9496526 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_100.png differ diff --git a/pythonscript/original_beta/ups/discharge_11.png b/pythonscript/original_beta/ups/discharge_11.png new file mode 100644 index 0000000..8d84831 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_11.png differ diff --git a/pythonscript/original_beta/ups/discharge_12.png b/pythonscript/original_beta/ups/discharge_12.png new file mode 100644 index 0000000..8a51bbe Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_12.png differ diff --git a/pythonscript/original_beta/ups/discharge_13.png b/pythonscript/original_beta/ups/discharge_13.png new file mode 100644 index 0000000..d284ef9 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_13.png differ diff --git a/pythonscript/original_beta/ups/discharge_14.png b/pythonscript/original_beta/ups/discharge_14.png new file mode 100644 index 0000000..66f405f Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_14.png differ diff --git a/pythonscript/original_beta/ups/discharge_15.png b/pythonscript/original_beta/ups/discharge_15.png new file mode 100644 index 0000000..2a76ac8 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_15.png differ diff --git a/pythonscript/original_beta/ups/discharge_16.png b/pythonscript/original_beta/ups/discharge_16.png new file mode 100644 index 0000000..9ebea3c Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_16.png differ diff --git a/pythonscript/original_beta/ups/discharge_17.png b/pythonscript/original_beta/ups/discharge_17.png new file mode 100644 index 0000000..ac66a03 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_17.png differ diff --git a/pythonscript/original_beta/ups/discharge_18.png b/pythonscript/original_beta/ups/discharge_18.png new file mode 100644 index 0000000..d28a73d Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_18.png differ diff --git a/pythonscript/original_beta/ups/discharge_19.png b/pythonscript/original_beta/ups/discharge_19.png new file mode 100644 index 0000000..7764268 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_19.png differ diff --git a/pythonscript/original_beta/ups/discharge_2.png b/pythonscript/original_beta/ups/discharge_2.png new file mode 100644 index 0000000..e6812e3 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_2.png differ diff --git a/pythonscript/original_beta/ups/discharge_20.png b/pythonscript/original_beta/ups/discharge_20.png new file mode 100644 index 0000000..70b9823 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_20.png differ diff --git a/pythonscript/original_beta/ups/discharge_21.png b/pythonscript/original_beta/ups/discharge_21.png new file mode 100644 index 0000000..ae1e310 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_21.png differ diff --git a/pythonscript/original_beta/ups/discharge_22.png b/pythonscript/original_beta/ups/discharge_22.png new file mode 100644 index 0000000..12909cd Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_22.png differ diff --git a/pythonscript/original_beta/ups/discharge_23.png b/pythonscript/original_beta/ups/discharge_23.png new file mode 100644 index 0000000..7f1b416 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_23.png differ diff --git a/pythonscript/original_beta/ups/discharge_24.png b/pythonscript/original_beta/ups/discharge_24.png new file mode 100644 index 0000000..e2c1436 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_24.png differ diff --git a/pythonscript/original_beta/ups/discharge_25.png b/pythonscript/original_beta/ups/discharge_25.png new file mode 100644 index 0000000..3557203 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_25.png differ diff --git a/pythonscript/original_beta/ups/discharge_26.png b/pythonscript/original_beta/ups/discharge_26.png new file mode 100644 index 0000000..3a599c1 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_26.png differ diff --git a/pythonscript/original_beta/ups/discharge_27.png b/pythonscript/original_beta/ups/discharge_27.png new file mode 100644 index 0000000..7ac6725 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_27.png differ diff --git a/pythonscript/original_beta/ups/discharge_28.png b/pythonscript/original_beta/ups/discharge_28.png new file mode 100644 index 0000000..56096ed Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_28.png differ diff --git a/pythonscript/original_beta/ups/discharge_29.png b/pythonscript/original_beta/ups/discharge_29.png new file mode 100644 index 0000000..c277aa7 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_29.png differ diff --git a/pythonscript/original_beta/ups/discharge_3.png b/pythonscript/original_beta/ups/discharge_3.png new file mode 100644 index 0000000..647deea Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_3.png differ diff --git a/pythonscript/original_beta/ups/discharge_30.png b/pythonscript/original_beta/ups/discharge_30.png new file mode 100644 index 0000000..4af715b Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_30.png differ diff --git a/pythonscript/original_beta/ups/discharge_31.png b/pythonscript/original_beta/ups/discharge_31.png new file mode 100644 index 0000000..f115ac6 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_31.png differ diff --git a/pythonscript/original_beta/ups/discharge_32.png b/pythonscript/original_beta/ups/discharge_32.png new file mode 100644 index 0000000..190e30d Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_32.png differ diff --git a/pythonscript/original_beta/ups/discharge_33.png b/pythonscript/original_beta/ups/discharge_33.png new file mode 100644 index 0000000..f4ef185 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_33.png differ diff --git a/pythonscript/original_beta/ups/discharge_34.png b/pythonscript/original_beta/ups/discharge_34.png new file mode 100644 index 0000000..e407b27 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_34.png differ diff --git a/pythonscript/original_beta/ups/discharge_35.png b/pythonscript/original_beta/ups/discharge_35.png new file mode 100644 index 0000000..6448ac5 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_35.png differ diff --git a/pythonscript/original_beta/ups/discharge_36.png b/pythonscript/original_beta/ups/discharge_36.png new file mode 100644 index 0000000..4c2931e Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_36.png differ diff --git a/pythonscript/original_beta/ups/discharge_37.png b/pythonscript/original_beta/ups/discharge_37.png new file mode 100644 index 0000000..0de290c Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_37.png differ diff --git a/pythonscript/original_beta/ups/discharge_38.png b/pythonscript/original_beta/ups/discharge_38.png new file mode 100644 index 0000000..a571a77 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_38.png differ diff --git a/pythonscript/original_beta/ups/discharge_39.png b/pythonscript/original_beta/ups/discharge_39.png new file mode 100644 index 0000000..d47f6f1 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_39.png differ diff --git a/pythonscript/original_beta/ups/discharge_4.png b/pythonscript/original_beta/ups/discharge_4.png new file mode 100644 index 0000000..7a61781 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_4.png differ diff --git a/pythonscript/original_beta/ups/discharge_40.png b/pythonscript/original_beta/ups/discharge_40.png new file mode 100644 index 0000000..a01fc76 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_40.png differ diff --git a/pythonscript/original_beta/ups/discharge_41.png b/pythonscript/original_beta/ups/discharge_41.png new file mode 100644 index 0000000..fa80f42 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_41.png differ diff --git a/pythonscript/original_beta/ups/discharge_42.png b/pythonscript/original_beta/ups/discharge_42.png new file mode 100644 index 0000000..28b49ef Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_42.png differ diff --git a/pythonscript/original_beta/ups/discharge_43.png b/pythonscript/original_beta/ups/discharge_43.png new file mode 100644 index 0000000..842e248 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_43.png differ diff --git a/pythonscript/original_beta/ups/discharge_44.png b/pythonscript/original_beta/ups/discharge_44.png new file mode 100644 index 0000000..fb540c8 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_44.png differ diff --git a/pythonscript/original_beta/ups/discharge_45.png b/pythonscript/original_beta/ups/discharge_45.png new file mode 100644 index 0000000..898269e Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_45.png differ diff --git a/pythonscript/original_beta/ups/discharge_46.png b/pythonscript/original_beta/ups/discharge_46.png new file mode 100644 index 0000000..1fe7ce3 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_46.png differ diff --git a/pythonscript/original_beta/ups/discharge_47.png b/pythonscript/original_beta/ups/discharge_47.png new file mode 100644 index 0000000..2c5221c Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_47.png differ diff --git a/pythonscript/original_beta/ups/discharge_48.png b/pythonscript/original_beta/ups/discharge_48.png new file mode 100644 index 0000000..c628308 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_48.png differ diff --git a/pythonscript/original_beta/ups/discharge_49.png b/pythonscript/original_beta/ups/discharge_49.png new file mode 100644 index 0000000..054c91f Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_49.png differ diff --git a/pythonscript/original_beta/ups/discharge_5.png b/pythonscript/original_beta/ups/discharge_5.png new file mode 100644 index 0000000..27a7ea9 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_5.png differ diff --git a/pythonscript/original_beta/ups/discharge_50.png b/pythonscript/original_beta/ups/discharge_50.png new file mode 100644 index 0000000..2b9c6f8 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_50.png differ diff --git a/pythonscript/original_beta/ups/discharge_51.png b/pythonscript/original_beta/ups/discharge_51.png new file mode 100644 index 0000000..bc9a530 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_51.png differ diff --git a/pythonscript/original_beta/ups/discharge_52.png b/pythonscript/original_beta/ups/discharge_52.png new file mode 100644 index 0000000..fa05a5b Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_52.png differ diff --git a/pythonscript/original_beta/ups/discharge_53.png b/pythonscript/original_beta/ups/discharge_53.png new file mode 100644 index 0000000..0592bd4 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_53.png differ diff --git a/pythonscript/original_beta/ups/discharge_54.png b/pythonscript/original_beta/ups/discharge_54.png new file mode 100644 index 0000000..03a70b7 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_54.png differ diff --git a/pythonscript/original_beta/ups/discharge_55.png b/pythonscript/original_beta/ups/discharge_55.png new file mode 100644 index 0000000..a330038 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_55.png differ diff --git a/pythonscript/original_beta/ups/discharge_56.png b/pythonscript/original_beta/ups/discharge_56.png new file mode 100644 index 0000000..5fa95ee Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_56.png differ diff --git a/pythonscript/original_beta/ups/discharge_57.png b/pythonscript/original_beta/ups/discharge_57.png new file mode 100644 index 0000000..8e77a5f Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_57.png differ diff --git a/pythonscript/original_beta/ups/discharge_58.png b/pythonscript/original_beta/ups/discharge_58.png new file mode 100644 index 0000000..5bf2961 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_58.png differ diff --git a/pythonscript/original_beta/ups/discharge_59.png b/pythonscript/original_beta/ups/discharge_59.png new file mode 100644 index 0000000..f12df42 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_59.png differ diff --git a/pythonscript/original_beta/ups/discharge_6.png b/pythonscript/original_beta/ups/discharge_6.png new file mode 100644 index 0000000..cb0eeff Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_6.png differ diff --git a/pythonscript/original_beta/ups/discharge_60.png b/pythonscript/original_beta/ups/discharge_60.png new file mode 100644 index 0000000..7833f2d Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_60.png differ diff --git a/pythonscript/original_beta/ups/discharge_61.png b/pythonscript/original_beta/ups/discharge_61.png new file mode 100644 index 0000000..66e0381 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_61.png differ diff --git a/pythonscript/original_beta/ups/discharge_62.png b/pythonscript/original_beta/ups/discharge_62.png new file mode 100644 index 0000000..004695e Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_62.png differ diff --git a/pythonscript/original_beta/ups/discharge_63.png b/pythonscript/original_beta/ups/discharge_63.png new file mode 100644 index 0000000..9d8d02f Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_63.png differ diff --git a/pythonscript/original_beta/ups/discharge_64.png b/pythonscript/original_beta/ups/discharge_64.png new file mode 100644 index 0000000..fc688a1 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_64.png differ diff --git a/pythonscript/original_beta/ups/discharge_65.png b/pythonscript/original_beta/ups/discharge_65.png new file mode 100644 index 0000000..b9f5ff0 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_65.png differ diff --git a/pythonscript/original_beta/ups/discharge_66.png b/pythonscript/original_beta/ups/discharge_66.png new file mode 100644 index 0000000..7a59198 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_66.png differ diff --git a/pythonscript/original_beta/ups/discharge_67.png b/pythonscript/original_beta/ups/discharge_67.png new file mode 100644 index 0000000..25fbbe2 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_67.png differ diff --git a/pythonscript/original_beta/ups/discharge_68.png b/pythonscript/original_beta/ups/discharge_68.png new file mode 100644 index 0000000..acee426 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_68.png differ diff --git a/pythonscript/original_beta/ups/discharge_69.png b/pythonscript/original_beta/ups/discharge_69.png new file mode 100644 index 0000000..1b519b3 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_69.png differ diff --git a/pythonscript/original_beta/ups/discharge_7.png b/pythonscript/original_beta/ups/discharge_7.png new file mode 100644 index 0000000..286b310 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_7.png differ diff --git a/pythonscript/original_beta/ups/discharge_70.png b/pythonscript/original_beta/ups/discharge_70.png new file mode 100644 index 0000000..be480a7 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_70.png differ diff --git a/pythonscript/original_beta/ups/discharge_71.png b/pythonscript/original_beta/ups/discharge_71.png new file mode 100644 index 0000000..4fcc530 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_71.png differ diff --git a/pythonscript/original_beta/ups/discharge_72.png b/pythonscript/original_beta/ups/discharge_72.png new file mode 100644 index 0000000..ca8a765 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_72.png differ diff --git a/pythonscript/original_beta/ups/discharge_73.png b/pythonscript/original_beta/ups/discharge_73.png new file mode 100644 index 0000000..35ed1c6 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_73.png differ diff --git a/pythonscript/original_beta/ups/discharge_74.png b/pythonscript/original_beta/ups/discharge_74.png new file mode 100644 index 0000000..ace632d Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_74.png differ diff --git a/pythonscript/original_beta/ups/discharge_75.png b/pythonscript/original_beta/ups/discharge_75.png new file mode 100644 index 0000000..137dc80 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_75.png differ diff --git a/pythonscript/original_beta/ups/discharge_76.png b/pythonscript/original_beta/ups/discharge_76.png new file mode 100644 index 0000000..55b60df Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_76.png differ diff --git a/pythonscript/original_beta/ups/discharge_77.png b/pythonscript/original_beta/ups/discharge_77.png new file mode 100644 index 0000000..4b5a6cb Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_77.png differ diff --git a/pythonscript/original_beta/ups/discharge_78.png b/pythonscript/original_beta/ups/discharge_78.png new file mode 100644 index 0000000..a2b844a Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_78.png differ diff --git a/pythonscript/original_beta/ups/discharge_79.png b/pythonscript/original_beta/ups/discharge_79.png new file mode 100644 index 0000000..cc501e7 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_79.png differ diff --git a/pythonscript/original_beta/ups/discharge_8.png b/pythonscript/original_beta/ups/discharge_8.png new file mode 100644 index 0000000..1648101 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_8.png differ diff --git a/pythonscript/original_beta/ups/discharge_80.png b/pythonscript/original_beta/ups/discharge_80.png new file mode 100644 index 0000000..c456340 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_80.png differ diff --git a/pythonscript/original_beta/ups/discharge_81.png b/pythonscript/original_beta/ups/discharge_81.png new file mode 100644 index 0000000..5e957fe Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_81.png differ diff --git a/pythonscript/original_beta/ups/discharge_82.png b/pythonscript/original_beta/ups/discharge_82.png new file mode 100644 index 0000000..2bd31ef Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_82.png differ diff --git a/pythonscript/original_beta/ups/discharge_83.png b/pythonscript/original_beta/ups/discharge_83.png new file mode 100644 index 0000000..71bee1e Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_83.png differ diff --git a/pythonscript/original_beta/ups/discharge_84.png b/pythonscript/original_beta/ups/discharge_84.png new file mode 100644 index 0000000..6e36e1f Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_84.png differ diff --git a/pythonscript/original_beta/ups/discharge_85.png b/pythonscript/original_beta/ups/discharge_85.png new file mode 100644 index 0000000..2c2c014 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_85.png differ diff --git a/pythonscript/original_beta/ups/discharge_86.png b/pythonscript/original_beta/ups/discharge_86.png new file mode 100644 index 0000000..dc12d6d Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_86.png differ diff --git a/pythonscript/original_beta/ups/discharge_87.png b/pythonscript/original_beta/ups/discharge_87.png new file mode 100644 index 0000000..1895e9d Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_87.png differ diff --git a/pythonscript/original_beta/ups/discharge_88.png b/pythonscript/original_beta/ups/discharge_88.png new file mode 100644 index 0000000..0700c7f Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_88.png differ diff --git a/pythonscript/original_beta/ups/discharge_89.png b/pythonscript/original_beta/ups/discharge_89.png new file mode 100644 index 0000000..10ee6d3 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_89.png differ diff --git a/pythonscript/original_beta/ups/discharge_9.png b/pythonscript/original_beta/ups/discharge_9.png new file mode 100644 index 0000000..96692c1 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_9.png differ diff --git a/pythonscript/original_beta/ups/discharge_90.png b/pythonscript/original_beta/ups/discharge_90.png new file mode 100644 index 0000000..732bd28 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_90.png differ diff --git a/pythonscript/original_beta/ups/discharge_91.png b/pythonscript/original_beta/ups/discharge_91.png new file mode 100644 index 0000000..cab8194 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_91.png differ diff --git a/pythonscript/original_beta/ups/discharge_92.png b/pythonscript/original_beta/ups/discharge_92.png new file mode 100644 index 0000000..294a9c9 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_92.png differ diff --git a/pythonscript/original_beta/ups/discharge_93.png b/pythonscript/original_beta/ups/discharge_93.png new file mode 100644 index 0000000..3bcd7b7 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_93.png differ diff --git a/pythonscript/original_beta/ups/discharge_94.png b/pythonscript/original_beta/ups/discharge_94.png new file mode 100644 index 0000000..4de3af2 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_94.png differ diff --git a/pythonscript/original_beta/ups/discharge_95.png b/pythonscript/original_beta/ups/discharge_95.png new file mode 100644 index 0000000..959af91 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_95.png differ diff --git a/pythonscript/original_beta/ups/discharge_96.png b/pythonscript/original_beta/ups/discharge_96.png new file mode 100644 index 0000000..396d6e5 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_96.png differ diff --git a/pythonscript/original_beta/ups/discharge_97.png b/pythonscript/original_beta/ups/discharge_97.png new file mode 100644 index 0000000..9f9fe5c Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_97.png differ diff --git a/pythonscript/original_beta/ups/discharge_98.png b/pythonscript/original_beta/ups/discharge_98.png new file mode 100644 index 0000000..5107108 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_98.png differ diff --git a/pythonscript/original_beta/ups/discharge_99.png b/pythonscript/original_beta/ups/discharge_99.png new file mode 100644 index 0000000..a0d4bd3 Binary files /dev/null and b/pythonscript/original_beta/ups/discharge_99.png differ diff --git a/pythonscript/original_beta/ups/loading_0.png b/pythonscript/original_beta/ups/loading_0.png new file mode 100644 index 0000000..2b82e29 Binary files /dev/null and b/pythonscript/original_beta/ups/loading_0.png differ