Use the Wii Nunchuck as a MIDI controller

Some weeks ago Wolfgang Gaube (a composer, musician and and sound designer) wrote me an email asking me, because I had some experience with the Wii and MIDI, whether it would be possible to use the Wii Nunchuck as a MIDI controller (hardware or software which generates and transmits MIDI data to MIDI-enabled devices). That’s how our cooperation started, we exchanged gear and setup details and started to work. Some research, scripting, trail and error resulted in a slick script for GlovePie…

Prerequisites (what you need to get it working):

  • Hardware
    • Computer
    • Bluetooth adapter (an adapter for using an open wireless protocol for exchanging data over short distances).
    • Wii Remote (also known as a wiimote, the primary controller for Nintendo’s Wii console)
    • Wii Nunchuck (Its appearance when attached to the Wii Remote resembles the nunchaku, hence the name)
  • Software
    • GlovePie (is a free Programmable Input Emulator, originally for the Essential Reality P5 Virtual Reality Glove, which now supports a huge range of input devices, especially the Nintendo Wii Remote (Wiimote))
    • MIDI Yoke (allows you to connect the MIDI output from one program to the MIDI input of a different program)
    • MIDI-OX (is a 32 bit multi-purpose tool: it is both a diagnostic tool and a System Exclusive librarian. It can perform filtering and mapping of MIDI data streams. It displays incoming MIDI streams, and passes the data to a MIDI output driver or the MIDI Mapper.)
    • ZynAddSubFX (is a open source software synthesizer capable of making a countless number of instruments, from some common heard from expensive hardware to interesting sounds that you’ll boost to an amazing universe of sounds)
    • WiiNunChuck2Midi GlovePie script (a script that converts Nunchuck movements to MIDI controller information)

 

Let’s get going:

Where possible I provided links to the necessary download locations.

Download MIDI Yoke and install it.

Press Close and REBOOT your computer.

 

 

Configuring MIDI ports in Windows

Configure your MIDI ports in Windows by accessing the control panel (Start / Control Panel) and select “Sounds and Audio Devices”.

Go to the “Audio” TAB and select “Out to MIDI Yoke: 1”  as MIDI music playback device and click “OK”.

 

Download MIDI-OX and install it.

 

Configuring MIDI-OX

Now we have to configure MIDI-OX to pass the MIDI signal from MIDI Yoke: 1 to MIDI Yoke: 2

 

What is really happening:

GlovePie converts the Wii Nunchuck movements to MIDI controller information and sends the MIDI signals via the “MIDI Yoke: 1”  to MIDI-OX, MIDI-OX on its turn sends the MIDI signals to ZynAddSubFX via “MIDI Yoke: 2”.  ZynAddSubFX converts the MIDI signal into a sound effect (Wii Nunchuck movements >> GlovePie >> MIDI Yoke: 1 >> MIDI-OX >> MIDI Yoke: 2 >> ZynAddSubFX >> Sound effect).

 

Start MIDI-OX go to “Options” and select “”MIDI devices”.

 

Now select “In From MIDI Yoke: 1” as input and select “Out To MIDI Yoke: 2” as output and click OK.

 

 

Download ZynAddSubFX and install it.

 

Configuring MIDI ports in ZynAddSubFX

Go to “File” and select “Settings”.

In the right bottom corner select “In From MIDI Yoke: 2” as MIDI-in device, and click “Close”.

 

Download GlovePie and install it. GlovePie doesn’t come with an installer so you have to create a folder and extract the zip file into the folder. In my case I created a folder called “C:\Program Files\GlovePie”. I also created a shortcut to my desktop (right click “GlovePIE.exe”, send to, shortcut to desktop).

 

 

Configuring GlovePie

After the installation of GlovePie we need a script that actually converts the Wii Nunchuck movements to MIDI controller events. So I wrote a script called Wii Nunchuck to MIDI (WiiNunChuck2MIDI), download the WiiNunChuck2MIDI GlovePie script and extract it to the “GlovePie\WiimoteScripts” folder (In our case the “C:\Program Files\GlovePie\WiimoteScripts” folder).

Check this update : Wii2MIDI including NunChuck MIDI control

 

Connecting the Wii Remote to Windows

