Automation program

7 years 1 month ago - 7 years 1 month ago #3662 by essenemari
Replied by essenemari on topic Automation program
just let you know: same server version like in my case ( If you are using "ready to go" "ESP8266 WiFi relay switch then one difference, in compare with my configuaration, is that you are using nodemcu... maybe it does matter... Did you try re-install easyiot server? Just thinking out loud.

Please Log in or Create an account to join the conversation.

7 years 1 month ago - 7 years 1 month ago #3666 by
hi, i already tried 0.8 version, also 0.9v and now i have 0.9b installed. it is the same. after power failure or RPI restart i still need to reenable automation program. in 0.9b version i have to enter into edit program script and click on update button. after that automation program runs. :-( i dont know what i have to do.

here is my code. after trigger on/off in easyiot im sending command to esp8266 relay to on or off
const String ESP8266_IP_ADDRESS = "";

const String MODULE_ADDRESS = "N1S0"; 

public void Setup()


  EventHelper.ModuleChangedHandler((o, m, p) =>


    Console.WriteLine(m.Domain +" "+ m.Address + " in program id "+ Program.ProgramId.ToString()+ " property "+ p.Property + " value " + p.Value);

      if (m.Domain == "Virtual" && m.Address == MODULE_ADDRESS && p.Property == "Sensor.DigitalValue")


        return true;



public void Run()



private void sendCommand(string value)




private void sendToServer(String message)



  //Console.WriteLine("TCP client command:" + message); 

   Int32 port = 80;

   System.Net.Sockets.TcpClient client = new System.Net.Sockets.TcpClient( ESP8266_IP_ADDRESS, port);

   Byte[] data = System.Text.Encoding.ASCII.GetBytes(message); 

   System.Net.Sockets.NetworkStream stream = client.GetStream();

   stream.Write(data, 0, data.Length);

   // Close everything.




  catch(Exception e)





Please Log in or Create an account to join the conversation.

Time to create page: 0.174 seconds

Forum latest

  • No posts to display.