Category Archives: VSCP

At last #VSCP

At last, after a long time the PIR sensors and the door sensors start to deliver some VSCP events. This is something that should have been live this spring, but due to unforeseen events of life, it all has been delayed. But better late than never I guess.

This is nothing fancy of course but I will still describe the project here in detail later. For me it is important to get some real world data to work with. Using real world data always give more insight in how things should work than simulate things. Side-effects of this project is smart lights, lock control and some other things, for part of our house and my office.

Now some coffee, then it’s time to go on with other parts of this project.

State of #VSCP (#nodered #raspberrypi)

Not much has happend in the VSCP world this year (hopefully it have in other places then in my location) but now it is time to do some serious stuff again.

Big changes are coming for VSCP.

One thing that happend the last years is that MQTT has become an IoT standard. Personally I have not been so keen to go this way because it really did not solve the issues of a fragmented IoT message community. Rather it encourage fragmentation.

The fact however is that MQTT became a standard and VSCP has a driver for it since it became available and people seems to prefer it so there is no other option really than to jump on this movement. The gain is massive software support and understanding of course. In VSCP case this means VSCP events will be pushed on a MQTT server on the JSON format as of the specification. Published on a channel /vscp/class/type/guid/index/zone/subzone it is easy to do some filtering also as MQTT allow for wildcards on each level. As an example subscribing to /vscp/10/6/* will get all temperature events. Details will follow.

Another thing I kept an eye on for many years is node-red. Up until recently this has been more of a toy but lately it has matured and now solve many of the things I have planned for vscpd. I therefore have decided to use node-red for higher level VSCP stuff in the future instead of doing this development on a parallel track. The coupling between vscp and node-red is easy. A node-red module that feed events form vscpd and a node-red module that send events to vscpd. Add some filtering and other stuff to this and we have a real winner IMHO. Expect a package soon.

Wo what does this mean for the vscp software suite?

Well, a new version of vscpworks is in development built on node.js and electron. Much nicer and faster development. It just needs to add MQTT interfacing to the tcp/ip and websocket interface that is available today. Also there is a node.js module available already.

vscpd will take a new development path and be a hub/relay or what it should be called, against lower level VSCP stuff such as can4vscp(bluetooth/etc drivers. It will do two tings.

  • Interface higher level stuff through it’s tcp/ip and websocket interface.
  • Interface lower level stuff through its level I/II/III drivers.

The rest of the functionality will go away. Most will be moved to Level II drivers wherever possible. MQTT interfacing is done with the MQTT driver available today.

So

  • The DM (decision matrix) of vscpd will be removed. Handled instead by node-red or other high end app. Will possibly be moved to a Level II driver.
  • The webserver of vscpd will be removed – Handled by standard web browser, node-red or other high end app.
  • The REST i/f of vscpd will be removed – Handled by higher end app such as node-red. Will possibly be moved to a Level II driver.
  • The sqlite3 database will be removed. Configurations will be all XML again.
  • The Javascript engine will be removed.
  • The LUA engine will be removed.
  • The UDP interface will be moved to a level II driver
  • The multicast i/f will be moved to a Level II driver
  • The discovery functionality will be removed. Yhis functionality will be built as a node-red module.
  • The automation functionality will be moved to a level II driver. Functionality is available in node-red already.
  • VSPC table functionality will be removed. (Will possibly be moved to driver). Handled in node-red or other high end app.
  • VSCP variables will go back to the original simple form – Handled better in node-red or other high end app. Variable types will be the same as VSCP abstractions. Deprecating the rest.
  • Not fully decided yet: Level II events will get JSON payloads. If so the current defined Level II events will be deprecated but available for a long long time. I welcome a discussion on this.

So vscpd will be a server that handles drivers and interface the higher level world through a tcp/ip and websocket interface. Nothing more. Nothing less.

Another important change that will come is to separate drivers from the software three. This lowers the dependencies to build the vscp tools a lot. Especially now when the dependency on wxwidgets is gone. The goal is to make things very easy to instal and use on devices such as Raspberry Pi and the likes.

So the roadmap for the near future is to implement this. As much of the work is to take a step back it is not expected to be a long runner.

As you all know I have been hospitalized under a long period this year due to an infection I got from a surgery. This is not fully cured and even when it is I have to redo the full operation sequence that started all of this. This mean I will be off for more time, not being able to do any development. But hopefully this will be a shorter time then the current disaster and mess.

I am very excited about all this and is confident that this is the way to go. Please let me now if you have questions or concerns about this.

Cheers
/Ake

This is a setup I have for my heating system. All VSCP of course, with a Raspberry Pi as a relay node and using node-red for higher level work.

State of #VSCP

Just a post to let you all know that VSCP is still alive even if not many things have happened for the last months.

As I wrote before I had some surgery in January this year and a follow up operation on that in June. Sadly I got a bad infection in the operation wound so I had to stay for some time at the hospital, but now I am home again eating tons of antibiotics.

Well things are pretty good now and I hope I am in working condition next month or so. But apparently one never know with deep infections, they often come back with full force. I, of course, hope it will not. 😉

I am sorry for all this talk about my health lately, everyone have enough with there own health and wellbeing, but this is my reality right know and I just want to indicate that VSCP is not dead. or even sick. It’s just me and I am in a good mode after all.

Have fun!
/Ake

State of #VSCP

It’s been many months. I have more or less been unable to do any serious VSCP development. All plans for the first half of 2019 just went out of the window. Even if that hurts, loosing such amounts of time, I had a second operation last week and the doctors says I am allowed to do some programming again from the end of the month. I look forward to that.

So hopefully “the state of VSCP” will be less about my scars and more about project progress after this summer. I have done quite a bit of the new VSCP works client during this slow time and hopefully some initial code will be available publically also very soon. JavaScript is still a little “strange” for me. But I like Electron and node.js more and more.

I hope everyone reading this will have a very nice summer. A Blackbird, named Pavarotti here on the hill, is singing for me and there is nothing in the world more beautiful than his song. Enjoy the summer my friends.

Howto: Read a #VSCP mdf file with node.js

The Module Description file is a XML file that all VSCP devices must have and which describe the device. It can either be stored on the device itself or more common linked by the device and stored on some external server storage. Software that wants to configure a device can fetch this file to get the knowledge to do so. Typically a user interface use this file to guide a user through device configuration. A good thing is that one software can handle and configure any device.

A sample MDF file is here an here.

Read a mdf file from a device, parse it and display the module name. A device can consist of several modules, there will always be one and result.vscp.module[0] will always refer to the first. Most devices contains only one module. You can get the number of modules with result.vscp.module.length

Below are some Javascript examples on how to get information from the MDF-file.

Display the module name

const axios = require('axios');
const xml2js = require('xml2js');

let parser = new xml2js.Parser();

axios.get('https://www.eurosource.se/ntc10KA_3.xml')  
  .then((response) => {
      parser.parseString(response.data,
                         (err, result) => {
        console.dir(result.vscp.module[0].name);    
      });
  })  
  .catch((err) => {    
    console.log(err);  
  });

Similar to above sample get a link to the manual for a device

console.log(result.vscp.module[0].manual[0].$.path);

List all registers with

console.dir(result.vscp.module[0].registers[0].reg);

Iterate through all registers an display there names

axios.get('https://www.eurosource.se/ntc10KA_3.xml')
  .then((response) => {
    parser.parseString(response.data, (err, result) => {
      for (let reg of result.vscp.module[0].registers[0].reg) {
        console.log(reg.name[0]._);
      }
    });

  })
  .catch((err) => {
    console.log(err);
  });

List register descriptions with

console.log(reg.description[0]._);

You get the language code for a register name or a register description with

console.log(reg.name[0].$.lang);

List abstractions with

axios.get('https://www.eurosource.se/ntc10KA_3.xml')
  .then((response) => {
    parser.parseString(response.data, (err, result) => {
      for (let reg of result.vscp.module[0].registers[0].reg) {
        console.dir(result.vscp.module[0].abstractions[0].abstraction);
      }
    });

  })
  .catch((err) => {
    console.log(err);
  });



List number of events the module can generate and the events

console.dir('# events: ' + result.vscp.module[0].events[0].event.length);
console.dir(result.vscp.module[0].events[0].event);

If you want an url to a picture of the module

console.log(result.vscp.module[0].picture[0].$.path);

If you want the manual

console.log(result.vscp.module[0].manual[0].$.path);

or a firmware image

console.log(result.vscp.module[0].firmware[0].$.path);

The number of firmware images available

axios.get('http://www.eurosource.se/paris_010.xml')
  .then((response) => {
    parser.parseString(response.data, (err, result) => {
  console.log(result.vscp.module[0].firmware.length);
    });
  })
  .catch((err) => {
    console.log(err);
  });

The release date for a specific firmware

console.log(result.vscp.module[0].firmware[3].$.date);

The way this works should be obvious by now. Enjoy!

State of VSCP

Just a short info about what is brewing in the VSCP world.

Over the years that VSCP has existed it has been times with pretty good interest and times with very low-interest.  This comes and goes and have done so many times.  At the moment we are in a  low period.  Contributions to the project has never been very high even in periods of high interest,  almost non existing in fact, and of course that is not better during a low period like this.

I have been working with this for so long now and coded a lot of code with other people’s needs in mind. Mostly broadcasting free stuff with a lot of effort behind it out in an empty space. It feels a bit awkward to continue that road ahead forever. As it feels now I will switch to do more “fun stuff” for my own needs instead of doing a general package for m2m/IoT in the future.

New drivers on the way

For my own projects I need some drivers for the Raspberry Pi and  I therefore is building three Raspberry Pi specific drivers at the moment

vscpl2drv-rpigpio and vscpl2drv-rpigpio-if2

This is a driver that handle general GPIO on the Raspberry Pi (used pigpio/pigpiod). It can be programmed with a decision matrix so you can send for example CLASS1.CONTROL, TurnON/TurnOff event(s) to control specific I/O, PWM, Servo and frequency support is there. Also input monitoring. Event based and periodic. It comes in two versions one that uses thew pigpio lib and one that use the pigpiod server.

vscpl2drv-rpilcd

With this driver you can control a LCD connected to the Raspberry Pi by sending/trigger on VSCP events. parallel mode and I2C supported.

vscpl2drv-rpimax6675

Interface a MAX6675 for K thermocoupole temperature measurements.

The driver is build if –enable-rpi is used in the configure script.  It will be a month or so before they is officially released.

Abandon wxWidgets

I have decided to leave wxWidgets for future work. This affects all components except VSCP works. Expect this to take a year or two before it is completed. The new drivers mentioned above already have this change in them.

XML configuration

For the future all Level II drivers will use a XML variable for configuration.  This is true for the drivers mentioned above and will be for all current drivers as well. The old variable model will still be there for backward compatibility.

Bluetooth mesh

I have used a lot of money to collect Bluetooth mesh capable hardware for some time. And this winter will be used for work with these. VSCP is very well suited for Bluetooth mesh. I can’t almost wait before I can start this work.  Excited!

OK that’s all for now folks.