Souliss Alpha 5.1, introduce openHAB Interface

1,129 views
Skip to first unread message

Dario Di Maio

unread,
Jan 23, 2014, 3:36:40 PM1/23/14
to sou...@googlegroups.com
Hi,

thanks to Fulvio we have basically completed the code for the inteface to openHAB. We have spoken a lot about even in the past and the actual interface use a different approach.
In the past we have dived into a dedicated binding into openHAB based on MaCaco over UDP/IP, that's a nice solution but not effective. As is designed openHAB it doesn't allow a zero-configuration setup as is done for SoulissApp and this drive Fulvio to an easier interaction basedhtt on HTTP/XML.

Actually on the openHAB side is just needed the standard HTTP binding that will collect data from Souliss' using GET requests, the XML structure is really simple and has splitted TYPICALS and SLOTS, lets have an example:

http://<ipaddress>/status?id=1 will return
<id1><s0>1</s0><s1>0</s1>...</id1>

http://<ipaddress>/typicals?id=1 will return
<id1><s0>11</s0><s1>11</s1>...</id1>

Numeric values are now HEX based (before was DEC) and only used slots are returned.

The openHAB interface (as all interfaces from this release) are no longer activated with the gateway, so even a peer (Ethernet) node can run this interface. Only nodes configured as Gateway with Persistance mode gets and reply with data from all the nodes in the network, Peers and Gateway without that option will only makes available data that belongs to them.

The use of Persistance mode reserve an high amount of RAM for data storage and shall run on bigger AVRs like ATmega2560 (Arduino Mega). You can run Persistance mode if your network is small enough, in that case reducing the number of NODES and SLOT in MaCacoCfg.h will redure the total amount of RAM needed for data persistance.

Let me say thanks to Fulvio!

Dario.




_Souliss A5.0.5 n4.zip

Dario Di Maio

unread,
Jan 23, 2014, 4:28:10 PM1/23/14
to sou...@googlegroups.com
I've just started a topic on the openHAB mailing list

https://groups.google.com/forum/?fromgroups#!topic/openhab/VEnSucYQYvs

Dario.

Marcolino

unread,
Jan 23, 2014, 5:00:07 PM1/23/14
to sou...@googlegroups.com
Hi Dario,
whit this new HTTP interface, I can integrate also Souliss, with Nagios. Nagios is an Opensource Monitoring System, http://www.nagios.org, used by big company to monitor their Server Farm and Devices. With this interface, we can simply monitor our home, using the power of Nagios Notification and Managment.

I'll start to test this new release with my node as soon as possible.

Thanks for your work.

Marco

Di Maio, Dario

unread,
Jan 23, 2014, 5:05:33 PM1/23/14
to sou...@googlegroups.com
Yes, generally every software that is able to parse HTTP and XML can be integrated in such way. This interface is designed by Fulvio as per openHAB needs, but it would be very nice if you can use it for Nagios also.

Of course, if specific needs for Nagios are not covered with this interface, we can discuss about and introduce those into a dedicated interface.

Nagios is probably more complicated than openHAB, so also in this case a general guide for the integration with Souliss is really appreciated.

Dario.


--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Marcolino

unread,
Jan 23, 2014, 5:12:48 PM1/23/14
to sou...@googlegroups.com
Hi Dario,
Basically Nagios do Polling at the devices and retrieve some information, for example cannot permit to Open a Window or turn on a Light, but permit to be immediatly notified if a window is becaming opened or if a light is turned On.
Basically Nagios is standar, but a Parser/Wrapper will be needed to parse Souliss XMM. This can be developed directly into a Linux Oriented Language (PHP, Phyton, BASH....), i prefer PHP. When Nagios decide to do a check, this script will be called, and pass return information to nagios. When I'll have an Usable Version I'll publish with some integration suggestion and hints.

Nagios is also able to receive trap and send a Notification. For Example, when Windows is Opened, The Souliss node, should send some kind of message to Nagios, and it send Alarm Immediately, without waiting for polling. I neved did this kink of integration , but we can consider as 2nd Step.

Marco

Fulvio Spelta

