Skip to content
john- edited this page Nov 4, 2018 · 42 revisions

Odroid

One Time Changes

Some basics

timedatectl set-timezone Zone/SubZone
pacman -Syu
hostnamectl set-hostname <hostname>
hostname cart1
pacman -S zsh emacs
# ham2mon seems to requires python2 and not 3
pacman -S hackrf gnuradio screen sudo git nginx wget python2
groupadd plugdev # for Hack RF

Airspy and gnuradio-osmosdr

With Airspy it looks like that it and gnuradio-osmosdr:

https://github.com/airspy/airspyone_host#how-to-build-the-host-software-on-linux

sudo pacman -S base-devel cmake libusb pkgconf
sudo pacman -S boost swig cheetah

gr-osmosdr cmake

cmake ../ -DENABLE_BLADERF=OFF   # Blade support causes compile error

Location to put stuff

mkdir /home/pub
chdir /home/pub
chgrp users pub
chmod 775 pub/
chmod g+s pub/

Do stuff as root

create file /etc/sudoers.d/local:

/etc/sudoers.d/local "%users ALL=(ALL) ALL"

Per User

useradd -m username
passwd username
chsh username
usermod -aG users,plugdev username

Wireless

pacman -S iw wpa_supplicant dhcpcd
# config /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
# do not enable any wpa_supplicant services otherwise dhcpcd hooks will not work

# looks like eth0 needs to be unplugged for routing or something to work.
# using dhcpd hooks to start wpa_supplicant
ln -s /usr/share/dhcpcd/hooks/10-wpa_supplicant /usr/lib/dhcpcd/dhcpcd-hooks/
systemctl start [email protected]
systemctl enable [email protected]

#systemctl start [email protected]
#dhcpd wlan0

# systemctl enable [email protected]
#systemctl enable [email protected]

# manual method
ip link set wlan0 up
wpa_supplicant -D nl80211,wext -i wlan0 -c <(wpa_passphrase "<ssid>" "<passprase>")
dhcpcd wlan0
iw dev wlan0 link

Database

pacman -S postgresql
https://wiki.archlinux.org/index.php/PostgreSQL   # initilize DB, etc
systemctl enable postgresql.service
sudo su - postgres
psql -f /home/pub/backups/backup_cart1.sql postgres

GPS

lsusb: Bus 001 Device 003: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light

create file /etc/udev/rules.d/gps.rules:

This should create /dev/gps0

pacman -S gpsd
systemctl start gpsd.service
systemctl enable gpsd.service

Perl

cpanplus-dist-arch is now giving mkpkg --asroot errors.

pacman -S  core/make perl-cpanplus-dist-arch
setupdistarch
cpanp i Mojolicious

perl attempt number two:

sudo pacman -Sy base-devel   # needed as some modules have c code to compile
pacman -S perl-cpanplus-dist-arch
cpanp i <modules>

Note: Do not run cpanp as root it will error out

nginx

from https://wiki.archlinux.org/index.php/nginx, see Managing server entries.

create file /etc/nginx/servers-available/cart:

mkdir /usr/share/nginx/{cart_console,heatmaps,jquery}

add to end of /etc/nginx/nginx.conf http block:

include servers-enabled/*;

create file /usr/share/nginx/html/index.html:

cart_console:

ln -s /home/pub/cart_console/bin/main.html /usr/share/nginx/cart_console/main.html

jquery:

cd /usr/share/nginx/jquery
wget http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css
wget http://code.jquery.com/jquery-1.11.2.js
wget http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.js

server:

ln -s /etc/nginx/servers-available/cart /etc/nginx/servers-enabled/cart
systemctl start nginx
systemctl enable nginx

HackRF

  1. create plugdev group
  2. add user to plugdev group
  3. create udev rules (see hackrf faq)

Cart Services

rtl_fm-scanner:

cpanp i Mojolicious DBD::Pg Mojo::Pg Mojo::IOLoop::ForkCall Mojolicious::Plugin::RenderFile Mojolicious::Plugin::CORS Linux::Inotify2 EV AnyEvent

create file /etc/systemd/system/rtl_fm-scanner.service

systemctl start rtl_fm-scanner

data_gather:

cpanp i Statistics::Basic

create file /etc/systemd/system/data_gather.service

systemctl start data_gather

See config file for hardware locations. The 1wire modules loaded on their own (w1_gpio,w1_therm).

tail_log

cpanp i Mojolicious::Plugin::Webtail

create file /etc/systemd/system/tail_log.service

systemctl start tail_log

leaderboard

cpanp i Text::CSV

create file /etc/systemd/system/leaderboard.service

systemctl start leaderboard

ham2mon

create file /etc/systemd/system/ham2mon.service create file /usr/local/bin/ham2mon_start

cart_cli

cpanp i Params::Util Params::Validate

I2C

The power/telemetry/fan board utilizes I2C to gather data from sensors.

cpanp i Device::Chip::Adapter::LinuxKernel Device::Chip::INA219 # other modules may be needed

Modifications

changed Device::Chip::Adapter::LinuxKernel by un-commenting this line:

$self->{max_rate} = delete $args{max_bitrate}; # We're unable to affect this from userland it seems

changed Device::Chip::INA219 by modifying sub I2C_options to pass %params:

sub I2C_options
{
    my $self = shift;
    my %params = @_;

    my $addr = delete $params{addr} // 0x40;
    $addr = oct $addr if $addr =~ m/^0/;

    return (
        %params,    # pass the parameters along
        addr        => $addr,
        max_bitrate => 100E3,
    );
}