switched db to mysql. Now working as intended
This commit is contained in:
		| @@ -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) | ||||
|  | ||||
|   | ||||
| @@ -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) | ||||
|  | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -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]) | ||||
|  | ||||
|  | ||||
|  | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								requirements.txt
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								requirements.txt
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										6
									
								
								run_client.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								run_client.sh
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										7
									
								
								run_server.sh
									
									
									
									
									
										Normal 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 | ||||
		Reference in New Issue
	
	Block a user
	 Remy Moll
					Remy Moll