Raspberry Pi Portable VN console build

Forum organization and occasional community-building.
Forum rules
Questions about Ren'Py should go in the Ren'Py Questions and Announcements forum.
Message
Author
User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi handheld VN console build.

#16 Post by Imperf3kt »

I spent a while last night tinkering and discovered that even under low load, the Pi 3 gets HOT, as in ~80 degrees celcius hot. Now, accoding to the tech specs, this little thing will HALVE the processor speed to 600Mhz if it exceeds 82.7 degrees.

So my priority now, is to work out how best to keep this thing around 30 - 40 degrees, without adding a ridiculously oversized heatsink + fan combo.

This research led me to discover the recently released, Asus Tinkerboard:
Image
Now, the Tinkerboard is somewhat more pricey than the Raspberry Pi (probably not made in communist China) but it has the advantage of 2gb of RAM (meaning most of the heavier Ren'Py games should work on it) and a 1.8Ghz quad core CPU.
Along with this, it includes an upgrade-able WiFi antennae and natively supports 4k UHD via HDMI. There is no mono audio with composite video, but there is stereo 192Khz 24bit Hyperaudio support and a microphone jack in its place.
The mSD card slot is also UHS 1 compliant. The ethernet port is gigabit, opposed to the Pi's 10/100Mbit
The rest of its features and specs (including shape, placement and form factor) are identical to the Raspberry Pi 3, except the lack of composite video.
https://www.asus.com/au/Motherboards/Tinker-Board/

I'll look into this board more, but I think, for the sake of my original goal, the Pi 3 will do very nicely.
For now, I'm off to buy some Arctic Silver (or whatever the best thermal grease I can get is) and some sort of aluminium or copper heatsink. Copper would be best, but its pricey.


Also, I know I said I wanted to make sure others could replicate the same thing I build, and I've gone ahead and used a repurposed battery.
Well, I took a look, and you can get a really decent Lithium battery pack for around 30 bucks(AUD) from element14. The dimensions are about the same as the Raspberry Pi, so it'd be a good fit.
http://au.element14.com/skross/1-302168 ... dp/2671706


E: After some more research, I think making this thing handheld is going to be a challenge.
So some thoughts on design are probably going to have to be rethought out.

For now, I've added a plastic shielding strip, some thermal grease and a salvaged aluminium heatsink from a dead BD player. To further help cool the Pi, I added an old 50mm fan that works great at 5v. I plugged this directly into pins 4 and 6 (4 is positive) and placed it at one end of the Pi (instead of above it)
This allows greater dissipation of heat, but also keeps space required to a minimum.
The setup brings the Pi down from ~80℃ to ~32℃. This is a major improvement of more than 50% and will ensure the CPU never throttles down to 600Mhz.

Here's a shot of it while turned on.
Image
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi handheld VN console build.

#17 Post by Imperf3kt »

I guess avoiding multi-posting is gonna be unavoidable here.
Anyway, lite update.

The more I try to fit a cooling system on this thing, the less "handheld" it begins to look.
Currently I have the following dimensions:

120mm (L) * 70mm (H) * 32mm (D) - does not account for a screen or battery (measurements not 100% accurate)
I can't squeeze any shallower on the depth without sacrificing cooling efficiency - which I am not willing to do.
Here's a mock up of current design. The grey represents the case which I ended up choosing opaque grey acrylic for. The black is fans, two in, one out plus vents (to prevent static pressure)
The grey square in the board represents the cooler/heatsink.
This likely will change in future.

Note: Image not to scale.
Image


Anybody got questions / tips / concerns?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Raspberry Pi handheld VN console build.

#18 Post by PyTom »

As a question - why are you trying to build this around a Raspberry PI? It seems like you'd probably get better results with a sufficently powerful android tablet, which you could then rebrand.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi handheld VN console build.

#19 Post by Imperf3kt »

Mostly for compatibility. Tablets run Android unless you shell out an unreasonable chunk of dough for a Windows one.
Many Ren'Py games I see do not get an Android release.

The other part is I wanted the experience.

Lastly, I'm aiming for a five inch screen. I don't see any tablets under seven.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

scriptbeast
Newbie
Posts: 3
Joined: Wed Apr 26, 2017 7:54 pm
Projects: A Simple Act | Monster Crush | ETERNAL
Github: scriptbeast
itch: scriptbeast
Location: h e l l
Contact:

Re: Raspberry Pi handheld VN console build.

#20 Post by scriptbeast »

have you considered hooking it up to a portable phone charger? you could order one off amazon
might be a bit more expensive but if you have one it should work, considering the pi uses microusb for power like most android phones
thats what a friend of mine uses to power his, and it lasts all day running piratebox or most of the day running a pentesting distro with that lcd touchscreen
edit: it appears you already tried the ones already in your possession. welp, amazon still stands if ya need it
edit again: nvm this stands for everyone who doesnt want to use a regular lithium ion but looks like youve got it figured out
didnt see page two lol

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi handheld VN console build.

#21 Post by Imperf3kt »

I actually changed that design but haven't had time to post.
It worked out better to simply purchase a 5v out, 3.4A (2.4A + 1A) li-po 12000mAh battery pack.

I've been having immense difficulty installing Ren'Py on the thing though and am about ready to just scrap the whole idea.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: Raspberry Pi handheld VN console build.

#22 Post by Unin »

I'm pursuing a similar project of renpy on a raspi. You really don't need a vertical fan and heat sink though. Here's a 4cm tall enclosed setup I use for my RPi3 pitop. Its a 4cm fan and a heatsink (1.4x1.4x0.6cm) cut down from a mosfet I pulled from an old dvd player and held on for the past 6 months with unscented diaper-rash cream (I don't actually recommend that last part :wink: ). My vent holes are under the board.

