Jan 22

Friday Post: AdvanceMAME 1.4 debs

Hey All,

Updates maybe sporadic for the next few weeks.

AdvanceMAME updated to 1.4 so I have recompiled the source and made .debs out of it.  This will work on the Pi and Pi2.

AdvanceMAME 1.4 Deb Download

To install goto a terminal and type:

sudo dpkg --force-install -i advancemame_1.4-1_armhf.db
advmame

You will now have a directory in ~/.advance and will need to edit your advmame.rc file.

nano ~/.advance/advmame.rc

Add to the first line:

device_video_clock 5 - 50 / 15.62 / 50 ; 5 - 50 / 15.73 / 60

Then press ctrl-x then y and hit enter to save.

You can now place your game files into the ~/.advance/roms directory and launch a game with the command:

advmame gamename
advmame sf2

Have a good weekend all!

-Shea

Aug 07

Friday Post: Raspberry Pi iBeacon

Hey All,

Now that Hack Day at the office is out of the way, I would like to post about what I learned and some examples to get you started.  The following is some example code and an introduction to iBeacons.

Setting up a Raspberry Pi to be an iBeacon

Longer guide available here: Adafruit PiBeacon

On a fresh install of Raspbian, login to the terminal and type:

sudo apt-get update
sudo apt-get install libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev

Next we want to download, build, and install BlueZ, a bluetooth stack for Linux and the Raspberry Pi.

sudo mkdir bluez
cd bluez
sudo wget www.kernel.org/pub/linux/bluetooth/bluez-5.11.tar.xz
tar xf bluez-5.11.tar.xz
cd bluez-5.11
./configure --disable-systemd
make
sudo make install

Now that BlueZ is installed, plug in your Bluetooth Adapter and reboot your Pi with:

sudo reboot

When it is finished rebooting, log back in and go into the bluez folder by typing:

cd bluez/bluez-5.11

Check that your bluetooth device is listed by running:

tools/hciconfig

You should see a few lines appear about hci0 and that it is currently down.

Issue these commands to bring up your bluetooth device:

 sudo tools/hciconfig hci0 up
sudo tools/hciconfig hci0 leadv 3
sudo tools/hciconfig hci0 noscan

Now we are going to turn the device into an iBeacon.

 sudo tools/hcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 E2 0A 39 F4 73 F5 4B C4 A1 2F 17 D1 AD 07 A9 61 01 00 00 01 C8 00

The long set of character E2 0A 39 F4 73 F5 4B C4 A1 2F 17 D1 AD 07 A9 61 is actually the iBeacon’s ID.

The next four numbers: 01 00 are the major id and show up as 100.

The next four numbers 00 01 are the minor number and show up as just 1.

You don’t have to worry about the numbers before E2 and after the minor value 00 01.

You can set the major and minor to anything from 0 to 9999. This is how you will be able to tell apart different beacons in your app. The app is currently set to recognize Major 100 Minor 1 and Major 100 Minor 2.

If you change these numbers on your device, make sure to update the app.js code as explained below.

If you reboot your Pi, you will find that the bluetooth device has been reset and that it is no longer functioning as an iBeacon.

To fix this we are going to edit /etc/rc.local.

sudo nano /etc/rc.local

You will want to place the following code above the exit 0 at the end of the file.

sudo /home/pi/bluez/bluez-5.11/tools/hciconfig hci0 up
sudo /home/pi/bluez/bluez-5.11/tools/hciconfig hci0 leadv 3
sudo /home/pi/bluez/bluez-5.11/tools/hciconfig hci0 noscan
sudo /home/pi/bluez/bluez-5.11/tools/hcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 E2 0A 39 F4 73 F5 4B C4 A1 2F 17 D1 AD 07 A9 61 01 00 00 01 C8 00

Press ctrl-x then y to save and quit.

Now reboot your Raspberry Pi and it should become an iBeacon on startup.

Application Side

We are now going to create the iBeacon app. The instructions below are to do this on a Mac with XCode, PhoneGap, and an iOS device with a developer subscription.  You can also do this on Android with Linux, OS X, or Windows, the Android SDK, and PhoneGap.

First, you want to install cordova. On a Mac or Linux machine use:

npm install -g cordova

(If you don’t have NPM on a Mac install the amazing tool Homebrew and then install node.js)

Then create your app directory:

cordova create beacon com.yourname.beacon beacon
cd beacon
cordova platforms add ios

(for android do cordova platforms add android, but make sure the android sdk is installed)

Add some basic plugins:

cordova plugin add org.apache.cordova.device
cordova plugin add org.apache.cordova.console

and the ibeacon plugin:

cordova plugin add https://github.com/petermetz/cordova-plugin-ibeacon.git

Now lets rename the www folder in the folder. We don’t need it, it’s the default phonegap application, but it could be a useful example later.

mv www www.example

Now let’s clone the ibeacon example!

git clone https://www.github.com/ssilverm/ibeacon-www www

Edit lines 7 – 23 of app.js to match the ID, Major, and Minor of your beacons. They will trigger the page changes on your device.

app.beaconRegions =
  [
	{
		id: 'Page1',
		uuid:'E20A39F4-73F5-4BC4-A12F-17D1AD07A961',
		major: 100,
		minor: 1
	},
	{
		id: 'Page2',
		uuid:'E20A39F4-73F5-4BC4-A12F-17D1AD07A961',
		major: 100,
		minor: 2
	},


  ]

You can see how the above code is set to the same as the iBeacon we set up above, as well as another beacon with the minor value set to 2.

The next steps are how to build your iBeacon app for an ios device like an iPhone or iPad. I don’t have an Android device, but as long as you have the Android sdk the functions should be the same. Change ios for android.

When you have finished editing app.js, save it and then type:

cordova build ios

After a few minutes your terminal should read Build Succeeded.

Open the platforms/ios folder and double click on the beacon.xcodeproj file to launch XCode. With your device connected you should be able to run your app on the device.

Make sure location services are enabled for the app.

Now go walk around to where you set up the beacons and the pages should automatically change as you get closer to them. It will also revert to the main page as you move out of range.

Screen Shot 2015-08-07 at 11.06.17 PM

I hope this has been helpful!

Have a great weekend all!

-Shea

GitHub Code: https://github.com/ssilverm/ibeacon-www

 

Mar 22

Very Late Friday Post: 2 Years!

Hey All,

Sorry for the very late post this week.  Trying to figure out why I’m having such connectivity issues to my web host.  Replaced the router.  Still happens.  Modem is fine.  It’s not my host.  But my ISP can’t see it as being down since it comes up 5 minutes later.  I can VPN into work and access my host from there.  So weird.

Anyways,

Tomorrow marks my 2nd Wedding Anniversary.  It feels like it’s been a day and a half 🙂 K, I love you.  Thank you for putting up with me.

PiPlay

0.8 Beta 9 is coming along.  It should be released in a day or so.  This is the best version yet, and I’m so sorry for the Beta 8 release.  Trying to get everything working on both the Pi and Pi2 has been a challenge.  But I think this version will be great.  We have upgraded to the latest Raspbian image, moved more emulators into GitHub / Git and now can update most of PiPlay with a Git Update.  Mark has created an awesome file watching script which automatically updates the frontend when a new file has been uploaded.  No more running the scraper, it all happens in the background.

Mario Party 10

Mario Party 10 came out this week.  I had a chance to play it with a group, and, well, it feels like Mario Party Lite.  The game is gorgeous, the levels are beautiful, but there are only three game modes.  Amiibo Party, Bowser Party, and “Mario Party” which isn’t like previous games.  Everyone works together to get to the end in a vehicle, basically pooling dice rolls.  The classic game has been shortened and moved to Amiibo Party.  It feels like a lot of content is missing.  The load times are also really long.  I really wanted to love this game, but I feel like its a demo.  I’m hoping patches and some free DLC fix that.

SmartiPi

I backed the SmartiPi kickstarter a short while ago, and received my case the other day.  I think this is one of the best designed cases out there.  It easily wraps around the whole Pi, and has LEGO compatible pegs on the case.

IMG_4913

 

Have a great week(end)!

-Shea

Nov 07

Friday Post: DISPMANX_vnc and Homepass

Hey All,

Happy Friday!  I want to send a Very Happy Birthday to my Father.  This weekend is his birthday and I’m very proud to be his son.

I’ve been very busy these past few weeks,  I’ve been contracted to write a second edition of my Raspberry Pi Gaming book, and it’s taking up a lot of my time.  Even though its a subject I’m very familiar with, i’m finding out tons of new things I can do with the Raspberry Pi that have cropped because of my need to record and capture things coming from the Pi’s framebuffer.

I’ve been using a few tools, mainly ones involving DISPMANX to copy the framebuffer into a png file.  It’s called raspi2png and it works really well.  Sometimes its difficult to trigger raspi2png at the right time though.

One thing I have always wanted was a way to ssh / tunnel into the actual console terminal.  Not a new tty device, and not from XWindows, but the one that displays on /fb0.  Enter dispmanx_vnc.  I had never thought of using VNC to tunnel the framebuffer,  but Hanzelpeter has done just that with dispmanx_vnc

There’s definite input lag, and I can only achieve about 15fps, but it is the best way I’ve found to record and capture straight from the framebuffer right now.  I can ssh into my Pi, run the dispmanx_vnc command, then use a VNC viewer (I used tightvnc) to control the main display.  I’m so excited about this 😀

Other news, if anyone has a 3DS, then you know about StreetPass.  It’s a way to virtually meet others who are around you with their 3DS.  There are a bunch of mini games built into the 3DS that require you to meet people using Street Pass in order to advance. There is also Street Pass Relay, which Nintendo created last year.  This allows those who are connected to a Nintendo Zone wifi access point to StreetPass with others from around the world, who are also connected to a Street Pass Relay. So of course this has been reverse engineered, and you can now turn a Raspberry Pi into a “HomePass” StreetPass relay.

Original instructions here .  There is a premade SD card available here, but I have yet to try it out.

Have a good weekend all!

-Shea

Apr 18

Friday Post: PiPlay 0.8 Beta 3

Update: PiPlay 0.8 Beta 3 is uploaded!

Lo all,

It’s been two weeks and my Kickstarter is at 242% funded!!  This is incredible.  I’m so excited and humbled at the community support.  Thank you!

PiPlay 0.8 Beta 3

I am uploading the latest SD Card image of PiPlay.  0.8 Beta 3 includes:

  • Recompiled kernel with Xin-Mo encoder support.
  • Better GBA support.
  • Better Neo Geo support.
  • Fixed issues with Genesis and Final Burn Alpha emulators not running.
  • Genesis emulator can now use Zip files.
  • Updated PiPlay to have a better updater system.
  • 2 player keyboard support in SNES emulator.

What I’m currently working on:

  • Snapshot/screenshot support in ROM list.
  • Documentation.
  • Looking for MSX, Atari, and TG16 emulators to add.

Look for this SD Card image to be available tonight or tomorrow.  My laptop is locking up / freezing randomly and I’m trying to generate a more recent backup, so I have to hurry up and wait while that happens.

I will update this post when it’s uploaded!

-Shea

Mar 14

Friday Post: Book Stats

Hey All,

Happy Friday!  I got an email this morning from Packt giving me the stats for my book sales from October to December of 2013.  I’m happy to report that I have sold over 200 copies.  Thank you all so much!

This weekend I will be doing a last minute presentation of PiMAME with FamiLAB at the Orlando Science Center.  I will then be preparing for PyCon in Montreal, where I will be doing a poster session on how PiMAME was built in Python.  I will also be attending Instructurecon in Utah and speaking about LTIs and how we program and implement them at UCF.   It’s going to be a fun two months of traveling 🙂

I have gotten some great feedback on PiMAME 0.8, and I am going to be working on some fixes this weekend (these are my two low hanging fruit goals to complete):

  • Tankstick / Numpad support
  • Configurable Buttons through config.yaml

Have a good weekend all!

Jan 31

Friday Post: PiMAME 0.8 Preview Release (only for the brave)

Hey All!

Happy Friday!  It has been a long week.  The weather in Florida right now is crazy.  One day it’s 80 degrees, the next day its 50, then 70, then 40.  I wish it would make up its mind!  The bad part about it is everyone is getting sick.  Anyways…

PiMAME 0.8…
… preview release only for the brave edition

PiMAME 0.8 is almost done.  We have a few more bugs to fix, and some more features to test, but the basics are there.

I have an installer available for the brave to try.  It will make a new pimame folder in your home directory, so I recommend using a fresh install of Raspbian.

From the home directory in your command line, enter in the following command:

wget -O - http://pimame.org/installer.sh | bash

When that has finished running, reboot your Pi.  It should automatically boot up into the new launcher, and a web interface should be available at your Pi’s IP address.

If you decide to test this, please send me any and all feedback!  It is much appreciated!

This has been a huge labor of love, and I couldn’t have done it without some of the contributors to the codebase:

  • Zach – https://github.com/zachberry
  • Connor – https://github.com/Conno123009
  • Scotty – https://github.com/KingScooty

Thanks everyone!  Have a great weekend!

-Shea