Automatic first setup script (HDMI rotation - RTC - ATtiny85 bat monitor - graceful shutdown - optimizations)

Various user-contributed guides for software-related things
Post Reply
razer.93
Posts: 56
Joined: Sun Apr 02, 2017 3:21 pm
Has thanked: 7 times
Been thanked: 39 times

Automatic first setup script (HDMI rotation - RTC - ATtiny85 bat monitor - graceful shutdown - optimizations)

Post by razer.93 » Sun May 28, 2017 4:35 am

Hi guys!
When I finished my GBz build 3 weeks ago I initially faced several problems like for example the 180° rotated screen issue when you connect it through HDMI, configuring the screen resolution correctly and so on...
So at the end I came out with collecting all the small fixes, optimizations and configurations in a useful GitHub repository.

This build is totally DIY, I didn't use none of the prebuilt parts (the graceful shutdown circuit for instance) and I also did a battery meter using the ATtiny-85 (link below).

GameBoy-Zero-Build Repo: https://github.com/vascofazza/GameBoy-Zero-Build
Gbz-ATtiny85-Monitor Repo: https://github.com/vascofazza/gbzattinymonitor (still writing the readme, PM me if you need help!)

I hope you will benefit too!
The repo contains two main scripts and they are both configurable (you can choose what to install).

install.sh is the basic one, it includes the following things:
  • WiFi credential setup
  • Adafruit Retrogame software installation (hardware buttons)
  • Custom config.txt ready for BW 3.5" screen
  • Automatic screen rotation when connected through HDMI (the composite screen is mounted upside down)
  • Python script for Graceful shutdown circuitry handling
  • Python script for Battery Level meter
  • Disable the initial boot logo (goes directly to the splashscreen without prompts)
  • Invert the status led behaviour for power saving (the led is powered on sd activity)
  • Downloads a fixed version of pifba for joypad compability
  • Added RTC (Real Time Clock) configuration for DS3231
install_extra.sh contains a lot of software improvements for battery and sd life:
  • Map log and tmp folders to ramdisk
  • Swap ram to disk only if strictly needed
  • Replaces the samba server with an FTP server (more resource-friendly)
  • Replaces OpenSSH with DropBear ssh server (more resource-friendly)
  • Removes avahi-daemon, you cannot use retropie.local in local network, but retropie.lan still works :)
Let me know if you would like guides for the RTC module, better description of the Graceful shutdown circuit or whatever :)

Frigo
Posts: 43
Joined: Sat Feb 04, 2017 6:45 am
Has thanked: 3 times
Been thanked: 3 times

Re: Automatic first setup script (HDMI rotation - RTC - ATtiny85 bat monitor - graceful shutdown - optimizations)

Post by Frigo » Mon Jun 05, 2017 1:34 pm

Hello razer.93 I would like to rotate the HDMI (because I put my screen upside down) so what part of your script I need to copy in my config.txt.

Nice GBZ!

razer.93
Posts: 56
Joined: Sun Apr 02, 2017 3:21 pm
Has thanked: 7 times
Been thanked: 39 times

Re: Automatic first setup script (HDMI rotation - RTC - ATtiny85 bat monitor - graceful shutdown - optimizations)

Post by razer.93 » Mon Jun 05, 2017 2:41 pm

Frigo wrote:
Mon Jun 05, 2017 1:34 pm
Hello razer.93 I would like to rotate the HDMI (because I put my screen upside down) so what part of your script I need to copy in my config.txt.

Nice GBZ!
You can take script/screen.sh script directly or go through the installer and choose just what you need! ;)

Frigo
Posts: 43
Joined: Sat Feb 04, 2017 6:45 am
Has thanked: 3 times
Been thanked: 3 times

Re: Automatic first setup script (HDMI rotation - RTC - ATtiny85 bat monitor - graceful shutdown - optimizations)

Post by Frigo » Tue Jun 06, 2017 2:36 am

Sorry but I'm a big noob on Linux, can you explain me the most easy way to make this like a tuto? I'm not sure to understand everything if I have to write a script (I'm french by the way.... :lol:)
It is not possible to change or add some line in the config.txt ? like "display_rotate=2" for the 3.5 screen and add a line for the HDMI who's look like "hdmi_rotate=1" ?

I hope someone will understand what I'm saying :?

razer.93
Posts: 56
Joined: Sun Apr 02, 2017 3:21 pm
Has thanked: 7 times
Been thanked: 39 times

Re: Automatic first setup script (HDMI rotation - RTC - ATtiny85 bat monitor - graceful shutdown - optimizations)

Post by razer.93 » Tue Jun 06, 2017 2:53 am

Frigo wrote:
Tue Jun 06, 2017 2:36 am
Sorry but I'm a big noob on Linux, can you explain me the most easy way to make this like a tuto? I'm not sure to understand everything if I have to write a script (I'm french by the way.... :lol:)
It is not possible to change or add some line in the config.txt ? like "display_rotate=2" for the 3.5 screen and add a line for the HDMI who's look like "hdmi_rotate=1" ?

I hope someone will understand what I'm saying :?
No, unfortunately is not that simple, otherwise a script wouldn't be needed!
You have to download the script located in /scripts/screen.sh on my github repository, put it onto your home in raspberrypi and let it start at boot (https://www.raspberrypi.org/documentati ... c-local.md).
Otherwise you can download the full repository on git hub, go to terminal and do "sudo bash install.sh" and the script will do the magic!

Frigo
Posts: 43
Joined: Sat Feb 04, 2017 6:45 am
Has thanked: 3 times
Been thanked: 3 times

Re: Automatic first setup script (HDMI rotation - RTC - ATtiny85 bat monitor - graceful shutdown - optimizations)

Post by Frigo » Mon Jun 12, 2017 1:01 am

thank you!! that work pefectly !

Baconbomb80
Posts: 13
Joined: Tue Jul 04, 2017 12:12 pm
Has thanked: 5 times
Been thanked: 2 times

Re: Automatic first setup script (HDMI rotation - RTC - ATtiny85 bat monitor - graceful shutdown - optimizations)

Post by Baconbomb80 » Mon Jul 31, 2017 7:44 am

How's the guide for the ATtiny batterymonitor comming along?

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests