Added NTCNA install/setup
This commit is contained in:
21
NTCNA/README.txt
Normal file
21
NTCNA/README.txt
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
Raspberry Pi 3 (RPi) Setup
|
||||||
|
==========================
|
||||||
|
|
||||||
|
After writing the MicroSD card with the Raspbian image downloaded from the raspberrypi.org site,
|
||||||
|
put it into the MicroSD card slot on the RPi and power it up.
|
||||||
|
|
||||||
|
Open a console window, and run the following commands.
|
||||||
|
|
||||||
|
sudo apt-get update
|
||||||
|
sudo install git subversion
|
||||||
|
mkdir NTCNA
|
||||||
|
cd NTCNA
|
||||||
|
svn co https://www.probestar.com/NTCNA/CVehicle (password is temppwd)
|
||||||
|
cd NTCNA/CVehicle/trunk/platforms/bboneb
|
||||||
|
./rpi-setup.sh
|
||||||
|
|
||||||
|
Takes awhile till it is done. There is a lot of software to install.
|
||||||
|
Powercycle the BBB.
|
||||||
|
|
||||||
|
Adjust start_v2v.sh link as needed, re-run to run the right apps.
|
||||||
4
NTCNA/etc/can.conf
Normal file
4
NTCNA/etc/can.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[default]
|
||||||
|
interface = socketcan_native
|
||||||
|
channel = can0
|
||||||
|
|
||||||
59
NTCNA/etc/dhcpcd.conf
Normal file
59
NTCNA/etc/dhcpcd.conf
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
# A sample configuration for dhcpcd.
|
||||||
|
# See dhcpcd.conf(5) for details.
|
||||||
|
|
||||||
|
# Allow users of this group to interact with dhcpcd via the control socket.
|
||||||
|
#controlgroup wheel
|
||||||
|
|
||||||
|
# Inform the DHCP server of our hostname for DDNS.
|
||||||
|
hostname
|
||||||
|
|
||||||
|
# Use the hardware address of the interface for the Client ID.
|
||||||
|
clientid
|
||||||
|
# or
|
||||||
|
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
|
||||||
|
# Some non-RFC compliant DHCP servers do not reply with this set.
|
||||||
|
# In this case, comment out duid and enable clientid above.
|
||||||
|
#duid
|
||||||
|
|
||||||
|
# Persist interface configuration when dhcpcd exits.
|
||||||
|
persistent
|
||||||
|
|
||||||
|
# Rapid commit support.
|
||||||
|
# Safe to enable by default because it requires the equivalent option set
|
||||||
|
# on the server to actually work.
|
||||||
|
option rapid_commit
|
||||||
|
|
||||||
|
# A list of options to request from the DHCP server.
|
||||||
|
option domain_name_servers, domain_name, domain_search, host_name
|
||||||
|
option classless_static_routes
|
||||||
|
# Respect the network MTU. This is applied to DHCP routes.
|
||||||
|
option interface_mtu
|
||||||
|
|
||||||
|
# Most distributions have NTP support.
|
||||||
|
#option ntp_servers
|
||||||
|
|
||||||
|
# A ServerID is required by RFC2131.
|
||||||
|
require dhcp_server_identifier
|
||||||
|
|
||||||
|
# Generate SLAAC address using the Hardware Address of the interface
|
||||||
|
#slaac hwaddr
|
||||||
|
# OR generate Stable Private IPv6 Addresses based from the DUID
|
||||||
|
slaac private
|
||||||
|
|
||||||
|
# Example static IP configuration:
|
||||||
|
interface eth0
|
||||||
|
static ip_address=192.168.1.12/24
|
||||||
|
#static ip6_address=fd51:42f8:caae:d92e::ff/64
|
||||||
|
#static routers=192.168.2.1
|
||||||
|
#static domain_name_servers=192.168.2.1 8.8.8.8
|
||||||
|
|
||||||
|
# It is possible to fall back to a static IP if DHCP fails:
|
||||||
|
# define static profile
|
||||||
|
#profile static_eth0
|
||||||
|
#static ip_address=192.168.1.23/24
|
||||||
|
#static routers=192.168.1.1
|
||||||
|
#static domain_name_servers=192.168.1.1
|
||||||
|
|
||||||
|
# fallback to static profile on eth0
|
||||||
|
#interface eth0
|
||||||
|
#fallback static_eth0
|
||||||
19
NTCNA/etc/hosts
Normal file
19
NTCNA/etc/hosts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
127.0.0.1 localhost
|
||||||
|
127.0.1.1 raspberrypi pi raspberry
|
||||||
|
|
||||||
|
# vehicle network
|
||||||
|
192.168.2.1 router
|
||||||
|
192.168.2.2 wsu obe obu
|
||||||
|
192.168.2.10 mabx2
|
||||||
|
192.168.2.12 pi pi1
|
||||||
|
192.168.2.15 carpc
|
||||||
|
192.168.1.77 denso pod wsu-77
|
||||||
|
192.168.2.98 winpc
|
||||||
|
192.168.2.99 linpc
|
||||||
|
|
||||||
|
# The following lines are desirable for IPv6 capable hosts
|
||||||
|
::1 ip6-localhost ip6-loopback
|
||||||
|
fe00::0 ip6-localnet
|
||||||
|
ff00::0 ip6-mcastprefix
|
||||||
|
ff02::1 ip6-allnodes
|
||||||
|
ff02::2 ip6-allrouters
|
||||||
2
NTCNA/etc/ld.so.conf.d/cvehicle.conf
Normal file
2
NTCNA/etc/ld.so.conf.d/cvehicle.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# NTCNA CVehicle library
|
||||||
|
/usr/local/cvehicle/lib
|
||||||
2
NTCNA/etc/ld.so.conf.d/pstar.conf
Normal file
2
NTCNA/etc/ld.so.conf.d/pstar.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# other libs
|
||||||
|
/usr/local/pstar/lib
|
||||||
26
NTCNA/etc/rc.local
Normal file
26
NTCNA/etc/rc.local
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# rc.local
|
||||||
|
#
|
||||||
|
# This script is executed at the end of each multiuser runlevel.
|
||||||
|
# Make sure that the script will "exit 0" on success or any other
|
||||||
|
# value on error.
|
||||||
|
#
|
||||||
|
# In order to enable or disable this script just change the execution
|
||||||
|
# bits.
|
||||||
|
#
|
||||||
|
# By default this script does nothing.
|
||||||
|
|
||||||
|
# CAN
|
||||||
|
ip link set can0 type can bitrate 500000 listen-only on
|
||||||
|
ifconfig can0 up
|
||||||
|
|
||||||
|
# CVehicle
|
||||||
|
/usr/local/cvehicle/sbin/cvehicle-setup
|
||||||
|
#cd /home/debian/NTCNA/CVehicle/trunk/daemons/bsmpd
|
||||||
|
#bsmpd -c can0 -m bsmpbeat.xml -t 50 -w -
|
||||||
|
|
||||||
|
# PyVehicle (DVI)
|
||||||
|
#chmod +x /home/debian/NTCNA/PyVehicle/bin/*.sh
|
||||||
|
|
||||||
|
exit 0
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=GPS (Global Positioning System) Daemon
|
||||||
|
Requires=gpsd.socket
|
||||||
|
# Needed with chrony SOCK refclock
|
||||||
|
After=chronyd.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
EnvironmentFile=-/etc/default/gpsd
|
||||||
|
ExecStart=/usr/sbin/gpsd $GPSD_OPTIONS $DEVICES
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
Also=gpsd.socket
|
||||||
|
|
||||||
11
NTCNA/etc/systemd/system/sockets.target.wants/gpsd.socket
Normal file
11
NTCNA/etc/systemd/system/sockets.target.wants/gpsd.socket
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=GPS (Global Positioning System) Daemon Sockets
|
||||||
|
|
||||||
|
[Socket]
|
||||||
|
ListenStream=/var/run/gpsd.sock
|
||||||
|
ListenStream=[::1]:2947
|
||||||
|
ListenStream=0.0.0.0:2947
|
||||||
|
SocketMode=0600
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sockets.target
|
||||||
5
NTCNA/home/pi/.config/lxsession/LXDE-pi/autostart
Normal file
5
NTCNA/home/pi/.config/lxsession/LXDE-pi/autostart
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
@lxpanel --profile LXDE-pi
|
||||||
|
@pcmanfm --desktop --profile LXDE-pi
|
||||||
|
@xscreensaver -no-splash
|
||||||
|
@point-rpi
|
||||||
|
@/home/pi/start_v2x.sh
|
||||||
1
NTCNA/home/pi/.vnc/passwd
Normal file
1
NTCNA/home/pi/.vnc/passwd
Normal file
@ -0,0 +1 @@
|
|||||||
|
<EFBFBD><EFBFBD><EFBFBD>o<EFBFBD><EFBFBD>ѩ
|
||||||
21
NTCNA/lib/systemd/system/rc-local.service
Normal file
21
NTCNA/lib/systemd/system/rc-local.service
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# This file is part of systemd.
|
||||||
|
#
|
||||||
|
# systemd is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=/etc/rc.local Compatibility
|
||||||
|
ConditionPathExists=/etc/rc.local
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
ExecStart=/etc/rc.local start
|
||||||
|
TimeoutSec=0
|
||||||
|
StandardOutput=tty
|
||||||
|
RemainAfterExit=yes
|
||||||
|
SysVStartPriority=99
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
11
NTCNA/lib/systemd/system/x11vnc.service
Normal file
11
NTCNA/lib/systemd/system/x11vnc.service
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Start x11vnc at startup.
|
||||||
|
After=multi-user.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/vnc.passwd -rfbport 5900 -shared
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
102
NTCNA/rpi-setup.sh
Executable file
102
NTCNA/rpi-setup.sh
Executable file
@ -0,0 +1,102 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# copy config files
|
||||||
|
for i in etc lib usr home
|
||||||
|
do
|
||||||
|
sudo cp -r $i/* /$i/
|
||||||
|
done
|
||||||
|
|
||||||
|
# network
|
||||||
|
|
||||||
|
# Need rc.local to start CAN and BSMPd
|
||||||
|
#sudo systemctl enable rc-local.service
|
||||||
|
#sudo systemctl enable x11vnc.service
|
||||||
|
|
||||||
|
# update & clean
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get dist-upgrade
|
||||||
|
sudo apt-get install -y ntpdate subversion git cmake
|
||||||
|
sudo apt-get -y autoremove
|
||||||
|
sudo apt-get clean
|
||||||
|
|
||||||
|
# enable GUI
|
||||||
|
sudo systemctl set-default graphical.target
|
||||||
|
|
||||||
|
# time
|
||||||
|
sudo ntpdate pool.ntp.org
|
||||||
|
sudo hwclock -w
|
||||||
|
sudo apt-get update
|
||||||
|
|
||||||
|
# clone/pull
|
||||||
|
mkdir -p $HOME/ProbeStar
|
||||||
|
cd $HOME/ProbeStar
|
||||||
|
for i in git_tools linux_tools pi_tools Cnomicon Pynomicon
|
||||||
|
do
|
||||||
|
if [ -d $i ]; then
|
||||||
|
cd $i
|
||||||
|
git config credential.helper store
|
||||||
|
git pull --recurse-submodules
|
||||||
|
cd ..
|
||||||
|
else
|
||||||
|
git clone https://github.com/nprobert/$i --recurse-submodules
|
||||||
|
cd $i
|
||||||
|
git config credential.helper store
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
cd $HOME
|
||||||
|
for i in ProbeStar/*; do
|
||||||
|
ln -fs $i
|
||||||
|
done
|
||||||
|
mkdir bin
|
||||||
|
cp linux_tools/bin/* bin/
|
||||||
|
|
||||||
|
# checkouts
|
||||||
|
mkdir -p $HOME/NTCNA
|
||||||
|
cd $HOME/NTCNA
|
||||||
|
for i in CVehicle PyVehicle
|
||||||
|
do
|
||||||
|
if [ -d $i ]; then
|
||||||
|
cd $i
|
||||||
|
git config credential.helper store
|
||||||
|
git pull --recurse-submodules
|
||||||
|
cd ..
|
||||||
|
else
|
||||||
|
git clone https://github.com/nprobert/$i --recurse-submodules
|
||||||
|
cd $i
|
||||||
|
git config credential.helper store
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
cd $HOME
|
||||||
|
for i in NTCNA/*; do
|
||||||
|
ln -fs $i
|
||||||
|
done
|
||||||
|
|
||||||
|
# packages & builds
|
||||||
|
if [ -d $HOME/ProbeStar/Cnomicon ]; then
|
||||||
|
cd $HOME/Cnomicon/packages
|
||||||
|
sudo ./packages.sh
|
||||||
|
cd ..
|
||||||
|
./cbuild.sh
|
||||||
|
./cinstall.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d $HOME/NTCNA/CVehicle ]; then
|
||||||
|
cd $HOME/CVehicle/packages
|
||||||
|
sudo ./packages.sh
|
||||||
|
cd ..
|
||||||
|
./cbuild.sh
|
||||||
|
./cinstall.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
# python stuff
|
||||||
|
cd $HOME/NTCNA/Pynomicon/packages
|
||||||
|
sudo ./packages.sh
|
||||||
|
chmod +x $HOME/Pynomicon/bin/*.sh
|
||||||
|
cd $HOME/NTCNA/PyVehicle/packages
|
||||||
|
sudo ./packages.sh
|
||||||
|
chmod +x $HOME/PyVehicle/bin/*.sh
|
||||||
|
|
||||||
|
# cleanup
|
||||||
|
sudo raspi-config
|
||||||
19
NTCNA/rpi-update.sh
Executable file
19
NTCNA/rpi-update.sh
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# copy config files
|
||||||
|
sudo cp -r etc lib usr home /
|
||||||
|
|
||||||
|
# Need rc.local to start CAN and BSMPd
|
||||||
|
sudo systemctl enable rc-local.service
|
||||||
|
|
||||||
|
# update
|
||||||
|
sudo ntpdate pool.ntp.org
|
||||||
|
sudo hwclock -w
|
||||||
|
|
||||||
|
# checkouts
|
||||||
|
ntcna-update.sh
|
||||||
|
|
||||||
|
# rebuild
|
||||||
|
#cd $HOME/NTCNA/CVehicle
|
||||||
|
#./build.sh
|
||||||
|
#./install.sh
|
||||||
19
NTCNA/usr/local/bin/all-update.sh
Executable file
19
NTCNA/usr/local/bin/all-update.sh
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd $HOME
|
||||||
|
|
||||||
|
for i in ProbeStar NTCNA CAMP Gits
|
||||||
|
do
|
||||||
|
if [ -L "$i" ]; then
|
||||||
|
echo "$i: Symlinked"
|
||||||
|
echo "============="
|
||||||
|
elif [ -d "$i" ]; then
|
||||||
|
if [ "$i" == "ProbeStar" ]; then
|
||||||
|
$HOME/bin/pstar-update.sh
|
||||||
|
else
|
||||||
|
d=`echo "${i,,}"`
|
||||||
|
$HOME/bin/$d-update.sh
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
58
NTCNA/usr/local/bin/ntcna-update.sh
Executable file
58
NTCNA/usr/local/bin/ntcna-update.sh
Executable file
@ -0,0 +1,58 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function do_git {
|
||||||
|
echo $1 "(Git)"
|
||||||
|
cd $1
|
||||||
|
git ls-remote --get-url
|
||||||
|
git pull
|
||||||
|
cd ..
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
function do_merc {
|
||||||
|
echo $1 "(Mercurial)"
|
||||||
|
cd $1
|
||||||
|
hg pull -uv
|
||||||
|
cd ..
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
function do_svn {
|
||||||
|
echo $1 "(Subversion)"
|
||||||
|
cd $1
|
||||||
|
svn info --show-item url
|
||||||
|
svn update
|
||||||
|
cd ..
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
function do_dir {
|
||||||
|
pwd
|
||||||
|
echo $1
|
||||||
|
echo "-----------------"
|
||||||
|
for i in *
|
||||||
|
do
|
||||||
|
if [ -d $i ]; then
|
||||||
|
if [ -d $i/.git ]; then
|
||||||
|
do_git $i
|
||||||
|
elif [ -d $i/.hg ]; then
|
||||||
|
do_merc $i
|
||||||
|
elif [ -d $i/.svn ]; then
|
||||||
|
do_svn $i
|
||||||
|
else
|
||||||
|
cd $i
|
||||||
|
do_dir $i
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -d $HOME/NTCNA ]; then
|
||||||
|
cd $HOME/NTCNA
|
||||||
|
echo "NTCNA Repositories"
|
||||||
|
echo "=================="
|
||||||
|
do_dir .
|
||||||
|
echo "=================="
|
||||||
|
fi
|
||||||
|
|
||||||
57
NTCNA/usr/local/bin/pstar-update.sh
Executable file
57
NTCNA/usr/local/bin/pstar-update.sh
Executable file
@ -0,0 +1,57 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function do_git {
|
||||||
|
echo $1 "(Git)"
|
||||||
|
cd $1
|
||||||
|
git ls-remote --get-url
|
||||||
|
git pull
|
||||||
|
cd ..
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
function do_merc {
|
||||||
|
echo $1 "(Mercurial)"
|
||||||
|
cd $1
|
||||||
|
hg pull -u
|
||||||
|
cd ..
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
function do_svn {
|
||||||
|
echo $1 "(Subversion)"
|
||||||
|
cd $1
|
||||||
|
svn info --show-item url
|
||||||
|
svn update
|
||||||
|
cd ..
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
function do_dir {
|
||||||
|
pwd
|
||||||
|
echo $1
|
||||||
|
echo "-----------------"
|
||||||
|
for i in *
|
||||||
|
do
|
||||||
|
if [ -d $i ]; then
|
||||||
|
if [ -d $i/.git ]; then
|
||||||
|
do_git $i
|
||||||
|
elif [ -d $i/.hg ]; then
|
||||||
|
do_merc $i
|
||||||
|
elif [ -d $i/.svn ]; then
|
||||||
|
do_svn $i
|
||||||
|
else
|
||||||
|
cd $i
|
||||||
|
do_dir $i
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -d $HOME/ProbeStar ]; then
|
||||||
|
cd $HOME/ProbeStar
|
||||||
|
echo "P* Repositories:"
|
||||||
|
echo "================"
|
||||||
|
do_dir .
|
||||||
|
echo "================"
|
||||||
|
fi
|
||||||
3
NTCNA/usr/local/sbin/start_vnc.sh
Normal file
3
NTCNA/usr/local/sbin/start_vnc.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
x11vnc -bg -o %HOME/.x11vnc.log.%VNCDISPLAY -rfbauth /etc/x11vnc.pass -auth /etc/x11vnc.pass -forever
|
||||||
|
|
||||||
Reference in New Issue
Block a user