Connect WiiMote to Windows by accessing the control panel (Start / Control Panel) and select “Bluetooth Devices”.

Click the “Add” button.

Select “My Device is set up and ready to be found”, press 1+2 on your WiiMote and click “Next”.

Select the found Nintendo device and click “Next”.

Select don’t use passkey and click “Next” then click “Finish”.

 

Now let’s Rock and Roll !

  • Start ZynAddSybFX select an instrument by going to “Instrument” and select “Show instrument bank” use the drop down box in the upper left corner and choose something you like (you can change instruments later while everything is up and running).
  • Start MIDI-OX
  • Connect your Wii Remote to Windows
  • Hookup your Wii Nunchuck to your Wii Remote
  • Start GlovePie
  • Load and start the WiiNunChuck2MIDI script
  • Play notes with you (virtual) keyboard and start controlling your sounds with Nunchuck movements 🙂
  • Have fun !!!

 

 

Suggestions for improving this article are welcome, please let me know and drop me a line

Combining the WiiMote with GlovePie to make MIDI music

After the first article on using the Wii Remote in Windows XP I tried to take it one step further, taking it to the next level using the WiiMote to make MIDI music.

Prerequisites (what you need to get it working):

  • Hardware
    • Computer
    • Bluetooth adapter (an adapter for using an open wireless protocol for exchanging data over short distances).
    • Wii Remote (also known as a wiimote, the primary controller for Nintendo’s Wii console)
  • Software
    • GlovePie(is a free Programmable Input Emulator, originally for the Essential Reality P5 Virtual Reality Glove, which now supports a huge range of input devices, especially the Nintendo Wii Remote (Wiimote))
    • MIDI Yoke (allows you to connect the MIDI output from one program to the MIDI input of a different program)
    • MIDI-OX (is a 32 bit multi-purpose tool: it is both a diagnostic tool and a System Exclusive librarian. It can perform filtering and mapping of MIDI data streams. It displays incoming MIDI streams, and passes the data to a MIDI output driver or the MIDI Mapper.)
    • ZynAddSubFX (is a open source software synthesizer capable of making a countless number of instruments, from some common heard from expensive hardware to interesting sounds that you’ll boost to an amazing universe of sounds)
    • Wii2MIDI GlovePie script (a script that converts buttons being pressed on the Wii Remote to MIDI note on / off information (there are multiple GlovePie scripts for download in this article))

 

Let’s get going:

Where possible I provided links to the necessary download locations.

Download MIDI Yoke and install it.

Press Close and REBOOT your computer.

 

 

Configuring MIDI ports in Windows

Configure your MIDI ports in Windows by accessing the control panel (Start / Control Panel) and select “Sounds and Audio Devices”.

Go to the “Audio” TAB and select “Out to MIDI Yoke: 1”  as MIDI music playback device and click “OK”.

 

Download MIDI-OX and install it.

 

 

Configuring MIDI-OX

Now we have to configure MIDI-OX to pass the MIDI signal from MIDI Yoke: 1 to MIDI Yoke: 2

 

What is really happening:

GlovePie converts buttons being pressed on the Wii Remote to MIDI note on / off information and sends the MIDI note on/off signal via the “MIDI Yoke: 1”  to MIDI-OX, MIDI-OX on its turn sends the MIDI note on/off signals to ZynAddSubFX via “MIDI Yoke: 2”.  ZynAddSubFX converts the MIDI signal into a sound (Buttons pressed on WiiMote >> GlovePie >> MIDI Yoke: 1 >> MIDI-OX >> MIDI Yoke: 2 >> ZynAddSubFX >> Sound).

 

Start MIDI-OX go to “Options” and select “”MIDI devices”.

 

Now select “In From MIDI Yoke: 1” as input and select “Out To MIDI Yoke: 2” as output and click OK.

 

 

Download ZynAddSubFX and install it.

 

Configuring MIDI ports in ZynAddSubFX

Go to “File” and select “Settings”.

In the right bottom corner select “In From MIDI Yoke: 2” as MIDI-in device, and click “Close”.

 

Download GlovePie and install it. GlovePie doesn’t come with an installer so you have to create a folder and extract the zip file into the folder. In my case I created a folder called “C:\Program Files\GlovePie”. I also created a shortcut to my desktop (right click “GlovePIE.exe”, send to, shortcut to desktop).

 

 

