User Tools

Site Tools


raspberrypi

This is an old revision of the document!


RaspberryPi

Install Raspbian using img file

On a Mac, use Etcher and point it at the downloaded image file, or …

  • Format the SD card using SDCardFormatter
  • Check where the SD card is mounted
0@@

We see here it is mounted on /Volumes/UNTITLED 4

  • Unmount the SD card using Disk Utility or
1@@
  • Copy the image file to the SD card
2@@

Backup your Raspberry Pi SD card to an image file

After the OS is installed, up to date, upgraded and just how you want it, keep a copy to save time if it crashes<br /> First find out the name of the Pi's disk

3@@

Do the copy

4@@

For the geeks, kill -29 makes dd report its status to stderr<br />

Enable remote SSH access

Either:

  • mount the sd card on another computer and create an empty file named 'ssh' on the boot filesystem, or
5@@

How to install a Raspberry Pi SMS Server

Send text messages via a 3G GSM modem from your applications

Use Pushbullet - no cost option

Autoboot the wlan0 wireless lan interface on Raspberry Pi

6@@

or, for later versions…

7@@
8@@

or on later versions of Raspbian, with the card in your computer, place a file named wpa_supplicant.conf on the boot filesystem containing the WiFi network and it's password and you are done!

9@@

and put this info in it (adjust as necessary)

10@@

This file then gets copied at boot time to <tt>/etc/wpa_supplicant/wpa_supplicant.conf</tt><br /> or, if using RetroPie…<br /> With the SD card in your computer, place a file named wifikeyfile.txt on the boot filesystem containing the WiFi network and it's password and you are done!

11@@

Mount an NFS share

  • Ready made tutorial here

Assign a fixed IP address (to the wireless adapter in the case)

Get the current IP address and other info

12@@

We're interested in these bits:

13@@

Get the router/gateway address

14@@

We're interested in these bits:

15@@

Now using the above data, edit /etc/network/interfaces and add the following lines to the wlan0 section (also changing the iface line to “static”)

16@@

It should end up looking something like this:

17@@

Restart the networking daemon

(or reboot the Pi)

18@@

Install an OpenVPN server

All operations as root<br />

Get the Pi up-to-date

19@@

Install the packages

20@@

and optionally this to be able to reach the server from the internet using names instead of numbers

21@@

and maybe other useful stuff

22@@

Generate a copy of the easy-rsa structure

23@@

Modify the easy-rsa location

24@@
25@@

Generate certificate authority files

26@@

This creates 4 files in the keys subdirectory…

27@@

Generate the server key files

just hit ENTER for the password but sign and commit the certificate when asked

28@@

keys subdirectory now looks like this

29@@

Generate the client keys

just hit ENTER for the password but sign and commit the certificate when asked

30@@

keys subdirectory now looks like this

31@@

Generate the Diffie-Hellman file

32@@

This gives us one extra file

33@@

Build a server config file

Copy from the examples directory…

34@@

… or

35@@

and paste this snippet:

36@@

Enable IP forwarding

37@@

Allow IP forwarding across reboots

38@@

Activate the changes with

39@@

Generate and export an OpenVPN client config file

Use Tunnelblick (on a Mac) to generate a template client configuration file or copy/paste and modify this:<br /> If you use Viscosity, this is not necessary. You just need to fill in the blanks on its connection panel…<br /> In either case you need to know where you stored the files (ca.crt, home_client1.crt and home_client1.key) generated earlier.

40@@

Check IP address and interface name

41@@

Alter routing table to allow traffic to the server

Copy/paste this snippet: assuming wired interface and the ip address of our Pi is 192.168.1.100<br /> Some info on iptables might come in handy at this point. See references below…<br />

42@@
43@@

then edit /etc/network/interfaces and add the following line just after “iface eth0 inet static”

44@@

Start the server

45@@

Server is running, setup client.<br />

  • Gotcha that caught me out several times…<br />

If you change any of the iptables rules, you need to stop/start the OpenVPN server for it to take note of the new settings!

46@@

ddclient sample configuration file

Put this in /etc/ddclient.conf and modify it to taste<br /> I use dnsdynamic. If you don't, you'll need to change more than is indicated below

47@@

iptables

  • man iptables!

list open ports

48@@

see if firewall is allowing access

49@@

list FILTER rules

50@@

list NAT rules

51@@

list all rules in selected chain

52@@

show all rules in a form to use for input

53@@

bring in those rules previously saved (does not overwrite the table - just adds these rules)

54@@

show local routing table

55@@

Install both Flightradar24 and FlightAware feeders on a headless Raspberry Pi (Stretch)

Feed flight data up to flight services.<br /> We can install both fr24feed and piaware and have them feeding at the same time.<br /> At the time of writing, the Pi 3b+ is out but FlightAware does not have an image that works on it yet. So we will install its package manually.

Steps

Install Raspbian

  • Very well documented already (I like Etcher though for burning the images)

Prepare for initial boot

Before installing the microsd card in the Pi

  • Enable the ssh server
56@@
  • Assign static (wired) IP address for initial boot
57@@

Append this to the end of the line already there (modifying for your local network)…

58@@

Initial boot

Put the microsd card in the Pi, plug in an ethernet cable and power it up. Give it 20 seconds and login using the IP address above.

  • Login as pi/raspberry and change the password and hostname if required
59@@
  • Assign static IP address in correct place

On Stretch, /etc/network/interfaces is no longer used

60@@

Remove the IP address added to <tt>/boot/cmdline.txt</tt>

61@@
  • Install useful stuff
62@@
  • Turn IPV6 off
63@@

Install the feeder packages

64@@

The web server of choice of both of these tools is lighttpd (good choice in my opinion) and it will be installed by whichever package is run first.<br /> In order to get the local skyview website up on <tt>http://<pi address>>8080</tt>, piaware should be installed first.

At this point, PiAware is installed, dump1090-fa is installed and lighttpd is installed. Now the DVB-T dongle needs to be connected otherwise the dump1090 software won't startup successfully.<br /> If this is a reinstall of the software, you will have lost your feeder identification and you will be uploading as a guest user.<br /> Get your feeder id from your login page on FlightAware. eg. flightaware.com/adsb/stats/user/rockingh0rse Put your feeder id back into PiAware's config file with this

65@@
  • Reboot to initialise everything.
  • Log back in as root ( as pi, then <tt>sudo su - </tt>) and check the status of the components with
66@@

or

67@@

If all is running ok, install FlightRadar24. This will detect that lighttpd and a version of dump1090 are already installed and will not overwrite them.

If you want to look at the script, download it using

68@@

If choosing to use MLAT, this is a good website to find your lat/long coordinates<br /> You will need these when the <tt>fr24feed –signup</tt> program runs (last part of the setup). It will also ask for a sharing key. This can be found in the Welcome mail Flightradar24 sent you! Check the status of the components with

69@@

or

70@@

All done? Check out the aircraft you're capturing. Start a browser and go to port 8080 on the Raspberry Pi for snazzy PiAware stats

71@@

or port 8754 for less snazzy but equally informative stats for FlightRadar24

72@@

Next step? Maybe interrogate the ACARS message system on board?

References

raspberrypi.1544273361.txt.gz · Last modified: 2018/12/08 12:49 by 0.0.0.0

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki