Difference between revisions of "Install dawnDusk"
(Created page with "The ''dawnDusk'' device sends an xPL message at dawn, sunrise, sunset and dusk. Before all, make sure you have installed an xPL hub. = Install xPL dawnDu...") |
(→Launch the xPL clock device at startup) |
||
Line 28: | Line 28: | ||
The monitor should report dawn and dusk times for the current day. | The monitor should report dawn and dusk times for the current day. | ||
− | = Launch the xPL | + | = Launch the xPL dawnDusk device at startup = |
− | The xPL | + | The xPL dawnDusk device is to be launched after the xPL hub. |
== Ubuntu == | == Ubuntu == | ||
− | On Ubuntu, the xPL | + | On Ubuntu, the xPL dawnDusk device starts-up once <code>xpl-hub_started</code> has been emitted. |
− | Edit <code>/etc/init/xpl- | + | Edit <code>/etc/init/xpl-dawnDusk.conf</code>: |
################################################################################ | ################################################################################ | ||
− | # xPL | + | # xPL dawnDusk, sends dawn and dusk occurence messages |
# | # | ||
− | description "xPL | + | description "xPL dawnDusk" |
version "1.0" | version "1.0" | ||
author "Francois Corthay" | author "Francois Corthay" | ||
Line 48: | Line 48: | ||
# | # | ||
env SCRIPTS_DIR='/home/control/Documents/Controls' | env SCRIPTS_DIR='/home/control/Documents/Controls' | ||
− | env SCRIPT_NAME='xpl- | + | env SCRIPT_NAME='xpl-dawnDusk.pl' |
env PARAMETERS='-n home' | env PARAMETERS='-n home' | ||
Line 67: | Line 67: | ||
Start the device and check it is up and running: | Start the device and check it is up and running: | ||
su root | su root | ||
− | service xpl- | + | service xpl-dawnDusk start |
− | service xpl- | + | service xpl-dawnDusk status |
initctl list | grep xpl | initctl list | grep xpl | ||
== Mac OS == | == Mac OS == | ||
− | On Mac OS, the xPL | + | On Mac OS, the xPL dawnDusk device starts-up later than the hub. |
Edit <code>/Library/LaunchDaemons/xpl-clock.plist</code>: | Edit <code>/Library/LaunchDaemons/xpl-clock.plist</code>: | ||
− | |||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | <plist version="1.0"> | ||
<dict> | <dict> | ||
<key>Label</key> | <key>Label</key> | ||
− | <string>xPL | + | <string>xPL dawn-dusk indicator</string> |
<key>OnDemand</key> | <key>OnDemand</key> | ||
<false/> | <false/> | ||
Line 88: | Line 87: | ||
<key>ProgramArguments</key> | <key>ProgramArguments</key> | ||
<array> | <array> | ||
− | <string>/Users/control/Documents/Controls/xpl- | + | <string>/Users/control/Documents/Controls/xpl-dawnDusk.pl</string> |
<string>-n</string> | <string>-n</string> | ||
<string>home</string> | <string>home</string> | ||
<string>-w</string> | <string>-w</string> | ||
<string>25</string> | <string>25</string> | ||
+ | <string>-l</string> | ||
+ | <string>46.0037</string> | ||
+ | <string>-o</string> | ||
+ | <string>18</string> | ||
</array> | </array> | ||
</dict> | </dict> | ||
Line 99: | Line 102: | ||
Start the device and check it is up and running: | Start the device and check it is up and running: | ||
su root | su root | ||
− | launchctl load /Library/LaunchDaemons/xpl- | + | launchctl load /Library/LaunchDaemons/xpl-dawnDusk.plist |
launchctl list | grep -i xpl | launchctl list | grep -i xpl | ||
[[Category: all]] [[Category: install]] [[Category: xPL]] | [[Category: all]] [[Category: install]] [[Category: xPL]] |
Revision as of 09:49, 25 May 2015
The dawnDusk device sends an xPL message at dawn, sunrise, sunset and dusk.
Before all, make sure you have installed an xPL hub.
Contents
Install xPL dawnDusk device
Download the xPL device script.
Move the script to xPL scripts directory:
SCRIPTS_BASE_DIR=/home/control/Documents/Controls mv xpl-dawnDusk.pl $SCRIPTS_BASE_DIR chown control:users $SCRIPTS_BASE_DIR/*.pl chmod 775 $SCRIPTS_BASE_DIR/*.pl
Test xPL dawnDusk device
Open a terminal window and launch the device:
SCRIPTS_BASE_DIR=/home/control/Documents/Controls $SCRIPTS_BASE_DIR/xpl-dawnDusk.pl -v
Open a second terminal window (on any machine with xPL installed) and monitor the xPL protocol:
SCRIPTS_BASE_DIR=/home/control/Documents/Controls $SCRIPTS_BASE_DIR/xpl-monitor.pl -vf
Open a third terminal window (on any machine with xPL installed) and monitor the xPL protocol:
SCRIPTS_BASE_DIR=/home/control/Documents/Controls $SCRIPTS_BASE_DIR/xpl-send.pl -c dawnDusk.basic command=status query=all
The monitor should report dawn and dusk times for the current day.
Launch the xPL dawnDusk device at startup
The xPL dawnDusk device is to be launched after the xPL hub.
Ubuntu
On Ubuntu, the xPL dawnDusk device starts-up once xpl-hub_started
has been emitted.
Edit /etc/init/xpl-dawnDusk.conf
:
################################################################################ # xPL dawnDusk, sends dawn and dusk occurence messages # description "xPL dawnDusk" version "1.0" author "Francois Corthay" #------------------------------------------------------------------------------- # Configuration variables # env SCRIPTS_DIR='/home/control/Documents/Controls' env SCRIPT_NAME='xpl-dawnDusk.pl' env PARAMETERS='-n home' #------------------------------------------------------------------------------- # Start and stop conditions # start on xpl-hub_started stop on shutdown respawn setuid control setgid users #------------------------------------------------------------------------------- # Start daemon # exec $SCRIPTS_DIR/$SCRIPT_NAME $PARAMETERS
Start the device and check it is up and running:
su root service xpl-dawnDusk start service xpl-dawnDusk status initctl list | grep xpl
Mac OS
On Mac OS, the xPL dawnDusk device starts-up later than the hub.
Edit /Library/LaunchDaemons/xpl-clock.plist
:
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>xPL dawn-dusk indicator</string> <key>OnDemand</key> <false/> <key>UserName</key> <string>control</string> <key>ProgramArguments</key> <array> <string>/Users/control/Documents/Controls/xpl-dawnDusk.pl</string> <string>-n</string> <string>home</string> <string>-w</string> <string>25</string> <string>-l</string> <string>46.0037</string> <string>-o</string> <string>18</string> </array> </dict> </plist>
Start the device and check it is up and running:
su root launchctl load /Library/LaunchDaemons/xpl-dawnDusk.plist launchctl list | grep -i xpl