New house controlled by Souliss

1,333 views
Skip to first unread message

guyc

unread,
May 16, 2015, 7:28:20 PM5/16/15
to sou...@googlegroups.com
I'm building a complete domotic system based on Souliss.

Starting points :
 - All the lights (LED's) has to  work on low voltage 24 Vdc, except for some TL-tubes in the cellar and the garage.
 - Only based on arduino, no addittional servers.
 - Controlled by smartphone and in future by Iphone and Ipad.
Last year I made some small tests with Souliss before I started my project.

Meanwhile the house in build and all the cabling (2,5 mm2) is finished. All the cables for the lights and the pushbuttom are centralized into 2 cabinets. One on the ground floor and  one the first level.
The cabinets are installed and now I'm finishing the internal wiring of the cabinets and the input and output boards. (+/- 80 inputs and 80 outputs)
The whole installaton will run on 5 arduino mega's. All connected by RS485, with one also connected to an ethernet board as gateway.

The leddrivers ( I ordered them in China )  will be installed into the lights, except for the dimmable lights. These drivers will be installed in the cabinets.
For the leds I'm using 7W COB leds, because they have a forward voltage of 22-24 Vdc and also some ledstrips 24Vdc.
All the cabling is done in 2,5 mm2.

Now that the hardware is nearly finished, I have to start with the hard stuff, the software and I'm not a software specialist.

As a test I've already made a small part of the software of node0 and I hope I follow a little bit the rules of Souliss.
I'm afraid in the near future I will need some help of the specialists here.

If somebody should be interested, all my documentation ( system overview, drawings of the I/O boards and my excel-sheets for the installation are available.)
Souliss_node0_gateway.ino

Yoosof Piran

unread,
May 17, 2015, 4:45:20 AM5/17/15
to sou...@googlegroups.com
do you design your cabinet and wiring in Eplan or Autocad electrical?
is it possible to share your schematics?

guyc

unread,
May 17, 2015, 12:35:07 PM5/17/15
to sou...@googlegroups.com
At this moment I made all my drawing is Viseo. Hope to convert the 230 V part this week to autocad.


Op zondag 17 mei 2015 10:45:20 UTC+2 schreef Yoosof Piran:

Profesor Did

unread,
May 17, 2015, 5:24:15 PM5/17/15
to sou...@googlegroups.com
Great Work Guy. LEt us know what you are doing!! :) IT is quite interesting..

Gabriele Ribichini

unread,
May 17, 2015, 6:00:06 PM5/17/15
to sou...@googlegroups.com
Ciao Guy,
your project looks really similar to mine.

I am still working on it (and I think I will never end) but at the moment all lightning (most of it LEDs 12V), windows shutters and HVAC are working based on Souliss.
The first version of the system was in use since December last year, and I've upgraded to Friariello just last week.. running really stable since days in the normal daily life.

My apartment have a mixture of ethernet + RS485 communication
all boards are ProDino and just one MEGA to control the HVAC + Gateway functionality.

I am planning to have:
1) an integrated alarm system (able to control lights and window shutters in case of alarm) with PIRs, reed switches and cameras
2) a power management system to give priority to appliances (e.g. do not allow heatpump peaks in case the laundry machine is working)
3) smart HVAC actuation to exploit low energy price slots (you could save up to 15€/month)
4) a watering system for the garden with weather forecast integration (no need to water now if tomorrow it will rain)
5) a smart window shading according to wanted temperature and sun presence (in summer lower the shader if you are cooling, or in winter raise it if the sun is shining)

the project is published at: https://github.com/ribico/gr-home-automation
I think you may find it a useful starting point.

My repository includes all needed file (including Souliss and DHT libraries) so that you just need to download and compile it with Arduino IDE 1.6.4

let me know if something is unclear, I still need to work on the documentation.

ciao

Juan Pinto

unread,
May 18, 2015, 12:28:38 PM5/18/15
to sou...@googlegroups.com
Awesome!,
 
Ty for sharing!
 
Regards.

El domingo, 17 de mayo de 2015, 1:28:20 (UTC+2), guyc escribió:

guyc

unread,
May 18, 2015, 4:52:26 PM5/18/15
to sou...@googlegroups.com

Juan,

All the documentaton that is ready I will post. Hope to upload the drawings for the outputs tomorrow.


Gabriele,
I have tried to understand your sketches but I still have a long time to go to understand them.

For the moment I'm working on my sketch of node0 and I have a question.

In the cellar I have 4 places with a light and a pushbutton . The stairs to go to the cellar has his own light, controlled by a pir sensor. (So far I can write my sketch already.)
For safety reasons I also want that the light of the stairs stays on as long as one of the lights in the cellar is on and stays on for 2 minutes after the last light was going off. After 2 minutes I'm sure, the pir has detected movement and takes the action to keep the light on for X minutes.

For this small sequence I need to detect the status or position of the lights from the different rooms in the cellar. ( I thinks this status must be memorized somewhere in a database in the node)
When I have the status, I can build with the 'if' and a timer instruction  the sequence and send  the result  to the stairs light.

Hope my explanation is a little bit clear.

Gabriele Ribichini

unread,
May 19, 2015, 1:41:17 AM5/19/15
to sou...@googlegroups.com
Ciao Guy,
If the lights you mention are controlled by several distributed boards, I suggest you to implement this logic on the gateway node.

By activating PERSISTENCE mode, you can easily access to the whole network status via pOutput.
Please take care that persistence may request a lot of RAM.

Otherwise you may use publish/subscribe to inform others in the network about lights status.

And finally use RemoteInput to control the stairs light from remote or a mixture of this mechanism..

BR

guyc

unread,
May 19, 2015, 3:48:11 AM5/19/15
to sou...@googlegroups.com

Gabriele,

The light of the stairs is in the same node as the other lights, so why do I have to use RemoteInput ?
Gone work further to my sketch this evening with your info.

 Thanks

As promised the drawings of the outputs with the connection to the arduino's
 
outputs.pdf

Gabriele Ribichini

unread,
May 20, 2015, 2:11:33 AM5/20/15
to sou...@googlegroups.com
Ciao Guy,
if all I/O is on the same node that's fairly easy.

In the node sketch for each slot you can access to the status of Souliss as follows:
mInput(slot) // status of the input (commands)
mOutput
(slot) // status of the output (slot status)

You should take care of the souliss basic functional logic.. to get this working.

Inputs are set by functions like DigIn, LowDigIn.. etc.. so you can read the mInput status only after that function has been called.
They should be interpreted as command to be executed on that slot. 
Typical values you may read are defined in Typicals.h as follow Souliss_T1n_ToggleCmd, Souliss_T1n_OnCmd, Souliss_T1n_OffCmd, Souliss_T1n_RstCmd

After that, Logics are normally called e.g. Logic_SimpleLight
These functions typically convert an input command into an output (which is the final state of the slot).
Please note that the input is normally reset in the logic execution, so if you read mInput after the logic execution you may find always Souliss_T1n_RstCmd. 

Outputs are the final status after the execution of the logic.
if a light is on, mOutput(LIGHT_SLOT) will return Souliss_T1n_OnCoil
if a light is off, it will return Souliss_T1n_OffCoil

I hope this is now clear than before.. I took quite some time at the beginning to enter into this easy but hidden mechanism.
In your case I think you have to preferred ways among others:

1) right after DigIn and before the Logic_SimpleLight you may check what the user asked to do by reading the mInput(slot) values.
Here you can modify some commands, e.g. if the user asked to turn on the LIGHT1 but you want to turn on the LIGHT2 too, then add this call
SetInput(LIGHT2, Souliss_T1n_OnCmd)

2) since you were talking about timing your ligths you may also be interested to use Timer and eventually Typical T12 (Autolight + Timer) instead of Typical T11
Timer can be used both with T11 and T12.
You find an explanation on its usage here : https://github.com/souliss/souliss/blob/friariello/base/T1n.cpp
at the beginning of the function Souliss_Logic_T11
Autolight is only in T12, and some info on that are on the same file right before of definition of function Souliss_Logic_T12

hope that it helps.

ciao

Di Maio, Dario

unread,
May 20, 2015, 7:54:03 AM5/20/15
to sou...@googlegroups.com
Hi Gabriele,

would you mind to review the https://github.com/souliss/souliss/wiki/Gateway wiki page including information to make clear how to use it?

I guess that have direct experience reported in the wiki is the best way to make it simpler and better.

Thanks,
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.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/0caa3b0e-bc8d-419d-bb42-e31d701223b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

guyc

unread,
May 20, 2015, 6:05:58 PM5/20/15
to sou...@googlegroups.com

Gabriele,

Where can I find all these instructions ?

I checked the wiki, but couldn't anything like

mInput(slot) // status of the input (commands)
mOutput
(slot) // status of the output (slot status)

thanks

Di Maio, Dario

unread,
May 20, 2015, 6:11:13 PM5/20/15
to sou...@googlegroups.com

Look at the Gateway page.

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.
To post to this group, send email to sou...@googlegroups.com.

Gabriele Ribichini

unread,
May 21, 2015, 2:02:28 AM5/21/15
to sou...@googlegroups.com
Ciao Guy,
Unfortunately dario is wrong.
You are right, these information are not really in the wiki.

As dario asked I will try to review the online documentation... And you could help us pointing out all sort of issue you don't find clear.
Since you are souliss newbie, you are really precious to identify unclear aspects.

Thanks

Profesor Did

unread,
May 21, 2015, 3:26:49 AM5/21/15
to sou...@googlegroups.com
Haha, That, looking for the documentation Dario have said at getaway was making me crazy... :)
Thanks.. :)

Di Maio, Dario

unread,
May 21, 2015, 3:43:42 AM5/21/15
to sou...@googlegroups.com
The documentation is not complete, the best way to get it better, is that you read it and then explain here what looks missing from your side.

If I look at the documentation by myself, I can see the information, but I understand that what is clear to me cannot be for other and viceversa.

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.
To post to this group, send email to sou...@googlegroups.com.

Profesor Did

unread,
May 21, 2015, 3:49:59 AM5/21/15
to sou...@googlegroups.com
Dario, you are right. ... And We have to thanks the people like you that have work on it since the first minute...

I am reading the documentation and following the forum and I will try to prepare a kind of manual with that kind of things for beginners like me! :) I hope that be helpful for all of us..
:)

Di Maio, Dario

unread,
May 21, 2015, 4:02:28 AM5/21/15
to sou...@googlegroups.com
More than a manual, please share what looks missing, so that we can still have one source of information, but get it more complete.

Dario.

guyc

unread,
May 21, 2015, 4:09:16 AM5/21/15
to sou...@googlegroups.com


The reason of my question was not to give remarks, but I want to disturb everybody as less as possible.
In the past I had a list of the SpeakEasy instructions, but they don't work anymore, so I was looking for an update of these instructions.

Yesterday I had another strange thing.  In Belgium we have 2 internet providers. One is working with the old telephone cabling  grid (Proximus) and the other works with the coax grid original only for television (Telenet).
I always work with the Proximus routers. Yesterday I made a test with my system on the Telenet router and could not make a connection. The app could not find the adress of the gateway. I made the test with port 77 and with port 17.

Profesor Did

unread,
May 21, 2015, 6:17:32 AM5/21/15
to sou...@googlegroups.com
guyc. I think you misundertood the ip with the port.. I'll try to help you.

For example if you are working at the net with an 192.168.1.xx range, surely your pc's and devices connected to this router will have the ip such as 192.168.1.1 (surely router ip) and 192.168.1.2 and so on for the rest of devices. If you set up your souliss addres as a 17 then to connect to your souliss you will have to enter the ip 192.168.1.17.
However according that to connect to your souliss device you have to get the connection by a pc (for example), the connection will pass throw your router. That means that if you don't set up your router to let it pass the connection then you will not connect because the port (not the ip). What you have to do is open the right port in your router. The more common port used in souliss communication is 230 (i am not sure). that means that if your router blocks that port you will not connect with your souliss application...

So I supose that you ara having prolbme with this new provider because in this new router you  don't have open de right port. You can check this link to know how to open a port in a tp-link router.. .http://www.tp-link.com/en/news-details-72.html

It is a bit more complex when you want to connect from outside your house. I mean from other net outside your router/net...

I hope be helpful.

Profesor Did

unread,
May 21, 2015, 6:20:12 AM5/21/15
to sou...@googlegroups.com
I don't know if it is polite what i am doing, please let me know if I am doing something wrong.
I am trying to clarify the files making a kind of manual.. The attached file is only the beginning... now I would like to comment the lines and the files in orther to help others...
As I said, please, if I am doing something wrong let me know it..

Thanks..
Basic manual souliss libraries .pdf

guy caluwaerts

unread,
May 21, 2015, 6:36:28 AM5/21/15
to sou...@googlegroups.com
VERY, VERY nice work

guy

From: Profesor Did <profes...@gmail.com>
To: sou...@googlegroups.com
Sent: Thursday, May 21, 2015 12:20 PM
Subject: Re: [souliss] Re: New house controlled by Souliss


For more options, visit https://groups.google.com/d/ optout.

--
You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/h0cw_YMFVCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.

To post to this group, send email to sou...@googlegroups.com.

Di Maio, Dario

unread,
May 21, 2015, 6:37:43 AM5/21/15
to sou...@googlegroups.com
Any help is always appreciated, what I mean is if in the wiki somenthing is not clear raise a query and say. I read in the wiki ... but what if I want to ..., so that we can understand where the holes are.

For me is quite hard to understand what isn't clear, and I need help from people that looks at the documentation for the first time.

Dario.

Gabriele Ribichini

unread,
May 21, 2015, 6:44:55 AM5/21/15
to sou...@googlegroups.com
I agree.
I would prefer to keep the focus on the online documentation only.
It is already difficult to keep just one source clear and updated.

Gab

--
You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/h0cw_YMFVCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.

To post to this group, send email to sou...@googlegroups.com.

Profesor Did

unread,
May 21, 2015, 7:40:17 AM5/21/15
to sou...@googlegroups.com, gabr...@ribichini.net
Ok, I understand. THen I Will use the document to learn about how souliss work by my own and in case I found something wrong or to be improved I will inform you in the forum in order the wiki could be improved... I understand that is what you want... isn't it?

Di Maio, Dario

unread,
May 21, 2015, 8:17:48 AM5/21/15
to sou...@googlegroups.com
Yes please, if we keep a single source of information became easier.

Dario.

guy caluwaerts

unread,
May 21, 2015, 12:13:08 PM5/21/15
to sou...@googlegroups.com
Dario,


Agree with you.
The designer can never write a good manual for his own system because he takes 10 steps at the same time. The 9 steps between are so clear and normal for him that he don't spent time to them.



From: "Di Maio, Dario" <dario....@souliss.net>
To: "sou...@googlegroups.com" <sou...@googlegroups.com>
Sent: Thursday, May 21, 2015 12:37 PM

Subject: Re: [souliss] Re: New house controlled by Souliss
You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/h0cw_YMFVCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.

To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
May 21, 2015, 5:15:21 PM5/21/15
to sou...@googlegroups.com, guycal...@yahoo.com

Please find the layout of the hardware.
The communication between the different nodes is done by RS485 over the serial1 port (pins 18&19).
The 24 Vdc power supplies are feeding all the led lights and the  DC/DC convertors are for the power of the arduino's.

domotica overview.pdf

Gabriele Ribichini

unread,
May 22, 2015, 1:34:08 AM5/22/15
to sou...@googlegroups.com, guycal...@yahoo.com

Ciao Guy,
Nice!
would you please share your bill of material too ?

Some ML user (including me) may be interested in which board you purchased, where, and how much you paid.

Thanks

   

--
You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/h0cw_YMFVCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
May 22, 2015, 4:14:01 PM5/22/15
to sou...@googlegroups.com, guycal...@yahoo.com, gabr...@ribichini.net
Gabriele,

please find the bill of material :

