Misc. Notes
===

###### 2019-11-01

* [Raspberry Pi Configuration](https://www.raspberrypi.org/documentation/configuration/)

Custom Splash Screen
---

[src](https://yingtongli.me/blog/2016/12/21/splash.html)

In `/boot/config.txt`, add:

```
disable_spash=1
```

optionally:

```
disable_overscan=1
```

---

In `/boot/cmdline.txt`, add:

```
logo.nologo consoleblank=0 loglevel=1 quiet
```

---

By hand run

```
systemctl disable getty@tty1
```

---

```
apt install fbi
```

Create `/etc/systemd/system/splashscreen.service`:

```
[Unit]
Description=Splash screen
DefaultDependencies=no
After=local-fs.target

[Service]
ExecStart=/usr/bin/fbi -d /dev/fb0 --noverbose -a /opt/splash.png
StandardInput=tty
StandardOutput=tty

[Install]
WantedBy=sysinit.target
```

With `/opt/splash.png` 

---

Might need to kill `fbi` when starting the kiosk.

### Packages

```
sudo apt install -y sox espeak mplayer ffmpeg alsa-utils
```

### Sound

Use `raspi-config` to force audio through the 3.5mm audio jack.

There's an issue with the HDMI 'going to sleep' and cutting off
the first two seconds of the audio if nothing is being played
through it.
The 3.5mm jack seems to not have that issue.

---

The 3.5mm jack has a lot of noise on the line.
The fix looks to be using a USB speaker.
For now we'll go with the 3.5mm jack but this will
eventually need replacement.

### Monitor

To get monitor resolution:

```
fbset -s
```

### System Setup

Make sure the following are installed:

```
apt install -y espeak mplayer
```

---

Enable ssh server (for debugging and setup):

```
systemctl enable ssh
systemctl start ssh
```

---

Run `raspi-config` and select option `4` for the screen (640x480 @ 60Hz):

```
raspi-config
```

---

Make sure to manually set volume on the waveshare screen (default is set at 50) from the buttons provided on the left.

---

Remove `libreoffice` to free up space (around 0.5Gb):

```
apt remove -y libreoffice libreoffice-base-core libreoffice-common libreoffice-core libreoffice-help-common libreoffice-help-en-gb libreoffice-help-en-us libreoffice-l10n-en-gb libreoffice-style-colibre libreoffice-style-tango
apt autoremove -y --purge

```

### GPRS fiddling

I'm still trying to get GPRS to work consistently.

Once the system is setup, it seems like it's pretty consistent, but getting `/dev/ttyGPRS` to be
consistently tied to the appropriate device is proving difficult...sometimes `/dev/ttyAMA0` works,
sometimes it's `/dev/serial0`, sometimes it's `/dev/ttyUSB0`, othertimes it looks like `/dev/ttyUSB2` works.

I notice messages of this sort happening most recently which could or could not be related to the the GPRS not working (`/var/log/syslog`):

```
Jan 30 11:56:23 raspberrypi systemd[1]: serial-getty@ttyAMA0.service: Succeeded.
Jan 30 11:56:23 raspberrypi systemd[1]: serial-getty@ttyAMA0.service: Service RestartSec=100ms expired, scheduling restart.
Jan 30 11:56:23 raspberrypi systemd[1]: serial-getty@ttyAMA0.service: Scheduled restart job, restart counter is at 198.
Jan 30 11:56:23 raspberrypi systemd[1]: Stopped Serial Getty on ttyAMA0.
Jan 30 11:56:23 raspberrypi systemd[1]: Started Serial Getty on ttyAMA0.
```

I followed [this](https://raspberrypi.stackexchange.com/questions/39165/how-can-i-stop-the-auto-login-console-and-getty-in-raspbian-8-jessie):

```
systemctl stop serial-getty@ttyAMA0.service
```



### Other References

* [raspberrypi.org: cmdline.txt](https://www.raspberrypi.org/documentation/configuration/cmdline-txt.md)
* [raspberrypi.org: 'How do I find out the display resolution?'](https://www.raspberrypi.org/forums/viewtopic.php?t=19817)
* [elinux.com: RPiconfig](https://elinux.org/RPiconfig)



