Difference between revisions of "GamePi20"

From Waveshare Wiki
Jump to: navigation, search
m (Text replacement - "== Support ==" to "")
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<div class="wiki-pages jet-green-color">
 
{{Infobox item
 
{{Infobox item
 
|img=[[File:GamePi20-8.jpg|400px|{{Amazon_nolink|default={{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}|url=link=https://www.waveshare.com/gamepi20.htm}}]]
 
|img=[[File:GamePi20-8.jpg|400px|{{Amazon_nolink|default={{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}|url=link=https://www.waveshare.com/gamepi20.htm}}]]
Line 11: Line 12:
 
{{Product List|Game Machines/Portable Game Machines/Raspberry Pi Based}}
 
{{Product List|Game Machines/Portable Game Machines/Raspberry Pi Based}}
 
}}
 
}}
 +
=Overview=
 +
==Features==
 +
*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 charging circuit, 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.
 
==Support Raspberry Pi==
 
==Support Raspberry Pi==
 
*Raspberry Pi Zero
 
*Raspberry Pi Zero
Line 16: Line 25:
 
*Raspberry Pi Zero WH
 
*Raspberry Pi Zero WH
  
==How to use it==
+
=How to use it=
===Assembly===
+
==Assembly==
 
*[[GamePi20 Assembly]]
 
*[[GamePi20 Assembly]]
===Hardware connection===
+
==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.'''
 
*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
 
*Mount the extension board to the metal box
Line 64: Line 73:
 
*#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.
 
*#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===
+
==Method 2: Install driver==
 
'''Install driver on Retropie'''
 
'''Install driver on Retropie'''
  
Line 287: Line 296:
 
For more operations, you can read [https://retropie.org.uk/docs/ Retropie Instructions]
 
For more operations, you can read [https://retropie.org.uk/docs/ Retropie Instructions]
  
== Resources ==
+
= Resources =
 
{{RPi Software}}
 
{{RPi Software}}
  

Revision as of 03:29, 16 July 2022

GamePi20
GamePi20-8.jpg

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

{{{name3}}}

{{{name4}}}

{{{name5}}}

Overview

Features

  • 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 charging circuit, 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.

Support Raspberry Pi

  • Raspberry Pi Zero
  • Raspberry Pi Zero W
  • Raspberry Pi Zero WH

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 One 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 One Drive
Retropie v4.8 Raspberry Pi Zero 2W pi/raspberry Gogle Drive
  • Download image file, unzip and write it to SD card
  • Insert the SD card to Raspberry Pi, assemble GamePi20 as #Hardware connection
  • turn the switch into 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.
  • Download ROMS of games you like

600px-Game-HAT-Manual08.png

  • Connect your Raspberry Pi to network (Make sure the network you connect is in the same LAN as your PC). Find SHOW IP in Retropie list, press “A” to query current IP address of your Raspberry Pi.

600px-Game-HAT-Manual09.jpg

  • Open it with the IP address on your PC

800px-Game-HAT-Manual10.png

600px-Game-HAT-Manual11.png

  • Then on emulator choose page, you can press “Start”->QUIT->RESTART EMULATIONSTAION, press “A” to confirm. Then restart emulator, you can find the game added.

For more operations, you can read Retropie Instructions

Resources


Support

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