Categories
VSCP

Changes for #MQTT driver from 1.1.0.22 Sodium #vscp #IoT #m2m

index

The MQTT driver have a new parameter added from 1.1.0.22 Sodium. Previously the parameter format was

"subscribe”|”publish”;channel;host;user;password;keepalive;filter;mask

the new format is

“sessionid";"subscribe”|”publish”;channel;host;user;password;keepalive;filter;mask

where sessionid is a unique session string, That is if you have several MQTT drivers in your VSCP daemon configuration file each of them should have a unique sessionid.

I usually try to make things backward compatible but it was not logical to place the sessionid at the end in my opinion.

Cheers
/Ake

Categories
VSCP

#VSCP – a lot of classes #m2m #oT

Screenshot from 2016-02-07 15:33:09

When one first look at VSCP one see “millions of classes” each having “millions of types”. It’s easy to be overwhelmed at first

Which class/type should I use for my needs?

Well lock at CLASS1.CONTROL, Type=5, TurnOn as an example. If you use this class a receiving end device will expect three data bytes

  • Byte 0 – User defined.
  • Byte 1 – Zone.
  • Byte 2 – Subzone.

And that’s the way most people  use it. They instruct  the “things” defined in a zone:subzone to TurnOn themseves.  If the “things” are well behaved they will reply with CLASS1.INFORMATION, Type=3, On events as a confirmation.  But that confirmation is just being well behaved. If you don’t want it you can skip it.

BUT…

and his is the big BUT, you can use any event you like for anything you like. If you want to use CLASS1.MEASUREMENT, Type=6, Temperature to turn things on, well use it. It’s up to you what meaning you give to a class/type pair. But what’s not up to you is the format of the data for a class/type pair. So if you decide to use CLASS1.MEASUREMENT, Type=6, Temperature to turn your things on you must adopt to the specified data format.

So for your needs you look up a class/type pair that do the job and use them.  There are obvious choices of course. Most will use  the CLASS1.MEASUREMENT class for measurements for example, but how you use it IS really your choice.

But if I can’t find a class/type pair that fits my needs?

Sometimes it happens that you don’t find a class/type pair that does the job you need to do.  Most often this is a discovery that would benefit others if this class/type pair was added to the specification. So ask on the VSCP list for it to be added. If it’s not a duplicate it will be added.

In other cases you may need your own events that are local to your network.  In that case you can specify any event and any format for these events in CLASS1.LOCAL and in CLASS1.LABORATORY.  You have full control of format and the types in each of them but you must remember that others also have this freedom. So if you put these out on a shared network definitions will probably collide with the definition other people have added. But local use – no problem.

So to conclude. Yes there is a lot of class/type pairs available in VSCP. One for most needs and there are many use cases. But the only thing that is carved in stone for there use  is the format for each class/type pair (what the VSCP world call an event). If you find something that is useful for your needs  just use it.  Nothing is wrong. Trust yourself.

Make the world smarter.

Categories
General

智能家居焦点图-二级页面-英文|新岸线

Smart Home System Wi-Fi SOC Solution

Source: 智能家居焦点图-二级页面-英文|新岸线

Categories
HowTo's VSCP

#VSCP HOWTO: Get MDF content in JSON or JSONP

To get a XML file in JavaScript can be difficult due to the same origin policyCORS is on solution but using  JSONP is a much simpler solution also because JavaScript kind of like the JSON format.

The problem here for VSCP is that the MDF (Module Description File) is in XML format. We therefore need a conversion.

This PHP scripts will handle this and out put a local xml file in JSON/JSONP format

Screenshot from 2016-02-02 11:50:50

You can test the output for the Paris module

here.

In this case the local MDF file is paris_010.xml and we request JSONP output using the function “callback”.

If we skip the

&jsonp=callback

we get pure JSON output instead.

The script can be downloaded here.