not work node + relay + push button

27 views
Skip to first unread message

Miguel Angel de Pablo

unread,
Aug 20, 2017, 10:08:54 PM8/20/17
to souliss
Hello I have this node that I can not make it work I put the code and a schematic of the connections, the relay stays on and ignores neither the app nor the button
https://04098312567864243441.googlegroups.com/attach/8bc101e9e22ad/nodo%20luces%20y%20pulsador.jpg?part=0.1&view=1&vt=ANaJVrGYR_oAJ8U_UAewzoWWsbQvVCBfzOwKUAni6lYjwm7nWL2Z1H4ox-0xMcJ2toZblwfoDH-WdtoRU2cjw11c6R6PcGb6zz1vZpD-K3CpHtV6okfLwHw
#include "SoulissFramework.h"

// Configure the framework
#include "bconf/MCU_ESP8266.h"              // Load the code directly on the ESP8266
#include "conf/IPBroadcast.h"

// **** Define the WiFi name and password ****
#define WIFICONF_INSKETCH
#define WiFi_SSID            
#define WiFi_Password      

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

//----------------------------------------------------
// 4. Slots
//----------------------------------------------------
#define LedSLOT         1
       
//----------------------------------------------------
// 5. Pines
//----------------------------------------------------
#define LedPIN     2

const int relay = 2;
const int BOTON = 0;
int val = 0; //val se emplea para almacenar el estado del boton
int state = 1; // 0 LED apagado, mientras que 1 encendido
int old_val = 0; // almacena el antiguo valor de val

void setup()
{  
 Initialize();
     
   // Connect to the WiFi network and get an address from DHCP
   GetIPAddress();
       
   SetAddress(0xAB04, 0xFF00, 0xAB01);
   
   Set_SimpleLight(LedSLOT);        
 
   pinMode(LedPIN, OUTPUT);  
    pinMode(BOTON,INPUT); // y BOTON como señal de entrada            
}
void loop()
{
    EXECUTEFAST() {                    
        UPDATEFAST();  
       
        FAST_50ms() {  
            DigIn(BOTON, Souliss_T1n_ToggleCmd, LedSLOT);
           Logic_SimpleLight(LedSLOT);                        
            DigOut(LedPIN, Souliss_T1n_Coil, LedSLOT);
           }    
        FAST_PeerComms();
        START_PeerJoin();
   }
   EXECUTESLOW() {
      UPDATESLOW();
      SLOW_PeerJoin();
   }  
}

Fulvio Spelta

unread,
Aug 22, 2017, 5:22:04 AM8/22/17
to souliss
What about using souliss app ? What are the typical's state from the app ? Does it change using app?
Check the output pin disconnected by the rele using a tester.
Reply all
Reply to author
Forward
0 new messages