Categories
VSCP

Autonomy #IoT #m2m #VSCP

floorplan_button_example

Yes I know. It’s all about the cloud nowadays. Every device should post their data up to the cloud and allow themselves to be controlled from the cloud. So I will talk about autonomy of a VSCP setup today. Well I know. It’s kind of the opposite to the cloud model as no cloud is needed. But wait, don’t go away, you can have the cloud and autonomy at the same time. Promise.

VSCP is an event bases system. Events are sent by nodes when things happen. The node that originates the event does not care if there is one or two or three receivers. It just originate the event for anyone to receive (must-be-in-the-cloud people: yes the event can be sent up into the cloud).

So another node receive this events, find it interesting, and do something with it. For example if the event sent was CLASS1.CONTROL, Type=TURN-ON (the standard event to turn things on) the receiving node will turn the thing(s) it is supposed to turn on and send CLASS1.INFORMATION, Type=ON (the standard event to tell that something has been  turned on) to tell interested parties that it has turned on a device.

This is typically how the VSCP event system work. An event is sent out and if something happens at a point and a receiving device  take interest in the event, this device also sending out an event telling the system it did something.

The ping-pong mechanism described above where a reply is sent when something is turned on can be used to validate that the expected operation actually has been carried out.

(Must-be-in-the-cloud people: yes the event can come from the cloud and the “response” can go to the cloud).

Well most systems around typically have a server in the system (or a server in the cloud). VSCP does not need one (but CAN have one). Because when a VSCP system is configured it behaves like an autonomous system. All this is possible because of the decision matrix (DM) that can be implemented  in a VSCP node..

The decision matrix

We will only discuss the Level I decision matrix here.  Made for low-end devices, The Level II works mostly the same.

The decision matrix is a 8-byte entity and a device can have zero or more rows in its matrix.  The purpose of the DM is to say

When an event of a certain kind comes in do something.

And the “do something” part of a decision matrix row is called an action. Take a look at the Paris Relay module for some action samples. This is typical for all modules. It has a few well-defined things it can carry out. In the case of the Paris relay module  turn on a relay, turn of a relay and so on.

As the DM looks the same on all VSCP devices it is easy to make a user interface that configures it

  1. Let the user decide which event(s) should trigger the action.
  2. Select from where the event should come.
  3. Select what action should be performed.

Same for every device.

When this is configured  for a devices it will work  autonomous from that point on. Incoming event’s will be feed through the DM of the device and if a match is found the action will be performed.

No server needed.

 

 

Categories
General

PiBakery – foolproof custom Raspbian setup – Raspberry Pi

Everybody loves cake, right? Cakes have layers. Mmm…. cake! We’re sure you’re also love PiBakery, a brand new way to bake Raspberry Pi images, which makes creating a custom image a… piece of cake. PiBakery was created by David Ferguson. He’s a talented 17-year-old whom we first met at the Big Birthday event we held […]

Source: PiBakery – foolproof custom Raspbian setup – Raspberry Pi

Categories
General

New Part Day: The ESP32 Has Been Released | Hackaday

There’s a CAN bus peripheral in the ESP32,

Source: New Part Day: The ESP32 Has Been Released | Hackaday

Categories
VSCP

Measurements in VSCP

kelvin11-500x500

Today’s topic is measurements.

Abstract: We show why a well-defined binary datagram content is an advantage over a textual content for measurement data on a wire.

When you see

42

you see two Arabic numbers and probably guess it’s a number in the decimal system. So it’s 40 + 2. But if you are on the receiving end of a communication line what is 42 then? Does it mean anything to you?

Well it could be anything. If the sender sent this number 42, as a temperature you don’t know that it is a temperature  on the receiving end without further information sent or it must be sent on  a channel dedicated for just temperatures. Also you don’t know the unit without more information added. The temperature could be expressed in Kelvin, Fahrenheit or Celsius or even some of the other possible units that are used around the globe.

Still this is how most measurement values are sent. Sometime with adding information like

Temperature: 42 Kelvin

often all packed in XML or JSON envelopes and in text form. Alternatively you will find manifests by packed with the measurement data, big ones, with lots of information and options. Always in textual form.

All this is good and fine for higher end nodes. They have the memory to handle the conversions, the power to do the translations fast. No problem. But for sensor it gets a bit stupid. They are often cost sensitive devices and the processing power will therefore be lower and parsing and memory usage should be kept low. It’s just plain stupid to use high level structures on this level.

The VSCP solution

In VSCP, measurements, like everything else, is identified by a class and a type. There are a few different classes available that handle measurements, but  let us look at the lowest end form here, made to make it easy for small devices to handle this kind of information in a resource efficient still safe way.

The measurement types in VSCP is fetched from the SI system. So all measurement type used in science and engineering is there and is so in a standardized form. Some examples

  • Temperature: Class=10 Type=6
  • Frequency: Class=10, Type=9
  • Pressure: Class=10 Type = 12

you get the picture. You have them all specified here.

All measurements in the SI system have a default units. For temperature  this unit is Kelvin. But people are used to use the more everyday common  Fahrenheit and Celsius. This is true for all other measurements to, so in addition to the class and type to define which measurement is sent VSCP also send which unit this measurement is in. For the low-end devices, four well-defined unit types  is available for each measurement type.  For temperature unit = 0 is Kelvin (zero is always the SI unit), unit=1 is Celsius, unit=2 is Fahrenheit.

Last the format of the data is specified and some other information is also available which we will not go into here (full info is here).

The end result is a very compact measurement record that contain all relevant information. In this case 42 degrees Celsius is packed in seven bytes. Perfect for slow communication lines like RF.

The advantages of this format is

  • Small packets with all needed information specified.
  • Easy to handle by a low en device.
  • Unit and type is always well specified.
  • Value coding is always well specified.
  • A unified format means uniform handling.

The uniform handling is interesting. This means that one solution can be used to, for example,  draw diagrams for all types of measurements, same for statistical analysis or other analysis or just handling data. Well you get it. A big time and resource saver and no more stupid mistakes (making us miss Mars).

Sync

VSCP is not specially designed to be used in real-time systems. Still if we talk about milliseconds and 10th of microseconds it is usable.

For Level II events in VSCP, which  have a timestamp in the package, this is no problem. Here we have microsecond resolution. But for low-end links the over head of a Level II event may be too much.

Level I events does not have a timestamp in the package. They are time stamped when they are received instead. This may not be enough in some situations.

Solution 1

The sync event (class=30, Type=26) is perfect if you want to  synchronize measurements from several remote modules. Send the sync event on timed occasions and the nodes will respond in a synchronized fashion.  You can timestamp them from the time you sent out the sync, optionally taking in to account the round trip time.

Solution 2

Instead of sync a node that send measurements can send a time event (Class=10, Type=4), using unit= 0 the timestamp can use millisecond resolution

OK that was all for today.

 

Categories
Home Automation Z-Wave

Z-Wave opens some specs.

http://z-wave.sigmadesigns.com/design-z-wave/z-wave-public-specification/

Categories
General

TIOBE Index | TIOBE – The Software Quality Company

The TIOBE Programming Community index is an indicator of the popularity of programming languages.

Source: TIOBE Index | TIOBE – The Software Quality Company

Categories
VSCP

Thanks

vscp_new_v2

Thanks for supporting VSCP (you now who you are). I really appreciate the contributions received after my last call out.

THANKS!

Categories
VSCP

VSCP firmware update

5

Updating firmware on a piece of hardware in your system is essential to keep it up to date.  VSCP can handle both it’s own firmware loading algorithm or uP specific algorithms for greatest flexibility.  But how does it work? Here is a short step by step walk through.

1.) A module should be updated with new firmware.

2.) The MDF (module description file) of the module is read form the manufacturers web server.

3.) By reading standard register 0x97 (or 0xffffff97 for Level II devices) the bootloader algorithm the module uses can be determined.

This information is also in the MDF under the boot tag

<boot>         
        <algorithm>1</algorithm>     
	<!-- Size of boot block/sector -->     
	<blocksize>20</blocksize>          
	<blockcount>66</blockcount> 
</boot>

4.) The MDF also contain available firmware for this module under the firmware tag.

<firmware path="url where firmware can be found" 
				format="intelhex8|intelhex16|intelhex32"
    size="Optional size in bytes for firmware file (not image)"
    date="ISO date year-month-day when released."
    version_major="x"
    version_minor="y"
    version_subminor="z">
    <description lang="en" >Firmware description</description> 
</firmware>

One can now  let a user select the firmware to load or load the latest available firmware.

The same security applies to firmware upgrades as for the rest of the system.

Categories
General

5 women who are changing the IoT world

Tech can really seem like an overwhelmingly male-dominated world, and IoT isn’t immune. But here are five incredible women leading the way for everyone.

Source: 5 women who are changing the IoT world