Very Simple Control Protocol

Last updated
Official VSCP logo.png

The Very Simple Control Protocol (VSCP) [1] is a free automation protocol suitable for all sorts of automation task where building- or home-automation is in the main focus.

Contents

Its main advantage is that each VSCP-node can work completely autonomous, being part of distributed network of other nodes.

VSCP is independent from the physical layer (e.g. CAN bus, Ethernet, RS-485, RS-232, MiWi) connecting the individual nodes to form the automation network bus. On the bus there can be nodes reading switches, controlling lighting, blinds, windows or information displays, broadcasting physical measurements (e.g. temperature, luminosity, power consumption, etc.), multimedia control, burglar- or fire-alarm, etc.

There is a subset of the protocol (Level I) that is very much tailored to the CAN bus and resource restricted microcontrollers. Protocol Level II is designed for Ethernet (UDP, TCP and own Ethernet-type Raw-Ethernet) and wireless physical layers. All share the same common message fields and framework and can be connected through gateways.

Event

VSCP is based on events. Each time an event occurs it is broadcast towards all other nodes. Each node on the network will receive the event and will decide if this event needs to be handled or not.

VSCP event processing diagram.png

The example given in the diagram describes a button being pressed. This will result in node 1 sending an event message onto the bus informing all others the button is pressed. Node 2 receives the message but decides this button should not trigger an event for node 2. Node 3 receives the message and decides this button should trigger lamp 2 to turn on.

There can be events for all sorts of things happening: an event can be a button pressed, a presence sensor being triggered, or the sun setting. Events can also be sent periodically, for instance a temperature reading every minute. VSCP predefines many events that could be happening. These events are defined into classes and types. Whether or not an event received should be handled is determined by the decision matrix or DM in short. Also the DM is explained further.

Event Class and Type

Events are organized into Classes. A class is a collection of events that somehow belong together. There are classes for ALARM, MEASUREMENTS, CONTROL, INFORMATION, etc. Currently VSCP specifies about 25 classes, but has room for many more 1. Each class is on its turn subdivided into types. A type further specifies the event within the class. For instance, events of Class 20 (0x14) are INFORMATION events. In this class there is a subtype 1 (0x01) BUTTON signaling a button being pressed. In this same INFORMATION class there are also types to signal ON, OFF, BELOW LIMIT, etc. Likewise in class measurements there are types to signal temperature, current, voltage, etc. Having all these classes and types defined makes the nodes speak the same language. For a full list of pre-defines classes & types check the VSCP wiki.

VSCP event datagram structure

Events that are broadcast contain a number of fields together forming one VSCP datagram. Exactly how these fields are mapped onto the physical layer is specified for a number of physical layer protocols such as CAN, Ethernet, TCP, etc. For others it is not yet defined, but it is in general not difficult to map these fields onto a physical layer protocol. There are 2 levels of the VSCP protocol called LEVEL I & LEVEL II. They are both basically the same protocol but differ in size of the different fields.

Level I is intended to run on nodes with more constrained resources and fields are defined a bit more conservatively. Level I is in fact a subset of level II, and with an appropriate gateway events can transverse between a Level I & II network.

VSCP datagram level I
PriorityHardcoded IDCLASSTYPESenderNickIDDataSizePayloadCRC
3 bits1 bit9 bits8 bits8 bits4 bits0 to 8 bytes16 bits

Level II is intended to be run on nodes that have little resource constraints and can easily cope with larger message sizes.

VSCP datagram level II
PriorityHardcoded IDCLASSTYPESenderGUIDDataSizePayloadCRC
3 bits1 bit16 bits16 bits128 bits16 bits0 to 487 bytes16 bits

Decision matrix

VSCP class/event mask & filter VSCP Class Event mask filter.png
VSCP class/event mask & filter

When events are received by a node the node needs to determine if it needs to execute a task based on that event. This is done by evaluating the decision matrix or DM in short. The DM matrix is made of a number of IF ... THEN ... conditions. Each such IF/THEN condition is called a line and multiple lines make up the decision matrix.

The Class and Type of the incoming message is always evaluated by a DM line. Evaluating Class & Type is done by passing the Class/Type through a mask first and then comparing with a filter. This method allows multiple class/Types to trigger a valid condition for 1 line of the DM. The other conditions for the DM line (SenderGUID, Zone, Subzone) are optionally evaluated. If the DM line is valid then the ACTION is executed. Together with the ACTION there is an ACTION parameters. An example ACTION would be: turn-on relay 6 with 6 being the action parameter. Exactly which ACTIONs are possible by the receiving node is determined by the design of the node itself. It is up to the firmware developer to define which actions can be executed. By then documenting the possible action in the MDF file (see later) the configuration SW will know how to select this action. The DM can be modified by setting the appropriate node configuration registers. A convenient way to do this is using the VSCPWorks configuration SW.

DataPayload

An event being sent can also carry a data payload. The content & organization of this payload is depending on the class and type of the event. For example, an event of class 10 (measurement) and type 6 (temperature) will carry the temperature data (with coding determined by byte 0, degrees or Celsius) in its payload. A button event will carry information about the button & button zone/subzone in its datapayload. For each class/type the data formatting is determined in the spec, please consult the wiki for details.

