2016
09.08

My model B has been sitting mainly unused now for about 10 months since I got my 2 and then a 3 in the last year. It has been sitting on my desk in its shiny PiBow reminding me of yesteryear’s of tinkering and projects. I decided I needed to give it a purpose and since it was now 3 years old it had to be a good one.

Cupcade
The Adafruit cupcade was the perfect project for the task. Not only was it a challenging and potentially fun project but if successful it would mean this old gal would have a home that would attract the attention of anyone who saw it and lead to countless conversations about the coolness of the Pi.

My model B would LIVE again

The package arrived
This is the largest project I’ve undertaken so far with a lot of components that would need to be combined to make the final product I was a bit nervous after the package arrived.

First thing I did was download the prebuilt cupcade image and imaged the SD card with it. This was so I had a known good OS to test the hardware with before I started any assembly. I put the PiTFT onto the GPIO of the Pi and powered up the image.

No problem, screen came on and booted to gamera. The screen and Pi were good to go.

ElectronicsIMG_1863

I had my laptop with the assembly guide opened and my iron heated and just dove into it with the guide.

This was only my second significant project with a soldering iron the last being my bluetooth controller with the Bluefruit. That project I ran into may soldering challenges and it was not at all pretty but I did prevail in the end.

This time around I was handling the soldering much better. I wasn’t making perfect hershy kiss style joins yet but it was a vast improvement over the last attempt and I had no horrid cross connection blobs to deal with. Soldering went fairly quickly starting with the speaker, then the amp/button pcb and the thumb stick pcb.

IMG_1868

 

Dry run

This was it, did I do it right or did I have to troubleshoot my connections. Much to my surprise the whole system worked first try. The buttons responded, the screen turned on and the speaker also functioned very well. Onto the cabinet

 

Cabinet

The Adafruit cupcade cabinet is a wonderful micro cab but it is probably the most challenging part of the whole damn project. They very cleverly designed it so that the nuts just slot into the + cross joints and the bolt comes in from the adjoining panel to connect. The unfortunate part is you have to take your dry run apart completely then rebuild it as you assemble the case which caused some issues I’ll explain later on. Getting the first half of the cab on its side together was fairly easy getting the second half on required some balance and prayer. Leave one side a little bit loose so you can get the front, banner and back panels in then tighten the whole thing once all the pieces are in.

Problems!

So after all that I plug it in and nothing happened. I turned it off and then back on. Smelt terrible. Immediately off again. I laid the cab down on its side and took the one panel off. Everything looks ok. I look at my Pi cabling and compare it to a picture I took earlier. Pin 1 on the ribbon is in the wrong place!!!!

  • Swapped it
  • Powered it
  • Still starts (lucky)

Make sure you put your Pin 1 where it belongs!!! Good thing I took a picture of the working one…

Second problem, the game buttons and stick aren’t working now. The PCB wasn’t connected to the underneath of the PiTFT correctly. It took some time but I managed to get it seated correctly without having to take the whole thing apart again. This is why it is kinda of a bummer you have to take it all apart after the perfectly working dry run šŸ˜‰

Now everything works so I put the cab back together and tightened the screws.IMG_1897

Software

The cupcade has its own image of Raspian Wheezy, retrogame, gamera, adv mame but the problem is that this is all seriously out of date and does things in not the best way anymore. Adafruit has several newer TFT guides that do screen accelerating with FBCP which means your software options are way more open that they used to be.

I updated the image to Jessie, downloaded Retropie 4’s setup script and installed the core packages, lr-quicknes, mame4all, lr-picodrive (genesis), lr-gambatte(gameboy), lr-beetle-pce-fast(tg16) and the pixel theme (looks the best)

I also installed and enabled the usb daemon so I could do hands free rom upload.

I overclocked the model B to 1GHZ with a 500mhz core. This allows for the widest possible emulation on this Pi.

Why FBCP?

Without it you would have to either pick portrait or landscape mode in the beginning of your build AND you would be very limited in what you could emulate since you’d be wasting a lot of cpu drawing by not making use of the PI’s GPU. With it I can run arcade games made upto the early 90’s and all the 8 and 16 bit era systems.

