Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.
/ WeatherClockV2 Public archive

Same, but better. This time with a raspberry pi and Go

Notifications You must be signed in to change notification settings

jimnelson2/WeatherClockV2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WeatherClockV2

Same, but better. This time with a raspberry pi and Go

Dev notes

Build for the pi

env GOOS=linux GOARCH=arm GOARM=5 go build -o wc-pi ./cmd/weatherclock/weatherclock.go

Install on pi w

  • Create a file called wc.json (note, that file is in our .gitignore b/c of the token). It should have this content

    {
        "DARKSKY_TOKEN": "DARKSKY_TOKEN_GOES_HERE",
        "LATITUDE": 0.00000,
        "LONGITUDE": -0.00000,
        "DARKSKY_POLL_SEC": 120
    }
  • Copy files to the raspberry pi. Everything below assumes the pi w has ssh enabled already

  • move files on the pi w to their correct locations

    • ssh to the pi w

      ssh [email protected]

    • move the files (you'll need to be root to do this so...)

      # become root
      sudo -i
      
      # place the executables. yeah root is gonna run it all. should come back this later...
      mkdir /usr/weatherclock
      mv /home/pi/fcserver-rpi /usr/weatherclock/
      mv /home/pi/wc-pi /usr/weatherclock/
      chmod a+x /usr/weatherclock/*
      chown -R root:root /usr/weatherclock
      
      # place the configuration file
      mv /home/pi/wc.json /etc/default
      chown -R root:root /etc/default/wc.json
      
      # setup both of our executables to run as services
      mv /home/pi/fcserver.service /etc/systemd/system/
      mv /home/pi/weatherclock.service /etc/systemd/system/
      chown root:root /etc/systemd/system/fcserver.service
      chown root:root /etc/systemd/system/weatherclock.service
      
      # run the services at startup
      systemctl enable fcserver
      systemctl enable weatherclock
      systemctl start fcserver.service
      systemctl start weatherclock.service

About

Same, but better. This time with a raspberry pi and Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages