Difference between revisions of "GamePi20"

From Waveshare Wiki
Jump to: navigation, search
Line 294: Line 294:
 
[[File:600px-Game-HAT-Manual09.jpg]]<br/>
 
[[File:600px-Game-HAT-Manual09.jpg]]<br/>
 
Open the corresponding IP in your PC, as shown below:<br/>
 
Open the corresponding IP in your PC, as shown below:<br/>
[[File:GamePi2001.png]]<br/>
+
[[File:800px-Game-HAT-Manual10.png]]<br/>
 
Copy ROMs to the corresponding directory, as shown below:<br/>
 
Copy ROMs to the corresponding directory, as shown below:<br/>
[[File:GamePi2003.png]]<br/>
+
[[File:600px-Game-HAT-Manual11.png]]<br/>
 
Then, on the emulator selection interface, press "Start"->QUIT->RESTART EMULATIONSTATION, and press "A" to confirm. After restarting the emulator, you can see the newly added game.<br/>
 
Then, on the emulator selection interface, press "Start"->QUIT->RESTART EMULATIONSTATION, and press "A" to confirm. After restarting the emulator, you can see the newly added game.<br/>
 
Then start your journey of retro gamepad!<br/>
 
Then start your journey of retro gamepad!<br/>

Revision as of 08:59, 21 November 2022

GamePi20
GamePi20-8.jpg

A mini game console based on Raspberry Pi
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Overview

Features

  • Support Raspberry Pi Zero/Zero W/Zero WH
  • 2inch IPS screen, 320 × 240 resolution
  • 60-frame experience, smooth display, no more frame loss
  • Support RetroPie game system and Recalbox game system, supporting thousands of classic games, as long as the TF card is big enough, you can add your favorite games arbitrarily
  • With a charging circuit, a built-in 14500 lithium battery power supply, easy to carry and play at any time
  • Battery capacity indicator
  • Onboard speaker and earphone jack, listen to the familiar BGM from the old days

How to use it

Assembly

Hardware connection

  • Attach Raspberry Pi Zero/Zero W to GamePi20 extension board. Note that you need to first set up SD card according to the instruction below, before you assemble it.
  • Mount the extension board to the metal box.
  • Place conductive rubber mats and buttons on it, finally assemble the front panel.

To use the GamePi20, you can use the pre-configured image or install driver to a fresh image yourself.

Method 1: Pre-configured Images

  • Here we provide a pre-configured image, you can download and test
OS Version Raspberry Pi Default user/password Download link
Recalbox 6.0-DragonBlaze Raspberry Pi 1/Zero/Zero W root/recalboxroot Google Drive
Recalbox v7.1.1 Raspberry Pi 1/Zero/ZeroW root/recalboxroot Google drive
Retropie v4.4 Raspberry Pi 1/Zero/Zero W pi/raspberry Google Drive
Retropie v4.7.1 Raspberry Pi 1/Zero/Zero W pi/raspberry Google Drive
Retropie v4.8 Raspberry Pi Zero 2W pi/raspberry Google Drive
  • Download the image file, unzip and write it to the SD card
  • Insert the SD card to Raspberry Pi, assemble GamePi20 as #Hardware connection
  • turn the switch to ON. Generally, LCD is light on and Raspberry Pi is booting. It may cause about 2 minutes for Raspberry Pi 1/zero/zero W to starting.
    • Raspberry Pi is failed to start if the battery is low. In this case, you can connect 5V/2A power adapter to the Power interface for charging. Capacity indicators
    • If the buttons cannot work normally, please add a line to the /boot/config.txt file, then reboot and try again.
dtparam=spi=on


Basic operations

  • Retropie
    1. After booting, you can select emulators by direction buttons on the left, then press "A" to confirm. For example, choose "A" and then "Start"
    2. Choose the games and press "A" to play
    3. Press "Start"+"Select" buttons to exit games
    4. You can adjust the potentiometer to adjust the volume. Or Press "Start" and choose "SOUND SETTINGS" to adjust volume
  • Recalbox
    1. After booting, you can select emulators by direction buttons on the left, then press "B" to confirm.
    2. Choose the games and press "A" to play, press "A" or "Start" to start games
    3. Press "Start"+"Select" buttons to exit games
    4. you can adjust the potentiometer to adjust volume. Or Press "Start" and choose "SOUND SETTINGS", press "B" confirm, then adjust "SYSTEM VOLUME" by direction buttons.

