Tingbot with EmulationStation and RetroPie


  • Core team

    How is Tingbot configured to use Emulation Station?

    The original version of this tutorial referred mainly to the First Installation · RetroPie/RetroPie-Setup Wiki instructions but since that relied setting up and configuring a standard Retropie installation by means of a Raspberry Pi connected to an HDMI monitor, this current version of the tutorial can be done on a Tingbot that has already been set up and cased. Furthermore, an existing Tingbot OS image is used as the starting point and RetroPie will be installed 'in-situ'. Please note, however, that the installation of RetroPie will overwrite parts of Tingbot OS and any existing Tingbot Apps so we recommend starting from a clean install as documented in Installing Tingbot OS.

    Clean install of Tingbot OS

    Once the Tinbot OS SD card has been prepared, inserted into the Tingbot and power applied the system will boot into the default Springboard splashscreen and the 'home' app - Shoutout - will be displayed, as follows:
    0_1479404795734_01_tb_shoutout_kb_01.png

    Plugging in a USB keyboard

    The following screen shots in this tutorial illustrate the steps used to install RetroPie on the Tingbot using the in-built terminal capabilities with input taken from a keyboard plugged directly into one of the Tingbot's USB ports. (An alternative would be to remotely login to the Tingbot and enter/paste input to the command line from the connected device.)

    Once a keyboard is plugged in the greyed-out keyboard icon is highlit (see below) and we're ready to go.
    0_1479404846248_01_tb_shoutout_kb_02.png

    Settings screen

    A touch of the Tingbot (T) icon will bring up the Settings screen and this can be used to check what IP address has been assigned to the Tingbot should you wish to remote login to it. A touch of Tingbot icon on the bottom of this screen will return to the home screen.
    0_1479404883796_02_tb_settings_kb.png

    Terminal App

    Each press of the right-hand button will scroll to the next app in sequence. The second app included in a clean install of Tingbot OS is the Terminal app and it is via this app that we interact with the Pi's command line.
    0_1479404899359_03_tb_terminal_kb_01.png

    A touch of the above Terminal icon will bring up a Pi command line as follows:
    1_1479404899359_03_tb_terminal_kb_02.png

    Reducing the console font size (optional)

    This step is optional and has been done for the purposes of the tutorial since more text can be displayed in the screenshots and there's less text wrapping of the command line input. If you skip this step please note that your input will wrap/display differently so please do take care to check your input carefully before pressing the return key.

    There's also no need to undertake this step if you're interacting with the Tingbot via a remote shell session.

    sudo dpkg-reconfigure console-setup
    

    Typing in the above command to the default shell will appear as:

    0_1479404961136_04_tb_dpkg_00.png

    and the following screenshots show the sequence of steps used to replicate the console font setting used in the rest of this tutorial.

    1_1479404961137_04_tb_dpkg_01.png

    2_1479404961137_04_tb_dpkg_02.png

    3_1479404961137_04_tb_dpkg_03.png

    4_1479404961137_04_tb_dpkg_04.png

    5_1479404961138_04_tb_dpkg_05.png

    6_1479404961138_04_tb_dpkg_06.png

    7_1479404961138_04_tb_dpkg_07.png

    8_1479404961138_04_tb_dpkg_08.png

    9_1479404961139_04_tb_dpkg_09.png

    And, finally, once given the <OK> the newly configure font size will take effect:

    10_1479404961139_04_tb_dpkg_10.png

    Updating and Upgrading

    Since the Tingbot OS image is a customised version of Jessie Lite, the next step in the RetroPie install is to update and upgrade the image to a more standard configuration. Please note that after this step is undertaken the SD Card wil no longer be a normal Tingbot OS image. Type in:

    sudo apt-get update && sudo apt-get upgrade
    

    0_1479405303029_05_tb_apt_get_00.png

    and once return is pressed a bunch of stuff will scroll by and the prompt Do you want to continue? [Y/n] will appear, as follows:

    0_1479405317396_05_tb_apt_get_01.png

    Once again, more stuff will scroll by and, eventually, the prompt will return signifying the end of the sudo apt-get update && sudo apt-get upgrade process.

    0_1479405334329_05_tb_apt_get_02.png

    Installing packages required for the RetroPie setup script

    Type in:

    sudo apt-get install -y git dialog
    

    0_1479405387892_06_tb_apt_get_git_dialog.png

    Note: It may be that the required packages were already installed so don't be surprised if nothing more needs to be done in this step.

    Installing the RetroPie setup script

    Now download the latest RetroPie setup script with

    cd
    git clone --depth=1 https://github.com/RetroPie/RetroPie-Setup.git
    

    0_1479405408842_07_tb_git_clone_retropie.png

    Executing the RetroPie setup script

    The script just downloaded is executed by:

    cd RetroPie-Setup/
    chmod +x retropie_setup.sh
    sudo ./retropie_setup.sh
    

    As shown in the following screenshot:

    0_1479405426275_08_tb_retropie_setup_00.png

    You will then be taken through a number of prompt screens. The following ones show the steps taken to perform a Basic install of RetroPie:

    0_1479405442123_08_tb_retropie_setup_01.png

    0_1479405459790_08_tb_retropie_setup_02.png

    0_1479405495371_08_tb_retropie_setup_03.png

    0_1479405529606_08_tb_retropie_setup_03_yes.png

    0_1479405624666_08_tb_retropie_setup_exit.png

    Finally, in preparation for the next steps, change directory back to the home directory with cd as follows:

    0_1479405663332_09_tb_retropie_cd.png

    Reinstating the Tingbot Overlay

    A side-effect of the above installation steps is the removal of the tingbot-overlay.dtb file from the /boot/overlays/ directory - shown by the lack of output from the ls -l /boot/overlays | grep tingbot command included in the following screenshot. To retrieve Tingbot's original overlay file type in the following commands:

    mkdir ~/tingbot_enable
    cd ~/tingbot_enable
    wget https://github.com/tingbot/tingbot-os/raw/master/root/opt/tingbot-os/tingbot-overlay.dtb
    sudo cp tingbot-overlay.dtb /boot/overlays/tingbot-overlay.dtb
    cd
    

    as per the following screenshots:

    0_1479674805743_10_tb_enable_01.png

    0_1479674865106_10_tb_enable_04.png

    Editing /boot/config.txt

    The next phase of installation is to edit /boot/config.txt to configure the HDMI settings to match the Tingbot screen parameters and to reinstate the tingbot device tree overlay so that the screen can be used. Type in the following command:

    sudo nano /boot/config.txt
    

    0_1479405753262_11_tb_nano_config_00.png

    and the first 'page' of lines will look similar to:

    0_1479405787426_11_tb_nano_config_01.png

    Now scroll down to the end of the file and the last 'page' will look similar to:

    0_1479405804342_11_tb_nano_config_02.png

    At this point we add the following text:

    # Set HDMI output to match the Tingbot resolution
    hdmi_force_hotplug=1
    hdmi_group=2
    hdmi_mode=87
    hdmi_cvt=320 240 60 1 0 0 0
    

    (as shown below:)

    0_1479405817392_11_tb_nano_config_03.png

    Finally, we need to enable the Tingbot screen by adding:

    # Enable the Tingbot screen
    dtparam=spi=on
    dtoverlay=tingbot:xohms=80
    

    (as shown below:)

    0_1479405830841_11_tb_nano_config_04.png

    Finally, Write out the changes with ctrl-O (^O) and then Exit nano with ctrl-X (^X).

    Editing /boot/cmdline.txt

    The next phase of installation is to edit /boot/cmdline.txt to add
    consoleblank=0 to the end of the line by typing the command

    sudo nano /boot/cmdline.txt
    

    (as shown below:)

    0_1479405858039_12_tb_nano_cmdline_00.png

    Scroll right to the end of the line and add the text. The editor screen will then look like:

    0_1479405871755_12_tb_nano_cmdline_01.png

    Again, Write out the changes with ctrl-O (^O) and then Exit nano with ctrl-X (^X).

    Installing fbcp

    Since RetroPie uses the HDMI capabilities of the Raspberry Pi to render its display we need a way of mirroring the HDMI to the Tingbot screen. This is done using fbcp which now needs to be downloaded and installed with the following commands:

    git clone https://github.com/tasanakorn/rpi-fbcp
    cd rpi-fbcp/
    mkdir build
    cd build/
    cmake ..
    make
    sudo install fbcp /usr/local/bin/fbcp
    

    The following screenshots take you through these steps:

    0_1479405981435_13_tb_git_clone_rpi_fbcp_01.png

    0_1479405994484_13_tb_git_clone_rpi_fbcp_02.png

    0_1479406007633_13_tb_git_clone_rpi_fbcp_03.png

    Launching fbcp during boot

    fbcp needs to be launched every time the system is booted. This is done by adding the line /usr/local/bin/fbcp & just before the final exit 0 line in /etc/rc.local. Now type in the following commands:

    cd
    sudo nano /etc/rc.local
    

    (as shown below:)

    0_1479406026033_14_tb_nano_rc_local_00.png

    Then scroll down through the first 'page':

    0_1479406042499_14_tb_nano_rc_local_01.png

    and position the cursor in the line above the exit 0

    0_1479406150365_14_tb_nano_rc_local_02.png

    and add the text /usr/local/bin/fbcp & (as shown below:)

    0_1479406170125_14_tb_nano_rc_local_03.png

    As usual, Write out the changes with ctrl-O (^O) and then Exit nano with ctrl-X (^X).

    Reboot

    Once the above installation steps have been completed it's time to reboot the system. So type in:

    sudo reboot
    

    0_1479420926455_17_tb_sudo_reboot_00.png

    and the rebooting messages will scroll past and after a short while the usual Pi login prompt will be displayed.

    0_1479420956505_18_tb_retropie_booted.png

    Now, login with the normal pi account and the usual password.

    0_1479420972454_19_tb_retropie_login.png

    Manually starting EmulationStation

    To start up EmulationStation for the very first time type in:

    emulationstation
    

    0_1479421023720_20_tb_retropie_es_00.png

    EmulationStation's welcome screen will display for a few seconds and, in the absence of a gamepad, the keyboard can be used to initially assign 'button' functions. The following images show a sequence of screen shots for a basic configuration of the (keyboard) controls.

    (Note: for a more detailed explanation of controller configuration see Controller Configuration (RetroArch))

    0_1479421046529_20_tb_retropie_es_welcome.png

    0_1479421071452_20_tb_retropie_es_kb_01.png

    0_1479421098649_20_tb_retropie_es_kb_02.png

    To skip the configuration of buttons that don't exist on a normal keyboard just hold down any key for as long as it takes to revert the PRESS ANYTHING prompt to NOT DEFINED and move on to the (non-)selection of the next button. For example:

    0_1479421123649_20_tb_retropie_es_kb_03.png

    Finally, once all buttons have been (un)defined, the OK prompt will be highlit and once selected by the key defined as SELECT, RetroPie's splashcreen will be displayed.

    0_1479421169612_20_tb_retropie_es_kb_04.png

    RetroPie Lives!

    0_1479421223546_21_tb_retropie_home_01.png

    RetroPie setup - auto-start Emulation Station

    As an example of setting up RetroPie by selecting MENU, the following screenshots show the process of setting up Emulation Station to launch at boot.

    0_1479421265767_22_tb_retropie_menu_01.png

    0_1479421278810_22_tb_retropie_menu_02.png

    0_1479421294758_22_tb_retropie_menu_03.png

    0_1479421311540_22_tb_retropie_menu_04.png

    0_1479421324824_22_tb_retropie_menu_05.png

    Bigger EmulationStation text (Optional)

    As mentioned in their RetroPie - Tuning & Tweaking turorial, Adafruit has documented the process of editing /etc/emulationstation/themes/carbon/carbon.xml to adjust the font size used in the game lists to make them easier to read. This can be done by typing in:

    sudo nano /etc/emulationstation/themes/carbon/carbon.xml
    

    0_1479406225689_15_tb_nano_carbon_00.png

    and scrolling down to the "gamelist" entries and altering the fontSize to 0.05 as shown in the sequence of screenshots below.

    0_1479406241675_15_tb_nano_carbon_01.png

    0_1479420873392_15_tb_nano_carbon_02.png

    0_1479420896608_15_tb_nano_carbon_03.png

    As usual, Write out the changes with ctrl-O (^O) and then Exit nano with ctrl-X (^X).



  • @xtramural - Hello, just a quick question here. So RetroPie will take over Tingbot OS in this installation? I'd like to help in the development for Emulation Station to be apart of Tingbot OS, I'm just not familiar with coding.


  • Core team

    @BeauSS yes, the tutorial I put together would result in RetroPie displacing Tingbot-specific features. It's on my todo list to configure a system so that EmulationStations runs under/alongside Tingbot OS so, hopefully, we can have the best of both worlds sometime in the new year.



  • @xtramural cool - is it possible to safe the image back to Pc? then its easier to change between images



  • what about recalbox?



  • anways that tutorial doesnt work anymore i get a white screen after sudo reboot cant do anything... and i did everything step by step


Log in to reply

Looks like your connection to Tingbot with EmulationStation and RetroPie was lost, please wait while we try to reconnect.