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 d269f96..886a3d2 100644 Binary files a/requirements.txt and b/requirements.txt differ diff --git a/run_client.sh b/run_client.sh new file mode 100644 index 0000000..63ac977 --- /dev/null +++ b/run_client.sh @@ -0,0 +1,6 @@ +#!/home/pi/AIO/VE/bin/python3 + +sleep 15 # gpio not inited right after boot? + +cd /home/pi/AIO/ +python3 client.py diff --git a/run_server.sh b/run_server.sh new file mode 100644 index 0000000..fa9ecf2 --- /dev/null +++ b/run_server.sh @@ -0,0 +1,7 @@ +#!/home/pi/AIO/VE/bin/python3 + + +sleep 15 # gpio not inited right after boot? + +cd /home/pi/AIO/ +python3 server.py