Gameplay

It’s surprisingly easy to get into playing on this and not even notice the size. Wrap your hands around the cab, thumbs on the stick and 2 buttons and it’s perfectly enjoyable and engaging. The mono speaker works very well and with Retropie you can control the volume from the emulationstation menu or Retropie Menu. The emulators above I specifically named because lr-mame4all proved to be a lot slower than stock mame4all and the other 2 NES emulators available were in fact slow on the model b (and probably a pi 0 too).

IMG_1876mame4all controls
If you use stock mame4all you’ll need to change the controls through mame you can do this by pressing [tab] when a game is running on an attached keyboard and selecting input general. You can navigate to each button you want press enter on the keyboard then hold the corresponding button on the cupcade until it shows up.

For UI exit you can mimic the emulationstation start+select by holding the 2 black buttons it will detect them both as a combo

 

 

The cupcade was a lot of fun to build and even more fun to play I recommend it to anyone with an old model B that needs a home.

 

 

 

2016
04.01

I’ve been looking for things to do with my older Pi’sĀ since purchasing the Pi 3 last month and I have been leaning back towards the Pi’s roots of quirky electronics projects. I bought a Pi camera a few weeks back and was considering making a portable PiCam and I also wanted to make a Remote goal light for hockey games.

I decided to actually combine the two ideas into 1. I am going to make an NHL Goal light that takes goal reaction pictures with the Pi camera.

First trials

Initially I wanted to see if I could set off the light I had with my Pi. The light takes a 3V disc battery, the Pi can output 3.3V over GPIO. What I did was I took a pair of Jumper cables and lobbed off the one end and stripped it a bit and plugged the other end into a GPIO pin and a GND pin. I took the stripped ends and put them on the +/- where the battery would go and pressed the button while the pin was set HIGH. Voila it can work in the basic sense and it didn’t blow up the light.

Converting the bottle opener

I tinned the stripped cable and then soldered it to the positions on the contacts for a permanent connection.

Then I cut up some small cardboard pieces about 1mm thick. The light originally worked by setting off 1 or more of 3 buttons on the light that pressure from using the bottle opener would cause. With the pieces of cardboard over the small buttons I put the bottle opener piece back into the light and locked it into place over the cardboard. This keeps the buttons permanently pressed down so when I set the GPIO pin HIGH it activates the light.

Python script

I created a python script that activated the pin, waited 10 seconds then pulled it down

#!/usr/bin/python
import RPi.GPIO as GPIO              
from time import sleep               
GPIO.setmode(GPIO.BCM)               
GPIO.setup(15, GPIO.OUT)              
    
GPIO.output(15, 1)      
sleep(10)                  # run horn 10 seconds  
GPIO.output(15, 0) 
GPIO.cleanup()             # resets all GPIO ports used by this program  

 

Remote control

What I did for the remote control was installed a web server on the Pi and created a script to execute the code above. Now I know you can run python within apache I have seen the lengthy guides but I like the fast route so I did PHP for the web side of the scripting.

apt-get install apache2
apt-get install php5

 

After it was installed I whipped up a quick script to execute the python but I got an error that you should be root to access the GPIO. I changed the Default USER/GROUP of Apache to PI. Since this is a single purpose local network project that didn’t seem to big of a deal to me however if you use whatever device you do this to for more than just that I wouldn’t recommend it. If you ran actual web pages along with it and it was somehow compromised what I did there in essence gives the attacker “pi” user privilages. Figured I should spell that out before continuing.

Simple webpage to activate horn

I wrote a simple web page that has an image of a goal horn. Click the image and the horn goes off. The website can only be accessed within my local home network. I also set an icon for the site so that when I save the bookmark to my mobile phone it looks like an App icon.

<html>
	<link rel="apple-touch-icon" href="goal.jpg" />
	<body>
		<a href="/?goal=1" border=0><img src="goal.png"/></a>
<?php
	if(isset($_GET["goal"])) {
		exec("./webhorn.py");
	}	
?>
	</body>
</html>

 

Next plans