unread,
Jan 24, 2014, 1:44:20 AM1/24/14
to sou...@googlegroups.com
Another nice integration that should be possibile is vs OpenRemote that is another high quality command system http://www.openremote.org/

Di Maio, Dario

unread,
Jan 24, 2014, 8:44:05 AM1/24/14
to sou...@googlegroups.com

May I ask you to go on the openHAB group and post a couple of pictures and a brief description of what has been achieved by you with openHAB, souliss and the other tools that you are currently using?

So they can have a preview while waiting for the official release.

Thanks,
Dario.

From Mobile.

On 24 Jan 2014 07:44, "Fulvio Spelta" <fulvio...@gmail.com> wrote:
Another nice integration that should be possibile is vs OpenRemote that is another high quality command system http://www.openremote.org/

--

Di Maio, Dario

unread,
Jan 26, 2014, 5:05:28 PM1/26/14
to sou...@googlegroups.com
The test on the openHAB integration are going further with Fulvio, attached there is mostly the release A5.1 that has different bugfix that has been out in these tests.

The reliability of the code has been improved with a couple of bugfix, the pointers limits wasn't checked while retrieving the URL and this can create troubles with URLs that contains additional information (like the ones generated by a browser).

You can have an idea of what's happening inside enabling the DEBUG in SoulissCfg.h

The two attached sketches has been used and gives those as result:
Request typical logic data definition, node 0
http://192.168.1.17/typicals?id=0
<id0><s0>21</s0><s1>11</s1></id0>

Request typical logic data definition, node 1
http://192.168.1.17/typicals?id=1
<id1><s0>11</s0><s1>11</s1><s2>11</s2><s3>11</s3></id1>

Request actual state and then force the first logic, for node 0
http://192.168.1.17/status?id=0
<id0><s0>0</s0><s1>0</s1></id0>
http://192.168.1.17/force?id=0&slot=0&val=1
http://192.168.1.17/status?id=0
<id0><s0>1</s0><s1>0</s1></id0>

Request actual state and then force the first logic, for node 1
http://192.168.1.17/status?id=1
<id1><s0>0</s0><s1>0</s1><s2>0</s2><s3>0</s3></id1>
http://192.168.1.17/force?id=0&slot=0&val=1
http://192.168.1.17/status?id=1
<id1><s0>0</s0><s1>0</s1><s2>0</s2><s3>0</s3></id1

A request to a node that hasn't been connected
http://192.168.1.17/status?id=2
<id2></id2>


Regards,
Dario.
openHAB_Peer.txt
_Souliss release A5.1 n0.zip
openHAB_Gateway.txt

Di Maio, Dario

unread,
Feb 1, 2014, 6:31:58 AM2/1/14
to sou...@googlegroups.com

Attached there is a working release and a draft of sketch.

Lets wait Fulvio for a complete set of configuration on either Souliss and openHAB side.

Dario.

From Mobile.

_Souliss A5.1 r1.zip

Dario Di Maio

unread,
Feb 11, 2014, 5:49:31 PM2/11/14
to sou...@googlegroups.com
An update to support writing on multiple slots at same time, use GET /force?id=...&slot=...&val=val1,val2,val3,val4,val5

Dario.
_Souliss A5.1 r2.zip

Juan Pinto

unread,
Feb 16, 2014, 6:28:40 PM2/16/14
to sou...@googlegroups.com
One last question (today ;P ) 

Works Openhab Interface over ENC28J60?

Di Maio, Dario

unread,
Feb 16, 2014, 8:22:01 PM2/16/14
to sou...@googlegroups.com

No it doesn't, at this time there are only the drivers for Wiznet based devices.

It may work over a Mega but needs some modification, you can try to port the code if you want to get a third mention in the release note :D

Dario.

From Mobile.

--

Marcolino

unread,
Feb 17, 2014, 4:04:30 AM2/17/14
to sou...@googlegroups.com
Hi Dario,
I would like to ask if it's possible to add in future release the Souliss_LowDigIn2State so we can handle also inverted logic. I think it could be useful also for other users.
Here the code:

