Raspberry-Pi-based Observatory Controller project.
View the Project on GitHub gszasz/rpi-observatory-controller
Note that Raspbian does not have NetworkManager installed to setup your network. You need to setup network manually in old-school Debian way.
For testing and compilation purposes it can be useful to temporarily connect Raspberry Pi box to local wi-fi network.
Convince yourself that the interface wlan0
is defined.
$ sudo nano /etc/network/interfaces
The file should contain following lines:
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Fire up the wlan0
interface
$ sudo ifup wlan0
Define new connection to wpa_supplicant.conf
.
$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Add following lines (replace SSID
and passphrase
with actual SSID and
passphrase for your network).
network={
ssid="SSID"
psk="passphrase"
key_mgmt=WPA-PSK
}
Reconfigure wpa_supplicant
.
$ sudo wpa_cli reconfigure
Check if the wlan0
interface received an IP address.
$ ifconfig
wlan0 Link encap:Ethernet HWaddr b8:27:eb:d3:65:d2
inet addr:10.200.136.38 Bcast:10.200.139.255 Mask:255.255.252.0
inet6 addr: fe80::d877:a0ac:9f28:ac15/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3114 errors:0 dropped:200 overruns:0 frame:0
TX packets:3577 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:324640 (317.0 KiB) TX bytes:587899 (574.1 KiB)
Note that wireless connection should be used only for testing and development.
Since observatory controller should be connected to LAN via wired connection, it is good idea to disable wireless interface and permanently unload wireless adapter kernel modules.
Disable wireless interface.
$ sudo ifdown wlan0
Remove wlan0
interface from the network configuration.
$ sudo nano /etc/network/interfaces
Comment out following lines:
# allow-hotplug wlan0
# iface wlan0 inet manual
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Then we can permanently turn off the wireless adapter:
$ sudo nano /boot/config.txt
Add following line to the file:
dtoverlay=pi3-disable-wifi
Reboot Raspberry Pi
$ sudo reboot
If your router is assigning your Raspberry Pi a stable IP based on MAC address, setup of your Ethernet interface is rather simple.
Disable ethernet interface.
$ ifdown eth0
Configure eth0
interface to use DHCP.
$ sudo nano /etc/network/interfaces
Modify lines related to eth0
to the following.
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
Enable ethernet interface.
$ sudo ifup eth0
Disable ethernet interface.
$ ifdown eth0
Configure static interface parameters
$ sudo nano /etc/network/interfaces
Modify lines related to eth0
to the following. Note that actual IP
addresses depends on your network.
auto eth0
iface eth0 inet dhcp
address 192.168.1.108
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 12.34.56.78 12.34.56.79
Enable ethernet interface.
$ sudo ifup eth0
Home > Installation > Getting Online