Method 2: Install driver

Install driver on Retropie

Download Retropie image from Retropie website

Game-HAT-Manual01.jpg

1) Download the image file to the computer and unzip it to get the .img file.

2) Connect the TF card to the computer, open the Win32DiskImager.exe software, select the .img file prepared in step 1, and click write to burn the image.

3) Connect SD card, keyboard and a HDMI display to Raspberry Pi, Turn the switch into ON side to power on Raspberry Pi. Press F4 (Keyboard) after booting. You may require an ETH/USB HUB HAT in this steps

4) Configure as below to enable fbtft module for displaying

  • Doenload the driver from the github
sudo apt-get install cmake
cd ~
git clone https://github.com/juj/fbcp-ili9341.git
  • Modify the source file to make the program support the current screen resolution
cd fbcp-ili9341
nano st7735r.h
  • Find the following code and change the value of DISPLAY_NATIVE_HEIGHT from 240 to 320
#if defined(ST7789) || defined(ST7789VW)
#define DISPLAY_NATIVE_WIDTH 240
#define DISPLAY_NATIVE_HEIGHT 320   //The original value was 240, changed to 320
#elif defined(ST7735R)
Gamepi20-001.png
  • Compile the program and run it.
mkdir build
cd build
cmake -DSPI_BUS_CLOCK_DIVISOR=20 -DWAVESHARE_ST7789VW_HAT=ON -DDMA_TX_CHANNEL=5 -DDMA_RX_CHANNEL=1 -DBACKLIGHT_CONTROL=ON -DSTATISTICS=0 ..
make -j
sudo ./fbcp-ili9341

After running the program, the screen will display an image, but the resolution may not be set, and the displayed image may not be completely accurate.

【Note】If a similar prompt appears as below, it means that the DMA channel has been occupied, and you need to modify the DMA channel and recompile.

bcm_host_get_peripheral_address: 0xfe000000, bcm_host_get_peripheral_size: 25165824, bcm_host_get_sdram_address: 0xc0000000
BCM core speed: current: 300000000hz, max turbo: 500000000hz. SPI CDIV: 10, SPI max frequency: 50000000hz
Allocated DMA channel 7
Allocated DMA channel 1
Enabling DMA channels Tx:7 and Rx:1
DMA hardware register file is at ptr: 0xb52ff000, using DMA TX channel: 7 and DMA RX channel: 1
DMA hardware TX channel register file is at ptr: 0xb52ff700, DMA RX channel register file is at ptr: 0xb52ff100
DMA RX channel 1 was assigned another peripheral map 1!
DMA channel 0 has peripheral map 0 (is lite channel: 0, currently active: 0, current control block: (nil))
DMA channel 1 has peripheral map 1 (is lite channel: 0, currently active: 1, current control block: 0xff0ea5a0)
DMA channel 2 has peripheral map 11 (is lite channel: 0, currently active: 1, current control block: (nil))
DMA channel 3 has peripheral map 10 (is lite channel: 0, currently active: 1, current control block: (nil))
DMA channel 4 has peripheral map 0 (is lite channel: 0, currently active: 0, current control block: (nil))
DMA channel 5 has peripheral map 6 (is lite channel: 0, currently active: 0, current control block: (nil))
DMA channel 6 has peripheral map 7 (is lite channel: 0, currently active: 0, current control block: (nil))
DMA channel 7 has peripheral map 0 (is lite channel: 1, currently active: 0, current control block: (nil))
DMA channel 8 has peripheral map 0 (is lite channel: 1, currently active: 0, current control block: (nil))
DMA channel 9 has peripheral map 0 (is lite channel: 1, currently active: 0, current control block: (nil))
DMA channel 10 has peripheral map 0 (is lite channel: 1, currently active: 1, current control block: (nil))
DMA channel 11 has peripheral map 13 (is lite channel: 0, currently active: 1, current control block: (nil))
DMA channel 12 has peripheral map 13 (is lite channel: 0, currently active: 0, current control block: (nil))
DMA channel 13 has peripheral map 13 (is lite channel: 0, currently active: 0, current control block: (nil))
DMA channel 14 has peripheral map 13 (is lite channel: 0, currently active: 0, current control block: (nil))
DMA RX channel was assigned another peripheral map!
  • Set auto-start when power on.
sudo cp ~/fbcp-ili9341/build/fbcp-ili9341 /usr/local/bin/fbcp
sudo nano /etc/rc.local
Add sentence fbcp& in the front of exit 0

1in3 lcd fb5.png

Configure /boot/config.txt file
sudo nano /boot/config.txt
#add lines below to config.txt file
hdmi_force_hotplug=1
hdmi_cvt=640 480 60 1 0 0 0
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
display_rotate=2
dtoverlay=pwm

5)Install driver for josytic

git clone https://github.com/waveshare/mk_arcade_joystick_rpi.git
cd mk_arcade_joystick_rpi
sudo ./install.sh 3
Finally, reboot it.
sudo reboot

6) Long-press "A" button (GamePi20) to enter the configuration page, configure it by pressing related buttons (GamePi20), you can also long-press to skip any button

After configuring, you can press "A" (GamePi20) to save configured and exit, or press "B" or "Start" (GamePi20) to exit without saving.

  • 【Note】If you find that there is no sound output, you need to modify the system default sound card

Open the configuration file and change the default sound card to sound card 1.

sudo vi /usr/share/alsa/alsa.conf  

Find the following two lines and modify them to correspond to the sound card.

defaults.ctl.card 1
defaults.pcm.card 1
GamePi20-10.jpeg

Install driver on Recalbox

Download the latest image from Recalbox website

GamePi15-Manual-02.jpg

  • Unzip the files download to get the .img file
  • Write the .img file to SD card
  • Copy driver to root directory of SD card
  • Connect SD card, keyboard and an HDMI display to Raspberry Pi, Turn the switch into ON side to power on Raspberry Pi. Press F4 then Alt+F2(Keyboard) after booting. (user: root; password: recalboxroot)
  • Setup display with commands below:
mount -o remount, rw /boot
mount -o remount, rw /
Configure modules file:
sudo nano /etc/modules.conf
Append lines to the file:
flexfb
fbtft_device
  • Enable SPI by adding statement to config.txt
sudo nano /boot/config.txt
add line below to the file
dtparam=spi=on
  • Create a fbtft.conf
nano /etc/modprobe.d/fbtft.conf
Add two lines to the fbtft.conf file
options fbtft_device name=flexfb gpios=reset:27,dc:25,cs:8,led:24 speed=96000000 bgr=1 fps=60 custom=1 height=240 width=320
options flexfb setaddrwin=0 width=320 height=240, init=-1,0x11,-2,120,-1,0x36,0xA0,-1,0x3A,0x05,-1,0x21,-1,0x2A,0x00,0x01,0x00,0x3F,-1,0x2B,0x00,0x00,0x00,0xEF,-1,0xB2,0x0C,0x0C,0x00,0x33,0x33,-1,0xB7,0x35,-1,0xBB,0x1F,-1,0xC0,0x2C,-1,0xC2,0x01,-1,0xC3,0x12,-1,0xC4,0x20,-1,0xC6,0x0F,-1,0xD0,0xA4,0xA1,-1,0xE0,0xD0,0x08,0x11,0x08,0x0C,0x15,0x39,0x33,0x50,0x36,0x13,0x14,0x29,0x2D,-1,0xE1,0xD0,0x08,0x10,0x08,0x06,0x06,0x39,0x44,0x51,0x0B,0x16,0x14,0x2F,0x31,-1,0x29,-3
  • Reboot Raspberry Pi and check if fb1 is recognized under /dev
reboot
  • Configure rcS file
nano /etc/init.d/rcS
Add a line to the rcS file
fbcp &
  • Modify recalbox.conf. Please check it again after save.
#global.videomode=CEA 4 HDMI
global.videomode=default
 
#global.ratio=auto
global.ratio=4/3
  • Modify /boot/config.txt file ,add lines to it
sudo nano /boot/config.txt
#添加
hdmi_force_hotplug=1
hdmi_cvt=640 480 60 1 0 0 0
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
dtoverlay=pwm
  • Finally, configure GPIO by modifing recalbox.conf file
