Raspberry-Pi-based Observatory Controller project.
View the Project on GitHub gszasz/rpi-observatory-controller
If your internal network at the observatory is already secured, it should be
safe to set sudo without password for user pi
.
Run visudo
command:
$ sudo visudo
Add NOPASSWD:
to the %sudo
group.
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) NOPASSWD:ALL
Press Ctrl-X
, then y
and ENTER
to confirm.
Raspbian comes with raspi-config
tool for quick setup.
$ sudo raspi-config
Now we will go through the individual menu entries
Default password for the user pi
is raspberry
. Since it is the same for all
Raspberry Pi devices, it is unsafe to keep it unchanged.
Set whatever hostname you would prefer for your observatory controller. I set
observatory-controller
.
I set just the following two boot options.
Boot Option | Value |
---|---|
B1 Desktop / CLI | Console |
B3 Splash Screen | Disable |
I set only following three options, while selecting en_US.UTF-8
as default
locale.
Localization Option | Value(s) |
---|---|
I1 Change Locale | en_GB.UTF-8, en_US.UTF-8, sk_SK.UTF-8 |
I2 Change Timezone | Bratislava |
I4 Change Wi-Fi Country | SK Slovakia |
I set single option required for SSH connectivity.
Interfacing Option | Value |
---|---|
P2 SSH | Yes |
I set following 5 options here.
Advanced Option | Value |
---|---|
A1 Expand Filesystem | Yes |
A2 Overscan | No |
A3 Memory Split | 16 |
A4 Audio | 1 Force 3.5mm jack |
A6 GL Driver | Legacy |
Now we should be already able to connect to Raspberry Pi via SSH from the other computer.
It very handy to map IP address of Raspberry Pi to actual hostname on your
computer. Open /etc/hosts
file:
[gszasz@iris ~]$ sudo nano /etc/hosts
And add following line (IP address depends on your network):
192.168.1.108 observatory-controler
If you’ve not done it yet, generate RSA private key with empty passphrase.
Just hit ENTER
three times after executing the command.
[gszasz@iris ~]$ ssh-keygen
Copy the key to the Raspberry Pi.
[gszasz@iris ~]$ ssh-copy-id pi@observatory-controller
Now you should be able to SSH into the Raspberry Pi without password.
[gszasz@iris ~]$ ssh pi@observatory-controller
pi@observatory-controller ~$
Now it is no longer necessary to have connected keyboard and screen directly to the device as long as it is connected to the network.
It is very unlikely that anybody would connect any bluetooth devices now. It is time to turn it off.
Power off bluetooth radio
$ sudo bluetoothctl
[bluetooth]# power off
[bluetooth]# quit
Permanently disable bluetooth interface.
$ sudo nano /boot/config.txt
Add following line to the file:
dtoverlay=pi3-disable-bt
Reboot Raspberry Pi
$ sudo reboot
Default swap space on Raspbian image is minimalistic. Now we have whole SD card to go, so now is the time to expand swap space to proper size.
Turn off swap
$ sudo dphys-swapfile swapoff
Configure swap size to 2x RAM Size.
$ sudo nano /etc/dphys-swapfile
Convince yourself that CONF_SWAPSIZE
is commented out and uncomment
CONF_SWAPFACTOR=2
line
# set size to absolute value, leaving empty (default) then uses
# computed value you most likely don't want this, unless you
# have an special disk situation
#CONF_SWAPSIZE=512
# set size to computed value, this times RAM size, dynamically
# adapts, guarantees that there is enough swap without wasting
# disk space on excess
CONF_SWAPFACTOR=2
# restrict size (computed and absolute!) to maximally this limit
# can be set to empty for no limit, but beware of filled
# partitions! this is/was a (outdated?) 32bit kernel limit (in
# MBytes), do not overrun it but is also sensible on 64bit to
# prevent filling /var or even / partition
#CONF_MAXSWAP=2048
Reload the configuration file.
$ sudo dphys-swapfile setup
Turn swap on again.
$ sudo dphys-swapfile swapon
Default locale settings are still not satisfying enough, at least not for an observatory located in Slovakia :).
Set global locales.
$ sudo nano /etc/default/locale
Make sure the file contains following lines:
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_TIME=en_GB.UTF-8
LC_PAPER=en_GB.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
LC_MONETARY=sk_SK.UTF-8
LC_COLLATE=C
Set US keyboard
$ sudo localectl set-keymap us set-x11-keymap us
Verify if locales are all set properly.
$ localectl
System Locale: LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_TIME=en_GB.UTF-8
LC_COLLATE=C
LC_MONETARY=sk_SK.UTF-8
LC_PAPER=en_GB.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
VC Keymap: us
X11 Layout: us
Note that Raspberry Pi has to be connected to the network. If it is not online, proceed with the Network Setup](network-setup.md) first.
$ sudo apt-get update -y
There are some essential packages that are generally useful for debugging and maintenance of the observatory controller.
$ sudo apt-get install -y wget tmux mc
I am maintaining a repository of useful scripts for Raspbian Jessie. It’s generally a good idea to install it.
$ mkdir -p ~/src && cd ~/src
$ git clone https://github.com/gszasz/rpi-scripts.git
$ cd rpi-scripts
$ sudo ./install.sh
Home > Installation > Initial System Setup