Pages

Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Powering non-PoE devices from a PoE switch

A brief note explaining how to use a standard Power Over Ethernet (PoE) switch to power non-PoE equipment.

Introduction
These days Power over Ethernet (PoE) switches are standard in larger organisations as they are typically used to connect desk phones on users desks using one cat-5 or cat-6 data cable.  This one cable provides both the data and power connections that the phone needs and saves time, effort and power (and therefore costs) in the modern office.

Increasingly you will find PoE is being used in homes and smaller business to power WiFi access points or small security / CCTV cameras where the savings are even more noticeable.  For example, if you decide to install a security camera outside your house you can easily see that only having to run one cable to the camera greatly simplifies the installation and saves on installation costs as no separate power socket or adapter is needed.

The only drawback to this approach is that you have to already have a PoE switch and you would normally need to buy a PoE-compatible camera. At least - you did need to buy a PoE-compatible camera.  This note explains how you can use a normal 12V / Ethernet camera and a nice piece of technology from TP-Link - the TP-LINK TL-POE10R PoE Splitter.

What is Power over Ethernet?
Power over Ethernet or PoE is a general term that is used to describe systems that pass power alongside data on twisted-pair (Cat-5 or Cat-6) Ethernet cables.  There are several common techniques used to transmit this power but in this note I'll stick to the IEEE 802.3 standard which defines the power supplied to be typically 15.4W or 25.5W for PoE+.

Anyone wanting to learn more about other alternative PoE systems are encouraged to look at the PoE entry on Wikipedia.


What is a PoE Switch?
A PoE Switch is just like any other Ethernet switch - except it is designed to provide 15.4W of power, on demand, down the Ethernet cable to the end device along with the Ethernet data signals.  Similarly, a PoE+ switch can provide upto 25.5W.  In my network I use a 24-port PoE+ Gigabit Ethernet switch similar to this TP-Link T1600G-28PS JetStream 24-Port Gigabit Smart PoE+ Switch.  You should consider one of these - or maybe a smaller 4 or 8 Port Gigabit PoE Switch to power your IP cameras if you are looking to do the same in your home or small business.

What is a PoE Splitter?
A PoE Splitter is a small device that passes the Ethernet data signals from input to output and at the same time draws power from the incoming PoE signal and provides a stable output power feed suitable for small devices such as a camera or WiFi access point as this diagram from TP-Link's user guide shows:


You can see from the diagram that this little device supplies power AND data to the end device but only has one cable connecting it to the switch.  To illustrate this the image below shows that I have powered a small 5-port Cisco switch from the unit.  The purple wire on the left connects to my PoE switch; the grey wire passes the Ethernet signal from the splitter to the Cisco switch and the black wire supplies power from the splitter to the switch.


In my next project I will be using this splitter to power a Raspberry Pi together with a Camera Module and LED light source as I construct a wildlife camera to watch the wildlife using the small pond in my garden.

I hope this note has been of use to you. I'll refer to it when I write up the Raspberry Pi outdoor wildlife camera project.

How to mount Google Drive on Linux

A short tutorial showing you how to install google-drive-ocamlfuse on a Linux Mint 17 system to access the contents of your Google Drive

Introduction
Most linux users who have tried to access their Google Drive contents will realise that there isn't an official Drive client for Linux yet - despite the wide availability of Drive clients for Windows and for Android devices.  Luckily there are alternatives available and this article shows you how to install google-drive-ocamlfuse on a system running Mint-17.

What is google-drive-ocamlfuse?
Technically, google-drive-ocamlfuse is a FUSE filesystem backed by Google Drive, written in OCaml. It lets you mount your Google Drive on Linux in a folder you choose during setup.  It has the following features:
  • Full read/write access to ordinary files and folders
  • Read-only access to Google Docs, Sheets, and Slides (exported to configurable formats)
  • Multiple account support
  • Duplicate file handling
  • Access to trash (.Trash directory)

The version I installed at the time I wrote this was google-drive-ocamlfuse 0.5.16.  The software is hosted on GitHub and more information is available on the project's GitHub page.

Installation instructions
The author has set up a .deb repository for installation under Ubuntu 14.04, 12.04 etc.  This means that any ubuntu derivatives (such as Mint) can use the same repository to install google-drive-ocamlfuse. To do this, open a Terminal window and enter the commands below
$ sudo add-apt-repository ppa:alessandro-strada/ppa $ sudo apt-get update $ sudo apt-get install google-drive-ocamlfuse
Once this has completed you need to configure google-drive-ocamlfuse to suit your system. First run google-drive-ocamlfuse without any parameters
$ google-drive-ocamlfuse
This command will create a folder (~/.gdfuse/default) containing the configuration files for the application and will also open a web browser asking you to confirm that you want the application to access your Google Drive.

Once access has been authorised the web browser will close and you will be returned to your Terminal window. You can then mount your Google Drive folder in your filesystem. In this tutorial I decided to keep things simple, so I created a Drive folder in my home area and configured google-drive-ocamlfuse to mount my Google Drive at this point.
$ mkdir -p ~/Drive $ google-drive-ocamlfuse ~/Drive
When you've done this you should see the files appearing as part of your new ~/Drive folder, depending on the speed of your Internet connection. Now be aware that there are two things you need to understand in order to get the best from this tutorial:
  • The first is that your Google Drive is mapped from the web. The files in your Google Drive stay in the cloud and are not synchronised with your local hard drive. This means that files take a while to open and close, as they are literally coming in from Google's servers. It also means that no Internet access equals no access to your Google Drive files. You can get round this by using rsync to sync or mirror another local folder with your Drive folder but that is a tutorial for another day.
  • The second is that the mount of your Google Drive is lost after a reboot or if you log out of your session. To get around this I added a couple of steps to the installation instructions you normally find so that your Google Drive reappears at the start of a new session.
Automounting your Google Drive
Open a Terminal session and create a shell script named gdfuse in /usr/bin.
$ sudo nano /usr/bin/gdfuse
Copy and paste the following lines into the script changing $username to match your username:

#!/bin/bash

su $username -l -c "google-drive-ocamlfuse -label $1 $*"
exit 0


Give the new script exec permissions
$ sudo chmod +x /usr/bin/gdfuse
Now edit /etc/fstab
$ sudo nano /etc/fstab
And add the following lines like this: (but remember to change uid and gid and /path/to/your/gdrive in the line below to the values of your username and of the path to your Google Drive folder accordingly.)

# Google Drive Automount
gdfuse#default /path/to/your/gdrive fuse uid=1000,gid=1000 0 0


You can then use mount to mount your Google Drive (again, with your Google Drive path in place of my example):
$ sudo mount /path/to/your/gdrive
That should be it. To test this, reboot the workstation and log back in again. After your desktop is ready you should see the Drive folder once more in place and if you click on the folder your Google Drive files should be visible again.

One final touch I did was to alter the file icon for my Drive folder so that it looked like a Google Drive folder.  I downloaded a suitable Drive icon from the web and adjusted the Properties of my Drive folder so that it showed the Google Drive icon instead.


I hope this tutorial has been of use to you. The steps involved took about ten minutes to complete and finally I have access to my Google Drive contents from my Mint workstation.

Adding new users on Mint 13 XFCE?

I've been advocating using Linux Mint 13 XFCE (codename MAYA) as a replacement operating system for older computers that were running Windows XP.  It's simple to use, fast, capable of most basic uses and, importantly, it's free!

I have also used Mint 13 on a number of occasions for single-task systems that just require a single user to do a single job.  But today I went to add a second user on a small system I am testing and I found that the basic installation of Mint 13 XFCE does not include the graphical tools to add new users.  You'd expect to find these by clicking  on Menu then selecting System and then Users and Groups.

Here is a simple one-line command to add this tool back in:

Open Terminal and enter the following line:
$ sudo apt-get install gnome-system-tools

Once the command has finished executing you can find the graphical tools to add users under System --> Users and Groups
Enjoy!