# ------------ D2 - GPIO Controllers ------------ #
## GPIO Controllers
## enable controllers on GPIO with mk_arcarde_joystick_rpi (0,1)
controllers.gpio.enabled=1
## mk_gpio arguments, map=1 for one controller, map=1,2 for 2 (map=1,map=1,2)
controllers.gpio.args=map=5 gpio=12,20,21,13,26,16,23,4,6,17,22,5,-1
  • Reboot Raspberry Pi

Add new games (Retropie)

Maybe default games in test image are not those you want, you can also add games as you like.

  • Size of most games are always large, so we need to expand filesystem fist. Choose RASPI-CONFIG on configure page and press enter

600px-Game-HAT-Manual03.jpg

600px-Game-HAT-Manual04.jpg

  • Choose 7 Advanced Options -> A1 Expand Filesystem, Enter->Finish, (physical keyboard is required)

600px-Game-HAT-Manual05.jpg

  • Choose OK, and reboot.

2) Prepare the corresponding game ROMs.
Recommended website: http://coolrom.com/
You can download various game ROMs through the PC. For example, if we want to play Sony Playstation games, we can choose:
Game-HAT-Manual06.png
Find the game you want to play in it and download it. For example: http://coolrom.com/roms/psx/39719/Tekken_3.php
Click here to download.
Game-HAT-Manual07.png
Unzip the downloaded file to get the following ROMs:
600px-Game-HAT-Manual08.png
3) Upgrade ROMs
Connect the network cable to the Raspberry Pi (the Raspberry Pi needs to be in the same LAN as your PC). Find SHOW IP under the RetroPie list and press "A" to find the current Raspberry Pi IP. As shown below:
600px-Game-HAT-Manual09.jpg
Open the corresponding IP in your PC, as shown below:
800px-Game-HAT-Manual10.png
Copy ROMs to the corresponding directory, as shown below:
600px-Game-HAT-Manual11.png
Then, on the emulator selection interface, press "Start"->QUIT->RESTART EMULATIONSTATION, and press "A" to confirm. After restarting the emulator, you can see the newly added game.
Then start your journey of retro gamepad!


WiFi Networking

Retropie and raspberry pi OS set WIFI networking

  • Download the following files, and extract the wpa_supplicant.conf file, open the wpa_supplicant.conf file, modify the SSID and password of WIFI and save the file. File:Wpa supplicant.zip
  • Put the modified wpa_supplicant.conf file in the boot directory and restart the Raspberry Pi. (Connect the TF card to the PC through the card reader, and the opened root directory is the boot directory.)

recalbox Set WiFi Networking

  • Press START to enter the main menu
  • Select network settings
  • Change "Enable WIFI" to "On"
  • Select "WIFI SSID" and enter your network name
  • Select "WIFI Password" and enter your network password

File:GamePi2006.png

  • After connecting to WiFi, RecalBox should check the system update:

File:GamePi2007.png

Pinout Definition

The pins marked as "NC" below indicate that the LCD does not occupy this pin, and the user can use it for other applications.

Pin # Identification Description
1 3.3V Power positive (3.3V power input)
2 5V Power positive (5V power input)
3 NC NC
4 5V Power positive (5V power input)
5 NC NC
6 GND Power Ground
7 B BCM=4, WPI=7
8 NC NC
9 GND Power Ground
10 NC NC
11 Y BCM=17, WPI=0
12 Earphone jack BCM=18, WPI=1
13 LCD_RESET BCM=27, WPI=2
14 GND Power ground
15 X BCM=22, WPI=3
16 A BCM=23, WPI=4
17 3.3V Power positive (3.3V power input)
18 LCD_LED BCM=24, WPI=5
19 LCD_MOSI BCM=10, WPI=12
20 GND Power ground
21 NC NC
22 LCD_D/C BCM=25, WPI=6
23 LCD_SCK BCM=11, WPI=14
24 LCD_CS BCM=8, WPI=10
25 GND Power Ground
26 NC NC
27 NC NC
28 NC NC
29 TL BCM=5,WPI=21
30 GND GND
31 TR BCM=6,WPI=22
32 UP BCM=12, WPI=26
33 RIGHT BCM=13, WPI=23
34 GND GND
35 NC NC
36 SELECT BCM=16, WPI=27
37 START BCM=26, WPI=25
38 DOWN BCM=20, WPI=28
39 GND GND
40 LEFT BCM=21, WPI=29

Resources


Support

If you require technical support, please go to the Support page and open a ticket.