Categories
General

Gateway Kit | Bluetooth Technology Website

Ready to develop with blue? Download the Gateway Smart Starter Kit to learn how to connect your Bluetooth sensors to the Internet of Things (IoT).

Source: Gateway Kit | Bluetooth Technology Website

Categories
General

Quick & dirty cable length & impedance measurement | EDN

Can’t afford a full-blown TDR? Here are a few quick & dirty measurement tips.

Source: Quick & dirty cable length & impedance measurement | EDN

Categories
General

Let’s Encrypt – Free SSL/TLS Certificates

Let’s Encrypt is a free, automated, and open certificate authority brought to you by the Internet Security Research Group (ISRG). ISRG is a California public benefit corporation, and is recognized by the IRS as a tax-exempt organization under Section 501(c)(3) of the Internal Revenue Code.

Source: Let’s Encrypt – Free SSL/TLS Certificates

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.

Categories
CAN4VSCP Paris the VSCP Daemon

How to schedule events/schemas with the daemon #Iot #m2m #vscp

I got the following question from a VSCP users

  • How to turn on lights at sunset.
  • How to turn off the lights at a specified time (either sunset + x hrs, or for example at YY:ZZ).
  • How to turn on at a certain time.
  • How to turn off at sunrise.

So the easiest way to demonstrate this capability of the VSCP daemon  is to show the setup I have here in our house for this. Oh well part of it of course, we should not go to far away from the topic.

Some background

Yes I use VSCP based devices for some things here in the house but just as the shoemakers children have holes in there shoes I am often stuck at fixing things for others before I can do something for myself.  So here it is a lot of  my setups are test setups that are replaced by other test setups that are replaced by even other test setups  etc in a never ending story. Its the just the way it is  for makers I guess.

But some things I use here at least and that is I schedule the lamps in the house so they turn on at sunset and turn off at sunrise and some other things. So the questions above is easily by explaining my own setup.

Now I could have used a Paris module to control lamps and I actually do here in the office but just in a test setup . In our house and for lamps on the  outside I use low cost wireless modules from Nexa and Proove

large

nexa-infalld-fjarrstrombrytare-1000-w

Well you all recognize them. Low cost single way communication modules working over 433 MHz.  Reliable enough for lights IMO. But they could of course equally well have been Z-Wave, KNX, X10 or some other solution.

The CAN4VSCP Roma module will control these things and it sits on my desk at the moment working pretty well. It will be available in the store also one day I hope.

At the moment I us a Tellstick  from Telldus AB to control  lights connected this way. There are other similar products available and Arduino solutions that can do it as well

TellStick_1-600x600_0

Well this solution just let me execute a binary on a Linux machine to turn on/off a group of lamps.  There are similar devices available for all other vertical solutions. So to control KNX units with the VSCP daemon find an executable that can do that and the same for Z-Wave (OpenZwave) or whatever solution you want to integrate. Or write your own script or executable that does it. It is usually not a big deal.

But it of course does not end with an executable. The VSCP daemon can do many other things. Call an URL/send events/start timers etc etc. You can add anything and you should be able to add everything because the world consist and will consist of many different things,

Turn on lights at sunset

So lets look at the first point. This can be done in many ways of course but if you enter the coordinates for your location in the VSCP daemon configuration file  (dm.xml) in the Automation section  the decision matrix will be feed with two events that are of interest for this  type of control

CLASS1.INFORMATION, Type=45, Sunset

Sent when astronomical sunset happens at the location set by the coordinates.

CLASS1.INFORMATION, Type=35, Sunset-Twilight

Sent when astronomical sunset-twilight happens at the location set by the coordinates. The definition of twilight is

Nautical twilight is the period when the center of the Sun is between 6 and 12 degrees below the horizon, when bright stars are still visible in clear weather and the horizon is becoming visible. It is too dark to do outdoor activities without additional lighting.

You have to enable the events also if they are disabled in the configuration file.

Restating the VSCP daemon with

/etc/init.d/vscpd restart

and then opening

http://192.168.1.6:8080/vscp/configure

in your web browser (replacing 192.168.1.6 with your server ip) will show you the calculated times

Screenshot from 2016-01-31 16:17:53

We see that today when this is written the sunset is at 15:57 and the sunset twilight is at 16:44 two times one can use to turn on lights because it’s getting dark outside.

For indoor light I use sunset and for outdoor light I use twilight sunset for this.  It all of course depends on how dark one want it to be before lights are turned on.

So setting this up in the web interface

Screenshot from 2016-01-31 16:25:23

Priority has flags set to zero so we don’t care about it.

Class is set to 20 which is CLASS1.INFORMATION and corresponding  flags are set to 0xFFFF meaning all bits should be checked.

Type is set to 45 which is Sunset and corresponding  flags are set to 0xFFFF meaning all bits should be checked.

GUID has mask all set to zero so we don’t check it.

On control we see that we don’t check index/zone/subzone but that we enable this row.

So at this point we say that events of type   CLASS1.INFORMATION, Type=45, Sunset  will perform what ever action we choose.

Screenshot from 2016-01-31 16:25:37

In the “when-section” we select when the action should happen. Her from the beginning of time to the the end of time and all weekdays and all times.  As you see it is possible to have different schemas for different weekdays and for different time of year.

Screenshot from 2016-01-31 16:25:48

And then we have the action to perform. In my case I execute an external file and turn on lamps in section 1. But there are many actions to choose from and Send Event is one. Typically used in his case to send to a group of Paris modules to instruct them to switch some relays on.

You can have many rows that trigger on the same event and therefore easily mix technology and control KNX, Z-wave, VSCP and other alongside each other.

The XML row for this scenario looks like this

<row enable=”true” groupid=”Tellstick” >
<mask priority=”0″
class=”65535″
type=”65535″
GUID=” 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00″ > </mask>
<filter priority=”0″
class=”20″
type=”45″
GUID=” 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00″ >
</filter>
<control>0x0</control>
<action>0x10</action>
<param>/usr/local/bin/tdtool –on 1
<comment>Turn on window ligts when sun goes down</comment>
<allowed_from>0000-01-01 00:00:00</allowed_from>
<allowed_to>9999-12-31 23:59:59</allowed_to>
<allowed_weekdays>mtwtfss</allowed_weekdays>
<allowed_time>*-*-* *:*:*</allowed_time>
<index bMeasurement=”false” > 0</index>
<zone>0</zone>
<subzone>0</subzone>
</row>

Turn off at sunrise

To turn off lights at sunrise just trigger on CLASS1.INFORMATION, Type=44, Sunrise or  CLASS1.INFORMATION, Type=52, sunrise twilight time.  The rest is the same as the above case.

Turn off the lights at a specified time

Here in this house I turn of some lights for the night at 02:00 regardless. This is how that is done

Screenshot from 2016-01-31 16:55:11

Priority is not used and therefore it’s corresponding  flags are set to zero.

Class is set t 65535 which is CLASS2.VSCP. The corresponding flags are set to all ones or 0xffff.

Type is set to 6 and that means we will trigger on CLASS2.VSCP, Type=6, Minute events. This event is feed through the matrix every minute. The corresponding flags are set to all ones or 0xffff.

GUID has mask all set to zero so we don’t check it.

On control we see that we don’t check index/zone/subzone but that we enable this row.

Screenshot from 2016-01-31 16:55:30

Again in the “when-section” we select when the action should happen. Her from the beginning of time to the the end of time and all weekdays.  The difference here frm the previous example is the

*-*-* 02:00:00/10/20/30/4/50

The

*-*-*

says the action will be triggered on every date.  If we want a specific thing to happen just on x-as eve we enter that here.

02:00:00/10/20/30/4/50

This part could have just been

02:00:00

meaning trigger at that time. But here we added some more times we now trigger on

02:00:00
02:00:10
02:00:20
02:00:30
02:00:40
02:00:50

that is on several times ten second apart.  A way to enter this without having a new DM row for each. This is possible on all fields in allowed time. So it is easy to do things at certain days of the month etc.

For the curious I did this so lights definitely will be turned off as I had some interference with the radio signal some times.

Screenshot from 2016-01-31 17:12:19

And then again we have the action which in this case turn off section 1 instead of on.

And yes turning on something at a certain time is just the same but with another action and also here one can send events or do other things.

The xml line looks like this

<row enable=”true” groupid=”” >
<mask  priority=”0″  class=”65535″  type=”65535″  GUID=” 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00″ > </mask>
<filter  priority=”0″  class=”65535″  type=”6″  GUID=” 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00″ > </filter>
<control>0x0</control>
<action>0x10</action>
<param>/usr/local/bin/tdtool –off 1;
<comment>Turn off window lights @ 02:00</comment>
<allowed_from>0000-01-01 00:00:00</allowed_from>
<allowed_to>9999-12-31 23:59:59</allowed_to>
<allowed_weekdays>mtwtfss</allowed_weekdays>
<allowed_time>*-*-* 02:00:00/10/20/30/40/50</allowed_time>
<index  bMeasurement=”false”  > 0</index>
<zone>0</zone>
<subzone>0</subzone>
</row>

 

The future

Time time is a resource that is limited.  When I did the DM of the VSCP daemon a long time ago an external nice and user friendly interface to edit it was planed. Not the web based interface that is available to day which is targeting a technical user.  Actually editing is possible remotely also today so it is only the UX code missing.  That will probably come in place one day. Giving this functionality the attention and usability it deserves.

An even more exciting feature that will come to this functionality, probably in the next release, is scripting right inside the VSCP daemon. That will make this an extremely cool cat.

Hopefully this gave some lights of the magic’s of the VSCP daemon DM.

Categories
General

Java vs. C/C++

giphy

Categories
General

Embedded Heap Behaviour: Analysis and Improvement

Recent work we have done to improve embedded heap behaviour on Smart.js – examples, code and gifs to walk you through the process.

Source: Embedded Heap Behaviour: Analysis and Improvement