RF question

66 views
Skip to first unread message

Giannis Melentis

unread,
Nov 20, 2016, 4:26:17 PM11/20/16
to souliss
HI everyone.
First of all i just wanted to say that you are doing great job here guys.
On my questions now.
I succsesfully managed to send a toggle on/off code through RF, but how can i manage my roller shutters with up\down?
I have two relays in each of my shutters, one for up one for down and i have to continuously press the button to my control  for them to go up or down.
How can i manage this with souliss?
Thx in advance.

Di Maio, Dario

unread,
Nov 21, 2016, 2:45:37 PM11/21/16
to sou...@googlegroups.com

There are examples dedicated to curtains,
https://github.com/souliss/souliss/tree/friariello/examples/wireless

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+unsubscribe@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/d4f7e395-273e-4be5-8fa3-0f212b7d0bab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Giannis Melentis

unread,
Nov 22, 2016, 4:48:15 PM11/22/16
to souliss
I can't make it work :(
I have two rf devices with 2 relays each, so i can control up and down on each device.
i manage to send the rf code but only for one node and only for one relay.
this is my file, any help appreciated

On Monday, 21 November 2016 21:45:37 UTC+2, Dario Di Maio wrote:

There are examples dedicated to curtains,
https://github.com/souliss/souliss/tree/friariello/examples/wireless

Dario.

From Mobile.

On 20 Nov 2016 22:26, "Giannis Melentis" <giannis....@gmail.com> wrote:
HI everyone.
First of all i just wanted to say that you are doing great job here guys.
On my questions now.
I succsesfully managed to send a toggle on/off code through RF, but how can i manage my roller shutters with up\down?
I have two relays in each of my shutters, one for up one for down and i have to continuously press the button to my control  for them to go up or down.
How can i manage this with souliss?
Thx in advance.

--
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.
souliss_gateway_v1_1.ino

Giannis Melentis

unread,
Nov 23, 2016, 2:52:16 AM11/23/16
to souliss
Good morning,
today another problem came up.
Although i can ping my souliss gateway from my pc, the app on my android can not connect to it (connection not available).
Any other with the same issue???
Thanks in advance.

Giannis Melentis

unread,
Nov 23, 2016, 6:58:47 AM11/23/16
to souliss
Ok i solved the connectivity problem with the app, but i still can not send my rf signals.

Domenico Carvetta

unread,
Nov 24, 2016, 2:26:41 PM11/24/16
to souliss
This code works fine with one rf device, but drives two differents codes respectevely ON and OFF.
I used the digital pin 10 to connect the RF TX 433Mhz.
Also, I added two lights with a typical T11.



// Configure the framework
#include "bconf/StandardArduino.h"          // Use a standard Arduino
#include "conf/nRF24L01.h"


// Include framework code and libraries
#include <SPI.h>
#include "Souliss.h"
#include <RCSwitch.h>
#include "extras/RGB_LedLamp.h" // Include the map for the IR codes
#include "extras/RGB_LedLamp.cpp"

// Define the network configuration according to your router settings
#define Gateway_address 0x6501              // The Gateway node has two address, one on the Ethernet side
                                           
// and the other on the wireless one
#define Peer3_address   0x6504
#define myvNet_subnet   0xFF00
#define myvNet_supern 0x0000              // è l'indirizzo del Gateway oppure se metti 0x0000 è tutto il network


#define WALL_SOCK1_NODE3 0
#define WALL_SOCK2_NODE3 1
#define LIGHT1_NODE3 2
#define LIGHT2_NODE3 3

RCSwitch mySwitch = RCSwitch();

#define RcDigOut(codeON, codeOFF, value, slot) Souliss_RcDigOut(codeON, codeOFF, value, memory_map, slot)

// Send an output command to the wall socket 1
void Souliss_RcDigOut(U32 codeON, U32 codeOFF, U8 value, U8 *memory_map, U8 slot)
{
       
// If output is active switch on the pin, else off
       
if(memory_map[MaCaco_OUT_s + slot] == value)
                 mySwitch
.send(codeON, 24);
       
else
                 mySwitch
.send(codeOFF, 24);
}


