Re: [souliss] Relés no responden al ejemplo de T_22

35 views
Skip to first unread message

Di Maio, Dario

unread,
May 7, 2016, 11:38:30 AM5/7/16
to sou...@googlegroups.com

Write to souliss-es for spanish support.

Dario.

From Mobile.

On 7 May 2016 17:17, "Adrián Sanz Rodrigo" <adriansa...@gmail.com> wrote:
Hola, he adaptado el ejemplo de "Peer_Curtain" para el uso con el esp como peer, la app responde correctamente al estado de los dos pushbuttons, pero a la hora de accionar la subida/bajada mediante la app activando/desactivando los relés, estos solo responden encendiendose o apagandose su led interno D3, pero no activando la subida o bajada(de momento lo tengo con dos luces antes de montarlo en la persiana, no vaya a ser que se joda el motor). Lo relés estan probados con un sketch simple de arduino y funcionan en modo no inverso correctamente. Aqui dejo el sketch, supongo que habrá que cambiar los digout:

[code]
#include "SoulissFramework.h"

#include "EEPROM.h"
#include <SPI.h>
#include "bconf/MCU_ESP8266.h"              // Load the code directly on the ESP8266
#include <ESP8266WiFi.h>
#include "conf/IPBroadcast.h"

// **** Define the WiFi name and password ****

#define WIFICONF_INSKETCH
#define WiFi_SSID               "ONOF88B"
#define WiFi_Password           "2212356108"  
  
// 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 Peer_address    0x6502
#define myvNet_subnet   0xFF00
#define myvNet_supern   Gateway_address

#include "Souliss.h"
//SLOTS
#define CURTAIN_NODE2           0 

//PINES
#define boton_subida 15
#define boton_bajada 13

#define rele_subida 2
#define rele_bajada 4

// **** Define here the right pin for your ESP module **** 


void setup() {

  Initialize();

GetIPAddress();

    // Setup the network configuration      
   SetAddress(0xAB02, 0xFF00, 0xAB01); // Direccion vNet, mascara  y gateway
      
// The logic that handles windows and curtains is T22, you can as alternative use Set_Windows()
 Set_T22(CURTAIN_NODE2);

    // Define inputs (hardware pulldown required) and outputs pins
    pinMode(boton_subida, INPUT);                              // Open Command from pushbutton
   pinMode(boton_bajada, INPUT);                              // Close Command from pushbutton
   pinMode(rele_subida, OUTPUT);                             // Open Relay
   pinMode(rele_bajada, OUTPUT);                            // Close Relay
START_PeerJoin();
}

void loop() {
  

  EXECUTEFAST() {                     
        UPDATEFAST();   

        // Process every 510ms the logic that control the curtain
        FAST_510ms() {

            // Use OPEN and CLOSE Commands
            DigIn(boton_subida, Souliss_T2n_OpenCmd_Local, CURTAIN_NODE2);
            DigIn(boton_bajada, Souliss_T2n_CloseCmd_Local, CURTAIN_NODE2);
            
           if(DigIn(boton_subida, Souliss_T2n_OpenCmd_Local, CURTAIN_NODE2))Serial.println("Open");
           if(DigIn(boton_bajada, Souliss_T2n_CloseCmd_Local, CURTAIN_NODE2))Serial.println("Close");
            
            // Run the logic
            Logic_T22(CURTAIN_NODE2);
            
            // 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(rele_subida, Souliss_T2n_Coil_Open, CURTAIN_NODE2);    
            DigOut(rele_bajada, Souliss_T2n_Coil_Close, CURTAIN_NODE2);   
                
        }  
        // Process the communication
        FAST_PeerComms();
        START_PeerJoin();
    
        // Define the hold time of the outputs, by default the timer hold the relays for 16 times, so:
        // 221x10x16ms that is about 35 seconds. Change the parameter inside FAST_x10ms() to change this time.
        FAST_x10ms(211) {                 
            Timer_T22(CURTAIN_NODE2);
        
    }
  }

}
[/code]

--
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/aa014213-600d-4cd6-930c-0e62a83c85bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages