texadactyl / rpi_clock

Raspberry Pi Clock & Weather display
GNU General Public License v3.0
13 stars 8 forks source link

SyntaxError: invalid syntax #13

Closed tehmessiah75 closed 1 year ago

tehmessiah75 commented 1 year ago

Describe the bug

File "/home/ben/rpi_clock/bin/rpi_clock.py", line 9
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax
texadactyl commented 1 year ago

<!DOCTYPE html> does not appear anywhere in that file. Did you clobber the rpi_clock.py with an HTML file?

tehmessiah75 commented 1 year ago

I signed in via SSH to try and download the files that you updated in the hope it would fix the issue. When I connected via SSH I received the above error message.

<!DOCTYPE html> does not appear anywhere in that file. Did you clobber the rpi_clock.py with an HTML file? Let me check

texadactyl commented 1 year ago

I only updated one file: rpi_clock_parameters.py

tehmessiah75 commented 1 year ago

looks like I messed that one up, sorry. I tried to download the files using wget.

I just did the following:

mv ~/rpi_clock ~/rpi_clock.bak
git clone https://github.com/texadactyl/rpi_clock
cp rpi_clock.bak/bin/rpi_clock.cfg $HOME/rpi_clock/bin/rpi_clock.cfg
Append $HOME/.profile with:

    (cd $HOME/rpi_clock/bin; python3 rpi_clock.py rpi_clock.cfg 2>&1 > $HOME/rpi_clock.log) &

and it still doesn't load at login.

Is it because I used XFCE instead of the default desktop PIXEL desktop?

I also tried to make a desktop shortcut to start the python script however that failed miserably too

tehmessiah75 commented 1 year ago

If I connect a mouse and keyboard my bash script to run your script works.

#!/bin/sh
# clock.sh
# 2 Dec 2022 Bash script to run tft clock and weather which is displayed on the 3.5" tft screen

(python3 /home/ben/rpi_clock/bin/rpi_clock.py /home/ben/rpi_clock/bin/rpi_clock.cfg 2>&1 > /home/ben/rpi_clock.log ) &
texadactyl commented 1 year ago

"Is it because I used XFCE instead of the default desktop PIXEL desktop?" Yes.

I would start over. Rebuild with a Raspberry PI OS with full desktop. See if your hardware can support the 64-bit variant (recommended if so). Figure out how to auto-login to your user ID or use "pi".

Nighty-night.

texadactyl commented 1 year ago

@tehmessiah75 Closing this issue because the problem as stated has been identified and remediated.