void setup()
{
 
// Setup the network configuration
 
Souliss_SetAddress(Peer3_address, myvNet_subnet, myvNet_supern);
 
       
Set_T11(WALL_SOCK1_NODE3);
       
Set_T11(WALL_SOCK2_NODE3);
       
Set_T11(LIGHT1_NODE3);
 
Set_T11(LIGHT2_NODE3);
 
 
// Define inputs, outputs pins
        pinMode
(10, OUTPUT);            // trasmettitore 433Mhz
        pinMode
(4, OUTPUT); // Output to control the LIGHT1 (relay)
        pinMode
(5, OUTPUT); // Output to control the LIGHT2 (relay)
 pinMode
(2, INPUT); // Pushbutton to power ON and the OFF the LIGHT1 (pulldown required)
        pinMode
(6, INPUT); // Pushbutton to power ON and the OFF the LIGHT2 (pulldown required)
       
       
// Transmitter is connected to Arduino Pin #10  
        mySwitch
.enableTransmit(10);

       
// Optional set pulse length.
        mySwitch
.setPulseLength(231);

       
//Serial.begin(9600); // for debug
}

void loop()
{  
   
// Here we start to play
    EXECUTEFAST
() {                    
        UPDATEFAST
();  

       
// Read every 510ms the input state and send it to the other board  
        FAST_510ms
() {

         
// Control the LIGHT1
 
DigIn(2, Souliss_T1n_ToggleCmd, LIGHT1_NODE3);
 
Logic_T11(LIGHT1_NODE3);
                       
DigOut(4, Souliss_T1n_Coil, LIGHT1_NODE3);

 
// Control the LIGHT2
                       
DigIn(6, Souliss_T1n_ToggleCmd, LIGHT2_NODE3);
 
Logic_T11(LIGHT2_NODE3);
                       
DigOut(5, Souliss_T1n_Coil, LIGHT2_NODE3);
           
 
// Control the Wall socket 1/2                      
                       
Logic_T11(WALL_SOCK1_NODE3);
                       
Logic_T11(WALL_SOCK2_NODE3);
                   
                       
if(data_changed) {
                               
RcDigOut(4128960, 4128768, Souliss_T1n_Coil, WALL_SOCK1_NODE3);    
                               
RcDigOut(983232, 983040, Souliss_T1n_Coil, WALL_SOCK2_NODE3);
                       
}
 
}
                         FAST_PeerComms
();      
                         
 
}

    EXECUTESLOW() {
        UPDATESLOW
();
       
        SLOW_10s
() {        // We handle the light timer with a 10 seconds base time
           
Timer_T11(LIGHT1_NODE3);
           
Timer_T11(LIGHT2_NODE3);
       
}      
 
{                
                       
RcDigOut(4128960, 4128768, Souliss_T1n_Coil, WALL_SOCK1_NODE3);    
                       
RcDigOut(983232, 983040, Souliss_T1n_Coil, WALL_SOCK2_NODE3);
 
}    
 
}
}


Giannis Melentis

unread,
Nov 25, 2016, 9:08:19 AM11/25/16
to souliss
Hi thx for the reply.
I managed to make it work with one rf device and two different codes, but i can not make it work with 2 rf devices and 4 different codes.
Any help appreciated

Domenico Carvetta

unread,
Nov 25, 2016, 9:34:39 AM11/25/16
to souliss
I never used 2 rf devices with 4 codes, but I guess should be very easy.
Pls start from my code and try to add things step by step.




Giannis Melentis

unread,
Nov 25, 2016, 10:13:40 AM11/25/16
to souliss
I have two sockets, one on slot0 and one on slot 1. Ihave setup 4 different rf codes 

RcDigOut(8390705, 8390706, Souliss_T1n_Coil, WALL_SOCK1_NODE3);    
RcDigOut(983232, 983040, Souliss_T1n_Coil, WALL_SOCK2_NODE3);

if  i press "on"  of slot 0 socket 1 poweron
if i press "off" of slot 0 socket 1 powers off 
now if  i press "on"  of slot 1 socket 1 powers on again and not socket 2, same for off

domenico carvetta

unread,
Nov 25, 2016, 10:25:27 AM11/25/16
to souliss

Pls post me the whole code.

Giannis Melentis

