Wednesday, April 13, 2016

How to find the hardware uuid for iPhone to update Team profile to test iPhone APP outside of Apple Store for beta test

Collect iPhone UUID


As some of you might be willing to help out a developer with beta-testing their apps, he will most certainly ask you for the UUID for your device. So this is a quick three-step guide to finding your iPhone Universally Unique Identifier (or UUID) using iTunes.
While there are apps out there that will tell you what your UUID is, some will cost you money, and if all you need is the UUID, then it's pointless to download an app that does that. Instead, you can use iTunes to reveal it. Here's how.

1. Plug In Your iPhone

Connect your iPhone to your MAC or PC and if iTunes doesn't start automatically, fire it up. Next, go to the Devices heading in the navigation panel on your left and locate your iPhone.

2. Find Your Serial Number

Under the iPhone's Summary heading, you should see a bunch of information including the software version, your phone number and the iPhone's serial number.

3. Reveal Your UUID

If you click your Serial Number (I know it doesn't show as clickable, but just click it), that will change to Identifier and the string of numbers and letters following there is your UUID. Simply press CTRL+C (Windows) or Command/AppleKey + C (Mac) and it will be copied to your clipboard.



Update profile with up to 99 specific device uuid

Exporting Your App for Testing Outside the Store

Because testers don’t have Xcode to run your app, you create an iOS App file (a file with an .ipa filename extension) that they can then use to install your app on their device. Use this method to test a universal app that runs on all supported devices or test device variants that the store distributes later to users.
To create an iOS App file for testing

    ../Art/6_ios_createappstorepackage_1_2x.png
  1. Open the Archives organizer (choose Organizer from the Window menu), and select the archive.
    ../Art/6_ios_archive_organizer_2x.png
  2. Click the Export button, select an export option, and click Next.
    To distribute your app to users with designated devices, select “Save for Ad Hoc Deployment.” The app will be code signed with the distribution certificate.
    To distribute your app for internal testing, select “Save for Development Deployment.” The app will be code signed with your development certificate.
  3. In the dialog that appears, choose a team from the pop-up menu and click Choose.
    If necessary, Xcode creates the needed signing identity and provisioning profile for you.
    ../Art/6_ios_export_choose_team_2x.png
  4. In the Device Support dialog, choose whether to export the universal app or a variant for a specific device, and click Next.
    • If you want to run the app on any supported device, select “Export one app for all compatible devices.”
    • If you want to test all device variances, select “Export for specific devices” and choose “All compatible device variants” from the pop-up menu.
    • If you want to test a specific device variant, select “Export a thinned app for a specific device” and choose the device family from the pop-up menu.

Deploy IPA to test devices


Method # 1 – Using iTunes.
iTunes too provides a functionality to directly install ipa apps on your device. Perform the following steps to install ipa apps through iTunes –
  • Connect your Phone to computer and launch iTunes.
  • Drag the app’s .ipa file into iTunes library.
  • Click on Sync and done, that’s it . If the app was earlier backed up from the same device, it would be installed without any fuss else you need to make sure there's a provisioning profile associated with the app embedded in it generated with the device uuid.
Method # 2 – iFunbox

install ipa through iFunbox
iFunbox is yet another easy method to install ipa files/apps on your iPhone. Perform the following steps to install Apps on your iPad/iPhone through ifunbox –
  • Download and install ifunbox from i-funbox.com if not already installed.
  • Launch iFunbox and connect your iPhone/iPad/iPod.
  • Now navigate to the File Browser tab as shown in the figure and select “User Applications” (Highlighted in the same figure).
  • Now click on “Install App” button, select the ipa or apmx file of app which you want to install and click on Open!
  • Yo! The app will be installed successfully.

Monday, April 11, 2016

SVG to PNG using Inkscape

I really like to use Inkscape to generate Icon for iOS or Android.
When using SVG you can create multiple size icons all looking great using a small script like this one


@echo off
SETLOCAL
set Programs="%ProgramFiles%"
if "%ProgramFiles(x86)%" NEQ "" (
    set Programs="%ProgramFiles(x86)%"
)
REM Trim the double-quotes
set Programs=%Programs:~1,-1%

SET INKSCAPE=%Programs%\Inkscape\Inkscape.com

echo.%~dp0
echo.%INKSCAPE%
pause
pushd  graphics
"%INKSCAPE%" --export-png=target.png --export-area-drawing source.svg  -w 48 -h 48
popd

ENDLOCAL

Friday, March 18, 2016

mount usb 2.0 stick HDD raspberry pi


sudo apt-get install ntfs-3g
sudo mkdir /media/usbdrive
sudo mount -t ntfs-3g -o uid=pi,gid=pi /dev/sdb1 /media/usbdrive/


extra in /etc/fstab
/dev/sdb1 /media/usbdrive ntfs-3g uid=pi,gid=pi 0 0

Wednesday, March 09, 2016

Raspberry Pi Temperature & Humidity Network Monitor

Picture of Raspberry Pi Temperature & Humidity Network Monitor
IMG_2294.jpg
Please note that there's a Git repo for code at:
If you'd like the latest fixes or would like to contribute. Thanks Jonny Ervine!

I had some issues with Kingston SD Cards, but the SanDisk cards I'm using now have run for weeks without issues, so I'm changing the parts list to reflect that.
Also, after some 49 days, 16 hours, the display flatlines, as the reading routines start returning the same number over and over again. A reboot clears it, so just reboot once a month until I figure out what's up.

Over the past summer, my vacation home had a small water leak for three months, and I realized that had I been measuring the humidity in the effected area, I'd have
seen it go to 100% for a long time and I could have dispatched someone to fix the small problem before it became a big one.
And since I've been playing with Raspberry Pi computers for a while now, and saw an inexpensive temperature/humidity sensor on AdaFruit, I had all the pieces I needed
to implement an inexpensive network-connected monitor.
The Bill Of Materials (BOM):
1) Raspberry Pi Model B
2) Case
3) SD Card
4) Temperature/Humidity sensor
5 ) Power Supply (I use PoE splitters, but any 5V 1A Micro-USB supply will work)
I used the following exact parts, but obvious substitutions can be made to match local conditions and the state of your junk box. Shipping and the availability of bundles
may effect your final price.
$35.00 RPi http://www.newark.com/raspberry-pi/raspbrry-modb-...
$ 8.12 Case http://thepihut.com/products/classic-raspberry-pi... (5.99 Euros)
$ 6.99 SD Card (Sandisk, not Kingston)
$15.00 Sensor http://www.adafruit.com/products/393
$15.99 PoE Splitter http://www.newegg.com/Product/Product.aspx?Item=N...
And a few other miscellaneous things like hand tools, soldering iron, hot melt glue gun, small pieces of plastic wood, etc.
Step

