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.
There are examples dedicated to curtains,
https://github.com/souliss/souliss/tree/friariello/examples/wirelessDario.
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.
// 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);
}
}
}
Pls post me the whole code.
/************************************************************************** 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 adressuint8_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 1void 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();}