static/log.txt
Opened this issue · 4 comments
I installed SiriGarage and have verified that the relay and the sensor (1) for door 1 are working.
I am having some difficulty saving new Settings, and when I run the program I get the following…
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2091, in call
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2076, in wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/home/pi/SiriGarage/siriweb.py", line 122, in index
logfile = open("static/log.txt","a")
FileNotFoundError: [Errno 2] No such file or directory: 'static/log.txt'
There is a file “log.txt” in a folder “static” in SiriGarage. I’m running it from the /home/pi location (though I get the same error if I install it in /root. I haven't mucked around in flask yet, but that’s where I’m headed.
the first thing i would try would be to change line 122 that says logfile = open("static/log.txt","a")....change the path listed to the full path, you may need to change similar lines too, like 128 and 404.
Change to:
logfile = open("/home/pi/SiriGarage/static/log.txt","a")
let me know if that fixes your problem.
Sounds like its another issue locating the file to save the configuration file. Line 286 says:
ConfigFile = open("config.py", "w")
Change that to include the file location:
ConfigFile = open("/home/pi/SiriGarage/static/config.py", "w")
If this doesn't work, you can always open the config.py file with the nano app and change your settings there.
sudo nano config.py
(Also make sure you are running the program using the "sudo" command.)