Skip to content

Running The Software

Victor Linfield edited this page Apr 6, 2019 · 10 revisions

Before Running Topsides

Make sure ethernet is up by running:

$ sudo ifup enp2s0

Note that ifdown will bring down ethernet so wifi can be used.

Running

Just run the start and start camera shortcuts or run the scripts directly by using:

$ cd eer/2019
$ ./start
$ ./camera

If these scripts can't be executed run the following to give them permission to do so:

$ cd eer/2019
$ chmod +x start camera

You can also run things manually by following the instructions below.

Topsides

Run the server with:

$ cd eer/2019/topsides
$ sudo python3 main.py

You can access the webpage at localhost:80 in Google Chrome.

The IP address for the topsides laptop is currently 192.168.88.2

Raspberry pi

To run the raspberry pi communications first ssh into the raspberry pi:

$ ssh pi@192.168.88.5

Then run the communications with:

$ cd rapspi
$ python3 raspiComms.py

The IP address for the raspberry pi is currently 192.168.88.5

Cameras

On topsides run the following two commands in separate terminals:

$ gst-launch-1.0 udpsrc port=5002 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink
$ gst-launch-1.0 udpsrc port=5003 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink

For the two raspberry pis run the following in two more terminals:

$ ssh pi@192.168.88.4 
$ raspivid -t 0 -vf -hf -n -h 720 -w 1280 -fps 60 -b 3000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse config-interval=1 ! rtph264pay ! tee name=t \
t. ! queue ! udpsink host=192.168.88.2 port=5002 \
t. ! queue ! udpsink host=192.168.88.2 port=5004
$ ssh pi@192.168.88.5 
$ raspivid -t 0 -n -h 720 -w 1280 -fps 60 -b 3000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse config-interval=1 ! rtph264pay ! udpsink host=192.168.88.2 port=5003

Testing

When running the topsides server or Raspberry Pi communications:

Use the --dev flag to run the program with localhost as the IP addresses.

Keeping the software up to date

To update topsides just pull down the latest software from the master branch with:

$ git pull

To update the code on the raspberry pi you should send the updated files from topsides using scp:

scp FILE pi@192.168.88.5:DIR/FILE

FILE should be replaced with the file you want to upload to the raspberry pi and DIR should be replaced with the directory on the pi.