SwichKingPi an Image
Posted: Fri 07 Nov 2014, 20:11
SwitchKingPi an Image
for RaspberryPi, ver B+ and 2, with Telldus and SwitchKing running on Mono HardFloat
Download attached 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 GOOD LUCK
Göran
for RaspberryPi, ver B+ and 2, with Telldus and SwitchKing running on Mono HardFloat
Download attached 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 GOOD LUCK
Göran