Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2435541
Added Yio remote config
martonborzak May 4, 2019
940351c
Patch for wiringpi
martonborzak May 5, 2019
b4f3714
Update
martonborzak May 6, 2019
1cd49cc
Update
martonborzak May 31, 2019
4de00d0
Updated system service files
martonborzak Jun 10, 2019
0010799
Added shutdown service
martonborzak Jun 20, 2019
2bf25a1
Update
martonborzak Jul 20, 2019
0e94f95
Bluetooth support added
martonborzak Jul 22, 2019
f0465b6
Update
martonborzak Jul 22, 2019
9136224
Lighttpd configuration added
martonborzak Jul 24, 2019
a72f209
Added wifi scripts
martonborzak Aug 7, 2019
32cd506
Update
martonborzak Aug 8, 2019
5ce7714
Software update
martonborzak Aug 12, 2019
d55c45e
Update
martonborzak Aug 12, 2019
d451a48
Wirless AP setup
martonborzak Aug 18, 2019
f820b18
Wifi setup
martonborzak Aug 18, 2019
ddf15ab
Wifi setup
martonborzak Aug 18, 2019
33f8ea3
Delete yio-remote-defconfig
martonborzak Aug 19, 2019
6967bf9
Delete yio-remote-defconfig2
martonborzak Aug 19, 2019
8cb2aef
mDNS added and fixed Wifi Setup shutdown bug
martonborzak Aug 25, 2019
26375d0
Wifi setup update
martonborzak Aug 25, 2019
8cd5fee
Display Month correctly
carp3-noctem Aug 31, 2019
47b4b8c
display month correctly
carp3-noctem Aug 31, 2019
a95160b
Wifi setup fix
martonborzak Sep 1, 2019
4f096aa
Added support for remote-dock bluetooth communication
martonborzak Sep 3, 2019
10861ae
Wifi setup update
martonborzak Sep 8, 2019
5d649cb
Update wifi_network_setup.sh
martonborzak Sep 10, 2019
065b911
Wifi setup update
martonborzak Sep 15, 2019
e7614bf
Wifi setup network list fix
martonborzak Sep 20, 2019
7144c6c
Migrate old buildroot repository (#1)
zehnm Oct 15, 2019
5159e40
Updated build documentation (#1)
zehnm Oct 15, 2019
a325409
Updated build documentation
zehnm Oct 16, 2019
150a4a5
Improved WiFi setup, handle SSIDs with spaces
zehnm Oct 14, 2019
41b9292
Fixed typo, added TODOs
zehnm Oct 14, 2019
b339378
Cleanup, removed old readme
zehnm Oct 16, 2019
90b10bc
Set name of boot partition (#7)
zehnm Oct 18, 2019
c8dff4c
Merge branch 'feature/1-migrate_buildroot_repo' into develop
zehnm Oct 18, 2019
afc8c89
Restore lighttpd configuration after WiFi setup
zehnm Oct 18, 2019
1a69845
Moved fonts to yio-remote directory (#9)
zehnm Oct 18, 2019
b590e21
Added updated remote app and web configurator alpha for testing
martonborzak Oct 19, 2019
187de77
Rewrote WiFi scanning with iw scan output parsing
zehnm Oct 14, 2019
46b7b72
fixup! Rewrote WiFi scanning with iw scan output parsing
zehnm Oct 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*.pyc
*.bak
*.old
*.log

### macOS ###
# General
.DS_Store
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "buildroot"]
path = buildroot
url = https://github.com/buildroot/buildroot.git
Empty file modified LICENSE
100755 → 100644
Empty file.
127 changes: 127 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,130 @@ For details about the YIO Remote, please visit our documentation repository whic
<https://github.com/YIO-Remote/documentation>

This repository contains the custom Linux OS built with [buildroot](https://www.buildroot.org/) for the YIO Remote.

## Build

Requirements:

- Preferably a Linux box or VM.
- At least 20 GB of free space.
- At least 4 GB RAM. More RAM = better file system caching.
- Fast CPU with many cores for quicker build times.
- SSD is highly recommended.
- Internet connection: packages will be downloaded during the build.
- 1+ GB microSD card
- Future images might be larger!
- Recommended card: Samsung EVO Plus (64 and 128GB have much higher write speed!)
- See: [RPi microSD card performance comparison 2019](https://www.jeffgeerling.com/blog/2019/raspberry-pi-microsd-card-performance-comparison-2019)

### Prepare Build Environment

#### Linux Ubuntu 18.04.3 or newer

- If you just need a headless build VM then use the minimal [Ubuntu 18.04.3 LTS Server](http://cdimage.ubuntu.com/releases/18.04.3/release/) version.
- Some packages might already be installed depending on the version (desktop or server).

Install required tools:

1. Prepare Ubuntu for buildroot:

sudo apt-get install \
build-essential \
g++ \
gettext \
patch \
git \
libncurses5-dev \
libtool \
python \
texinfo \
unzip

2. Optional: convenient packages for development

sudo apt-get install \
mc \
nano \
screen

3. Optional: SSH server for remote access

sudo apt-get install openssh-server

#### macOS

TODO

#### Windows

TODO maybe

### Build SD Card Image

#### Initial Checkout

SRC_DIR=~/projects/yio

mkdir -p ${SRC_DIR}
cd ${SRC_DIR}
git clone https://github.com/YIO-Remote/remote-os.git

# switch to development branch
cd remote-os
git checkout develop

# checkout buildroot (Git submodule)
git submodule init
git submodule update

#### Build Image

cd ${SRC_DIR}/remote-os/buildroot

make defconfig BR2_DEFCONFIG=../yio_rpi0w_defconfig
make

Hint: redirect the `make` output log into a logfile to easy find an error during building or when using `screen` without scrollback capability:

make 2>&1 | tee ../buildlog-$(date +"%Y%m%d_%H%M%S").log

The built SD card image can be found at: `${SRC_DIR}/remote-os/buildroot/output/images/yio-remote-sdcard.img`

#### Buildroot Commands

TODO: shortly describe the main commands (menuconfig, clean, rebuild, etc.)

#### Write SD Card Image

Use [balenaEtcher](https://www.balena.io/etcher/) - available for Linux, macOS and Windows - or your favorite tool.

## Technology Research

The following technologies were / are investigated for finding an easy and automated solution to build the RPi image.

### Docker

Docker works best for running services. But it can also be used to build software or anything else. Well, that's a service too :-)

TODO:

- [ ] Docker setup using Docker Volumes for the build cache. (Volume mounts have too many issues on Windows).

### Vagrant

Vagrant would be perfect for building the RPi image. Everything could be automated and one would only have to type `vagrant up`.

Found issues so far:

- Almost all official Linux boxes have a 'small' 10 GB disk:
- Not enough to build the image.
- No standard way of extending the disk, or limited to one virtualization provider.
- Synced folders don't work because of hard links
- Serious issues with VirtualBox 6 in combination with newer Ubuntu images
- Bootup takes 5+ minutes instead of seconds
- Issue is something with the UART console

TODO:

- [ ] Search for suitable official Box with at least 20 GB volume
- [ ] Investigate further...
1 change: 1 addition & 0 deletions board/yio-remote/rpi0/cmdline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
logo.nologo root=/dev/mmcblk0p2 rootwait rootfstype=ext4 quiet fastboot vt.global_cursor_default=0 console=tty9 loglevel=3
132 changes: 132 additions & 0 deletions board/yio-remote/rpi0/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
"areas": [
{
"area": "Entrance",
"bluetooth": "xx:xx:xx:xx:xx"
},
{
"area": "Kitchen",
"bluetooth": "xx:xx:xx:xx:xx"
}
],
"entities": [
{
"data": [
{
"area": "Entrance",
"entity_id": "light.backdoor_lamp",
"favorite": false,
"friendly_name": "Backdoor lamp",
"integration": "homeassistant",
"supported_features": [
"BRIGHTNESS"
],
"type": "light"
}
],
"type": "light"
},
{
"data": [
{
"area": "Bedroom",
"entity_id": "cover.bedroom_blinds_level",
"favorite": false,
"friendly_name": "Bedroom blinds",
"integration": "homeassistant",
"supported_features": [
"OPEN",
"CLOSE",
"STOP",
"POSITION"
],
"type": "blind"
}
],
"type": "blind"
},
{
"data": [
{
"area": "Kitchen",
"attributes": {
"state": "off"
},
"entity_id": "media_player.kitchen",
"favorite": false,
"friendly_name": "Kitchen speaker",
"integration": "homeassistant",
"supported_features": [
"SOURCE",
"APP_NAME",
"VOLUME",
"VOLUME_UP",
"VOLUME_DOWN",
"VOLUME_SET",
"MUTE",
"MUTE_SET",
"MEDIA_TYPE",
"MEDIA_TITLE",
"MEDIA_ARTIST",
"MEDIA_ALBUM",
"MEDIA_DURATION",
"MEDIA_POSITION",
"MEDIA_IMAGE",
"PLAY",
"PAUSE",
"STOP",
"PREVIOUS",
"NEXT",
"SEEK",
"SHUFFLE",
"TURN_ON",
"TURN_OFF"
],
"type": "media_player"
}
],
"type": "media_player"
}
],
"integration": [
{
"connectionOpen": true,
"data": {
"ip": "ip:port",
"token": "xxxxxx"
},
"friendly_name": "Home Assistant",
"id": 1,
"plugin": "homeassistant",
"type": "homeassistant"
}
],
"language": "en_US",
"settings": {
"autobrightness": true,
"darkmode": true,
"menu": {
"order": [
{
"display_name": "Favorites",
"displayname": "Favorites",
"name": "favorites",
"show": true
},
{
"display_name": "Settings",
"displayname": "Settings",
"name": "settings",
"show": true
}
],
"showareas": true,
"showdevices": true
},
"proximity": 40,
"shutdowntime": 7200,
"softwareupdate": false,
"wifitime": 240,
"bluetootharea": false
}
}
28 changes: 28 additions & 0 deletions board/yio-remote/rpi0/config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
dtoverlay=sharp
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0
framebuffer_width=480
framebuffer_height=800
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=454678
hdmi_timings=480 0 16 16 24 800 0 4 2 2 0 0 0 60 0 32000000 6

dtoverlay=goodix

boot_delay=0
disable_splash=1

gpu_mem=128

arm_freq=1000
arm_freq_min=700
force_turbo=0

dtoverlay=pi3-miniuart-bt
enable_uart=1
core_freq=250
34 changes: 34 additions & 0 deletions board/yio-remote/rpi0/genimage-rpi0.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
image boot.vfat {
vfat {
# set volume name with mkfs.vfat parameter
extraargs = "-n \"YIO boot\""
files = {
"bcm2708-rpi-0-w.dtb",
"config.txt",
"cmdline.txt",
"config.json",
"rpi-firmware/bootcode.bin",
"rpi-firmware/fixup.dat",
"rpi-firmware/start.elf",
"overlays",
"kernel.img"
}
}
size = 32M
}

image yio-remote-sdcard.img {
hdimage {
}

partition boot {
partition-type = 0xC
bootable = "true"
image = "boot.vfat"
}

partition rootfs {
partition-type = 0x83
image = "rootfs.ext4"
}
}
Binary file added board/yio-remote/rpi0/goodix.dtbo
Binary file not shown.
11 changes: 11 additions & 0 deletions board/yio-remote/rpi0/patches/wiringpi/0003-mcp23017.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- /wiringPi/mcp23017.c
+++ /wiringPi/mcp23017.c
@@ -176,7 +176,7 @@
int fd ;
struct wiringPiNodeStruct *node ;

- if ((fd = wiringPiI2CSetup (i2cAddress)) < 0)
+ if ((fd = wiringPiI2CSetupInterface ("/dev/i2c-3",i2cAddress)) < 0)
return FALSE ;

wiringPiI2CWriteReg8 (fd, MCP23x17_IOCON, IOCON_INIT) ;
Binary file added board/yio-remote/rpi0/pi3-miniuart-bt.dtbo
Binary file not shown.
27 changes: 27 additions & 0 deletions board/yio-remote/rpi0/post-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

set -u
set -e

# Add a console on tty1
if [ -e ${TARGET_DIR}/etc/inittab ]; then
grep -qE '^tty1::' ${TARGET_DIR}/etc/inittab || \
sed -i '/GENERIC_SERIAL/a\
tty1::respawn:/sbin/getty -L tty1 0 vt100 # HDMI console' ${TARGET_DIR}/etc/inittab
fi

ln -fs ../../../../usr/lib/systemd/system/wpa_supplicant@.service $1/etc/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service

ln -fs ../../../../usr/lib/systemd/system/backlight.service $1/etc/systemd/system/multi-user.target.wants/backlight.service

ln -fs ../../../../usr/lib/systemd/system/sharp-init.service $1/etc/systemd/system/multi-user.target.wants/sharp-init.service

ln -fs ../../../../usr/lib/systemd/system/app.service $1/etc/systemd/system/multi-user.target.wants/app.service


rm -rf $1/var/log/journal

#rm -r $1/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service

#rm -r $1/etc/systemd/system/multi-user.target.wants/dhcpcd.service

Loading