switched db to mysql. Now working as intended

This commit is contained in:
Remy Moll 2021-06-30 13:40:16 +02:00
parent 21599019fd
commit 2d62aa55ff
7 changed files with 21 additions and 14 deletions

View File

@ -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)

View File

@ -1,5 +0,0 @@
#!/bin/bash
sleep 30
cd /home/pi/AIO
sudo python3 launcher.py

View File

@ -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)

View File

@ -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])

Binary file not shown.

6
run_client.sh Normal file
View File

@ -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

7
run_server.sh Normal file
View File

@ -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