Category Archives: VSCP

What the heck…. #VSCP #IoT #m2m

I will probably starve to death doing this but  the following hardware modules will be open source again.

can4vscp_accra – Counter module.
can4vscp_sanfrancisco_barometer  – Barometer module.
can4vscp_humidity – humidity and temperature
can4vscp_beijing – I/O- module.
can4vscp_vilnius – AD- module.
can4vscp_odessa – Expansion module.
can4vscp_kelvin_1wire – 1-wire temperature module.
can4vscp_frankfurt_rs232 – RS-232 interface to CAN4VSCP
can4vscp_frankfurt_gprs – GPRS interface to CAN4VSCÅ
can4vscp_newyork_lcd_display_controller – Display controller
can4vscp_frankfurt_eth – Ethernet <->CAN4VSCP
zeus_expansion_roma – Ethernet controller.
zeus_expansion_moscow
can4vscp_power_injector
zeus
zeus_expansion_napoli
zeus_expansion_leicester
zeus_expansion_kiev
zeus_expansion_budapest
zeus_expansion_brussels
blitz
thunder
can4vscp_frankfurt_ble
can4vscp_frankfurt_bridge CAN4VSCP <-> CAN4VSCP
can4vscp_frankfurt_rs485 RS485 <-> CAN4VSCP
can4vscp_frankfurt_usb  USB <-> CAN4VSCP
can4vscp_kelvin_9700
can4vscp_kelvin_multisensor
can4vscp_kelvin_smt160
can4vscp_kelvin_thermocouple
can4vscp_Loos_temp_control

 

Closing source for hardware modules ##VSCP #IoT #m2m

The following hardware modules will be closed source from today

can4vscp_accra – Counter module.
can4vscp_sanfrancisco_barometer  – Barometer module.
can4vscp_humidity – humidity and temperature module.can4vscp_beijing – I/O- module.
can4vscp_vilnius – AD- module.
can4vscp_odessa – Expansion module.
can4vscp_kelvin_1wire – 1-wire temperature module.
can4vscp_frankfurt_rs232 – RS-232 interface to CAN4VSCP
can4vscp_frankfurt_gprs – GPRS interface to CAN4VSCÅ
can4vscp_newyork_lcd_display_controller – Display controller
can4vscp_frankfurt_eth – Ethernet <->CAN4VSCP
zeus_expansion_roma – Ethernet controller.
zeus_expansion_moscow
can4vscp_power_injector
zeus
zeus_expansion_napoli
zeus_expansion_leicester
zeus_expansion_kiev
zeus_expansion_budapest
zeus_expansion_brussels
blitz
thunder
can4vscp_frankfurt_ble
can4vscp_frankfurt_bridge CAN4VSCP <-> CAN4VSCP
can4vscp_frankfurt_rs485 RS485 <-> CAN4VSCP
can4vscp_frankfurt_usb  USB <-> CAN4VSCP
can4vscp_kelvin_9700
can4vscp_kelvin_multisensor
can4vscp_kelvin_smt160
can4vscp_kelvin_thermocouple
can4vscp_Loos_temp_control

Paris and Kelvin NTC will be open and free as before for reference as will one or two RF modules resp.Ethernet modules.

Someone may ask why? The answer is that open source has not been working for these modules and I just don’t want to throw away the 1000h of work I put into them.

Next release of #VSCP #IoT #m2m

It’s been quite some time now since the last release of VSCP & Friends. Sorry to say it will be a few months more until the release is out. Why? Mostly because there is a lot to do and if Google and the likes can do a man year in a week a man year is a man year for someone working alone on a project as I am.  But there is a lot of nice functionality coming so it is hopefully worth the wait.

Of course you can use the head code. But beware that database structures will change still for some time and if you use head code please remove all configuration data including databases so it get built from scratch. This will of course be taken care of automatically when the release is out.

And again of course if someone want to take part in the project (there is many tasks) or sponsor it please let me know.

#JavaScript in decision matrix of #VSCP #IoT #m2m

Now it is possible to use execution of JavaScript as a result from a triggered action in the decision matrix of the VSCP Daemon.  Things that is triggering an action can typically be events from external nodes or internal VSCP daemon generated events.  For example a measurement value can be sent to a remote cloud service or an ON event can enable some special on-board functionality or just toggle a pin on some output. The possibilities are endless.

With the VSCP decision matrix escape functionality dynamic data can be written into the JavaScript before it is executed. This includes the triggering event data as well as environment information.

File, encryption and socket functionality is available from inside the script plus functions to send event, receive events, handle VSCP remote variables, handle measurements and more.

As a script can be stored in a VSCP remote variable it can be externally edited and functionality can therefore be dynamic.

The new functionality is described here.

Callback functions for VSCP functionality is described here.

LUA scripting will be added later making it possible to do slightly more complicated scripting.

Raspberry Pi and 1-wire temperature sensors to VSCP #rpi #iot #1wire

This article is based on this tutorial from AdaFruit. Read it before you continue. Here is an extended version. It explains how to connect 1-wire sensors to a Raspberry Pi system (Works on other Linux systems also of course).

As explained in the above article there is support for 1-wire in the Linux Kernel.  You will get a folder for every  each temperature sensor you attach to the system under /sys/bus/w1/devices

The script send_pi_onewire.py  will read information from each on the attached sensors and send to a VSCP daemon for further processing.  This script originally comes from Adafruit but has been extended and changed, see the original article.

The usage is

./send_pi_onewire.py  host user password

The script will use the 1-wire sensor GUID to construct a valid unique VSCP GUID.

Only sensors that has been read correctly will be sent to the VSCP daemon.

