Difference between revisions of "Main Page"

From xPL
Jump to: navigation, search
(MediaWiki editing)
(Moving xPL services)
(38 intermediate revisions by one user not shown)
Line 4: Line 4:
 
and register to a hub in order to receive the messages sent by others.
 
and register to a hub in order to receive the messages sent by others.
  
The protocol is light enough to run on simple machines such as the [http://beagleboard.org BeagleBone].
+
The protocol is light enough to run on simple machines such as the [http://beagleboard.org BeagleBone]
Some [[install BeagleBone|setup insructions]] show how to prepare a BeagleBone to use with xPL.
+
or the [https://www.raspberrypi.org/ Raspberry Pi].
 +
Some setup insructions show how to prepare a [[install BeagleBone|BeagleBone]] or a [[install Raspberry Pi|Raspberry Pi]] to use with xPL.
 +
A [[SBC comparison|comparison]] of different single-board computers gives an idea of speed and power consumption issues.
  
 
The hub and the devices can be installed on different [http://xplproject.org.uk/wiki/index.php/Development_Tools platforms].
 
The hub and the devices can be installed on different [http://xplproject.org.uk/wiki/index.php/Development_Tools platforms].
The system shown here bases on [http://www.perl.org Perl],
+
The system shown here run with [http://www.perl.org Perl],
 
which is part of the Linux and Mac OS operating systems and can easily be installed on Windows.
 
which is part of the Linux and Mac OS operating systems and can easily be installed on Windows.
 +
It is based on John Bent's [http://johnb.xplproject.org.uk/info/perl/ xPL ToolKit for Perl].
  
 
= Install xPL =
 
= Install xPL =
Line 25: Line 28:
 
For this, the [[install serial port|xPL serial port device]] can be instantiated as many times as needed.
 
For this, the [[install serial port|xPL serial port device]] can be instantiated as many times as needed.
 
The xPL infrastructure supports this by the fact that these devices are differentiated by their name.
 
The xPL infrastructure supports this by the fact that these devices are differentiated by their name.
 +
 +
== Audio alerts ==
 +
 +
In the same way as your PC, your home wants to alert you from time to time.
 +
 +
For this, the [[install alert|xPL alert device]] can emit alert sounds.
 +
This can fro example be [[install central| triggered by other xPL messages]].
  
 
== Controlled equipment ==
 
== Controlled equipment ==
Line 30: Line 40:
 
The xPL scripts found here allow to control:
 
The xPL scripts found here allow to control:
 
* [[install EIB|EIB / KNX devices]] such as lights, shutters, …
 
* [[install EIB|EIB / KNX devices]] such as lights, shutters, …
 +
* [[install myStrom|myStrom devices]] such as buttons, lights, …
 +
* Ethernet [[install switches|controlled switches]]
 
* a [http://wiki.slimdevices.com/ Logitech Media Server]  [[install squeeze|controller]]
 
* a [http://wiki.slimdevices.com/ Logitech Media Server]  [[install squeeze|controller]]
* a Denon [[install AVR 3808|audio-video controller]]
 
* a Panasonic [[install plasma TH|plasma screen]]
 
 
* Philips Hue [[install Hue|LED light bulbs]] control and a [[install Hue clock|time display]] using 2 bulbs: one for the hour and one for the minute
 
* Philips Hue [[install Hue|LED light bulbs]] control and a [[install Hue clock|time display]] using 2 bulbs: one for the hour and one for the minute
* Ethernet [[install MSNswitch|controlled switches]]
+
* a Denon [[install AVR 3808|audio-video controller]]
 +
* a Sony Bravia [[install Bravia|Android TV]] or a Panasonic [[install plasma TH|plasma screen]]
 +
 
 +
Additionally, a [[install Canvas|picture display]] service on high-resolution monitors and screens
 +
hosted on a [https://www.raspberrypi.org/ Raspberry Pi] can turn the living room into a little museum.
  
 
== Triggered actions ==
 
== Triggered actions ==
  
 
An xPL device sends [[install clock|clock ticks]] every minute.
 
An xPL device sends [[install clock|clock ticks]] every minute.
 +
A xPL [[install dawnDusk|dawnDusk device]] sends messages at dawn and at dusk.
 +
 +
TBD - A [https://www.raspberrypi.org/ Raspberry Pi] based device sends [[install meteo|meteorologic information]] every minute.
  
 
A [[install central|central xPL device]] monitors all the messages and is configured to trigger specific actions on specific messages.
 
A [[install central|central xPL device]] monitors all the messages and is configured to trigger specific actions on specific messages.
Line 45: Line 62:
 
* to [[install actions|launch scripts]] at given times or on specific events
 
* to [[install actions|launch scripts]] at given times or on specific events
  
= Moving services =
+
TBD - The location of the personal mobile phone can be used to trigger actions, such as opening the garage door.
 +
A [[install phoneDistance|distance calculator]] sends xPL messages on any receipt of a [http://www.gpsinformation.org/dale/nmea.htm#position NMEA position message].
 +
 
 +
= RESTful web service =
 +
A [http://en.wikipedia.org/wiki/Representational_state_transfer#RESTful_web_APIs RESTful] web service
 +
allows to [[install REST|query and modify the state of the home]] using HTTP methods.
 +
 
 +
It works in conjunction with the [[install state|home state]] xPL device.
 +
 
 +
= Browser control =
 +
 
 +
An [[Install HTML|HTML web page]] can also be used to control the home.
 +
 
 +
It works in conjunction with a [https://en.wikipedia.org/wiki/Common_Gateway_Interface CGI script] capable of sending xPL messages.
 +
This implies to [[Install HTML#Install a web server|install a web server]] on a machine in the same local domain as the xPL system.
 +
 
 +
Obviously, the  [[Install HTML|home control pages]] have to be tailored to the user's wishes.
 +
These pages, in turn, can be generated by a CGI script, based on an [https://en.wikipedia.org/wiki/XML XML] description of the buttons and their associated commands.
 +
 
 +
= Moving xPL services =
  
 
Movng services require to stop them on a given device and starting them on another.
 
Movng services require to stop them on a given device and starting them on another.
Line 51: Line 87:
 
Stop a service on a given device:
 
Stop a service on a given device:
 
  su
 
  su
 +
ll /lib/systemd/system/xpl-*
 +
systemctl list-units --type=service --state=running | grep xpl
 
  SERVICE='xpl-central'
 
  SERVICE='xpl-central'
  SERVICE_CONF="/etc/init/$SERVICE"
+
   
  service $SERVICE stop
+
SERVICE_DEFINITION="/lib/systemd/system/$SERVICE"
  echo "manual" >> $SERVICE_CONF.override
+
  reset
 +
echo -e "\n$SERVICE_DEFINITION.service\n"
 +
echo ; cat $SERVICE_DEFINITION.service ; echo
 +
systemctl stop $SERVICE
 +
systemctl disable $SERVICE
 +
 +
SERVICE_SCRIPT="/home/control/Documents/Controls/$SERVICE.pl"
 +
reset
 +
  echo -e "\n$SERVICE_SCRIPT\n"
 +
echo ; cat $SERVICE_SCRIPT ; echo
 +
 +
reboot
 +
 
 +
Start it on the other machine:
 +
su
 +
SERVICE='xpl-central'
 +
 +
SERVICE_DEFINITION="/lib/systemd/system/$SERVICE"
 +
ed $SERVICE_DEFINITION.service
 +
 +
SERVICE_SCRIPT="/home/control/Documents/Controls/$SERVICE.pl"
 +
ed $SERVICE_SCRIPT
 +
 +
chmod 775 $SERVICE_SCRIPT
 +
chown control:users $SERVICE_SCRIPT
 +
systemctl enable $SERVICE
 +
systemctl status $SERVICE
 +
 
 +
= Contact =
 +
 
 +
My name is Francois Corthay.
 +
I teach [http://wiki.hevs.ch/fsi/ digital electronics] in an [http://www.hevs.edu/ engineering school] in Switzerland.
 +
If you have problems installing xPL, you can contact me at <i>my_first_name&#46;my_surname</i>&#64;dspc.ch.
  
= MediaWiki editing =
+
[[Category: all]]
Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.
+

Revision as of 14:06, 3 June 2021

The xPL protocol allows different devices to exchange information in a simple manner. The devices broadcast their messages to the others and register to a hub in order to receive the messages sent by others.

The protocol is light enough to run on simple machines such as the BeagleBone or the Raspberry Pi. Some setup insructions show how to prepare a BeagleBone or a Raspberry Pi to use with xPL. A comparison of different single-board computers gives an idea of speed and power consumption issues.

The hub and the devices can be installed on different platforms. The system shown here run with Perl, which is part of the Linux and Mac OS operating systems and can easily be installed on Windows. It is based on John Bent's xPL ToolKit for Perl.

Install xPL

Hub

The first step to xPL automation is to install a hub.

This has to be done on each machine that participates to the xPL network.

Serial port

Many devices are controlled over an RS-232 serial port.

For this, the xPL serial port device can be instantiated as many times as needed. The xPL infrastructure supports this by the fact that these devices are differentiated by their name.

Audio alerts

In the same way as your PC, your home wants to alert you from time to time.

For this, the xPL alert device can emit alert sounds. This can fro example be triggered by other xPL messages.

Controlled equipment

The xPL scripts found here allow to control:

Additionally, a picture display service on high-resolution monitors and screens hosted on a Raspberry Pi can turn the living room into a little museum.

Triggered actions

An xPL device sends clock ticks every minute. A xPL dawnDusk device sends messages at dawn and at dusk.

TBD - A Raspberry Pi based device sends meteorologic information every minute.

A central xPL device monitors all the messages and is configured to trigger specific actions on specific messages. This allows:

TBD - The location of the personal mobile phone can be used to trigger actions, such as opening the garage door. A distance calculator sends xPL messages on any receipt of a NMEA position message.

RESTful web service

A RESTful web service allows to query and modify the state of the home using HTTP methods.

It works in conjunction with the home state xPL device.

Browser control

An HTML web page can also be used to control the home.

It works in conjunction with a CGI script capable of sending xPL messages. This implies to install a web server on a machine in the same local domain as the xPL system.

Obviously, the home control pages have to be tailored to the user's wishes. These pages, in turn, can be generated by a CGI script, based on an XML description of the buttons and their associated commands.

Moving xPL services

Movng services require to stop them on a given device and starting them on another.

Stop a service on a given device:

su
ll /lib/systemd/system/xpl-*
systemctl list-units --type=service --state=running | grep xpl
SERVICE='xpl-central'

SERVICE_DEFINITION="/lib/systemd/system/$SERVICE"
reset
echo -e "\n$SERVICE_DEFINITION.service\n"
echo ; cat $SERVICE_DEFINITION.service ; echo
systemctl stop $SERVICE
systemctl disable $SERVICE

SERVICE_SCRIPT="/home/control/Documents/Controls/$SERVICE.pl"
reset
echo -e "\n$SERVICE_SCRIPT\n"
echo ; cat $SERVICE_SCRIPT ; echo

reboot

Start it on the other machine:

su
SERVICE='xpl-central'

SERVICE_DEFINITION="/lib/systemd/system/$SERVICE"
ed $SERVICE_DEFINITION.service

SERVICE_SCRIPT="/home/control/Documents/Controls/$SERVICE.pl"
ed $SERVICE_SCRIPT

chmod 775 $SERVICE_SCRIPT
chown control:users $SERVICE_SCRIPT
systemctl enable $SERVICE
systemctl status $SERVICE

Contact

My name is Francois Corthay. I teach digital electronics in an engineering school in Switzerland. If you have problems installing xPL, you can contact me at my_first_name.my_surname@dspc.ch.