Configuring GlovePie

After the installation of GlovePie we need a script that actually converts the buttons that are being pressed on the WiiMote to MIDI note on/off events. So I wrote a script called Wii to MIDI (Wii2MIDI), download the Wii2MIDI GlovePie script (or the newer script v1.1) and extract it to the “GlovePie\WiimoteScripts” folder (In our case the “C:\Program Files\GlovePie\WiimoteScripts” folder). OK, I’ve just updated the Wii to MIDI script (again) so it can play the whole range of MIDI notes (octave 1 till octave 8), basically it sets you of with having a full blown MIDI keyboard within your reach (download Wii2MIDI v1.3 here). If you want to use your WiiMotes as drumsticks you could also try this GlovePie script called Wii to MIDI whacker, it triggers MIDI notes while whacking your WiiMote and pressing buttons. Like the Wii to MIDI script version 1.3 it also enables octave scaling using the plus and minus buttons on your Wii Remote (you can actually scale octaves for each separate WiiRemote).

 

 

Connecting the Wii Remote to Windows

Connect WiiMote to Windows by accessing the control panel (Start / Control Panel) and select “Bluetooth Devices”.

Click the “Add” button.

Select “My Device is set up and ready to be found”, press 1+2 on your WiiMote and click “Next”.

Select the found Nintendo device and click “Next”.

Select don’t use passkey and click “Next” then click “Finish”.

 

Now let’s Rock and Roll !

  • Start ZynAddSybFX select an instrument by going to “Instrument” and select “Show instrument bank” use the drop down box in the upper left corner and choose something you like (you can change instruments later while everything is up and running).
  • Start MIDI-OX
  • Connect Wii
  • Start GlovePie
  • Load and start the Wii2MIDI script.
  • Have fun !!!

 

 

Suggestions for improving this article are welcome, please let me know and drop me a line !

Guitar Hero World Tour Drums to MIDI

Last month I received a couple of e-mails from readers asking me whether I had a script to hook up their Guitar Hero World Tour Drums (GHWT) to MIDI. Although willing to help, I wasn’t able to pull this one of myself as I don’t own (such) a drum kit. So I wrote them back that I was willing to help, but that I needed their help as well. Happily someone called Fonz replied to my request, willing to help me write a script. So I wrote several scripts and Fonz would test the scripts whether they were working or not. This collaboration payed of… Although the scripts are not completely finished (work in progress), the results are MIDI recordable :-))

Prerequisites (what you need to get it working):

  • Hardware
    • Computer
    • Bluetooth adapter (an adapter for using an open wireless protocol for exchanging data over short distances).
    • Wii Remote (also known as a wiimote, the primary controller for Nintendo’s Wii console)
    • Guitar Hero World Tour Drums (GHWT) (compatible) drum kit
  • Software
    • GlovePie version 0.30 !!! (is a free Programmable Input Emulator, originally for the Essential Reality P5 Virtual Reality Glove, which now supports a huge range of input devices, especially the Nintendo Wii Remote (Wiimote))
    • MIDI Yoke (allows you to connect the MIDI output from one program to the MIDI input of a different program)
    • MIDI-OX (is a 32 bit multi-purpose tool: it is both a diagnostic tool and a System Exclusive librarian. It can perform filtering and mapping of MIDI data streams. It displays incoming MIDI streams, and passes the data to a MIDI output driver or the MIDI Mapper.)
    • ZynAddSubFX (is a open source software synthesizer capable of making a countless number of instruments, from some common heard from expensive hardware to interesting sounds that you’ll boost to an amazing universe of sounds)
    • WiiDrums2MIDIZynAdd GlovePie script (or the General MIDI version WiiDrums2GMMIDI script) (a script that converts drum pads being hit on the Drum Kit to MIDI note on / off information)

 

Let’s get going:

Where possible I provided links to the necessary download locations.

Download MIDI Yoke and install it.

Press Close and REBOOT your computer.

 

Configuring MIDI ports in Windows

Configure your MIDI ports in Windows by accessing the control panel (Start / Control Panel) and select “Sounds and Audio Devices”.

 

Go to the “Audio” TAB and select “Out to MIDI Yoke: 1”  as MIDI music playback device and click “OK”.

 

Download MIDI-OX and install it.

 

Configuring MIDI-OX

Now we have to configure MIDI-OX to pass the MIDI signal from MIDI Yoke: 1 to MIDI Yoke: 2

 

What is really happening:

GlovePie converts drum pads being hit on the Drum Kit to MIDI note on / off information and sends the MIDI note on/off signal via the “MIDI Yoke: 1”  to MIDI-OX, MIDI-OX on its turn sends the MIDI note on/off signals to ZynAddSubFX via “MIDI Yoke: 2”.  ZynAddSubFX converts the MIDI signal into a sound (Drum pads being hit on the Drum Kit >> GlovePie >> MIDI Yoke: 1 >> MIDI-OX >> MIDI Yoke: 2 >> ZynAddSubFX >> Sound).

 

Start MIDI-OX go to “Options” and select “”MIDI devices”.

 

Now select “In From MIDI Yoke: 1” as input and select “Out To MIDI Yoke: 2” as output and click OK.

 

Download ZynAddSubFX and install it.

 

Configuring MIDI ports in ZynAddSubFX

Go to “File” and select “Settings”.

In the right bottom corner select “In From MIDI Yoke: 2” as MIDI-in device, and click “Close”.

 

Download GlovePie version 0.30 and install it (it’s very important to use version 0.30 !!!). GlovePie doesn’t come with an installer so you have to create a folder and extract the zip file into the folder. In my case I created a folder called “C:\Program Files\GlovePie”. I also created a shortcut to my desktop (right click “GlovePIE.exe”, send to, shortcut to desktop).

Configuring GlovePie

After the installation of GlovePie we need a script that actually converts drum pads being hit on the Drum Kit to MIDI note on/off events. So I wrote a script called Wii Drums to MIDI for ZynAddSubFX (WiiDrums2MIDIZynAdd), download the WiiDrums2MIDIZynAddGlovePie script (or the General MIDI version WiiDrums2GMMIDI script) and extract it to the “GlovePie\WiimoteScripts” folder (In our case the “C:\Program Files\GlovePie\WiimoteScripts” folder).

 

 

Connecting the Wii Remote to Windows

Connect WiiMote to Windows by accessing the control panel (Start / Control Panel) and select “Bluetooth Devices”.

Click the “Add” button.

Select “My Device is set up and ready to be found”, press 1+2 on your WiiMote and click “Next”.

Select the found Nintendo device and click “Next”.

Select don’t use passkey and click “Next” then click “Finish”.

 

Now let’s Rock and Roll !

  • Start ZynAddSybFX select an instrument by going to “Instrument” and select “Show instrument bank” use the drop down box in the upper left corner and choose “Drums” and select “1. Drums Kit1”.
  • Start MIDI-OX
  • Connect Wii
  • Start GlovePie
  • Load and start the Wii Drums to MIDI (WiiDrums2MIDIZynAdd.PIE) script.
  • Have fun !!!

 

A big word of THANKS for Fonz as I couldn’t do this without him!!!

Suggestions for improving this article are welcome, please let me know and drop me a line !

Using the KORG nanoKONTROL 2 in Qtractor

As a musician and part time audio engineer I recently bought myself a bright white KORG nanoKONTROL 2 USB controller as an addition to my mobile Digital Audio Workstation (DAW) setup. Setting it up and running it within OSX went smoothly, but I prefer Ubuntu Studio as Qtractor is my DAW of choice. So I connected the nanoKONTROL to Qtractor using Jack. I clearly saw midi events coming in, but nothing happened. This is where I started my search for enabling the nanoKONTROL in Qtractor. After reading many articles and blogs (special thanks to Jeremy!) I was able to reconstruct a working Qtractor control file (a .qtc file :-).

In this article I’ll try to explain the steps I took, what works, and what I still need to figure out… Reading the articles and blogs I learned that it is possible to assign Midi Machine Control (MMC) and MIDI Control Change (MIDI CC) messages to certain functions within Qtractor. The “only thing” I had to do is, connect the right CC messages to the right functions (knobs and sliders) in Qtractor. That sounds simple, but it took me some trail and error before I had it working! So the first thing I needed to do was figuring out what my nanoKONTROL was sending (in other words – how it was configured).

 

 

So, first of all I headed over to the Korg Kontrol Editor to figure out, how the nanoKONTROL was configured (It’s nice to know that you can run the Korg Kontrol Editor within Linux using Wine!).

And even more important…

 

After that I figured I had to write a Qtractor control file, so I started to analyze its logic (Jeremy you are the man, thanks!). Using gedit I had the first knobs and sliders working in no-time 🙂 The only problem I had was that my buttons for soloing, muting and recording tracks only worked as long as I kept them pressed. So I headed back to my Korg Kontrol Editor and changed the function of those knobs to “Toggle” mode.

You can download my Qtractor control file here.

You can download my tutorial control file here.

 

And you can configure / import the Qtractor control file by starting up Qtractor, go to “View”, select “Controllers”.

 

There you’ll find an “Import” button with which you can import the Qtractor control file.

 

So what is working and what needs to be fixed? Currently working are TrackSolo, TrackMute, TrackRecord, TrackPanning and TrackGain buttons and sliders. What I still need to figure out, are all the other knobs like the transport functions (play, record, rewind, fast forward, etc.). So if you happen to know how that works, then please send me an email!

 

PS. Don’t forget to link your KORG nanoKONTROL 2 to Qtractor, because otherwise it won’t work!!!

 

Suggestions for improving this article are welcome, please let me know and drop me a line .

Improving readability of worksheet data in Excel

It can be a big help if your data in Excel is easy to read (avoiding errors in calculations and or data analysis). I know there are more ways than one to achieve that goal, in this article I’ll show you some code that handles the solution without using conditional formatting. It’s a rough and simple solution…

To address the problem visually look at the differences between the images below…

The original layout above.

The new and improved layout below 😉

 

For those of you that are not familiar with VBA / macro’s use the steps below…

  • If you use the latest version of Excel make sure you’ve got the “Developer” tab in Excel
  • Next press the button “Record Macro”
  • Then press the button “Stop Recording”
  • Press ALT + F8
  • Choose “Edit”
  • Copy and paste the code below (or download a text file containing the code here…)
  • Save your Excel !!!
  • Press ALT + F8 and Run the Macro

 

Sub ImproveReadability()

‘ ImproveReadability Macro

‘ Developer: Winko Erades van den Berg
‘ E-mail : winko at winko-erades.nl
‘ Developed: 10-10-2011
‘ Modified: 10-10-2011
‘ Version: 1.0

‘ Description: Improve the readability of your Excel worksheet data by using colors’Declare variables
Dim iRow As Long
Dim iCol As Long
Dim HeaderRow as Integer’Constant values
HeaderRow = InputBox(“Specify the row that contains the header information:”) ‘Create Input Box to ask the user where the header starts
iCol = ActiveSheet.UsedRange.Columns.Count ‘Determine how many columns are in use

‘Change de header lay-out
ActiveSheet.Range(ActiveSheet.Cells(HeaderRow, 1), ActiveSheet.Cells(HeaderRow, iCol)).Select
With Selection.Interior ‘Fill Color
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0
.PatternTintAndShade = 0
End With

With Selection.Font ‘Font Color
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
End With
Selection.Font.Bold = True ‘Font Bold

‘Start highlighting alternate rows
For iRow = HeaderRow + 2 To ActiveSheet.UsedRange.Rows.Count Step 2
ActiveSheet.Range(ActiveSheet.Cells(iRow, 1), ActiveSheet.Cells(iRow, iCol)).Select
With Selection.Interior ‘Fill Color
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0.75
.PatternTintAndShade = 0
End With
Next iRow

End Sub

 

Suggestions for improving this article are welcome, please let me know and drop me a line.

Automated calibration of your WiiMote in GlovePie

After having used GlovePie several times, I thought it would be handy to have a function that would auto calibrate my Wii remote. I couldn’t find a script or routine that did this, so I decided to give it a try.

I wrote a routine that sampled and summed the values of the x-, y- and z-axes for 200 times, dividing the generated sum by two hundred gives a rather good Offset value :-). You can copy and paste my script into most other scripts. It makes it much easier (and faster) to hook up any WiiMote and use it instantly. All you have to do after copying and pasting my script is place the Wiimote face up on a flat surface, start the GlovePie script and wait for the calibration to be 100 %

You can download the WiiMote Auto Calibration script here.

 

An example of the automatic calibration of the WiiMote can be seen into action in the adjusted “Google Earth Interface for Wii Remote” script written by Joseph Coulston.

You can download the original scipt here, and you can download the adjusted script here.

 

Suggestions for improving this article are welcome, please let me know and drop me a line !

Convert MAC address in MS Access

Sometime ago I wrote an article about updating MAC Addresses before (Convert MAC address in MS Excel or OO Spreadsheet) so the subject is not new :-). But this time I’ll try to explain how to Convert MAC addresses in MS Access. The standard format for printing MAC addresses in human-friendly form is six groups of two hexadecimal digits, separated by hyphens (-) or colons (:), in transmission order, e.g. 01-23-45-67-89-ab, 01:23:45:67:89:ab. In this article I’ll give you examples of how to add, remove or change the separator for MAC addresses in MS Access.

The whole concept of updating records in MS Access is based upon creating queries. So you’ll have to create some queries depending on what you want to achieve. In the examples below I have an MS Access database that holds a table called “Table1”. Within that table I have a Column called “MacAddress”.

 

Adding a seperator, changing 0123456789ab into 01-23-45-67-89-ab.

UPDATE Table1 SET Table1.MacAddress = MID([Table1].[MacAddress],1,2) & ‘-‘ & MID([Table1].[MacAddress],3,2) & ‘-‘ & MID([Table1].[MacAddress],5,2) & ‘-‘ & MID([Table1].[MacAddress],7,2) & ‘-‘ & MID([Table1].[MacAddress],9,2) & ‘-‘ & MID([Table1].[MacAddress],11,2)
WHERE LEN([Table1].[MacAddress])=12;

 

Adding a seperator, changing 0123456789ab into 01:23:45:67:89:ab.

UPDATE Table1 SET Table1.MacAddress = MID([Table1].[MacAddress],1,2) & ‘:’ & MID([Table1].[MacAddress],3,2) & ‘:’ & MID([Table1].[MacAddress],5,2) & ‘:’ & MID([Table1].[MacAddress],7,2) & ‘:’ & MID([Table1].[MacAddress],9,2) & ‘:’ & MID([Table1].[MacAddress],11,2)
WHERE LEN([Table1].[MacAddress])=12;

 

Removing a separator, changing 01-23-45-67-89-ab into 0123456789ab.

UPDATE Table1 SET Table1.MacAddress = REPLACE(Table1.MacAddress,’:’,”)
WHERE instr(Table1.MacAddress,”:”)=true;

 

Removing a separator, changing 01:23:45:67:89:ab into 0123456789ab.

UPDATE Table1 SET Table1.MacAddress = REPLACE(Table1.MacAddress,’:’,”)
WHERE instr(Table1.MacAddress,”:”)=true;

 

Changing a separator, changing 01-23-45-67-89-ab into 01:23:45:67:89:ab.

UPDATE Table1 SET Table1.MacAddress = REPLACE(Table1.MacAddress,’-‘,’:’)
WHERE instr(Table1.MacAddress,”-“)=true;

 

Changing a separator, changing 01:23:45:67:89:ab into 01-23-45-67-89-ab.

UPDATE Table1 SET Table1.MacAddress = REPLACE(Table1.MacAddress,’:’,’-‘)
; WHERE instr(Table1.MacAddress,”:”)=true;

 

And that’s all folks!!!

 

Suggestions for improving this article are welcome, please let me know and drop me a line.

Using Wiican makes gaming easier in Linux

A month ago I stumbled upon a program called Wiican. Wiican is a fantastic program, or to put it more correctly it’s a bunch of extremely powerful scripts, that makes your life easier using your Wii Mote in Linux.

Having my holidays within sight, I really didn’t have time to give it a close look before I took of to France. “Luckily” I had some time during my holidays (read: I had some rainy days) to experiment and discover the power of Wiican.

So after a bit of fiddling I came up with a script that to use your Wiimote in First Person Shooter (FPS) games like Assaultcube, Sauerbraten, Warsow), etc.

Prerequisites (what you need to get it working):

  • Hardware
    • Computer running Ubuntu
    • Network connection
  • Software
    • Wiican installed (I’ll describe the installation of Wiican in a different article, because at this moment the installation struggles with some dependencies issues)

 

  • Download and unzip the Wiican script I wrote
  • Import the script within Wiican (details will follow when I’m back from my holidays)
  • Start the script
  • Hookup your WiiMote
  • Start fragging some bots

 

Or you can try to write your own script within Wiican…

Script contents:

Name : CUBE Game Gamepad
Comment : Control CUBE games using the Wiimote
Authors : Winko Erades
Version : 0.3# Wiimote accelerometer as mouse XY axis
Plugin.acc.X = REL_Y
Plugin.acc.Y = – REL_X# Wiimote buttons for movement
Wiimote.Up = KEY_LEFT
Wiimote.Down = KEY_RIGHT
Wiimote.Left = KEY_DOWN
Wiimote.Right = KEY_UP

# Wiimote buttons for shooting and jumping
Wiimote.1 = BTN_LEFT
Wiimote.2 = KEY_SPACE

And now start fragging!!! 🙂

 

Suggestions for improving this article are welcome, please let me know and drop me a line.

A poor man’s dynamic DNS on a Raspberry Pi

If you want to connect to your Digital Video Recorder (DVR) or ownCloud installation from the internet, you need to know to which IP address you need to connect (See this DVR article as well). The bad thing however is that the most of us don’t have a fixed IP address on the internet (this might change in the future with IPv6). This means your IP address can change in time. There are several payed services to solve this problem like DynDNS, DuckDNS, DtDNS, No-IP, etc. Most of the time you are the only user of the services you are hosting at home, if so than there is a cheap solution.

As described above the whole thing is, that you need to know which IP address your Raspberry Pi has. The solution is to write a script that checks your external IP address and that sends you an email in case the external IP address has changed.

Login on your Raspberry Pi with SSH:

ssh pi@your IP address
cd ~
nano ./ipaddrcheck.sh

 

Now copy and paste the following code to nano (of course you need to change username@domain.ext to your own email address):

#!/bin/bash
curl -o ~/newip ifconfig.co
cmp ~/newip ~/oldip >/dev/null || {
mv ~/newip ~/oldip
mailx -s “I – IP ${HOSTNAME} changed” username@domain.ext < ~/oldip
}

Use Ctrl O to save the file
Use Ctrl X to exit the nano editor

 

Make let’s make the script executable:

sudo chmod +x ./ipaddrcheck.sh

 

Let me roughly explain what the script does:
It’s a bash script that checks the external IP address by using curl ifconfig.co and writes the results to a file called newip.
After that it checks whether the IP address has changed by comparing the files newip and oldip, in case the two files are not the same it sends you an email.

 

Now we need to install the necessary packages to sent mail:

sudo apt-get install ssmtp heirloom-mailx

 

The next thing is to configure your Raspberry Pi so it’s able to send mail. Therefore you need to add the following lines, at the end of the file /etc/nail.rc :

sudo nano /etc/nail.rc

 

Now copy and paste the following code to nano (of course you need to change: smtp.domain.ext, username@domain.ext, password and email sender’s nice name to your own email settings):

# Smtp server
set smtp-use-starttls
set ssl-verify=ignore
set smtp=smtp://smtp.domain.ext
set smtp-auth=login
set smtp-auth-user=” username@domain.ext
set smtp-auth-password=”password”
set from=”email sender’s nice name”

Use Ctrl O to save the file
Use Ctrl X to exit the nano editor

 

Now we need schedule and execute the script by using crontab:

crontab -e

 

Add the following line, at the end of the file (it schedules the ipaddrcheck.sh every hour):

0 * * * * /home/pi/ipaddrcheck.sh

Use Ctrl O to save the file
Use Ctrl X to exit the nano editor

 

You can check the date and time stamp of the file ~/newip to see whether your script ran.

Changing the IP address in ~/oldip enables you to check whether emailing works, as it should send you an email the next time the sript runs.

 

PS. if mailing yourself doesn’t work, try editing the /etc/ssmtp/ssmtp.conf file (as it heavily depends on your mailserver configuration).

 

Suggestions for improving this article are welcome, please let me know and drop me a line .