Page 1 of 6

SwichKingPi an Image

Posted: Fri 07 Nov 2014, 20:11
by gorhak
SwitchKingPi an Image
for RaspberryPi, ver B+ and 2, with Telldus and SwitchKing running on Mono HardFloat

Download attached torrent:
2015-02-08-SwitchKingPi-4G.torrent
Unpack it with 7-zip to obtain the img-file
2015-02-08-SwitchKingPi-4G.img

Write image to SD card, minimum 4GB but I recomend 8GB, using Win32DiskImager.exe
(I use: Transcend TS16GUSDHC10U1 Ultimate 600x MicroSDHC Memorycard - 16GB)

Put SD card in RaspberryPi and start

Figure out your RaspberryPi:s IP addres. (Check your router, or DHCP server)

Connect from windows using PuTTY.

Start raspi-config:
-Expand the file system
-Set your configuration/language and keyboard, swedish is selected
-Select overclocking if you want, 700MHz selected. However, don't use Turbo if you'r runing RPi 2.

Stop SwitchKing Service
/etc/init.d/switchkingd stop

Brows your network for SwichKingPi from windows and open SwitchKing Server/DB/

If you alredy have, copy your switchKing.server.db3 to DB folder and change permissions and ownership
sudo chmod 666 /bin/SwitchKing/Bin/DB/switchKing.server.db3
sudo chown pi:pi /bin/SwitchKing/Bin/DB/switchKing.server.db3

Start SwichKing's supervision crontab-job on SwichKingPi
crontab -e
remove the # form the lines that looks like
# */1 * * * * nice -n19 sudo bash /usr/local/sbin/switchking.sh
# */10 * * * * nice -n19 sudo bash /usr/local/sbin/telldus.sh
and save: ctrl-X Y Enter

The SwitchKing service will start within a minute, check with
skstatus.sh

From SwitchKing Client on Windows connect to SwichKingPi, remembering your IP

If you have a big DB you may need to extend the timouts in the Clients config file.
I used 1 hour for all these four (don't forget to change back), ex from windows:
C:\Program Files (x86)\Switch King\Switch King Client\SwitchKingPro.exe.config
...
<binding name="WSHttpBinding_FrameworkService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
...

There are five bash scripts that runs as crontab-jobs located in /usr/local/sbin/
switchking.sh: Checks if switchkingd is running every minute, if not it: starts switchking service
telldus.sh: Checks if telldusd is running every 10 minute, if not it restarts telldus and switchking services
maintenance.sh: Runs a maintenance / updating job every day at 02:00
restart.sh: Restrats telldus and swichking services every day at 05:00
boot.sh: Updates RPI firmware and reboots the SwitchKingPi every Monday morning at 03.00

There are two other bash scripts in /usr/local/sbin/
skstatus.sh: Prints the status of telldus and switchking daemons
cleanlogs.sh: Deletes the log files, remaining the links on ~/

If you want to reproduce it yourself, or just curious check this
2015-02-08-SwitchKingPi-helperfiles.7z.torrent
GOOD LUCK
Göran

Re: SwichKingPi an Image

Posted: Sat 08 Nov 2014, 22:27
by chris
Fungerar perfekt tusen tack :D

Re: SwichKingPi an Image

Posted: Tue 11 Nov 2014, 11:57
by albinsson
Fungerade finfint enligt din guide! Tack så mycket
Tyvärr blev mitt system alldeles för segt för att det ska vara användbart. Jag fick köra vidare på min Windows 8 netbook.
Vet inte, men kan det bero på att man har för många enheter? Min server DB ligger på ca 15Mb

Re: SwichKingPi an Image

Posted: Sun 23 Nov 2014, 15:48
by The_Lizzard
Funkar klockrent! Tusen tack! :D

Re: SwichKingPi an Image

Posted: Sun 23 Nov 2014, 20:38
by 600gts
Tjoho, sugen på att testa detta. Nån som kan dela imagen?

///Mattias

Re: SwichKingPi an Image

Posted: Tue 25 Nov 2014, 23:57
by OMX-dulfer
Fungerar klockrent. Stort tack!!
It work´s perfect. Many thanks!!

Re: SwichKingPi an Image

Posted: Thu 27 Nov 2014, 21:58
by 600gts
Hej

Tack för detta, laddade in det hela igår å det funkar fin fint ännu :-)

Jag delar den Bosse så det borde funka för dig att dra från mig?

MVH
Mattias

Re: SwichKingPi an Image

Posted: Thu 27 Nov 2014, 22:58
by gorhak
Min dator står alltid på och mytorrent likaså. Nedladdad ett tiotal gånger så det borde finnas ett antal användare som också delar ut. Jag antar att man delar med sig efter att ha laddat hem. Får in timeout så försök igen, eller kanske kolla om det går att förlänga tiden för timeout.
Göran

Re: SwichKingPi an Image

Posted: Sat 29 Nov 2014, 00:29
by OMX-dulfer
Seedar på jag med :wave:

Re: SwichKingPi an Image

Posted: Sat 29 Nov 2014, 22:16
by metalic
Hej! Sjukt bra guide och image. Det bara "funkar" hur bra som helst!

Jag har en fundering dock, hur får jag detta registrerat med Telldus Live? Skulle vilja kunna använda Tellevent på iOS som förlitar sig helt på Tellevent Live!.

Tack oavsett, /metalic