The temperature logging pygame script i'm using just calls subprocess.check_output(["vcgencmd", "measure_temp"]) and i'm getting a max temp of 54.8C doing a full benchmark subprocess.Popen(["sysbench", "--test=cpu", "--cpu-max-prime=20000", "--num-threads=4", "run"])
higher than your temp, but I'm sitting in 30C room right now :( . The graph shows a single benchmark, but it stays level at 55C on consecutive tests.
Attachments
rats nest of wires is to RTC module, fan, and side mounted rotary encoder/button
rats nest of wires is to RTC module, fan, and side mounted rotary encoder/button
IMG_1838.JPG
IMG_1837.JPG
pitop.jpg

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi handheld VN console build.

#23 Post by Imperf3kt »

Have you had any success setting Ren'Py up?
So far I've had dozens of failed attempts and at one point I was ready to just throw everything in the garbage.

My 5" TFT touchscreen display arrived yesterday, so I was hoping to fiddle with it tonight for half an hour or so.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: Raspberry Pi handheld VN console build.

#24 Post by Unin »

I installed ren'py 6.18.3 several months ago following http://fuckyeahrenpy.tumblr.com/post/10 ... spberry-pi
but that was on noobs v2.0.0 and I installed the experimental driver afterwords.

I'll try 6.99 on a fresh rasbian install and see if I can write up a detailed walkthrough.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi handheld VN console build.

#25 Post by Imperf3kt »

I've not really updated this with the latest design changes, but I've changed a few things.
I'm not sure what I already posted and don't feel like re-reading my posts, so I'll describe the project as it currently stands.

I'm using a 12,000mAh Li-Poly battery pack. This gives oout 5v @ 3.4A (2.4+1.0)
At its rated 3.7volt storage, it lasts 44.4 Watt hours, which I am guessing should bring me roughly 15-18 hours of use with the Pi.
I have temporarily removed both the fan + heatsink so as to install a 5" touchscreen. I plan to change this later, but for now, direct access to the GPIOs is all I've got until I get a breadboard of some sort. I've got an old (new, never used) IDE ribbon cable that perfectly sits on the GPIOs (except for one pin, IDE has 39 pins, GPIO has 40)
Once I check the cable's rated voltage and amperage specs, I'll probably use that to secure the GPIO pins to the monitor.

Handheld has gone out the window. With the Pi + monitor alone, this thing is 30mm deep. Stick on a 12mm deep battery and suddenly you've got one hell of a chunky handheld even before encasing it.
So, I'm still aiming for portable, just this time a portable console.

For a bit of retrogaming nostalgia, I've decided to make a case that resembles the PS1 from the SCPH-7xxx series, albeit smaller. No, not the PSOne, that "thing" was ugly.
There were some things I disliked about the SONY Playstation, like the massive circular on/off button and eject button. I'll use newer designs, partly for aesthetics, mostly to avoid lawsuits >.> (not that there should be any)
The CD lid will have to be recetangular and will hopefully house the monitor. Flippy ejection mechanism included.

As to controls, aside from a touchscreen, I am hoping to include two buttons that will simulate left + right mouse clicks. At this point, I can see a dozen reasons this isn't gonna work with all Ren'Py games, but its been fun.

The HDMI port will be exposed so a large screen can be used instead if desired. I need to work out how to automatically turn the 5" monitor off when it is unplugged, or at least allow access to the backlight switch to conserve power.