Step 1: Physical assembly

Picture of Physical assembly
IMG_2300.jpg
IMG_2303.jpg
IMG_2307.jpg
IMG_2311.jpg
Split the case, find the hardware bag inside, and set the rubber feet aside for later.

Attach the Raspberry Pi to the case bottom with the supplied hardware.

Remove the GPIO knockout with a razor blade or Xacto knife and snap the two case halves together.

To keep the power dissipation of the power supply and Raspberry Pi from effecting the sensor readings, I cut a piece of Azek plastic lumber about 1.1 x 2.4 x 0.75 inches as a standoff.

Heat up your hot-melt glue gun and stack the parts as in the picture. You'll have a few seconds to make the alignment perfect before the glue sets, so get the alignment close before you press the parts together.  Be careful not to use so much glue that it extrudes from the edges of the seams or extrudes into the case, where it might interfere with the SD card connector.

1) Glue the sensor to the standoff

2) Glue the standoff to the top half of the case. Be careful not to block the LED cutouts on the one side or the ribbon cable cutout for the camera on the other side.

3) Glue the case bottom to the top of the PoE adapter. Make sure the "LAN Out" connector is on the same side as the Raspberry Pi Ethernet adapter.

4) Stick the 4 rubber feet to the bottom of the power adapter.

5) Ensure the voltage-output selection switch is set to 5V. Put a dab of hot-melt glue in the switch to prevent it from being changed and destroying your Raspberry Pi.

Step 2: Electrical Assembly

Picture of Electrical Assembly
IMG_2313.jpg
IMG_2314.jpg
IMG_2316.jpg
IMG_2319.jpg
The White wire from the sensor is a spare ground, and is not needed.  Cut it off inside the sensor case, being careful not to cut any of the other wires.

Braid the other three wires to keep them together, and cut them off about 3.5 inches long.

Prepare a 5-pin single inline female connector (cut from https://www.sparkfun.com/products/115 or equivalent), and solder the wires to it:

1) Red (+3.3V)
2) No Connection
3) No Connection
4) Yellow (Data)
5) Black (Ground)

Plug the connector into the GPIO on the Raspberry Pi so that pin 1 on the connector (red wire) is on pin 1 of the GPIO connector (label P1 on the board, upper right in the picture).  Note that the Red wire is on GPIO Pin 1 (+3.3V), the Yellow wire is on GPIO pin 7 (GPIO 4), and the Black wire is on GPIO Pin 9 (Ground).

Tuck the excess wire into the case.

Use a short CAT5 cable (something like http://www.monoprice.com/Product?c_id=102&cp_id=10232&cs_id=1023201&p_id=7505 ) to connect the LAN OUT on the PoE splitter and the Raspberry Pi Ethernet jack.  Twist it up to make it stay close to the case.

Take the PoE output cable and a Micro-USB connector or cable and solder them together.  If using an AdaFruit http://www.adafruit.com/products/1390 Micro-USB connector, wire it up as shown at http://learn.adafruit.com/assets/12402 , if using a cut-off cable, determine +5 and Gnd wires with a multimeter.  Note that the TP-Link wire with the white stripe is POSITIVE.

 

Step 3: Raspberry Pi software setup

Picture of Raspberry Pi software setup
Getting the basic Raspberry Pi software up and running has been documented elsewhere, but basically, go to:
http://www.raspberrypi.org/downloads
download the latest NOOBS (v1.3.2 as of this writing)
Format the SD card using the SD card tool at https://www.sdcard.org/downloads/formatter_4/
Unzip the NOOBS file and put the contents at the root of the SD card.
Insert the SD card into the Raspberry Pi
Connect a keyboard, monitor, mouse, and LAN cable to the Raspberry Pi and connect the power supply (when you plug the PoE splitter into the LAN cable, the Raspberry Pi will power up).

Select the Raspian distribution and install it.
While that's installing, select English-US keyboard, which autoselects US Keymap

On first boot, the raspi-config utility will run.
Select Console Login as the default on boot
Change Locale to en_US UTF-8
Set timezone for your location
Set keyboard to Generic 105-key, English US
Enable the camera
change the hostname to something memorable (I used 'rpithon' for Raspberry Pi Temp/Humid On Net)
set 16M memory split as we'll be running headless
Enable SSH
reboot

Now you can either continue to use the console or ssh to it from another machine.  From my Mac I can just say:
ssh pi@rpithon
and log in using the password 'raspberry'.  If your router doesn't do the DNS to help you find 'rpithon' then make note of the IP address on the console and use that instead.

Update everything (this will take a while):

sudo apt-get update
sudo apt-get upgrade
sudo rpi-update

and reboot

Since this is going to be a LAN-only device, I get sick of playing "Mother May I?" with sudo, and I want to avoid any permissions problems with the additional software, so let's enable the root user and delete the pi user:

sudo passwd root
repeated twice
exit

log back in as root user (or ssh root@rpithon) using the password selected above

remove pi user:

deluser -remove-home pi

I prefer Emacs, and don't want all the X-Windows stuff, so:

apt-get install emacs23-nox

Tell it to check the disk (SD Card) every time it boots:

tune2fs -c 1 /dev/mmcblk0p6

emacs /etc/ssh/sshd_config

change X11Forwarding to no
UseDNS no
ClientAliveInterval 60

service ssh restart

Step 4: Setting up LAMP server (web server)

Picture of Setting up LAMP server (web server)
So we want to be able to see the graphs we'll be generating (below), so we need to install a LAMP server.

LAMP: /Linux/Apache/MySQL/PHP&Perl

Linux is the operating system you are using (Raspian is a version of Debian, which is one of the common flavors of Linux)
Apache is the name of the web server software
MySQL is a SQL (Standard Query Language) database interface.  Databases sound really scary, but they are easy to use for simple things once you get used to them.
PHP and Perl are programming languages that are commonly used with websites, though we'll be using the Raspberry Pi standard Python for graphing the data and 'creating' the website.

apt-get install apache2  php5 mysql-client mysql-server vsftpd

This takes a while to install.  Midway through it'll ask you for a MySQL password, pick one memorable, I'll use 'password' for this tutorial.

Now you should be able to browse to http://rpithon (or http:// if the DNS doesn't work) and see a demo web page.  Try to edit /var/www/index.html and see if your changes show up when you refresh the webpage.

Step 5: ez_setup, MySQL, matplotlib

Picture of ez_setup, MySQL, matplotlib
ez_setup is a Python program that loads some nice addons (think of it as apt-get on steroids)

wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
python ez_setup.py

These next steps install some integration between Python and MySQL:

apt-get install python-mysqldb
apt-get install libmysqlclient-dev
easy_install MySQL-python

We'll be using the wonderful, powerful, and free(!) matplotlib for graphing our data, though we won't be using much of its power.

apt-get install libblas-dev liblapack-dev python-dev libatlas-base-dev gfortran python-setuptools python-scipy python-matplotlib

Step 6: WiringPi - GPIO interface

Picture of WiringPi - GPIO interface
Gordon Henderson has created a wonderful programming interface for the GPIO pins, including some drivers for the esoteric interface that our Temperature/Humidity sensor uses.  See http://wiringpi.com/ for more details.

git clone git://git.drogon.net/wiringPi
cd wiringPi
./build
cd examples
emacs rht03.c (change the line #define RHT03_PIN 0 to #define RHT03_PIN 7 for the GPIO pin we're using)
make rht03
./rht03
(you should get continuous temperature and humidity readings)

now we know our hardware is working, let's write our own program...

Step 7: Set up a database and a table

Picture of Set up a database and a table
So we have database software, but there's no database, or tables, so let's create them:

Open the MySQL command interface:

mysql -ppassword <-- br="" mysql="" password="" picked="" previously="" the="" you="">
[...]

Create a new database, called Monitoring

mysql> create database Monitoring;
Query OK, 1 row affected (0.00 sec)

Select that as our current database

mysql> use Monitoring;
Database changed

Create a single table in the database called TempHumid, which will contain the Unix Epoch (seconds since 1970) and Temperature and Humidity readings

mysql>create table TempHumid (ComputerTime INTEGER UNSIGNED,Temperature DECIMAL(5,1), Humidity DECIMAL(5,1));
Query OK, 0 rows affected (1.70 sec)

Done with MySQL, exit back to the command prompt.

mysql> exit
Bye

Step 8: Add readings to the database

Because the timing is tight on the sensor protocol, we're going to use C code to communicate with the sensor and add readings to the database.

So go to the root user's default directory:

cd ~

copy the Makefile (instructions on how to build the code we're going to create)

cp wiringPi/examples/Makefile .

emacs makeFile
change the two lines below to match this:

INCLUDE = -I/usr/local/include,/usr/include/mysql

LDFLAGS = -L/usr/local/lib,/usr/lib/arm-linux-gnueabihf -lmysqlclient -lpthread -lz -lm -lrt -ldl

Now copy th.c (included here) into your default directory. Change the password on line 68 from "password" to whatever you chose as the MySQL password.

When you compile it:

make th

you'll get a couple of warnings about declarations of exit, but it'll work fine.

Now you can run the program by typing:

./th

It waits for a 60-second interval (minute) to end, then reads the sensor, inserts the time and sensor readings into the database, and loops forever.

Once we have that working properly, we want it to start whenever the Raspberry Pi starts up:

emacs /etc/rc.local
insert:

/root/th >> /root/th.log &

before the line that reads "exit 0"

reboot and see if th.log grows by one line per minute:

tail -f th.log

You can confirm that the data is getting into the database with:

mysql -ppassword
use Monitoring;
select * from TempHumid;

You should get a list of all values in the database.

Step 9: Graph data from the database

Picture of Graph data from the database
We're going to use Python for pulling readings out of the database and graph them with matplotlib.  Log in as root.

Set up the directory structure we'll be using:
mkdir Graph
cd Graph
mkdir graphics

copy GraphTH.py into the Graph directory
Change the password on line 40:
DBconn = mdb.connect('localhost', 'root', 'password', 'Monitoring')
to match the MySQL password you set previously.
You can also set on line 81 to match your desired location name

Try running it:

python GraphTH.py

It will get the last 24 hours of readings from the database, reorganize the data, throw out obvious bad data, create a graph of the results, and copy TH.png to /var/www so you should be able to see a new graph time you run GraphTH.py  at http://rpithon/TH.png

Now we want this to run every minute, so:
export EDITOR=emacs
crontab -e
Add the line:
* * * * * /usr/bin/python /root/Graph/GraphTH.py >> /root/Graph/GraphTH.log
at the bottom of the file.

Now GraphTH.py should run every minute, and if you update http://rpithon/TH.png (or http:///TH.png you should see it change about once a minute.

In the example above I covered the sensor with a damp Kleenex while it dried as a test.

Step 10: Monitor more than one location

Picture of Monitor more than one location
So I built five of these boxes for various locations, and on the LAMP server of one of them, added the following TH.html





 
   
   
    Temperature and Humidity readings
 

 
   

     


  

     Temperature and Humidity
    

  


  

    
      

  Sensor locations:
      

      

  White  - A Room
      

  Green  - Another Room
      

  Blue   - A Place To Monitor
      

  Purple - Another Place
      

  Orange - Somewhere Else
      

      

  Graphs are updated every minute.
      
    

  

     
     

     

     

     

     


so now I can point my browser at: http://rpithon-wht/TH and see all of the graphs updated every minute.

Step 11: Extras - Camera

Picture of Extras - Camera
image.jpg
You remember how we enabled the camera module when we installed the Raspian operating system?  Now we can add a Raspberry Pi Camera module:

$25 http://www.newark.com/raspberry-pi/rpi-camera-board/add-on-brd-camera-module-raspberry/dp/69W0689

Just feed the camera cable through the slot in the top case and plug it into the connector on the Raspberry Pi as per the instructions at http://www.raspberrypi.org/camera using the connector next to the Ethernet port, with the tinned leads pointing away from the Ethernet connector.

I used another piece of Azek to position the camera with some hot melt glue, but there are obviously  a lot of options.

Now you can use the camera module to let you see into the area you are monitoring for temperature and humidity.  From another computer you can do something like:

ssh root@rpithon 'raspistill -o image.jpg'
scp root@rpithon:image.jpg .

Or have a cron job save a new file to the webserver on a regular basis!

In addition to the camera, there are lots of other peripherals and functions you can add to the Raspberry Pi, let your imagination guide you!

PiPoE - powering a Raspberry Pi over Ethernet

Picture of PiPoE - powering a Raspberry Pi over Ethernet
This project enables a Raspberry Pi, , or other small computer to be powered over an Ethernet cable. This very handy if you have a Pi somewhere where getting mains power to it is difficult, or if you want to run several devices from one central UPS.
It's cheap and quite simple to put together, with just one slightly tricky bit of soldering...

Step 1: About Power over Ethernet

If you want to get straight on with building, skip this bit!
The basic principles of Power over Ethernet (PoE) are straighforward: at one end of the cable, either near the network hub or built into it, is an 'injector' which takes DC power and the network signals, and combines them onto one cable. At the far end of the cable is a 'splitter' which does the reverse, taking the cable input and producing a DC power output and a network connection.
There are two main types of PoE systems. 'Active' systems have circuitry at both ends so that the injector only turns power on when a compatible device is detected on the cable. This is the sort you'll find on commercial network switches with PoE built in. 'Passive' systems are commonly found in cheaper applications (e.g. home CCTV) - here the power is applied all the time and no detection circuitry is used.
A passive system uses spare wires in a CAT-5 network cable to supply power - a 10- or 100-Mbit Ethernet connection only needs 4 of the 8 available wires to operate, leaving 4 free for power. Gigabit Ethernet connections need all 8, so don't work with passive PoE. Fortunately just about all Gigabit devices will fall back to 100-Mbit operation if only 4 wires are connected.
This project uses a simple passive PoE arrangement. The only refinement is to use a higher DC supply voltage (12-24V) than the Pi needs, and to step it down to 5V at the Pi end. The advantages to doing this are:
  • supplying 5V directly at one end of the cable means the Pi would get less than 5V, due to the resistance in the cable. This would make the Pi less reliable as the cable got longer.
  • the current in the cable is less, meaning that less electrical power is wasted.
  • the step-down regulator provides (some) protection for the Pi if the cable is mis-connected.

Step 2: You will need...

Picture of You will need...
IMG_1043.JPG
IMG_1029 Network tester.jpg
The project uses these components:
  • A DC power supply - any voltage between 12V and 24V, regulated or unregulated, will do. In my tests, powering a Raspberry Pi used under 200mA at 15V, so make sure the supply is rated at least 250mA (at 15V) or 300mA (at 12V) for each Pi you will be powering.
  • A passive PoE injector box. The one in the pictures was £7 on Amazon for a 4-port one - many other types are available.
  • A short length of CAT5 cable with a RJ45 plug attached. (I cut the end off a short Ethernet patch lead where the plug on the other end had broken).
  • A DC-DC step down converter module. (Search for 'LM2596' on Amazon or eBay - the one shown in the pictures was about £2).
  • A PCB-mounting RJ45 socket.
  • A two-pin 0.1" pitch socket (for a Raspberry Pi), or DC jack plug (for Beaglebone)
  • A small piece of prototyping pad board. (Note this has to be pad board not strip board).
  • Wire, cable ties
You will also need these tools:
  • Fine-tipped soldering iron + solder
  • Wire cutters, strippers, pliers, etc.
  • A multimeter
  • A drill with small (1mm) bits - a Dremel is ideal
  • Optional: a network cable tester(see photo)

Step 3: Solder in the RJ45 socket

Picture of Solder in the RJ45 socket
Life is never just easy, and the first problem is getting an RJ45 socket soldered into some 0.1"-pitch pad board.
One row of pins will fit fine, but the other is offset, and you need to drill out holes in the board until they go in. Also, the plastic mounting lugs will need a bigger hole. The end result isn't pretty, but if you get 4 pins in OK, the socket will be pretty solid.

Step 4: Wire up the DC-DC converter

Picture of Wire up the DC-DC converter
IMG_1023.JPG
The DC-DC converter module can now be mounted on the board. The one I bought had its input and output connections in the corners, which let me attach it using four Molex pins (see photo). Put the pins in right places in the pad board, then lower the module down over them, and soldered the top of each pin to the module. Then turn it all over and solder the bottom of each pin to the pad board.
The next stage is wiring the converter's input to the RJ45 socket. This is best done by following the photo: the back row of pins on the socket are numbers 1,3,5,7 (left to right), and the front row are 2,4,6,8. You'll need to connect both pins 4 and 5 to the converter's +V input, and 7 and 8 to the -V (or Ground) input. These are the red and black wires, respectively, in the photo.
At this stage, I would strongly recommend checking the connections are correct using a multimeter:
  • connect the board to the PoE injector unit using a short RJ45 cable (make sure it's not a 'crossover' cable)
  • check that the -V on the converter module is connected to the -V or ground on the injector's input socket
  • check that the +V on the converter is connected to +V on the injector
  • check for short circuits between the +V and -V on the converter
If all is well, apply power to the PoE injector and check that there is a corresponding voltage between the +V and -V input to the DC-DC converter. If so, check that you have +5V on the output terminals of the converter. (The module I bought had a trimmer to adjust the output voltage). Please check the converter output voltage before wiring this to the Pi, as the Pi will be damaged if it is too high.

Step 5: Wire up the Ethernet connection

Picture of Wire up the Ethernet connection
IMG_1028.JPG
Here comes the tricky bit!
Start by cutting off one end of the spare Ethernet cable, leaving about 20-25cm of the cable attached to one of the plugs. Strip off about 3cm the outer sheath, exposing the 8 cores in the cable, then strip a few mm from the end of each core.
The Ethernet connection is made by connecting pins 1, 2, 3 and 6 on the RJ45 socket to the same pins on the plug. The standard ("T568B") wire colours for these are as follows:
  • Pin 1 - white + orange stripe
  • Pin 2 - orange
  • Pin 3 - white + green stripe
  • Pin 6 - green
It is worth checking (with a multimeter) that your cable follows these beforesoldering the wires in, as it'll be messy to put right afterwards. Once you have picked out the four wires you need, the other four can be snipped off, as they should be left unconnected.
To attach the wires to the pins of the RJ45 socket, I found it helpful to drill out four of the holes in the pad board so the wires could be fed through from the top side. This holds them in the right place for soldering, and will provide some strain relief when assembled.
When you're done, the socket should look something like the photograph (except, hopefully, a bit neater). To hold the cable in place, I drilled a couple of small slots in the pad board, then threaded through a small cable tie.

Step 6: Connect power to the Pi

Picture of Connect power to the Pi
The Raspberry Pi can be most easily powered by connecting to the power pins on the GPIO header. The (original) Model A and B headers are described athttp://www.raspberrypi.org/documentation/usage/gpi... , and the newer Model B+ header is shown at http://www.element14.com/community/docs/DOC-68203/...
For either model, pins 4 (+5V) and 6 (Ground) are suitable connection points. I used a simple 2-pin 0.1" socket (Multicomp 2212S-02SG-85 fromhttp://cpc.farnell.com) wired as shown in the photo: the red wire is +5V and the green is ground. You may want to protect the connections with heat-shrink sleeving or a blob of silicone.

Step 7: Test and go!

Picture of Test and go!
IMG_1048 whole system.JPG
It's a good idea to give the wiring a final check before hooking up the Pi. Using a network tester or multimeter, check that lines 1, 2, 3 and 6 are connected through the RJ45 socket to the RJ45 plug (see photo). Do not connect the network tester to the PoE injector when it is powered on, as it will fry the LEDs in the tester.
The whole system can now be assembled. The 'input' side of the PoE injector (marked 'LAN' in the photo) connects to a network hub / router. The 'output' side connects to the splitter board via a network cable (usually this will be much longer, of course). The RJ45 plug and power lead from the splitter board go to the Pi - double check the connection to the GPIO header before powering on.
If all is well the Pi will boot when you apply power to the PoE injector, and it will have a connection to your network. Success!