Main menu

Purple Technician

Din leverantör av System- och tekniklösningar inom IT-området

Tjänster Läs mer


Utveckling av mjukvara

Utveckling av applikationer och spel

Läs mer


Installation, konfigurering, felsökning och support av nätverk, klienter, servrar och programvaror

Läs mer


Systemdesign, Weblösningar, IT-säkerhet, Utbildning m.m.

Läs mer

Using DDclient on a Raspberry Pi (Debian)

DDclient is used to update your IP-address when you use a DDNS-provider.

Step 1. Setting up the Raspberry

If you havent yet set up your Raspberry Pi  my step 1-3 in my earlier article can help you:

LAMP with Raspberry Pi

Step 2. Installing DDclient (if using for example dyndns, noip)

 sudo apt-get install ddclient

You will be guided through a installation. Use your dynamic DNS-information from your provider.

Step 2. Installing DDclient (if using other providers added after DDclient 3.8.0)

Browse wget to check for lastest ddclient.

sudo wget
sudo dpkg -i ddclient_3.8.2-4_all.deb

You will be guided through a installation. Use your dynamic DNS-information from your provider. Leave blank when network interface is asked or else your local address instead of your global adress will be used. In my case dtdns wasn´t a choice so I had to edit the ddclient.conf file with the below (use your favorite editor, in my case nano):

nano /etc/ddclient.conf

Change the protocol line to:


Add the following after the comments in top of file:

use=web,, web-skip='IP Address'

Restart ddclient:

service ddclient restart

You can check that ddclient is working by:

ddclient -daemon=0 -noquiet -debug

All done!


Nginx redirect from public URL to internal IP

Welcome to this turorial on how to config Nginx redirects from a public URL to an internal IP.

First follow step 1-3 on my tutorial LAMP with Raspberry Pi and step 1-7 om my tutorial Install Owncloud 7.01 on Raspberry Pi (Debian).

Login in as root (su) so you don't have to use sudo.

Step 1 - Edit nginx site-config

cd /etc/nginx/sites-enabled

Here you find your config for your site, could be named default or something else (owncloud if you followed my tutorial)

nano owncloud

In this case I will add a camera which is on the internal IP

Add the following in the used server-directive (starts with server { )(Don't forget all the slashes below)

location ^~ /camera1/ {
        proxy_pass ;

Save and exit nano.

Restart Nginx by

service nginx restart

All done.

Remotestick-server on a Raspberry Pi (Debian)

Welcome to this turorial on how to install Remotestick-server on a Raspberry Pi.

First follow step 1-3 on my tutorial LAMP with Raspberry Pi.

Login in as root so you don't have to use sudo.



I have used a very good source in Raspberry Pi + Tellstick Duo + Nexa = Awsome! How to set it up!

I will use the IP-address Change the below IP-address if you are using another.


Step 1 - Install  telldus-core

Add the source-list /etc/apt/sources.list.d/telldus.list

sudo nano /etc/apt/sources.list.d/telldus.list
deb-src stable main

Download key


Add key

sudo apt-key add telldus-public.key

Update packetlist

apt-get update

Check that build-essentials is installed

apt-get install build-essential

Install dependencies

apt-get build-dep telldus-core

Install more dependencies

sudo apt-get install cmake libconfuse-dev libftdi-dev help2man

Create temporary folder

mkdir -p ~/telldus-temp
cd ~/telldus-temp

Download and compile sourcecode

sudo apt-get --compile source telldus-core

Install package

sudo dpkg --install *.deb

Remove temporary folder

rm ~/telldus-temp

You should have telldus-core installed and a deamon that aoutostarts in /etc/init.d/telldusd


Step 2 - Connect your tellstick duo

Connect your tellstick to the raspberry Pi. You probably have to use a USB-hub to provide sufficient power.


Step 3 - Configure /etc/tellstick.conf

Below you have my config-file with a few Kjell&Co-switches combined with Nexa-switches. You can read more on the config file here.

sudo nano /etc/tellstick.conf
## Start tellstick.conf
user = "nobody"
group = "plugdev"
deviceNode = "/dev/tellstick"
ignoreControllerConfirmation = "false"

device {
  id = 1
  name = "Huset"
  controller = 0
  protocol = "fuhaote"
  model = "codeswitch"
  parameters {
    # devices = ""
    # house = ""
    # unit = ""
    code = "0001010000"
    # system = ""
    # units = ""
    # fade = ""

device {
 id = 2
 name = "Fontän"
 protocol = "arctech"
 model = "selflearning-switch"
 parameters {
  house = "1" # You can use a random number here
  unit = "1"

device {
 id = 3
 name = "Motorvärmare"
 protocol = "arctech"
 model = "selflearning-switch"
 parameters {
  house = "1" # You can use a random number here
  unit = "2"

controller {
  id = 1
  # name = ""
  type = 1
  serial = "A900I885"
## EOF

When you are done editing you have to restart the deamon.

sudo /etc/init.d/telldusd restart


Step 4 - Syncronize your assessories to tellstick

How to learn tellstick about assessories, example unit 1 in tellstick.conf file:

tdtool -e 1

Do the above for all your assessories

How to list all configured units. Example text below:

tdtool -l
Number of devices: 3
1 Huset ON
2 Fontän OFF
3 Motorvärmare OFF


Step 5 - Install prerequisites for remotestick-server

Install python-bottle

apt-get install python-bottle


Step 6 - Download and configure remotestick-server

Go to the remote-stick server-webpage here. I downloaded to get the web-GUI.

Create a folder in your home-director. Transfer and unpack the files.

mkdir ~/remotestick-server
cd ~/remotestick-server
wget -O
unzip /etc/remotestick-server/

Start server

python ––host= ––port=8422 ––user=tellstick ––pass=tellstick


     Bottle server starting up (using WSGIRefServer())…
Listening on
Use Ctrl-C to quit.

You can now access the web-GUI with your RasPi IP-address, for example: 

(You have to add the last / for the page to work)


With this GUI you can turn individual assessories on and off and also on/off on all assessories.

Now abort the python script with CTRL+C.


Step 7 - Run remotestick-server in background

Make a new file


And add the following

cd ~/remotestick-server/
./ ––host= > /dev/null 2>&1 &

 Save and exit and make it executable

chmod +x 

Run script


There are apps on Google Market, for example Remotestick Lite, to control the tellstick.


Step 8 - Start remotestick-server at boot

Make a new file

nano /etc/init.d/

And add the following

# Provides: remotestick-server
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 2 3 4 5
# Short-Description: Remotestick-server services
cd ~/remotestick-server/ &&
./ ––host= > /dev/null 2>&1 &

Save. Make executable and add to bootsequence.

sudo chmod +x /etc/init.d/
sudo update-rc.d defaults

Test service

ps aux | grep python

Probable output

pi 737 0.0 0.1 3540 800 pts/0 S+ 20:09 0:00 grep python
pi 2007 0.0 1.6 12744 8456 pts/0 S Nov30 6:56 python –h=


Optional Step 9 - Cronjob

crontab -e

Add the following (example)

# m h dom mon dow command
## Hallen
# Power on 12:00
00 12 * * * tdtool -n 1 > /dev/null 2>&1
# Power off 21:59
59 21 * * * tdtool -f 1 > /dev/null 2>&1
## Vrum
# Power on 18:33
33 18 * * * tdtool -n 2 > /dev/null 2>&1
# Power off 23:32
32 23 * * * tdtool -f 2 > /dev/null 2>&1
## Kok
# Power on 17:19
19 17 * * * tdtool -n 3 > /dev/null 2>&1
# Power off 21:55
55 21 * * * tdtool -f 3 > /dev/null 2>&1

Example when turning on/off at the same minute (you have to use sleep):

# Power on 18:33
33 18 * * * sleep 1; tdtool -n 2 > /dev/null 2>&1
# Power on 18:33
33 18 * * * sleep 3; tdtool -n 3 > /dev/null 2>&1


Optional Step 10 - Make the Web-GUI more fancy

Henrik Löwenhamn has made some improvements on the web-GUI.

Download the web-GUI here.

Transfer the files to the Raspberry and replace the static map in ~/remotestick-server with the new one.

Edit the index.html-file

Search for "welcome" and change the text as appropriate.



Raspberry Pi

Telldus forum / site


Install Windows 10 on a Raspberry Pi 2

Step 0

Get  an account for Microsoft connect.

Step 1 .

Get your hands on a windows 10 install (so an iso for PC), i used en_windows_10_pro_technical_preview_10074_x64_dvd.iso (download it from )

Step 2

Open the iso with 7zip (or any other program that can look into ISO's)

Step 3

From the folder "sources" copy everything except the subfolders and the 2 biggest files (you can copy them ofcourse, but it will take less time if you skip them) to a folder on your PC. I put everything in C:\w10install . I am not sure which files are actually needed but just copying dism.exe and some dll's didnt work. So thats why I copy the whole directory.

I had to install Windows 10 ADK to get the file ffuprovider.dll which is not supplied in the latest Windows 10 ISO. Just install the ADK and then seach for ffuprovider.dll and copy this to the same location.

Step 4

Copy the file Flash.ffu that you downloaded from the Microsoft site to this same folder. (this file is within, that can be downloaded from )

Step 5

Start a command prompt (run as administrator)
Type the following commands:
list disk

And note the number of your SD card

Step 6

dism.exe /Apply-Image /ImageFile:flash.ffu /ApplyDrive:\\.\PhysicalDriveN /SkipPlatformCheck
Where the N in PhysicalDriveN is the drive number from the previous step.
The image will now be written to the SD card

Step 7

Thats it, now put the SD card in the Pi 2 and wait a while, it will boot up to Windows 10 IoT. The first boot will take quite some time, so have a bit of patience