The USB ports will also be exposed (maybe repositioned via an expansion header.
The audio jack will probably be used for headphones only, no built-in speakers (at this time)

More design ideas / changes may have been missed.

Now if only the software side was going so smoothly...
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi handheld VN console build.

#26 Post by Imperf3kt »

-rage post removed-
Technical difficulties almost cause project fold.
Last edited by Imperf3kt on Sun Jun 18, 2017 9:11 pm, edited 1 time in total.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Taleweaver
Writing Maniac
Posts: 3428
Joined: Tue Nov 11, 2003 8:51 am
Completed: Metropolitan Blues, The Loyal Kinsman, Daemonophilia, The Dreaming, The Thirteenth Year, Adrift, Bionic Heart 2, Secrets of the Wolf, The Photographer
Projects: The Pilgrim's Path, Elspeth's Garden, Secret Adventure Game!
Organization: Tall Tales Productions
Location: Germany
Contact:

Re: Raspberry Pi handheld VN console build.

#27 Post by Taleweaver »

Imperf3kt wrote:Renpy on pi is impossible fuck this shit. Project canned
Aw. What happened that made you give up?
Scriptwriter and producer of Metropolitan Blues
Creator of The Loyal Kinsman
Scriptwriter and director of Daemonophilia
Scriptwriter and director of The Dreaming
Scriptwriter of Zenith Chronicles
Scriptwriter and director of The Thirteenth Year
Scriptwriter and director of Romance is Dead
Scriptwriter and producer of Adrift
More about me in my blog
"Adrift - Like Ever17, but without the Deus Ex Machina" - HigurashiKira

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi handheld VN console build.

#28 Post by Imperf3kt »

I'm probably gonna cool off soon and retry, but currently I'm a little ... upset that I can't get pygame_sdl2 to work. This is one of Ren'Py's dependancies so without it I can't do jack squat.

I'm not sure where things went wrong and the error messages I'm getting don't give me much to go on in order to work out why it won't work.
I've been at this for a week straight with no luck and I'm getting thoroughly annoyed at having to reflash my SD card every night.

Edit:
I just cannot get Pygame_SDL2 to install
I found this. Did PyTom have a hand in SDL2ś creation?
https://www.reddit.com/r/pygame/comment ... game_sdl2/

Anyway. traceback:

Code: Select all

pi@raspberrypi:~ $ git clone https://www.github.com/renpy/pygame_sdl2
fatal: destination path 'pygame_sdl2' already exists and is not an empty directory.
pi@raspberrypi:~ $ pushd pygame_sdl2
~/pygame_sdl2 ~
pi@raspberrypi:~/pygame_sdl2 $ python fix_virtualenv.py $VIRTUAL_ENV
/usr/include/python2.7 is not a symlink. Perhaps this script has already been run.
pi@raspberrypi:~/pygame_sdl2 $ python setup.py install

sh: 1: sdl2-config: not found
Traceback (most recent call last):
  File "setup.py", line 59, in <module>
    parse_cflags([ "sh", "-c", "sdl2-config --cflags" ])
  File "/home/pi/pygame_sdl2/setuplib.py", line 93, in parse_cflags
    output = subprocess.check_output(command, universal_newlines=True)
  File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['sh', '-c', 'sdl2-config --cflags']' returned non-zero exit status 127
pi@raspberrypi:~/pygame_sdl2 $ python setup.py install_headers
sh: 1: sdl2-config: not found
Traceback (most recent call last):
  File "setup.py", line 59, in <module>
    parse_cflags([ "sh", "-c", "sdl2-config --cflags" ])
  File "/home/pi/pygame_sdl2/setuplib.py", line 93, in parse_cflags
    output = subprocess.check_output(command, universal_newlines=True)
  File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['sh', '-c', 'sdl2-config --cflags']' returned non-zero exit status 127
pi@raspberrypi:~/pygame_sdl2 $ popd
~
pi@raspberrypi:~ $ 
Iḿ over this. I´ve been at this most nights for two weeks and I've had enough. To hell with this headache.
Last edited by Imperf3kt on Sun Jun 18, 2017 9:14 pm, edited 1 time in total.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Raspberry Pi handheld VN console build.

#29 Post by PyTom »

Yes, I did. I don't support Raspberry Pi as a platform, however.

I'd suggest that a lot of your problems stem from not running in a virtualenv. You also seem to be missing the SDL2 development library package. I'd suggest running through the documentation at:

https://github.com/renpy/renpy

in order. It looks like you're skipping steps, and that's why things aren't working.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Delete this thread

#30 Post by Imperf3kt »

Running a virtual environment fails with the error "unknown command"

Here's what I did (this will be edited many times)

Code: Select all

sudo aptitude install virtualenvwrapper python-dev libavcodec-dev libavformat-dev \
    libavresample-dev libswresample-dev libswscale-dev libfreetype6-dev libglew1.6-dev \
    libfribidi-dev libsdl2-dev libsdl2-image-dev libsdl2-gfx-dev \
    libsdl2-mixer-dev libsdl2-ttf-dev libjpeg-turbo8-dev
Everything except libjpeg-turbo8-dev installed or already existed. Libjpeg-turbo8-dev appears to be missing, so following the advice in the tumblr linked in my other thread, I installed libjpeg-turbo64 or whatever it was called.

Next the github says "We strongly suggest installing the Ren'Py modules into a Python virtualenv"
"strongly suggest" so when it failed with 'unknown command', I assumed this step was outdated/incompatible with Raspberry Pi and not strictly mandatory.
Skipping this step, I installed Cython (two weeks ago)

Code: Select all

pip install -U cython
Which took a very long time.

Next I installed the debian media repositories

Code: Select all

stuff
Which took hours.

And finished with

Code: Select all

git clone https://www.github.com/renpy/pygame_sdl2
pushd pygame_sdl2
python fix_virtualenv.py $VIRTUAL_ENV
python setup.py install
python setup.py install_headers
popd
Which fails every time because I don't know why. This is where I've been stuck for 15 days, 3 hours every day. Hence, I'm pissed off / over it.

$20USD via paypal to the firsr person who can give me instructions that work.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: No registered users