U8 Souliss_LowDigIn2State(U8 pin, U8 value_state_on, U8 value_state_off, U8 *memory_map, U8 slot)
{
 
// If pin is off, set the "value"
 
if(digitalRead(pin)==0 && !InPin[pin])
 
{
 memory_map
[MaCaco_IN_s + slot] = value_state_on;
 
 
InPin[pin] = true;
 
return MaCaco_DATACHANGED;
 
}
 
else if(digitalRead(pin) && InPin[pin])
 
{
 memory_map
[MaCaco_IN_s + slot] = value_state_off;
 
 
InPin[pin] = false;
 
return MaCaco_DATACHANGED;
 
}
 
 
return MaCaco_NODATACHANGED;
}

Di Maio, Dario

unread,
Feb 21, 2014, 12:17:54 PM2/21/14
to sou...@googlegroups.com
Included.


Fulvio Spelta

unread,
Feb 22, 2014, 8:18:57 PM2/22/14
to sou...@googlegroups.com
Dario there is a little mistake.

Line 163 of openhab.cpp is:
valf[i]  = incomingURL.indexOf(",", valf[i-1]);

and should be:
valf[i]  = incomingURL.indexOf(",", valf[i-1]+1);

without this correction the /force url doesn't function.

attached the file modified
openHAB.cpp

Di Maio, Dario

unread,
Feb 22, 2014, 8:35:18 PM2/22/14
to sou...@googlegroups.com
I've added your modification to the actual code, thanks :)


--

Di Maio, Dario

unread,
Feb 22, 2014, 10:04:47 PM2/22/14
to sou...@googlegroups.com
The attached code include the bugfix from Fulvio and a beta migration for the openHAB code to the ENC28J60.

I don't even know if it does compile properly, but it should load the uIP interface in the case.

Dario.
_Souliss A5.1 RC4.zip

Di Maio, Dario

unread,
Feb 23, 2014, 10:26:41 AM2/23/14
to sou...@googlegroups.com
Now it compiles :)
_Souliss A5.1 RC5.zip

Di Maio, Dario

unread,
Feb 25, 2014, 1:40:01 PM2/25/14
to sou...@googlegroups.com
Let me share the rc6, it contains a small modification on subscription sintax that now allow also to subscribe all nodes without known the number of actual node at time of request. This will be probably useful while developing the openHAB interface based on MaCaco.

The openHAB XML is working fine over W5100/W5200 rather over ENC28J60 there are some major bugs.

Regards,
Dario.
_Souliss A5.1 rc6.zip

Di Maio, Dario

unread,
Mar 2, 2014, 4:21:39 PM3/2/14
to sou...@googlegroups.com
Attached the R7, that is only for brave users :)

It modify the W5100, W5200 and ENC28J60 drivers in order to use a part of their RAM as extension of the microcontroller one.

I've tested it on the ENC28J60, need feedback on the Wiznet.

In the arduino_uip topic there is the sketch to be used with.

Thanks,
Dario.
_Souliss A5.1 r7.zip

Dario Di Maio

unread,
Mar 9, 2014, 12:47:27 PM3/9/14
to sou...@googlegroups.com
The A5.1 has been released, get it via the Souliss website.

Now we are switching to Google Drive and the files cannot longer be downloaded from the Download section of Google Code, but the Git repository will stay there.

Regards,
Dario.

Fulvio Spelta

unread,
Mar 13, 2014, 7:09:39 PM3/13/14
to sou...@googlegroups.com
Ciao Dario
ho trovatola necessità di una piccola correzione.

Il buffer di ricezione della url è un filo troppo corto per cui se invio la url:
/force?id=0&slot=0&val=34,100,100,100
per pilotare la striscia led l'ultimo carattere va perso e il valore del blu viene impostato a 10.

Ho modificato la riga 31 di openhab.h  in
#define HTTP_REQBYTES 50 // Max lenght for URL request
aggiungendo10 char (50 invece di 40) e oraè ok.Valuta il recepimento della modifica nel prossimo rilascio

ciao
f

Di Maio, Dario

unread,
Mar 13, 2014, 7:37:11 PM3/13/14
to sou...@googlegroups.com

Certo.

Grazie,
Dario.

From Mobile.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages