From 2d62aa55ffd4030db90279589a24deac64124ab5 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Wed, 30 Jun 2021 13:40:16 +0200 Subject: [PATCH] switched db to mysql. Now working as intended --- clock/hardware/unicorn.py | 8 ++++---- launch.sh | 5 ----- persistence/models.py | 2 +- persistence/p_out.py | 7 +++---- requirements.txt | Bin 1006 -> 1026 bytes run_client.sh | 6 ++++++ run_server.sh | 7 +++++++ 7 files changed, 21 insertions(+), 14 deletions(-) delete mode 100644 launch.sh create mode 100644 run_client.sh create mode 100644 run_server.sh diff --git a/clock/hardware/unicorn.py b/clock/hardware/unicorn.py index 8a6d34b..5b6728d 100644 --- a/clock/hardware/unicorn.py +++ b/clock/hardware/unicorn.py @@ -71,7 +71,7 @@ class ClockOut: def put(self, matrices): """Sets a height x width matrix directly""" self.reset_clock() - matrix = np.concatenate((matrices[0], matrices[1]), axis=0) # or 1?? + matrix = np.concatenate((matrices[0], matrices[1]), axis=1) # or 1?? self.show(matrix) @@ -85,11 +85,11 @@ class ClockOut: """Output the contents of the buffer to Unicorn HAT HD.""" ########################################################## ## Change to desire - buff2 = numpy.rot90(matrix[:self.HEIGHT,:16],3) - buff1 = numpy.rot90(matrix[:self.HEIGHT,16:32],1) + buff2 = np.rot90(matrix[:self.HEIGHT,:16],3) + buff1 = np.rot90(matrix[:self.HEIGHT,16:32],1) ########################################################## # separated these are: 16x16x3 arrays - buff1, buff2 = [(x.reshape(768)).astype(numpy.uint8).tolist() for x in (buff1, buff2)] + buff1, buff2 = [(x.reshape(768)).astype(np.uint8).tolist() for x in (buff1, buff2)] self.spi_write(buff1, buff2) diff --git a/launch.sh b/launch.sh deleted file mode 100644 index 635b0b5..0000000 --- a/launch.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -sleep 30 -cd /home/pi/AIO -sudo python3 launcher.py diff --git a/persistence/models.py b/persistence/models.py index ba9c9cb..b01b50f 100644 --- a/persistence/models.py +++ b/persistence/models.py @@ -8,7 +8,7 @@ from . import keys dbk = keys.db_keys -db = PostgresqlDatabase(dbk["name"], user=dbk["username"], password=dbk["password"], host=dbk["url"], port=dbk["port"], autorollback=True) +db = MySQLDatabase(dbk["name"], user=dbk["username"], password=dbk["password"], host=dbk["url"], port=dbk["port"], autorollback=True) diff --git a/persistence/p_out.py b/persistence/p_out.py index 8680dbd..6bcf64f 100644 --- a/persistence/p_out.py +++ b/persistence/p_out.py @@ -11,11 +11,10 @@ class DBLogging: self.errors = models.ErrorMetric self.lists = models.List - # self.create_tables() + self.create_tables() - # def create_tables(self): - # with self.db as db: - # db.create_tables([self.sensors, self.chats, self.errors, self.lists]) + def create_tables(self): + self.db.create_tables([self.sensors, self.chats, self.errors, self.lists]) diff --git a/requirements.txt b/requirements.txt index d269f9630f9e2d520f80d4b2106b0f16bfd29c18..886a3d2eb36d17822e29d87f4df4c0b912dd64f5 100644 GIT binary patch delta 74 zcmaFI-o&xNgh{rDA)lcHh?5vf8PXVRfzX&ikHL_^97q~Zj%8Ao4q&Kc@CD*vhCl`% SunI$