unread,
Nov 25, 2016, 10:46:58 AM11/25/16
to souliss
/**************************************************************************
    Souliss - Gateway
    
    For 10 nodes, network adressation 10.10.10.1.
    
    Node adress 10.10.10.102, 103 ....
    Gateway adress 10.10.1.101
    
    The maximum number of remote nodes from your gateway is by default 45
    
    Run this code on one of the following boards:
      - Arduino Ethernet (W5100) 
      - Arduino with Ethernet Shield (W5100)
      
    As option you can run the same code on the following, just changing the
    relevant configuration file at begin of the sketch
      - Arduino with W5200 Ethernet Shield
      - Arduino with W5500 Ethernet Shield
        
***************************************************************************/

// Configure the framework
#include "SoulissFramework.h"
#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, we have just one node


// Include framework code and libraries
#include <SPI.h>
#include "Souliss.h"
#include <RCSwitch.h>


//Manual IP adress
uint8_t ip_address[4]  = {192, 168, 1, 230};
uint8_t subnet_mask[4] = {255, 255, 255, 0};
uint8_t ip_gateway[4]  = {192, 168, 1, 1};  

#define Gateway_address 230 //This is your gateway IP adress
#define Peer_address    231 //This is your peer adress nr 1
//#define Peer_address    103 //This is your peer adress nr 2

#define myvNet_address  ip_address[3]       // The last byte of the IP address (101) is also the vNet address
#define myvNet_subnet   0xFF00
#define myvNet_supern   Gateway_address
#define pTYP                    MaCaco_P_TYP_s
#define pOUT                    MaCaco_P_OUT_s
#define pTypical(node231,slot)     memory_map[pTYP+slot+(node*MaCaco_NODES*MaCaco_SLOT)]
#define pOutput(node231,slot)      memory_map[pOUT+slot+(node*MaCaco_NODES*MaCaco_SLOT)]

#define WALL_SOCK1_NODE3 0
#define WALL_SOCK2_NODE3 1



RCSwitch mySwitch = RCSwitch();


#define RcDigOut(codeON, codeOFF, value, slot) Souliss_RcDigOut(codeON, codeOFF, value, memory_map, slot)

// Send an output command to the wall socket 1
void Souliss_RcDigOut(U32 codeON, U32 codeOFF, U8 value, U8 *memory_map, U8 slot)
{
        // If output is active switch on the pin, else off
        if(memory_map[MaCaco_OUT_s + slot] == value)
                 mySwitch.send(codeON, 24);
        else
                 mySwitch.send(codeOFF, 24);
}


void setup()
{   
    Initialize();

 // Set network parameters
    Souliss_SetIPAddress(ip_address, subnet_mask, ip_gateway); //Setup adress
    SetAsGateway(myvNet_address);                   // Set this node as gateway for SoulissApp  

     // This node as gateway will get data from the Peer
    SetAsPeerNode(231, 1); //define peer node nr 1
   
        Set_T11(WALL_SOCK1_NODE3);
        Set_T11(WALL_SOCK2_NODE3);
       
// Define inputs, outputs pins
        pinMode(7, OUTPUT);            // trasmettitore 433Mhz

        // Transmitter is connected to Arduino Pin #7  
        mySwitch.enableTransmit(7);

        // Optional set pulse length.
       //mySwitch.setPulseLength(231);

        //Serial.begin(9600); // for debug

}

void loop()
{   
    // Here we start to play
    EXECUTEFAST() {                     
        UPDATEFAST();
           
// Read every 510ms the input state and send it to the other board  
        FAST_510ms() {
          
          
          // Control the Wall socket 1/2                      
                       Logic_T11(WALL_SOCK1_NODE3);
                        Logic_T11(WALL_SOCK2_NODE3);

                    
                        if(data_changed) {
                                RcDigOut(8573265, 8573266, Souliss_T1n_Coil, WALL_SOCK1_NODE3);    
                                RcDigOut(983232, 983040, Souliss_T1n_Coil, WALL_SOCK2_NODE3);
                               
                              
                        }
 }
                           FAST_PeerComms();
 }

        // Here we handle here the communication with Android, commands and notification
        FAST_GatewayComms();
}    

Reply all
Reply to author
Forward
0 new messages