jeffbass / imagehub Goto Github PK
View Code? Open in Web Editor NEWReceive and save images from multiple Raspberry Pi's
License: MIT License
Receive and save images from multiple Raspberry Pi's
License: MIT License
This following error occurs with Windows 10:
Traceback (most recent call last):
File "imagehub\imagehub\imagehub.py", line 41, in main
with Patience(hub.patience):
File "C:\Stephens_Folder\Programming\Home_Monitor\imagehub\imagehub\tools\utils.py", line 63, in __enter__
signal.signal(signal.SIGALRM, self.raise_timeout)
AttributeError: module 'signal' has no attribute 'SIGALRM'
2020-08-05 08:31:47,888 ~ Exiting imagehub.py
A work-around (not a fix) for this error can be made to utils.py
. Add the following line of code to the import section of utils.py.
from sys import platform
Next, replace the __enter__
and __exit__
functions of class Patience
section with the following:
def __enter__(self):
if platform != "win32":
signal.signal(signal.SIGALRM, self.raise_timeout)
signal.alarm(self.seconds)
else:
pass
def __exit__(self, *args):
if platform != "win32":
signal.alarm(0) # disable alarm
else:
pass
Note: This will allow you to run imagehub.py
on a Windows platform, but it will not function as a normal, and may result in some unusual behavior of the imagehub
.
For an overview of the yin-yang-ranch distributed computer vision pipeline design, see this repo. The essence of the design is that multiple imagenodes
send images and event messages to each imagehub
. The imagehub
uses Python logging to save the imagenode
event messages since it is easy to use and allows easy rotation of log files. In the current version of imagehub
, the RotatingFileHandler
file handler is used, which means that the log files are named like this at each rotation:
current (today) imagehub.log
previous log imagehub.log.1
previous log imagehub.log.2
previous log imagehub.log.3
As my development of the librarian
code progresses, the current naming convention for the event log files presents 2 problems:
librarian
uses rsync for backups of imagehub
data, since it is very good at efficiently backing up only what changes. But with the current RotatingFileHandler
, all the log files are backed up every time because every existing log file is renumbered at each rotation.To address these problems, I am changing the imagehub
logging to use the TimedRotatingFileHandler
. This is what the log files will look like after the change:
current (today) imagehub.log
previous log imagehub.log.2020-10-22
previous log imagehub.log.2020-10-21
previous log imagehub.log.2020-10-20
It solves both of the above problems, and, frankly, it should have been done that way from the start. For anyone currently using imagehub
and using a program that reads the event log files, this change will require that those programs be modified.
The actual code change is simple and only involves changing 2 lines in the logging section of imagehub.py
. Here is the existing code:
handler = logging.handlers.RotatingFileHandler(hub.logfile,
maxBytes=99000, backupCount=995)
which becomes:
handler = logging.handlers.TimedRotatingFileHandler(hub.logfile,
when='midnight', backupCount=995)
My existing librarian
code has been changed and I'll be testing it for a few more weeks. The new imagehub code will be merged into the master branch when the librarian
testing is done. This issue is a heads up to anyone currently using imagehub
that the change is coming. Feel free to comment.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.