The script can of course be added to cron if one for example want to have temperature reported every minute. There are other howto’s on this blog that explains how this is done.

note

A good reading of a sensor gives this data on the filesystem

2a 00 4b 46 ff ff 0f 10 40 : crc=40 YES
2a 00 4b 46 ff ff 0f 10 40 t=20812

May be worth checking that you have this content in the file(s) there before using the script.

Monitor GPU temp of a Raspberry Pi #rpi #vscp #iot

If you want to know the GPU temperature of your Raspberry Pi you issue

  /opt/vc/bin/vcgencmd measure_temp

and will get a response like

  temp=45.5’C

form this command.

We will show a script here that send this temperature to a VSCP daemon so that you can handle, display, diagram, react on the measured value etc

The script to do this is here.

You use it like this

./send_pi_gpu_temp.py 192.168.1.6 admin secret –

First remember to make it executable (chmod a+x send_pi_gpu_temp.py ).

The parameters are.

  • IP address to server (192.168.1.9) where VSCP daemon resides.
  • User name for TCP/IP connection, obviously you should use anther user than the admin user in most cases.
  • Passsword for TCP/IP connection.
  • GUID to use for the temperature event. This is an optional parameter and if not given “-” wil be used which is the same as a GUID with all zeros and mans that the event will have the GUID of the interface. It is better to give an explicit GUID but this works for now.

So issuing this and watching it in VSCP Works

now we can add this to a cron script to get the temperature sent to the VSCP daemon every minute.

We add a script send_gpu_temp to /etc/cron.d looking like this

* * * * * root cd /root;./send_pi_gpu_temp.py 192.168.1.6 admin secret 00:00:00:00:00:00:00:00:00:00:00:00:00:01:00:03

Note that a GUID has been assigned here for the sensor. The

00:00:00:00:00:00:00:00:00:00:00:00:xx:xx:xx:xx

can be used for lab usage and I put a id for some hardware in byte 2/3 in this case 00:01 and index in byte 0/1 ( 00:03). We could have used the MAC address or the IP address  of the Raspberry Pi as a base for this or a privately assigned GUID series. You can read more about the GUID’s here.

Thats it. You can now alarm yourself when the temperature reach critical levels or just diagram the data or collect it in a database.

Monitor CPU temp of a Raspberry Pi #rpi #vscp #iot

The CPU temperature of a Raspberry Pi can be checked with

  cat /sys/class/thermal/thermal_zone0/temp

what you get is the CPU temperature in degrees Celsius times 1000. A typical output would therefore be

  44388

which is 44.388 degrees Celsius.

If we want to react on this temperature or collect it or diagram we need to send it to the VSCP daemon.  There is many ways to do this but the probably easiest way is to send it to the VSCP daemon over the TCP/IP interface. If you like MQTT more or websocket or a REST interface you can choose any of them instead as they all are supported by the VSCP daemon.

On a Raspberry Pi we usually have Python so we do this with a Python script for simplicity.  We can add this python script to cron and as we will see later get the CPU temperature every minute.

The script by the way is general. It can send any temperature times 1000 expressed in degrees Celsius and stored in a file to the VSCP daemon. It is possible to have the conversion as an input parameter but we skip that in this case.

The script is easy and looks like this

You use it like this

./send_pi_cpu_temp.py 192.168.1.6 admin secret –

First remember to make it executable (chmod a+x send_pi_cpu_temp.py ).

The parameters are.

  • IP address to server (192.168.1.9) where VSCP daemon resides.
  • User name for TCP/IP connection, obviously you should use anther user than the admin user in most cases.
  • Passsword for TCP/IP connection.
  • GUID to use for the temperature event. This is an optional parameter and if not given “-” wil be used which is the same as a GUID with all zeros and mans that the event will have the GUID of the interface. It is better to give an explicit GUID but this works for now.

So issuing this and watching it in VSCP Works

now we can add this to a cron script to get the temperature sent to the VSCP daemon every minute.

We add a script send_cpu_temp to /etc/cron.d looking like this

* * * * * root cd /root;./send_pi_cpu_temp.py 192.168.1.6 admin secret 00:00:00:00:00:00:00:00:00:00:00:00:00:01:00:02

Note that a GUID has been assigned here for the sensor. The

00:00:00:00:00:00:00:00:00:00:00:00:xx:xx:xx:xx

can be used for lab usage and I put a id for some hardware in byte 2/3 in this case 00:01 and index in byte 0/1 ( 00:02). We could have used the MAC address or the IP address  of the Raspberry Pi as a base for this or a privately assigned GUID series. You can read more about the GUID’s here.

Thats it. You can now alarm yourself when the temperature reach critical levels or just diagram the data or collect it in a database.

A note
VSCP base measurements on the SI system.  So a measurement has a base unit that is standardized and well specified. For convenience you can often use other units also. As an example, for temperature, the base unit (0) is Kelvin. But you can send the temperature data as degrees Celsius (unit=1) or degrees Fahrenheit (unit=2) also. The important thing is that it will always be well specified.

The format of the data is also well specified. In VSCP there is no questions raised about big/little endian or decimal point formats and such things. The number can come in many formats (string/integer/float…) but they are all well specified and have a clear conversion path between each other.

Well why? you may ask. What can we gain from this?

The thing is that as soon as we have the data in a common format routines for handling one type of measurement will work equally well for another type of measurements. Write once use many times.  You can even see this in the above sample. Only the unit and the class type will have a new meaning if we wanted to send a sound level measurement instead of a temperature measurement to the VSCP daemon.

In this case all VSCP Level I is used. That means max. 8 bytes of data.  Even the smallest device out there can handle this. It’s both practical and economical.

And all this is true for turning on/off things etc also of course.