Skip to content

VSCP Demo server

Åke Hedman edited this page Aug 6, 2024 · 35 revisions

VSCP Demo server

The VSCP demo server is located at mqtt.vscp.org It is to be used for demo purposes only. It can't be used for mission-critical tasks. Also https://test.mosquitto.org is available. A mirror is available at the test.mosquitto.org server )same topics as described below). Follow the link info about ports etc.

mqtt.vscp.org
tcp/ip port 1883 - no TLS, need authentication
tcp/ip port 8883 . TLS, need authentication
websocket port 9001 - no TLS, need authentication
websocket port 9901 - TLS, need authentication

username: vscp
password: secret

Clients

Command line client tools

Mosquitto

On Linux install mosquitto client package with

sudo apt install mosquitto-clients

After installation, you can subscribe to events published on all VSCP topics with

mosquitto_sub -u vscp -P secret -h mqtt.vscp.org -p 1883 -t vscp/#

or use

mosquitto_sub -u vscp -P secret -h mqtt.vscp.org -p 1883 -t vscp/25:00:00:00:00:00:00:00:00:00:00:00:06:01:00:01/1040/6/1/2/#

to get the current fridge temperature in our kitchen.

MQTT.js

Another command line alternative is to use MQTT.js. Install with

npm install mqtt --save

Graphical interface client tools

MQTT Explorer

Info is here. Easy to use tool but (as it looks) apparently not developed anymore.

VSCP Works +

Not released yet but will have both general MQTT support and VSCP specific support.

Available topics

vscp-daemon

Each VSCP daemon that publish events to the demo server is listed here. The GUID for the server identifies it and drivers and discovery gives information about running drivers on the daemon and nodes discovered by the daemon respectively. See the VSCP daemon documentation for more information about this content.

vscp

Under this topic events from nodes are available. The format for a typical measurement topic is

vscp/guid/vscp-class/vscp-type/node-id/data-byte-0

This give maximum flexibility for the client to filter out the events it is interested in. Byte zero of the data is set because for Level II measurements this byte holds the sensor index for the sensor on the remote node that the measurement value comes from. For other events - that is non measurement events - data byte zero may have some other meaning so check the VSCP spec when interpreting event.

GUID's

For the demo server the Grodans Paradis AB assigned GUID

25:00:00:00:00:00:00:00:00:00:00:00:Y1:Y2:XX:XX

is used as a basis for all GUID's. A driver use the two LSB bytes (XX:XX above) for it's own use as node id's (nickname id's). The Y1:Y2 byte s are used for devices and drivers. Y1 is server specific, each server has a different value here. The Y2 byte is zero for the server itself and 1-255 for drivers. Btw you can request your own GUID series by sending a mail to [email protected] or use one of the available series.

note: The above is the schema we use in our house. You are free to setup any schema you like in your own setup of course. There is millions of possibilities.

So here is a list of the events and GUID's you may see on the vscp/# topic. I will add to this list as we go.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A small example subscriber
"""
import paho.mqtt.client as paho

def on_message(mosq, obj, msg):
    print("%-20s %d %s" % (msg.topic, msg.qos, msg.payload))
    mosq.publish('pong', 'ack', 0)

def on_publish(mosq, obj, mid):
    pass

if __name__ == '__main__':
    client = paho.Client()
    client.on_message = on_message
    client.on_publish = on_publish

    client.username_pw_set(username="vscp", password="secret")

    #client.tls_set('root.ca', certfile='c1.crt', keyfile='c1.key')
    client.connect("mqtt.vscp.org", 1883, 60)

    client.subscribe("vscp/25:00:00:00:00:00:00:00:00:00:00:00:0D:02:00:01/20/3/#", 0) // ON
    client.subscribe("vscp/25:00:00:00:00:00:00:00:00:00:00:00:0D:02:00:01/20/4/#", 0) // OFF

    while client.loop() == 0:
      pass

# vi: set fileencoding=utf-8 :

Events on the Demo server

Live data is currently pushed from the following sources.

  • VSCP events from Pi1 - Misc sensing (inside/outside temperature).
  • VSCP events from Pi2 - Misc sensing (inside/outside temperature).
  • VSCP events from Pi3 - Weather station data.
  • VSCP events from Pi4 - Fridge and refrigerator control in our kitchen.
  • VSCP events from Pi5 - Furnace control and water usage in our house.
  • VSCP events from Pi6 - Electrical usage.
Clone this wiki locally