5x Arduino mega. I use a mix of original bard (45€/p) and chinees copies (10€/piece).  Both boards are working very well.
5x DC/DC convertors 3 A for powering the arduino's . I bought them also in China. (2€/piece)
5 x RS845 converters, also from china. (2@/piece.
1 x ethernet shield W5100. This is also a Chinees copy, but don't work very well. I recommend to buy the original ethernet shield. The problem with this shield (and its seems a common problem) that you cannot upload a sketch with the shield installed. )
For the power supplies, I used industrial power supplies from Phoenix, but you can buy switching power supplies 24 V - 10 A for less than 50€/piece.
For the relays, I also used phoenix, but you can order a compleet relays board with 8 or 16 relays including the optical drivers for less than 25 €. I have to make my drivers myself. ((transistor BC747 with a resistor. )
For another project with arduino,I used the board on the picture.

12V 16 Channel Relay Module Interface Board For Arduino PIC ARM DSP PLC With Optocoupler Protection LM2576 Power(China (Mainland))

The input boards I made myself to, but have no drawing of it for the moment. (16 opto couplers, and some resistors and connectors)
For the internal cabling between the boards, the arduino's and the outside world I come back later
On the pictures of the cabinets I posted before, you can see already some of the input modules installed ( (green modules left corner below).



Also the led-drivers (24 V, 350 mA) and also the dimmable versions, I bought in China (2€/piece). I come back later with a question about these dimmable drivers for help because they have an inverse input

I think  I may say that the whole system is rather  chiep.
hope it was a little bit helpfull
guy

Op vrijdag 22 mei 2015 07:34:08 UTC+2 schreef Gabriele Ribichini:

Gabriele Ribichini

unread,
May 22, 2015, 4:28:05 PM5/22/15
to sou...@googlegroups.com, guycal...@yahoo.com
thanks for sharing.

guyc

unread,
May 27, 2015, 1:00:56 PM5/27/15
to sou...@googlegroups.com, guycal...@yahoo.com


My first node (node0 is ready I think and will be installed Saterday.
This node is the gateway and will be connected to the other 4 nodes via RS485 and the serial 1 port (pins 18 and 19).

Can someone check the sketch, specially the communication part and give me feedback and remarks for thinks that are wrong or can better ?
Souliss_node0_gateway.ino

Di Maio, Dario

unread,
May 28, 2015, 1:39:11 AM5/28/15
to sou...@googlegroups.com, guy caluwaerts

Is this an Ethernet only node or you need usart?

You have a too big code inside FAST50ms use multiple phases with different values to balance code execution across time. Generally you can run logics slower.

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.

To post to this group, send email to sou...@googlegroups.com.

Enrique Martí

unread,
May 28, 2015, 1:51:59 AM5/28/15
to sou...@googlegroups.com

Only an ethernet node

Enviado desde Sony Xperia

You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/h0cw_YMFVCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.

To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
May 28, 2015, 3:05:02 AM5/28/15
to sou...@googlegroups.com
Dario,
Enrique,
This node (node0à is has to work as Ethernet node (gateway)  and usart node. As I have tried to explain, all the other nodes will be connected by RS485 bridge to this node. ( see the overview I posted a few days before.
What do I have to modify so that it will also collect data from the other nodes ?
Dario,
I will change the FAST50ms to FAST70ms or FAST100ms
guy

Op donderdag 28 mei 2015 07:51:59 UTC+2 schreef Profesor Did:
domotica overview.pdf

Di Maio, Dario

unread,
May 28, 2015, 3:20:18 AM5/28/15
to sou...@googlegroups.com
Hi,

you need to setup an address also on the RS485 side,

Add nodes require the following

Draft a sketch and we will check it.

Regards,
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.
To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
May 28, 2015, 3:58:31 AM5/28/15
to sou...@googlegroups.com
/**************************************************************************
 *     Souliss - New house domotica - PEER NODE CELLAR + OUTSIDE
 *    
 *     It handles simple ON/OFF lights and one sequence.
 *     - simple ON/OFF lights and one sequence.
 *     - one sequence for light cellar stairs controlled by a pir and the other lights in cellar
 *      - one light in the garage controlled by pir and the auto_light routine.
 *
 *     The sketch in running one Arduino Megaas gateway with ethernet board (5100) and RS485 UART (over serial 1)
 *
*      
*
 *     CONFIGURATION IS MANDATORY BEFORE COMPILING
 *
 *    
 *         0x43                    Arduino with UART
 *        
 *    
 *     ******************** Configuration Parameters *********************
 *    
 *         Configuration file        Parameter
 *         QuickCfg.h                #define    QC_ENABLE            0x01
 *         QuickCfg.h                #define    QC_BOARDTYPE        0x03, 0x04, 0x05
 *
 *         QuickCfg.h                #define    QC_GATEWAYTYPE        0x01       
 *        
 *     Is required an additional IP configuration using the following parameters
 *         QuickCfg.h                const uint8_t DEFAULT_BASEIPADDRESS[] = {...}
 *         QuickCfg.h                const uint8_t DEFAULT_SUBMASK[]       = {...}
 *         QuickCfg.h                const uint8_t DEFAULT_GATEWAY[]       = {...}
 *    
 ***************************************************************************/
// Configure the framework

#include "bconf/StandardArduino.h"          // Use a standard Arduino
#include "conf/ethW5100.h"                  // Ethernet through Wiznet W5100
#include "conf/Gateway.h"                   // The main node is the Gateway
#include "conf/Webhook.h"                   // Enable DHCP and DNS


#include "Souliss.h"
#include <SPI.h>
//#include "Typicals.h"
//#include <SPI_Class.h>

// Define the network configuration
//
// In the QuickCfg.h file set DEFAULT_BASEIPADDRESS[] = {192,168,1,0}
#define myvNet_address        0x0011             // 0x0011 is equal to 17 in decimal
#define myvNet_subnet        0xFF00
#define myvNet_supern        0x0000



#define GATEWAYTYPE_INSKETCH
#define QC_GATEWAYTYPE 0x01
#define BOARDTYPE INSKETCH
#define QC_BOARDTYPE 0x04
#define QC_BOARDTYPE 0x43
#define peer_usart 0xCE01
#define peer_usart 0xCE02
#define peer_usart 0xCE03
#define peer_usart 0xCE04
#define USARTDRIVER_INSKETCH
#define USARTDRIVER Serial1


// define the number of the slots
#define KL4                    0  //technische ruimte
#define KL5                1  //berging    
#define KL2                2  //wijnkelder
#define KL1                3  //archief
#define KL3                4  //gang+trap kelder
#define L8                5  //garage
#define L30                  8  //buitenverlichting oost muur
#define L6                  9  //berging (L6+L44)
//#define pir                    10  //pir kelder   
#define L35                             11  //berging tablet
#define L43                             12  //wachtverlichting garage


 
#define LIGHT_ON_CYCLE        31 // light stairs ON during 10 cycles if triggered by PIR or lights cellar all OFF       
byte TR;  //status techn_ruimte
byte BG;  //status berging
byte WK;  //status wkelder
byte AR;  //status archive
byte ST;  //status stairs
byte PR;  //status pir
unsigned long gtime; //delay stairs activated by pir or last light off




void setup()
{   
    Souliss_SetAddress(myvNet_address, myvNet_subnet, myvNet_supern);       
    SetAsGateway(myvNet_address);        // Set this node as gateway for SoulissApp   
  // initialize serial communication:
  Serial.begin(9600); 
     

  //Souliss_SetAddress(peer_usart, network_my_subnet, gateway_eth);
  //

  Set_SimpleLight(KL4);        // Define the logic
  Set_SimpleLight(KL5);
  Set_SimpleLight(KL2);
  Set_SimpleLight(KL1);   
  Set_SimpleLight(L8);
 
  Set_SimpleLight(L30);
  Set_SimpleLight(L6);
  Set_AutoLight(KL3);
  Set_SimpleLight(L35);
  Set_AutoLight(L43);
 
 

  // inputs
  pinMode(22, INPUT);    // connector A - B3a
  pinMode(24, INPUT);    // connector A - B3c
  pinMode(26, INPUT);    // connector A - B3d
  pinMode(28, INPUT);    // connector A - B2c
  pinMode(30, INPUT);    // connector A - B2d
  pinMode(32, INPUT);    // connector A - B4a
  pinMode(34, INPUT);    // connector A - B4b
  pinMode(36, INPUT);    // connector A - B4c
  pinMode(23, INPUT);    // connector B - B4d
  pinMode(25, INPUT);    // connector B - B1a
  pinMode(27, INPUT);    // connector B - PL4
  pinMode(29, INPUT);    // connector B - PL5
  pinMode(31, INPUT);    // connector B - PIR trap
  pinMode(33, INPUT);    // connector B - PL2
  pinMode(35, INPUT);    // connector B - PL1
  pinMode(37, INPUT);    // connector B - PIR garage

  //outputs
  pinMode(38, OUTPUT);    // connector C    L8 
  pinMode(40, OUTPUT);    // connector C    KL4    
  pinMode(42, OUTPUT);    // connector C    KL5    
  pinMode(44, OUTPUT);    // connector C    KL3
  pinMode(46, OUTPUT);    // connector C    KL2
  pinMode(48, OUTPUT);    // connector C    KL1   
  pinMode(50, OUTPUT);    // connector C   
  pinMode(52, OUTPUT);    // connector C   
  pinMode(39, OUTPUT);    // connector D    L35   
  pinMode(41, OUTPUT);    // connector D    L6+L44
  pinMode(43, OUTPUT);    // connector D    L7 (24V)- SAMEN MET KL3 (230Vac)
  pinMode(45, OUTPUT);    // connector D    L30
  pinMode(47, OUTPUT);    // connector D    L43
  pinMode(49, OUTPUT);    // connector D   
  pinMode(51, OUTPUT);    // connector D   
     
// set all output off after reset arduino
DigOut(39, Souliss_T1n_Coil, L35);
      DigOut(40, Souliss_T1n_Coil, KL4);
      DigOut(42, Souliss_T1n_Coil, KL5);
      DigOut(46, Souliss_T1n_Coil, KL2);
      DigOut(48, Souliss_T1n_Coil, KL1);
      DigOut(41, Souliss_T1n_Coil, L6);
      DigOut(38, Souliss_T1n_Coil, L8);
      DigOut(45, Souliss_T1n_Coil, L30);                   
      DigOut(47, Souliss_T1n_Coil, L43);
}

void loop()
{

  EXECUTEFAST() {                       
    UPDATEFAST();   

    FAST_100ms() {    // We process the logic and relevant input and output every 100 milliseconds
      //read the inputs
      DigIn(22, Souliss_T1n_ToggleCmd, L35);
      //DigIn(24, Souliss_T1n_ToggleCmd,     );
      //DigIn(26, Souliss_T1n_ToggleCmd,   );
      //DigIn(28, Souliss_T1n_ToggleCmd,   );
      //DigIn(30, Souliss_T1n_ToggleCmd,   );
      DigIn(32, Souliss_T1n_ToggleCmd, L6);
      DigIn(34, Souliss_T1n_ToggleCmd, L30);
      //DigIn(36, Souliss_T1n_ToggleCmd,  );
      //DigIn(23, Souliss_T1n_ToggleCmd,   );
      DigIn(25, Souliss_T1n_ToggleCmd, L8);
      DigIn(27, Souliss_T1n_ToggleCmd, KL4);   
      DigIn(29, Souliss_T1n_ToggleCmd, KL5);
      //DigIn(31, LIGHT_ON_CYCLE, KL3);
      DigIn(33, Souliss_T1n_ToggleCmd, KL2);
      DigIn(35, Souliss_T1n_ToggleCmd, KL1);       
      DigIn(37, LIGHT_ON_CYCLE, L43);
      PR= digitalRead (31);
     
      // Execute the logic
          Logic_SimpleLight(L8);
          Logic_SimpleLight(KL4);
        Logic_SimpleLight(KL5);
       
        Logic_SimpleLight(KL2);
        Logic_SimpleLight(KL1);
       
        Logic_SimpleLight(L35);
        Logic_SimpleLight(L6); //+L44
       
        Logic_SimpleLight(L30);
        Logic_AutoLight(L43);
     
    
         
      // set the outputs                           
      DigOut(39, Souliss_T1n_Coil, L35);
      DigOut(40, Souliss_T1n_Coil, KL4);
      DigOut(42, Souliss_T1n_Coil, KL5);
      DigOut(46, Souliss_T1n_Coil, KL2);
      DigOut(48, Souliss_T1n_Coil, KL1);
      DigOut(41, Souliss_T1n_Coil, L6);
      DigOut(38, Souliss_T1n_Coil, L8);
      DigOut(45, Souliss_T1n_Coil, L30);                   
      DigOut(47, Souliss_T1n_Coil, L43);
     
      // this handles light of the cellar stairs
     // inlezen statussen lichtpunten kelder
      TR = memory_map[OUT+0];
      BG = memory_map[OUT+1];
      WK = memory_map[OUT+2];
      AR = memory_map[OUT+3];
     
           
      if (TR==1 || BG==1 ||WK ==1|| AR==1 ||PR==1)
          { ST=1;
          memory_map[IN+4] = 1;
          digitalWrite(44, HIGH);
          digitalWrite(43, HIGH);
           Serial.println("licht aan");
        // Logic_AutoLight(KL3);
          // DigOut(44,Souliss_T1n_Coil, KL3);
        }
      if ((TR==0 && BG==0 && WK ==0 && AR==0 &&ST==1)||PR==1)
          {
          // memory_map[IN+4] = 1;
          //digitalWrite(44, HIGH);
          gtime=millis();
          ST=0;
          Serial.println("timer loopt");
      }
     
      if (TR==0 && BG==0 && WK ==0 && AR==0 &&ST==0 && millis()-gtime>60000)
          {
           memory_map[IN+4] = 0;
          digitalWrite(44, LOW);
          digitalWrite(43, HIGH);
          ST=0;
          Serial.println("licht uit");
      }
     
       // Process data communication
        FAST_GatewayComms();
     
     
    EXECUTESLOW()   {  
        UPDATESLOW();

        SLOW_10s()  {         
       
            // The timer handle timed-on states
            Timer_AutoLight(L43);
        
                                
        }    
    }
  }
  }
  }
   
     
     

Op donderdag 28 mei 2015 09:20:18 UTC+2 schreef Dario Di Maio:

guyc

unread,
May 28, 2015, 5:05:48 PM5/28/15
to sou...@googlegroups.com


Today I made an update of the sketch of node0,
On the app I can see now also the other nodes. (Still empty because they are not connected yet)
Hope it's looks better now


Souliss_node0_gateway.ino

Di Maio, Dario

unread,
May 28, 2015, 5:17:37 PM5/28/15
to sou...@googlegroups.com
You can delete these:

#define GATEWAYTYPE_INSKETCH
#define QC_GATEWAYTYPE 0x01
#define BOARDTYPE INSKETCH
#define QC_BOARDTYPE 0x04
#define QC_BOARDTYPE 0x43

Still you have one big FAST with all code inside, the best is have more than one with different timings.

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.
To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
May 28, 2015, 6:03:08 PM5/28/15
to sou...@googlegroups.com

Dario, Thanks
Gone delete these lines you mentioned.
I also think there must be something wrong in my sketch to, because I didn't define somewhere that node0 has also to work as USART bridge or is this automatically adress 0xCE00 ?

What is the prefered amount of typicals for one fast loop ?
Can these fast loops on teh same speed or does I choose another speed for each loop ?
guy

Di Maio, Dario

unread,
May 28, 2015, 6:05:04 PM5/28/15
to sou...@googlegroups.com
You have to insert the usart configuration file
https://github.com/souliss/souliss/wiki/Framework%20Configuration

Then assign an address for the RS485 on the Gateway
https://github.com/souliss/souliss/wiki/Addressing

Dario.

guyc

unread,
May 30, 2015, 6:28:17 PM5/30/15
to sou...@googlegroups.com

I removed the old lines form the previous Souliss version and added
#include 'conf/usart.h".

For the gateway I defined an adress I think or is this not enough ?


#define myvNet_address        0x0011             // 0x0011 is equal to 17 in decimal
#define myvNet_subnet        0xFF00
#define myvNet_supern        0x0000

Do I have to define a second adress for the gateway so that the node can communicate with the other node over RS485 ?
The adress of the other nodes are defined as 0xCE01,0xCE02, 0xCE03  and 0xCE04

Op vrijdag 29 mei 2015 00:05:04 UTC+2 schreef Dario Di Maio:

Di Maio, Dario

unread,
May 31, 2015, 3:17:57 AM5/31/15
to sou...@googlegroups.com

The 0xCE01 is for the gateway, the other nodes can keep progressive ones.

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.
To post to this group, send email to sou...@googlegroups.com.

Lesjaw Ardi™ ♂

unread,
May 31, 2015, 10:23:45 AM5/31/15
to sou...@googlegroups.com

Dario..

If i have 2 super node..

One is using 0xCE01 for usart and 0xCE02 for arduino

So the other supernode address suppose to?

I try : 0xCE03 for usart and 0xCE04 for arduino...
But it seem conflict when both supernode online... If I turn off one of them is ok..

Di Maio, Dario

unread,
May 31, 2015, 11:31:33 AM5/31/15
to sou...@googlegroups.com

You shuld use 0xCF01/02.

Dario.

From Mobile.

guyc

unread,
Jun 2, 2015, 6:14:06 PM6/2/15
to sou...@googlegroups.com


Meanwhile I have my  first node (node 0) in service  and  the system is running fine for 3 days now. Thanks to everyone  for the support I received.
I will publish the sketch at the moment the second node is in service, so that I'm sure that the RS485 communication is working.

Now I'm preparing the sketch for the second node. This will contain ON/OFF lights, curtains and dimmable led's (single color)
The ON/OFF and the curtains is no problem, I made already some tests.
With the dimmable led lights I have some questions :

-  with a short push on the pushbutton I will switch ON/OFF the light.
-  when I hold the pushbutton IN for a longer time (1 or 2 seconds) after the light is ON, the brightness has to go down.
I think it should be possible with the DigInHold instruction, but I don't know how to use this function, specially in combination with the toggle function.


Di Maio, Dario

unread,
Jun 3, 2015, 9:48:51 AM6/3/15
to sou...@googlegroups.com
You can try this

uint8_t invalue = Souliss_DigInHold(pin,1, 2, 0, 0)

if(invalue = 1)
{
// Short press
mInput(slot) = Toggle value;
}
else if(invalue = 2)
{
// Long press
mInput(slot) = BrightDown value;
}

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.
To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
Jun 3, 2015, 5:43:24 PM6/3/15
to sou...@googlegroups.com
Dario,
I did the test today but I received error massages :
'Toggle'  and 'Brightdown' are not declared in this sketch.

guy

Op woensdag 3 juni 2015 15:48:51 UTC+2 schreef Dario Di Maio:

Gabriele Ribichini

unread,
Jun 3, 2015, 6:10:05 PM6/3/15
to sou...@googlegroups.com
Souliss_T1n_ToggleCmd
Souliss_T1n_BrightDown

You can find them all here:
https://github.com/souliss/souliss/blob/friariello/Typicals.h

ciao
gab

Di Maio, Dario

unread,
Jun 4, 2015, 1:33:42 AM6/4/15
to sou...@googlegroups.com

This is a sample code, you have to change it with proper values as listed in Typicals.h

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.
To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
Jun 4, 2015, 2:21:07 PM6/4/15
to sou...@googlegroups.com


Did a lot of tests today with no sucess.

I also tried to understand the example followme n1 which looks a little bit similar.

 The last code I tried :

uint8_t invalue = Souliss_DigInHold(28,1, 2, 0, 0);


 if(invalue = 1)
        {
        // Short press
        mInput(28) = (Souliss_T1n_ToggleCmd,L1) ;

     
        }
        else if(invalue = 2)
        {
        // Long press
        mInput(28) = (Souliss_T1n_BrightDown,L1) ;
     

       }

        Logic_DimmableLight(L1);
        analogWrite(13, mOutput(L1));

Di Maio, Dario

unread,
Jun 4, 2015, 2:26:47 PM6/4/15
to sou...@googlegroups.com

mInput(28) = Souliss_T1n_ToggleCmd ;

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.
To post to this group, send email to sou...@googlegroups.com.

Di Maio, Dario

unread,
Jun 4, 2015, 2:26:48 PM6/4/15
to sou...@googlegroups.com

mInput(28) = Souliss_T1n_ToggleCmd ;

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.
To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
Jun 4, 2015, 4:10:12 PM6/4/15
to sou...@googlegroups.com

Dario,
That's one of the test I did, but doesn't work for some reason

// Configure the framework

#include "bconf/StandardArduino.h"          // Use a standard Arduino
#include "conf/ethW5100.h"                  // Ethernet through Wiznet W5100
#include "conf/Gateway.h"                   // The main node is the Gateway
#include "conf/Webhook.h"                   // Enable DHCP and DNS
#include "conf/usart.h"                     // RS485

#include "Souliss.h"
#include <SPI.h>
#include "Typicals.h"



// Define the network configuration
//
// In the QuickCfg.h file set DEFAULT_BASEIPADDRESS[] = {192,168,1,0}
//#define myvNet_address        0x0011             // 0x0011 is equal to 17 in decimal
#define myvNet_subnet        0xFF00
#define myvNet_supern        Gateway_RS485_address
#define Gateway_RS485_address   0xCE01
#define PEERNODE1 0xCE02
#define PEERNODE2 0xCE03
#define PEERNODE3 0xCE04
#define PEERNODE4 0xCE05

#define USARTDRIVER_INSKETCH
#define USARTDRIVER Serial1


// define the number of the slots
#define L14                    0  //keuken meubel
#define L4                1  //kolom terras     

#define L25                3  //5 x eettafel living

#define RG1                  9  //rolgordijn keuken tuin

#define L2                             19  // tafel keukenblok


#define ONTIME                  15          // Light is on for ONTIME number of cycles



#define LIGHT_ON_CYCLE        31 // light stairs ON during 10 cycles if triggered by PIR or lights cellar all OFF       

void setup()
  // put your setup code here, to run once:
{
  Initialize();

    // Setup the network configuration 
  Souliss_SetAddress(PEERNODE1, myvNet_subnet, myvNet_supern);
 
Serial.begin(9600);

 
  // Define the logic
   Set_Windows(RG1);
    Set_DimmableLight(L2); 
 
   pinMode(22, INPUT);    // connector M2-1 - B5b - klem 16o - L2
  pinMode(36, INPUT);    // connector M2-1 - B7a - klem 20b - RG1 up
  pinMode(23, INPUT);    // connector M2-2 - B7b - klem 21b - RG1 down
 
 
   pinMode(39, OUTPUT);    //     RG1up
  pinMode(41, OUTPUT);    //     RG1down
  pinMode(12, OUTPUT);    // L2 (tafel keuken)   
 
}


void loop() {
  // put your main code here, to run repeatedly:
 EXECUTEFAST() {
    UPDATEFAST();
      FAST_70ms() {    // We process the logic and relevant input and output every 110 milliseconds
     
      //test Dario:
        uint8_t invalue = Souliss_DigInHold(22,1,2,0,0);

           if(invalue = 1)
        {
        // Short press
        mInput(22) = Souliss_T1n_ToggleCmd ;

                     }
        else if(invalue = 2)
        {
        // Long press
        mInput(22) = Souliss_T1n_BrightDown ;
               }
        // Execute the logic
       Logic_DimmableLight(L2);
            
       // set the outputs
       analogWrite(12, mOutput(L2));
              }
      
 FAST_510ms() {
                    // Use OPEN and CLOSE Commands
            DigIn(36, Souliss_T2n_OpenCmd_Local, RG1);
            DigIn(23, Souliss_T2n_CloseCmd_Local, RG1);          
            //run the logic
         Logic_Windows(RG1);
                 
         // Control the output relays, the stop is with both the relays not active.
            // If you need to active the relays on stop, use nDigOut instead.
            DigOut(39, Souliss_T2n_Coil_Open, RG1);   
            DigOut(41, Souliss_T2n_Coil_Close, RG1);
           
        }
  FAST_x10ms(50) {                
            Timer_T22(RG1);
            }
}
}

Di Maio, Dario

unread,
Jun 4, 2015, 4:19:13 PM6/4/15
to sou...@googlegroups.com

In mInput(slot) you should use the slot and not the pin.

Dario.

From Mobile.

guyc

unread,
Jun 4, 2015, 6:15:23 PM6/4/15
to sou...@googlegroups.com
I changed the pin number by the slot number 19), but doesn't work. Also tested by changing the pin with the slot name (L2)
 
 uint8_t invalue = Souliss_DigInHold(22,1,2,0,0);

       
           if(invalue = 1)
        {
        // Short press
        mInput(19) = Souliss_T1n_ToggleCmd ;

                     }
        else if(invalue = 2)
        {
        // Long press
        mInput(19) = Souliss_T1n_BrightDown ;

Di Maio, Dario

unread,
Jun 4, 2015, 6:30:31 PM6/4/15
to sou...@googlegroups.com

The equal is == in c/c++, add also some Serial.print to understand if you enter the if.

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.
To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
Jun 5, 2015, 2:57:14 AM6/5/15
to sou...@googlegroups.com

Dario,
I added some serial prints to monitor what's happens.
The digInhold seems to work.The parameter invalueL2 becomes 1 or 2 depending if it was a short or long pulse, but falls immediately back to 0.
 So I always write "0" to the output.

 FAST_70ms() {    // We process the logic and relevant input and output every 70 milliseconds
     
      //test Dario:
        uint8_t invalueL2 = Souliss_DigInHold(22,1,2,0,0);
        //invalue
        Serial.print(invalueL2);
           if(invalueL2 == 1)

        {
        // Short press
        mInput(19) = Souliss_T1n_ToggleCmd ;
        Serial.println("aan/uit");
        Logic_DimmableLight(L2);
        analogWrite(12, mOutput(L2));
        Serial.println(mOutput(L2));
                     }
        else if(invalueL2 == 2)

        {
        // Long press
        mInput(19) = Souliss_T1n_BrightDown ;
        Serial.println("dimmen");
        Logic_DimmableLight(L2);
        analogWrite(12, mOutput(L2));
        Serial.println(mOutput(L2));
               }
        // Execute the logic
       //Logic_DimmableLight(L2);
            
       // set the outputs
       //analogWrite(12, mOutput(L2));
              }

Di Maio, Dario

unread,
Jun 5, 2015, 3:07:02 AM6/5/15
to sou...@googlegroups.com
If you see the Serial.print into the if() statements, then is working fine. Is L2 = 19?

I'm expecting to see mInput(L2) = ...

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.
To post to this group, send email to sou...@googlegroups.com.

guy caluwaerts

unread,
Jun 5, 2015, 4:49:10 AM6/5/15
to sou...@googlegroups.com
Dario,

L2 is slot 19.
I did the test with both : mInput(19) and mInput(L2)

On the serial monitor I see always 0. When I give a short puls, I receive one 1,
he goes to the if-function because I receive on the serial monitor "aan/uit", but then the  invalueL2 is O again.
00000000000001aan/uit
00000000000000000000000000000000000000000


The same with a long puls. :
00000000000000000000000000000000000000000002dimmen
00000000000000000000000000000000000000000

guy


From: "Di Maio, Dario" <dario....@souliss.net>
To: "sou...@googlegroups.com" <sou...@googlegroups.com>
Sent: Friday, June 5, 2015 9:07 AM
Subject: Re: [souliss] Re: New house controlled by Souliss

You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/h0cw_YMFVCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.

To post to this group, send email to sou...@googlegroups.com.

Di Maio, Dario

unread,
Jun 5, 2015, 4:59:36 AM6/5/15
to sou...@googlegroups.com
The if() statement is working, it prints that you are into the if() and so you are applying the input value to that logic.

Doesn't work?

Dario.

guy caluwaerts

unread,
Jun 5, 2015, 5:07:26 AM6/5/15
to sou...@googlegroups.com
Dario,

I think the problem must be that the status of slot 19 is going back to zero immediately, so that the instruction analogewrite, sends always 0 to the output.
That what I see on the monitor :
00000000000001aan/uit
00000000000000000000000000000000000000000


The same with a long puls. :
00000000000000000000000000000000000000000002dimmen
00000000000000000000000000000000000000000

I think it has to be :
00000000000001aan/uit
1111111111111111111111111111111111111111


The same with a long puls. :
00000000000000000000000000000000000000000002dimmen
254 (and going down to 0 if the keep the button pushed.)
guy


Sent: Friday, June 5, 2015 10:59 AM

Di Maio, Dario

unread,
Jun 5, 2015, 5:11:33 AM6/5/15
to sou...@googlegroups.com
You are not using properly the T19, move to a T11 and let me know.


Dario.

guyc

unread,
Jun 5, 2015, 10:54:49 AM6/5/15
to sou...@googlegroups.com


replaced T19 with T11.
The ON/OFF is working but the dimming. Think its normal because of the DigOut.

How many slot are used by T19 ?

Di Maio, Dario

unread,
Jun 5, 2015, 10:56:42 AM6/5/15
to sou...@googlegroups.com
The T19 use two slots, details are in the T1n.cpp file in the comments before the T19 logic.

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.
To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
Jun 5, 2015, 6:39:06 PM6/5/15
to sou...@googlegroups.com
today I started all over again, after trying to understand something of the typicals

description of T19 :

If using a monostable wall switch (press and spring return),
            each press will toggle the output status.       
                #define Souliss_T1n_ToggleCmd        0x01
                #define Souliss_T1n_BrightUp        0x10
                #define Souliss_T1n_BrightDown        0x20

          
with my sketch below, the led is going on&off with a single pulse ( Logic_SimpleLight(L2))

With the long pulse, there is no reaction of the led

definition :
    #define L2                             19 
    pinMode(22, INPUT);
    pinMode(12, OUTPUT);    // L2


setup :
   Set_DimmableLight(L2);

loop :
       uint8_t invalue = Souliss_DigInHold(22,1,2,0,0);
               
       
       if(invalue == 1)
          {
            Serial.print("invalue : ");
                Serial.print(invalue);

          // Short press
          mInput(L2)=Souliss_T1n_ToggleCmd;
      
        Serial.print("  mInput : ");
        Serial.print(mInput(L2));

        Logic_SimpleLight(L2);
        DigOut(12,Souliss_T1n_Coil,L2 );
        //analogWrite(12, mOutput(L2));

        Serial.print("   mOutput : ");
        Serial.println(mOutput(L2));
                     }
        else if(invalue == 2)
        {
          Serial.print("invalue : ");
                Serial.print(invalue);

        // Long press
        mInput(L2) = Souliss_T1n_BrightDown ;

        Serial.print("  mInput : ");
        Serial.print(mInput(L2));

        Logic_DimmableLight(L2);
        analogWrite(12, mOutput(L2));

        Serial.print("   mOutput : ");
        Serial.println(mOutput(L2));
       
               }


the results in the serial monitor :
invalue : 1  mInput : 1   mOutput : 1
invalue : 1  mInput : 1   mOutput : 0
invalue : 1  mInput : 1   mOutput : 1
invalue : 2  mInput : 32   mOutput : 1
invalue : 2  mInput : 32   mOutput : 1
invalue : 2  mInput : 32   mOutput : 1
invalue : 1  mInput : 1   mOutput : 0
invalue : 2  mInput : 32   mOutput : 0
invalue : 2  mInput : 32   mOutput : 0


for the short pulse , the mInput(slot) stays always ON, but the output toggles

for the longpulse, the mInput stays on 32 and reaction on the output

I replaced 'brightDown" by "brightUp" and then the result is :
invalue : 2  mInput : 16   mOutput : 0

When I change the logic for the short pulse to the normal situation :
        mInput(L2)=Souliss_T1n_ToggleCmd;
        Logic_DimmableLight(L2);
        analogWrite(12, mOutput(L2));

  I see no reaction on the mInput and mOutput after a short pulse
invalue : 1  mInput : 1   mOutput : 0
invalue : 1  mInput : 1   mOutput : 0
invalue : 1  mInput : 1   mOutput : 0




Di Maio, Dario

unread,
Jun 6, 2015, 5:59:43 AM6/6/15
to sou...@googlegroups.com
Hi,

you cannot have two different typicals (Simple Light and Dimmable Light) on the same slot. Set the Dimmable Light only as typical and process it out of the if().

Use SoulissApp to ensure that the Dimmable Light is working properly, then try with your own inputs. Consider that you should power it on before dim it.

Regards,
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.
To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
Jun 6, 2015, 6:20:40 PM6/6/15
to sou...@googlegroups.com

Dario,
Maybe I was not clear in my previous post. The second test was only with the typical 19. 
When I toggle the  push button, the mInput stays always '1'   and the the output stays 'O'.
When  gave a long pulse, the mInput gives  '32' and the mOutput stays '1'.

Tomorrow I gone do a test with a small sketch with the T19 contralled by the app and not with a pushbutton because it seems that T19 is not working with pushbutton control
guy



When I change the logic for the short pulse to the normal situation :
        mInput(L2)=Souliss_T1n_ToggleCmd;
        Logic_DimmableLight(L2);
        analogWrite(12, mOutput(L2));

  I see no reaction on the mInput and mOutput after a short pulse
invalue : 1  mInput : 1   mOutput : 0
invalue : 1  mInput : 1   mOutput : 0
invalue : 1  mInput : 1   mOutput : 0



invalue : 2  mInput : 32   mOutput : 1
invalue : 2  mInput : 32   mOutput : 1
invalue : 2  mInput : 32   mOutput : 1

--

guyc

unread,
Jul 10, 2015, 5:46:56 PM7/10/15
to sou...@googlegroups.com

The house in in service now, but the domotic system is still very basic. All the 5 nodes are installed and working  standalone for the moment. Connection with the app and the bridges is for a next step.

I have one big problem. Node 1 refuses to work and is doing crazy things. Although the typicals that are used are identical as on the other nodes and the sketches are build on the same way.

I'm using arduino IDE : 1.6.5, Souliss 7.0 -5
I also made some modifications in  :
       modification in vNetCfg.h :
             - line 38 :# define VNET_MAX_PAYLOAD   66 (original 46)
 
             - modification in MaCacoCfg.h :
             -  lines 261 & 262 :
                                  #  define MaCaco_NODES     10
                                  # define MaCaco_SLOT      41

Specially T22 is doing very strange. When I give an UP puls, the curtain doesn't react, and sometime a few minutes later the curtain is going up from itself.
also when I give a UP-puls, the relay DOWN is activated sometimes

I changed already the arduinos and I made a test rack to check if the problem was not in the hardware, but also in the test rack, it doesn't work.

Please find the sketches from node 1 and node 3 and 4. As said node 3 and 4 are nearly identical as node 1.
I  did already a lot of test.
 - slowing down the fast loops,
- removing all the typicals except the T22,
- switching the hardware ,
......
Can someone have a look at  the sketch from node 1 for me because I don't see it anymore
Souliss_node1_peer1.ino
Souliss_node3_peer3.ino

Di Maio, Dario

unread,
Jul 12, 2015, 4:29:11 AM7/12/15
to sou...@googlegroups.com

Probably using the analog pins as digital one get more easily noise, and your device act in a strage way for that reason.

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.
To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
Jul 25, 2015, 12:59:22 PM7/25/15
to souliss, dario....@souliss.net
Dario,

I installed the version 7.0 friariello.3 again and everything is working.

Is there something change in the latest version Friariello 5 maybe ?

guy

Op zondag 12 juli 2015 10:29:11 UTC+2 schreef Dario Di Maio:

Di Maio, Dario

unread,
Jul 26, 2015, 5:49:02 AM7/26/15
to sou...@googlegroups.com

Strange...

From Mobile.

guyc

unread,
Aug 9, 2015, 3:14:23 PM8/9/15
to souliss

All the nodes are in service now and the systems is running for more than a month in basic version ( only controlled by the pushbuttons ).

The only problem I  detected for the moment is typical T22.

For some unknown reason the screens stops somewhile before the timer has achieved his timeout.

I can check this because when the timer is stopped, I can activate the screens with one push to go to the other direction. When a screen is stopped in a middle position, I have to push the button two times. ( first push to stop the screen and reset the timer, the second push to activate the screen again.

The problem is on all the screens, which are located on different nodes. (80 % of the time its going fine  and 20 % of the time one of the screens stops in a middle position.

PS : I promised to publish the whole system. I will do this as soon as the RS485 bus is installed,  the cabinets are cleaned up and the drawing are finished


Di Maio, Dario

unread,
Aug 9, 2015, 9:08:03 PM8/9/15
to sou...@googlegroups.com

What if you increase your timeouts?

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.
To post to this group, send email to sou...@googlegroups.com.
Message has been deleted
Message has been deleted

guyc

unread,
Aug 9, 2015, 11:00:22 PM8/9/15
to souliss


In the beginning I had  the parameters :
 -  SLOW_10s() 
 - #define   Souliss_T2n_Timer_Val 0xA3
 - #define   Souliss_T2n_Timer_Off 0xA0
 
I increase Timer Val to 0xA5, but it's the same result.
I think nothing is wrong with the timer because in 80 % the screens are working correct.

Please find one of the sketches.
Souliss_node1_peer1.ino

Di Maio, Dario

unread,
Aug 10, 2015, 3:44:29 AM8/10/15
to sou...@googlegroups.com

How much time your curtains need to open or close?

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.
To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
Aug 11, 2015, 6:19:46 PM8/11/15
to souliss
Dario,

The time the curtains need is 25 seconds to open or close completely.


Op maandag 10 augustus 2015 09:44:29 UTC+2 schreef Dario Di Maio:

Di Maio, Dario

unread,
Aug 11, 2015, 6:23:15 PM8/11/15
to sou...@googlegroups.com
So your timer is too close, because is approximately 30 seconds. 

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.
To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
Aug 12, 2015, 1:11:12 AM8/12/15
to souliss


Dario,
I don't thinks so because the timer is on 50 seconds.
I'm nearly  sure the stop signal is not coming from the timer because when the curtain stops somewhere in the middle, I have to push two times the button before the curtain start running again. (first push : stop timer) second push : active UP or DOWN.
It looks  there are some spikes generated in the wiring or in a push button, but all ( 8) curtains have the same behavior, including my test rack. For that reason I start thinking that the spike is generated by the software for some reason.

As a test,  I increased the time of the fast loops of one of the nodes. Let's see within a few days


Di Maio, Dario

unread,
Aug 12, 2015, 1:27:40 AM8/12/15
to sou...@googlegroups.com

If you have spikes you can try adding a filtering for DigIn functions, you should use the extended Souliss_DigIn and set true as last parameter.
https://github.com/souliss/souliss/blob/friariello/base/LocalIO.cpp#L106

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.
To post to this group, send email to sou...@googlegroups.com.

Andreas Karl

unread,
Aug 26, 2015, 5:51:12 AM8/26/15
to souliss
Hello guyc!
nice reading - exactly what I was looking for, but the part I really need is missing.
You are feeding the switches with 24V, but how to you get the signal back in Arduino input? Is every switch a extra cable or how do you handle it?
Regards 
Andy

On Sunday, May 17, 2015 at 1:28:20 AM UTC+2, guyc wrote:
I'm building a complete domotic system based on Souliss.

Starting points :
 - All the lights (LED's) has to  work on low voltage 24 Vdc, except for some TL-tubes in the cellar and the garage.
 - Only based on arduino, no addittional servers.
 - Controlled by smartphone and in future by Iphone and Ipad.
Last year I made some small tests with Souliss before I started my project.

Meanwhile the house in build and all the cabling (2,5 mm2) is finished. All the cables for the lights and the pushbuttom are centralized into 2 cabinets. One on the ground floor and  one the first level.
The cabinets are installed and now I'm finishing the internal wiring of the cabinets and the input and output boards. (+/- 80 inputs and 80 outputs)
The whole installaton will run on 5 arduino mega's. All connected by RS485, with one also connected to an ethernet board as gateway.

The leddrivers ( I ordered them in China )  will be installed into the lights, except for the dimmable lights. These drivers will be installed in the cabinets.
For the leds I'm using 7W COB leds, because they have a forward voltage of 22-24 Vdc and also some ledstrips 24Vdc.
All the cabling is done in 2,5 mm2.

Now that the hardware is nearly finished, I have to start with the hard stuff, the software and I'm not a software specialist.

As a test I've already made a small part of the software of node0 and I hope I follow a little bit the rules of Souliss.
I'm afraid in the near future I will need some help of the specialists here.

If somebody should be interested, all my documentation ( system overview, drawings of the I/O boards and my excel-sheets for the installation are available.)

guy caluwaerts

unread,
Aug 26, 2015, 7:51:06 AM8/26/15
to sou...@googlegroups.com
Andy,

I worked with cable trees. 
To the first switch of each room I have a 10 pair cable. From that switch to the next switches I reduced the amount of pairs. (At the end I used UTP cables.

The inputs are optical insulated. If you want, I can send you the electronic drawing of the input modules. But indeed I use 24 V for the pushbutton (with a resistor of 2K2)

Guy


From: Andreas Karl <andreas...@gmail.com>
To: souliss <sou...@googlegroups.com>
Sent: Wednesday, August 26, 2015 11:51 AM
Subject: [souliss] Re: New house controlled by Souliss

--
You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/h0cw_YMFVCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.

To post to this group, send email to sou...@googlegroups.com.

Andreas Karl

unread,
Aug 26, 2015, 8:56:17 AM8/26/15
to souliss, guycal...@yahoo.com
That would be nice! Thanks

guyc

unread,
Aug 27, 2015, 6:20:00 PM8/27/15
to souliss


I increased the timer value and it seems to work now.



guyc

unread,
Aug 27, 2015, 6:23:11 PM8/27/15
to souliss

as promised the drawing of the optocoupler input ( on the left of the picture)

schema input dimmer.jpg

Andreas Karl

unread,
Aug 28, 2015, 12:50:03 AM8/28/15
to souliss
thank you for the drawing
but honestly I don't get it...why is there a 24v and a 5v Input?

Andreas Karl

unread,
Aug 28, 2015, 5:14:31 AM8/28/15
to souliss
maybe you can also make some photos of your setup?

Electroguard

unread,
Aug 28, 2015, 5:36:42 AM8/28/15
to souliss
Think of it like the National Grid, which uses high voltage for reliable long distance transmission, then drops down to normal working voltage for the home.

The 5v is the Arduino supply and couldn't supply a house, but even if it could, the voltage drop on the cables going out and back from all the remote switches would result in much less voltage returned than the HIGH logic levels needed by the Arduino, so operation would at best be unreliable, and prone to false triggering from spark induced electrical noise etc swamping the switching signals.

It's much more manageable if you use higher switching voltages that are more immune to noise and voltage drop, and then when they reach the Arduino translate everything back to 5v logic levels using optocouplers.

guy caluwaerts

unread,
Aug 28, 2015, 9:02:22 AM8/28/15
to sou...@googlegroups.com
Andreas, the 24 V is the standaard voltage that I use in the house. The 5V is the voltage comming from the arduino.


From: Andreas Karl <andreas...@gmail.com>
To: souliss <sou...@googlegroups.com>
Sent: Friday, August 28, 2015 6:50 AM
Subject: Re: [souliss] Re: New house controlled by Souliss

--
You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/h0cw_YMFVCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
Aug 28, 2015, 4:35:51 PM8/28/15
to souliss, guycal...@yahoo.com
The answer of Electroguard is 100% correct.
This is also one of the reasons why all my lighting in the house is on 24 Vdc and not on 12Vdc.

All my modules are made on prototype board for the moment be cause I'm still looking for someone who can dessin a PCB board with Fritzing

Andreas Karl

unread,
Aug 31, 2015, 1:14:45 AM8/31/15
to souliss, guycal...@yahoo.com
Thanks for your explanation - I'm still new to reading schematics.
May I ask you for a photo of your prototype board?

Gabriele Ribichini

unread,
Aug 31, 2015, 1:49:51 AM8/31/15
to souliss
Ciao Guy,
I've never had issues with timer but I had issues with spikes and by pressing the wrong button, which is close to the light buttons.
I was often activating shutters instead of lights..

So that's what solved (both electrical spikes and human error):

#define WINDOW_DELAY 800
#define DigInWindowToggle(pin, slot) Souliss_DigInHold(pin, Souliss_T2n_StopCmd, Souliss_T2n_ToggleCmd, memory_map, slot, WINDOW_DELAY)

guyc

unread,
Jan 9, 2016, 6:17:41 PM1/9/16
to souliss
The system is in service now for 6 month ans is working for. (basic version)
Within the next months I have some time and I will use this time to optimise everything.

I installed a windspeed sensor for the sunscreens so that the screens go open  when there is a heavy wind.

Sequence :

'm reading theposition in the databank with (mOutput(sc1)== Souliss_T2n_Coil_Close),  this results in "1", so I think this instruction is

guyc

unread,
Jan 9, 2016, 6:49:12 PM1/9/16
to souliss

The system is in service now for 6 months and is very stable. Thanks for the designers.
Within the next time I will work further to optimize some things.

I installed a windspeed sensor now to protect the sunscreens when there is a lot of wind.
sequence :
- when the sun screens are open and a heavy wind comes up  > do nothing
- When the screens are down + heavy wind > screens OPEN
I try to read the position of the screens in the database, and if the screens are down, I need to write the instruction in the database to go UP.
I can't get it work.

Please find the loop I made :
// screens

    // heavy wind protection
      FAST_110ms() {
        //  screens down and heavy wind > screens UP.
       
          if ((mOutput(sc1)== Souliss_T2n_Coil_Close) && windSpeed >= 7)   // read position of the screen
             {
               Serial.print(mOutput(sc1));                               
               Serial.print("      storm    ");
              mInput(sc1) = Souliss_T2n_OpenCmd_SW;                               // write open status in database
               Serial.println(mOutput(sc1));
              Souliss_Logic_T22(memory_map, sc1, &data_changed, Souliss_T2n_Timer_Val); // execute
              DigOut(39, Souliss_T2n_Coil_Open, sc1);
             }
      }
     // conctrol screen by push buttons
      FAST_x10ms(20) {
                 

         // Use OPEN and CLOSE Commands
            DigIn(29, Souliss_T2n_OpenCmd_Local, sc1);
            DigIn(31, Souliss_T2n_CloseCmd_Local, sc1);
            DigIn(25, Souliss_T2n_OpenCmd_Local, sc2);
            DigIn(27, Souliss_T2n_CloseCmd_Local, sc2);
           
           
           
            //run the logic
            Souliss_Logic_T22(memory_map, sc1, &data_changed, Souliss_T2n_Timer_Val);
            Souliss_Logic_T22(memory_map, sc2, &data_changed, Souliss_T2n_Timer_Val);
        
        
        
         // Control the output relays, the stop is with both the relays not active.
            // If you need to active the relays on stop, use nDigOut instead.
            DigOut(39, Souliss_T2n_Coil_Open, sc1);   
            DigOut(41, Souliss_T2n_Coil_Close, sc1);
            DigOut(43, Souliss_T2n_Coil_Open, sc2);   
            DigOut(45, Souliss_T2n_Coil_Close, sc2);
          
        }

result : when the windspeed is higher than 7m/sec, and the screen is moving down,  after some  time delay (I think the time of the timer), the screen opens but when the screen is closed and both relays are not active nothing happens. It seems that I'm reading the wrong data in the database or that the position of the screen is not memorised in the database. ( the IF-instruction comes not active)

Can somebody say what's happening or  what mistake I make ?

Di Maio, Dario

unread,
Jan 10, 2016, 5:25:29 AM1/10/16
to sou...@googlegroups.com

You are matching only the "closing" case and not the "closed", that's why.

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.

To post to this group, send email to sou...@googlegroups.com.

guyc

unread,
Jan 10, 2016, 3:57:04 PM1/10/16
to souliss
Dario,
What do I have to change in my sketch to check the close position ?

Is it right that with :

mOutput(slot)  = reading the value from the memory map
mInput(slot) = writing new value to the memory map ?

guy

Op zondag 10 januari 2016 11:25:29 UTC+1 schreef Dario Di Maio:

Di Maio, Dario

unread,
Jan 10, 2016, 4:40:00 PM1/10/16
to sou...@googlegroups.com
Try this

 if (((mOutput(sc1)== Souliss_T2n_Coil_Close) || (mOutput(sc1)== Souliss_T2n_State_Close)) && (windSpeed >= 7))


guy caluwaerts

unread,
Jan 10, 2016, 5:12:51 PM1/10/16
to sou...@googlegroups.com
Tried the instruction but receive following feedback when compiling

'Souliss_T2n_State_Close' was not declared in this scope

guy


From: "Di Maio, Dario" <dario....@souliss.net>
To: "sou...@googlegroups.com" <sou...@googlegroups.com>
Sent: Sunday, January 10, 2016 10:39 PM

Subject: Re: [souliss] Re: New house controlled by Souliss
You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/h0cw_YMFVCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.

To post to this group, send email to sou...@googlegroups.com.
It is loading more messages.
0 new messages