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
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
VSCP

VSCP and the big money

open-source-logo

A big problem for all people working with open source is how to finance the time it takes to do the work. For instance am I in the process now of adding a real web admin user interface and databases and other high level things to the VSCP  & Friends suite. This is work I estimate will take up to six months. Yes that is full time or more likely around 16h/day for a full seven days of a week. That is a long time without a possibility to take other paid work.  Yes and there are hosting bills, electric bills, and all the rest of the  bills a company have, and they all need to be paid by open source people to. Yes it is strange. I know. Who could ever thought it was like that? 😉

Fortunately  the project get some donations from time to time. That is a big help and I really would like to take the opportunity to thank everyone that have sponsored the project over the years.  But donations counts for only about one percent or less of the total cost to run the project.  The rest is money I have to take from my own pocket. Multiplied with the sixteen years the project has been on the road this adds up to quite some large sums I can assure you.

I know we are not as used to supporting free projects  in Europe as people in the US are,  but anyway I ask all of you guys out there who like the project or even use it, to support the VSCP project  with a few cents or a couple of Euros, or even  with some hands that can help. Make life a bit easier for  this free and open alternative for an IoT protocol.

Donations can be sent using the donate button on the home page.

/Ake Hedman

Categories
VSCP

VSCP turns 16 today

vscp_new_v2

Categories
VSCP

Back again

paris1

First day back in the office after my vacation.  +3000 mails in the inbox.  Just need to go through them, then lets do magic!

Categories
VSCP

Databases coming to #VSCP

Screenshot from 2016-06-09 17:38:10

With the SQLITE3 integration into  VSCP a lot more information will be available through the websocket/tcp/ip/REST interfaces.  Accompanying web interface code will follow this. The result is hopefully a simplified configuration interface. Remotely accessible of course.

Categories
VSCP

#VSCP & Friends 1.12.4 Magnesium released #IoT #m2m

internet-of-things-concept-illustration

VSCP & Friends 1.12.4 Magnesium has been released.   

This is the last version that will be released on the Windows platform. Future releases will only target  Linux/Unix.  Windows will still be usable as a client using available web interfaces and web applications.

Source and setup files can be downloaded from Sourceforge.

Release notes can be found on Github.

Categories
VSCP

Ending Windows support for the #VSCP daemon?

20160415_142722

VSCP & Friends has been available on the Windows platform since the beginning of time.   But nowadays most of our users is on Linux/Unix, using PC’s or devices like Raspberry Pi.  Well we been there also since the beginning of time but now it’s maybe time to concentrate and put all our efforts on these important platforms. With Linux support on Windows this may not be giving up Windows after all.

But,

maybe there are reasons why we should not do this. Reasons we did not think of ourselves.  If you think there are, speak out now. It’s still time to rethink this.  And we listen to our users. Always.

 

Categories
VSCP VSCP UX

Version 1.8.0 of the #VSCP #HTML5 user interface library

start | VSCP Specification

https://github.com/grodansparadis/vscp-ux/releases/tag/v1.8.0

Demo server is here http://demo.vscp.org:8080/index.html  Please note! This is a development server that runs head code and it may not be stable all the time. Many users and developers runs (sometime) strange and buggy code against this server. Please download the stable version of VSCP & Friends and set up your own system if you need a stable system.

Special thanks to Andreas Merkle for doing work on this system.