Git Product home page Git Product logo

airball-display's Introduction

Airball Telemetry and Display Source

Introduction

This is the source tree for the Airball Telemetry and display system. It is intended to be compiled on a Linux system. The actual display runs on a Raspberry Pi, and at the moment the system needs to be compiled from scratch on the Raspberry Pi as well.

Configuring monitor

For the display we are using:

https://www.waveshare.com/3.5inch-hdmi-lcd.htm

Add the following to config.txt on the boot partition.

hdmi_group=2
hdmi_mode=87
hdmi_cvt 480 320 60 6 0 0 0
hdmi_drive=1

avoid_warnings=1

The avoid_warnings setting is based on the following advice:

https://terminalwiki.com/disable-low-voltage-warning-in-raspberry-pi/

Building

sudo apt-get install \
     git \
     cmake \
     libcairo2-dev \
     libasio-dev \
     libboost-all-dev \
     libasound2-dev \
     libeigen3-dev \
     hostapd \
     dnsmasq

pip install netifaces

git clone https://github.com/airball-aero/airball-embedded.git

cd airball-embedded/host
mkdir external
git clone https://github.com/google/googletest external/googletest
git clone https://github.com/miloyip/rapidjson external/rapidjson

mkdir build
cd build
cmake ..
make ab

Network setup

  • eth0 on the RPi by default is set up as a DHCP client. It can be used for connecting via wired Ethernet for development.
  • wlan0 is configured with a static IP of 192.168.4.1.
  • We configure an access point on wlan0:
    • Depending on the "serial number" of the device being configured, the SSID will be {airball0001, airball0002, ...}.
    • The default password is relativewind.
  • The probe joins the same network statically.
    • The probe assigns itself 191.168.4.200.
    • The RPi must know not to assign that to anyone.

See also:

https://thepi.io/how-to-use-your-raspberry-pi-as-a-wireless-access-point/

Run:

sudo systemctl stop hostapd
sudo systemctl stop dnsmasq

Add to /etc/dhcpcd.conf:

interface wlan0
static ip_address=192.168.4.1/24
denyinterfaces eth0
denyinterfaces wlan0

Run:

sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig

Put into /etc/dnsmasq.conf:

interface=wlan0
  dhcp-range=192.168.4.10,192.168.4.100,255.255.255.0,24h

Put into /etc/hostapd/hostapd.conf:

interface=wlan0
# bridge=br0
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
ssid=airball0001
wpa_passphrase=relativewind

In the file /etc/default/hostapd ensure:

DAEMON_CONF="/etc/hostapd/hostapd.conf"

Run the commands:

sudo systemctl disable systemd-resolved
sudo systemctl mask systemd-resolved
sudo systemctl unmask hostapd
sudo systemctl start hostapd
sudo systemctl start dnsmasq

System configuration

sudo apt install python-pip
sudo pip install flask

Copy each of the contents of rootfs/ (in this repository) into the target system.

Web settings editor

On a separate system, clone and build:

https://github.com/airball-aero/airball-settings-editor

Build this using:

flutter build web --release --web-renderer=html

Copy all the contents of build/web into a new directory called /var/www/app/.

Edit the file /var/www/app/index.html and ensure the <base> tag reads:

<base href="/app/">

Raspberry Pi configuration

In /boot/config.txt put the lines:

dtoverlay=smi
dtoverlay=smi-dev

To free up some GPIO pins, we need to make the SMI not control the address pins. Create a new directory and de-compile the relevant DTB overlay using the command:

$ dtc -I dtb -O dts /boot/overlays/smi.dtbo  > smi.dtb

You will get an smi.dtb containing the snippet:

smi_pins {
  brcm,pins = <0x02 0x03 0x04 0x05 0x06 0x07 ... >;
  brcm,function = <0x05 0x05 0x05 0x05 0x05 0x05 ... >;
  brcm,pull = <0x02 0x02 0x02 0x02 0x02 0x02 ... >;
  phandle = <0x01>;
};

The brcm,pins, brcm,function and brcm,pull fields must all contain the same number of entries. The SMI system uses GPIO pins 0 through 5 as address lines. You need to remove the same number of entries from all three fields, so that brcm,pins does not contain pins 0 through 5. In this example, we delete the first 4 entries of each field and end up with:

smi_pins {
  brcm,pins = <0x06 0x07 ... >;
  brcm,function = <0x05 0x05 ... >;
  brcm,pull = <0x02 0x02 ... >;
  phandle = <0x01>;
};

Now re-compile the DTB and put it back into /boot:

$ dtc -I dts -O dtb smi.dtb  > smi.dtbo
$ sudo cp smi.dtbo /boot/overlays

airball-display's People

Contributors

ihab avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.