Zone/subzone

Some (quite some) events contain a field zone and a field subzone in their datapayload. This functionality is present to make grouping of nodes possible. For instance we could determine that all buttons controlling a certain lamp are part of the same group. This simplifies the DM for certain scenarios. Instead of having one DM line as the lamp node for each button (1 line per button: IF button x then turn-on lamp) we could have 1 DM line only saying IF (zone match) THEN turn-on lamp. Making multiple node switches part of a group is done by configuring the nodes, the firmware of the node will support this functionality.

Configuring a VSCP node

A node needs to be configured appropriately before it will execute its function. Each VSCP node provides its own set of configuration registers tailored for its function. A button node would have some possibility to configure the zone/subzones the buttons belong to. A temperature node would have some possibility to set trigger values. Also configuring the DM is part of configuring a node.

Configuration registers

VSCP register space VSCP register space.png
VSCP register space

Configuring a node is done by writing to registers. Each (Level I) node provides access to 256 registers. The highest 128 registers are reserved for VSCP core functions. In these 128 registers we find items such as node GUID, Nickname, MDF and a paging register. The lower 128 registers are free for application specific use. If 128 registers are not sufficient then there is a 16bit paging possibility. This allows for 65536 x 128 8bit registers for application use. Writing/reading these registers is done using CLASS 0 events. Class 0 events are VSCP protocol functionality messages intended for configuring and managing nodes.

Module Description File

Keeping track of which register serves what purpose can be a challenge, especially for the application specific registers. But this is where the module description file or MDF comes in. The MDF file is a machine-readable XML file describing the function of each register of a module, giving the configuration options for that register, etc. This file is used by configuration software (VSCPWorks) to show configuration options specific for the module addressed. The MDF file can be stored on the node itself and fetched from there by VSCPWorks, but more commonly the MDF file will be an XML file hosted on a webserver somewhere. A node then just needs to inform VSCPWorks where (URL) the XML file can be found. This URL is present in the VSCP reserved registers 0xE0-0xFF.

VSCPWorks

Screenshot of VSCPworks VSCPworks screenshot.jpeg
Screenshot of VSCPworks

VSCPworks is the PC (Linux & Windows)-based tool to configure and manage the nodes. VSCPWorks allows reading/setting registers presenting those registers in a human-readable format by parsing the MDF file automatically. VSCPWorks also provides wizards to set the decision matrix.

VSCP & Friends

If VSCP is the protocol VSCP & Friends is used to name a software API, schema and abstraction layer built around VSCP. VSCP & Friends allow for layered abstractions of legacy devices by using drivers that make them look like VSCP devices. This means any device can be controlled and monitored with the VSCP & Friends framework. VSCP & Friends solves four common IoT and M2M problems

Related Research Articles

The Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet Protocol (IP) networks for automatically assigning IP addresses and other communication parameters to devices connected to the network using a client–server architecture.

In computer networking, the maximum transmission unit (MTU) is the size of the largest protocol data unit (PDU) that can be communicated in a single network layer transaction. The MTU relates to, but is not identical to the maximum frame size that can be transported on the data link layer, e.g. Ethernet frame.

<span class="mw-page-title-main">Network topology</span> Arrangement of the elements of a communication network

Network topology is the arrangement of the elements of a communication network. Network topology can be used to define or describe the arrangement of various types of telecommunication networks, including command and control radio networks, industrial fieldbusses and computer networks.

The Address Resolution Protocol (ARP) is a communication protocol used for discovering the link layer address, such as a MAC address, associated with a given internet layer address, typically an IPv4 address. This mapping is a critical function in the Internet protocol suite. ARP was defined in 1982 by RFC 826, which is Internet Standard STD 37.

A virtual local area network (VLAN) is any broadcast domain that is partitioned and isolated in a computer network at the data link layer. In this context, virtual, refers to a physical object recreated and altered by additional logic, within the local area network. VLANs work by applying tags to network frames and handling these tags in networking systems – creating the appearance and functionality of network traffic that is physically on a single network but acts as if it is split between separate networks. In this way, VLANs can keep network applications separate despite being connected to the same physical network, and without requiring multiple sets of cabling and networking devices to be deployed.

<span class="mw-page-title-main">KNX</span> Standard in building automation

KNX is an open standard for commercial and domestic building automation. KNX devices can manage lighting, blinds and shutters, HVAC, security systems, energy management, audio video, white goods, displays, remote control, etc. KNX evolved from three earlier standards; the European Home Systems Protocol (EHS), BatiBUS, and the European Installation Bus. It can use twisted pair, powerline, RF, or IP links. On this network, the devices form distributed applications and tight interaction is possible. This is implemented via interworking models with standardised datapoint types and objects, modelling logical device channels.

<span class="mw-page-title-main">Link aggregation</span> Using multiple network connections in parallel to increase capacity and reliability

In computer networking, link aggregation is the combining of multiple network connections in parallel by any of several methods, in order to increase throughput beyond what a single connection could sustain, to provide redundancy in case one of the links should fail, or both. A link aggregation group (LAG) is the combined collection of physical ports.

<span class="mw-page-title-main">NetworkManager</span> Software

NetworkManager is a daemon that sits on top of libudev and other Linux kernel interfaces and provides a high-level interface for the configuration of the network interfaces.

<span class="mw-page-title-main">Profinet</span>

Profinet is an industry technical standard for data communication over Industrial Ethernet, designed for collecting data from, and controlling equipment in industrial systems, with a particular strength in delivering data under tight time constraints. The standard is maintained and supported by Profibus and Profinet International, an umbrella organization headquartered in Karlsruhe, Germany.

CANopen is a communication protocol and device profile specification for embedded systems used in automation. In terms of the OSI model, CANopen implements the layers above and including the network layer. The CANopen standard consists of an addressing scheme, several small communication protocols and an application layer defined by a device profile. The communication protocols have support for network management, device monitoring and communication between nodes, including a simple transport layer for message segmentation/desegmentation. The lower level protocol implementing the data link and physical layers is usually Controller Area Network (CAN), although devices using some other means of communication can also implement the CANopen device profile.

<span class="mw-page-title-main">Computer network</span> Network that allows computers to share resources and communicate with each other

A computer network is a set of computers sharing resources located on or provided by network nodes. The computers use common communication protocols over digital interconnections to communicate with each other. These interconnections are made up of telecommunication network technologies, based on physically wired, optical, and wireless radio-frequency methods that may be arranged in a variety of network topologies.

Windows Rally is a set of technologies from Microsoft intended to simplify the setup and maintenance of wired and wireless network-connected devices. They aim to increase reliability and security of connectivity for users who connect the devices to the Internet or to computers running Microsoft Windows. These technologies provide control of network quality of service (QoS) and diagnostics for data sharing, communications, and entertainment. Windows Rally technologies provide provisioning for the following devices:

A multi-chassis link aggregation group is a type of link aggregation group (LAG) with constituent ports that terminate on separate chassis, primarily for the purpose of providing redundancy in the event one of the chassis fails. The IEEE 802.1AX-2008 industry standard for link aggregation does not mention MC-LAG, but does not preclude it. Its implementation varies by vendor; notably, the protocol existing between the chassis is proprietary.

Sercos III is the third generation of the Sercos interface, a standardized open digital interface for the communication between industrial controls, motion devices, input/output devices (I/O), and Ethernet nodes, such as PCs. Sercos III applies the hard real-time features of the Sercos interface to Ethernet. It is based upon and conforms to the Ethernet standard. Work began on Sercos III in 2003, with vendors releasing first products supporting it in 2005.

<span class="mw-page-title-main">Storage area network</span> Network which provides access to consolidated, block-level data storage

A storage area network (SAN) or storage network is a computer network which provides access to consolidated, block-level data storage. SANs are primarily used to access data storage devices, such as disk arrays and tape libraries from servers so that the devices appear to the operating system as direct-attached storage. A SAN typically is a dedicated network of storage devices not accessible through the local area network (LAN).

The Application Interface Specification (AIS) is a collection of open specifications that define the application programming interfaces (APIs) for high-availability application computer software. It is developed and published by the Service Availability Forum and made freely available. Besides reducing the complexity of high-availability applications and shortening development time, the specifications intended to ease the portability of applications between different middleware implementations and to admit third party developers to a field that was highly proprietary in the past.

MOST is a high-speed multimedia network technology optimized by the automotive industry. It can be used for applications inside or outside the car. The serial MOST bus uses a daisy-chain topology or ring topology and synchronous data communication to transport audio, video, voice and data signals via plastic optical fiber (POF) or electrical conductor physical layers.

<span class="mw-page-title-main">IEEE 1905</span> Multi-mode network enabler for home networking

IEEE 1905.1 is an IEEE standard which defines a network enabler for home networking supporting both wireless and wireline technologies: IEEE 802.11, IEEE 1901 powerline networking, IEEE 802.3 Ethernet and Multimedia over Coax (MoCA).

RTP-MIDI is a protocol to transport MIDI messages within RTP packets over Ethernet and WiFi networks. It is completely open and free, and is compatible both with LAN and WAN application fields. Compared to MIDI 1.0, RTP-MIDI includes new features like session management, device synchronization and detection of lost packets, with automatic regeneration of lost data. RTP-MIDI is compatible with real-time applications, and supports sample-accurate synchronization for each MIDI message.

Time-Sensitive Networking (TSN) is a set of standards under development by the Time-Sensitive Networking task group of the IEEE 802.1 working group. The TSN task group was formed in November 2012 by renaming the existing Audio Video Bridging Task Group and continuing its work. The name changed as a result of the extension of the working area of the standardization group. The standards define mechanisms for the time-sensitive transmission of data over deterministic Ethernet networks.

References

  1. Hedman, Ake. "YAP". VSCP Specification. Grodans Paradis AB. Retrieved 4 September 2017.