roamingthings / spyglass

A simple mjpeg server for Picamera2
GNU General Public License v3.0
57 stars 12 forks source link

Issue with Spyglass starting #28

Closed robertmarks closed 1 year ago

robertmarks commented 1 year ago

I followed the instructions to install Spyglass as a service but when trying to start it I get the following

spyglass.service - spyglass - Picamera2 MJPG Streamer
   Loaded: loaded (/etc/systemd/system/spyglass.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Wed 2023-02-15 22:40:49 GMT; 2s ago
     Docs: https://github.com/roamingthings/spyglass
  Process: 9073 ExecStart=/usr/local/bin/spyglass (code=exited, status=1/FAILURE)
 Main PID: 9073 (code=exited, status=1/FAILURE)

Looking at journalctl I can see:

Feb 15 22:03:20 mainsailos systemd[1]: Started spyglass - Picamera2 MJPG Streamer.
Feb 15 22:03:20 mainsailos crowsnest[927]: Version Control: rtsp-simple-server new version available: v0.20.2 (v0.19.1).
Feb 15 22:03:20 mainsailos spyglass[920]: Python 2.7.16
Feb 15 22:03:20 mainsailos spyglass[920]: INFO: Configuration file found in /home/pi/printer_data/config/spyglass.conf
Feb 15 22:03:20 mainsailos spyglass[920]: INFO: Print Configfile: '/home/pi/printer_data/config/spyglass.conf'
Feb 15 22:03:20 mainsailos spyglass[920]:                 NO_PROXY="true"
Feb 15 22:03:20 mainsailos spyglass[920]:                 HTTP_PORT="8080"
Feb 15 22:03:20 mainsailos spyglass[920]:                 RESOLUTION="640x480"
Feb 15 22:03:20 mainsailos spyglass[920]:                 FPS="15"
Feb 15 22:03:20 mainsailos spyglass[920]:                 STREAM_URL="/stream"
Feb 15 22:03:20 mainsailos spyglass[920]:                 SNAPSHOT_URL="/snapshot"
Feb 15 22:03:20 mainsailos spyglass[920]:                 AUTO_FOCUS="continuous"
Feb 15 22:03:20 mainsailos spyglass[920]:                 FOCAL_DIST="0.0"
Feb 15 22:03:20 mainsailos spyglass[920]:                 AF_SPEED="normal"
Feb 15 22:03:20 mainsailos spyglass[920]: Traceback (most recent call last):
Feb 15 22:03:20 mainsailos spyglass[920]:   File "/home/pi/spyglass/run.py", line 3, in <module>
Feb 15 22:03:20 mainsailos spyglass[920]:     from spyglass.cli import main
Feb 15 22:03:20 mainsailos spyglass[920]:   File "/home/pi/spyglass/spyglass/cli.py", line 121
Feb 15 22:03:20 mainsailos spyglass[920]: SyntaxError: Non-ASCII character '\xc2' in file /home/pi/spyglass/spyglass/cli.py on line 121, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
Feb 15 22:03:20 mainsailos systemd[1]: spyglass.service: Main process exited, code=exited, status=1/FAILURE
Feb 15 22:03:20 mainsailos systemd[1]: spyglass.service: Failed with result 'exit-code'.

OS info

cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
robertmarks commented 1 year ago

Just realised it's trying to use python 2 - not 3 Will look into that and reopen if I'm still unable to get it running

mryel00 commented 1 year ago

This problem could still persist as the error states that it can't parse a symbol on line 121. It's most likely due to the degree symbol °. If python 3 doesn't solve the issue try to add # -*- coding: utf-8 -*- at the top of /home/pi/spyglass/spyglass/cli.py. Please report back if it's working with python 3 and if it doesn't try to add the line.