Skip to content

universalvishwa/raspberrypi-home-connect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Raspberry pi Home Connect

Overview

  • Describes how to setup a Github Action workflow to manage a Raspberry Pi (or other Linux Home server).
  • In this scenario we are considering the Port forwarding feature available in your Home Router.
  • The objective is to directly interact with Raspberry Pi from Github Actions.
    • However more secure and feature rich methods exist by using 3rd party services. e.g. remote.it
  • The Home router needs to be setup with Port forwarding to connect with Home server's SSH port (Default: 22) and private IP address.
    • Source port: Something not port 22
    • Destination port: 22
  • NOTE: The workflow uses SSH keys instead of Passwords to connect to the Raspberry pi.
    • Generate an SSH key pair in the Raspberry Pi and add the id_rsa.pub to ~/.ssh/authorized_keys.
    • Use the id_rsa file for SSH_PRIVATE_KEY Github secret.

Github Secrets

  • HOST: Home router's public NAT IP. i.e. The result of "What's my IP'.
  • USERNAME: Raspberry pi user
  • PORT: Forwarding Port (Source port) setup at the Home router.
  • SSH_PRIVATE_KEY: Private key of authorized SSH key.

Misc: Setting Raspberry Pi Power saving mode OFF

  • Raspberry Pi may lose the WiFi connection after a period of inactivity if the Power saving mode is turned ON.
  • Check Power saving mode status,
    $ sudo iw dev wlan0 get power_save
    >>
    power_save: on
  • Disable power saving mode,
    $ sudo iw dev wlan0 set power_save off
  • Link: Does Your Raspberry Pi 3 Lose WiFi Connections After a While

References

About

Workflow to connect to Raspberry Pi in Home network

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published