So now that I have upgraded the horn from bottle opener to remote horn the next plan is to make it do automatic goal horning for which team I tell it. I also plan to add the ability to play a louder horn audio file through the audio out and also incorporate the Raspberry Pi camera to take goal reaction shots. Stay tuned for more!

2016
03.19

One of the excellent new features of the Raspberry Pi 3 is the built in bluetooth. If you are already running a set up OS and do not wish to start over again you can install the drivers to enable to feature manually with apt-get

Note, I am on raspian Jessie, I do not know if this will work for older wheezy users.

sudo apt-get install pi-bluetooth

This will install the appropriate driver for the pi 3 and once it is done setting up you should see something similar to this:

pi@retropie:~ $ hcitool dev
Devices:
hci0 B8:27:EB:C0:D7:C1

 

From there you can pair your bluetooth devices as normal.

This is a great upgrade to the Pi as it not only saves you $20 between a bluetooth and a wifi adapter but you also reclaim 2 USB ports.

2016
03.14

I was tinkering with the core_freq and v3d_freq options in /boot/config.txt trying to see if I could squeeze any more out of the Raspberry Pi 3.

I started at 600. System booted, splash screen displayed, started to load Emulation station…..Black screen. System froze.

Ok… Back up to 575. Booted, Splash, ES loaded….Graphical artifacts for a few seconds…freeze? Not completely I could still SSH so I backed off the settings again.

550, boot, splash, ES, Able to navigate…No Artifacts… 3D applications work…Jackpot.

So, it’s only a tiny improvement but it still counts.

core_freq=550
v3d_freq=550
h264_freq=333

 

I tried fiddling with the h264 but it seemed to cause more instability at anything higher. The extra 50 over my previous 500 did give an improvement to 3D rendering on some struggling applications. It’s a significant improvement over the default stock settings as well. The VideoCore IV is underpowered in todays world so every notch on the belt counts.

EDIT: I backed core_freq and v3d_freq down to 525. After a full day of running the Pi became unstable at 550 but 525 has been fine for a couple weeks now.

Get the rest of my settings from my previous post

2016
03.08

I have been enjoying my Raspberry Pi 3 for a few days now the extra speed and built in wifi have proven to be excellent upgrades to the product.

Overclocking still seemed to be a topic not too many people had been willing to hit yet, even myself I was waiting for something in the raspi-config to show up. Last night in the retropie dev channel a fellow name Twisted0815 showed up and said he had a stable overclock at 1450 running and it was running well. I decided to give this a whirl and asked for his settings

#1450
sdram_freq=500
arm_freq=1450
over_voltage=6

 

After adding the settings to /boot/config.txt and rebooting sure enough the pi came up without issue.

I popped open a heavy application and left it running for 10 min, no issue.

I played some games on it for a half hour straight no issue.

Heat

I already had heatsinks on my Pi, I always heatsink a machine I intend to overclock and all my Pi’s going back to the Pi 1 B were overclocked in some manner but here are my reports.

Idle: 49C
Moderate application usage: 59C
Single and dual core load: 63C

Further testing

After doing some stress testing to the system at this setting I noticed with one core operations and dual core 1450 was stable but at 3 and 4 cores it would lock the system. I went to a thread on raspberrypi.org where they seemed to test every setting they could in 10mhz increments and tried them out with 1450. Still experienced a lockup eventually but made it further with the 4 core test than before.

I backed my settings off to 1350 like theirs and I was able to get a stable test result with all 4 cores and no crash. My temp in the peak of the test with all 4 cores loaded Ā floated around 79C to 80C with a heat sink.

I hope we get an official answer from the foundation at some point and perhaps a rasps-config option but I’ll stick with 1350 for now unless someone comes up with a stable 4 core solution that’s higher.

Updated finalized settings:

#gpu

core_freq=500
v3d_freq=500
h264_freq=333

#cpu
arm_freq=1350

#RAM

sdram_freq=570
sdram_schmoo=0x02000020
over_voltage_sdram_p=6
over_voltage_sdram_i=4
over_voltage_sdram_c=4

over_voltage=4