Strange repeatition in logs when sensor notify ...

8 years 10 months ago #1775 by cdj
If i launch server manually i see in console output :
N1S0 in program id 24 property Sensor.Temperature value 30.4
N1S0 in program id 26 property Sensor.Temperature value 30.4
N1S0 in program id 29 property Sensor.Temperature value 30.4
N1S0 in program id 32 property Sensor.Temperature value 30.4

N5S0 in program id 24 property Sensor.Pressure value 1015.067
N5S0 in program id 26 property Sensor.Pressure value 1015.067
N5S0 in program id 29 property Sensor.Pressure value 1015.067
N5S0 in program id 32 property Sensor.Pressure value 1015.067

Is it normal ?
Thanks
Dario

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

8 years 10 months ago #1776 by EasyIoT

cdj wrote: If i launch server manually i see in console output :

N1S0 in program id 24 property Sensor.Temperature value 30.4
N1S0 in program id 26 property Sensor.Temperature value 30.4
N1S0 in program id 29 property Sensor.Temperature value 30.4
N1S0 in program id 32 property Sensor.Temperature value 30.4

N5S0 in program id 24 property Sensor.Pressure value 1015.067
N5S0 in program id 26 property Sensor.Pressure value 1015.067
N5S0 in program id 29 property Sensor.Pressure value 1015.067
N5S0 in program id 32 property Sensor.Pressure value 1015.067

Is it normal ?
Thanks
Dario


I guess you have Console.WriteLine in one of automation programs and you output this data.

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

8 years 10 months ago #1777 by cdj

EasyIoT wrote:

cdj wrote: If i launch server manually i see in console output :

N1S0 in program id 24 property Sensor.Temperature value 30.4
N1S0 in program id 26 property Sensor.Temperature value 30.4
N1S0 in program id 29 property Sensor.Temperature value 30.4
N1S0 in program id 32 property Sensor.Temperature value 30.4

N5S0 in program id 24 property Sensor.Pressure value 1015.067
N5S0 in program id 26 property Sensor.Pressure value 1015.067
N5S0 in program id 29 property Sensor.Pressure value 1015.067
N5S0 in program id 32 property Sensor.Pressure value 1015.067

Is it normal ?
Thanks
Dario


I guess you have Console.WriteLine in one of automation programs and you output this data.


This is my automation code :
//Programma Temperatura
const String ESP8266_IP_ADDRESS = "192.168.0.52";
const String NODE_ADDRESS = "N1S0";
/*
  This code is running one time when program is enabled
*/
public void Setup()
{
}
/*
  This code is running periodicaly when program is enabled. 
  Cron job detirmine running period.
*/
public void Run()
{
  String temp = QueryServer("GETTEMP");
  float response = (Single.Parse(temp) / 10);
  Console.WriteLine(response);
  ModuleHelper.SetProperty("Virtual", NODE_ADDRESS, "Sensor.Temperature", response.ToString());
  EventHelper.SetEvent("Virtual", NODE_ADDRESS, "Sensor.Temperature");
}
private static string QueryServer(String message)
{
try
	{
		Console.WriteLine("TCP client command: " + message + "\r\n");
		Int32 port = 43333;
		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);
		
		data = new Byte[256];
		String responseData = String.Empty;
		Int32 bytes = stream.Read(data, 0, data.Length);
		responseData = System.Text.Encoding.ASCII.GetString(data, 0, bytes);
		// Close everything.
		stream.Close();
		client.Close();
		return responseData;
	}
	catch(Exception e)
	{
		Console.WriteLine(e.StackTrace + "\r\n");
	}
return "0.00";
}

Is it something wrong ?
Thanks
Dario

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

8 years 10 months ago #1780 by EasyIoT

cdj wrote:

EasyIoT wrote:

cdj wrote: If i launch server manually i see in console output :

N1S0 in program id 24 property Sensor.Temperature value 30.4
N1S0 in program id 26 property Sensor.Temperature value 30.4
N1S0 in program id 29 property Sensor.Temperature value 30.4
N1S0 in program id 32 property Sensor.Temperature value 30.4

N5S0 in program id 24 property Sensor.Pressure value 1015.067
N5S0 in program id 26 property Sensor.Pressure value 1015.067
N5S0 in program id 29 property Sensor.Pressure value 1015.067
N5S0 in program id 32 property Sensor.Pressure value 1015.067

Is it normal ?
Thanks
Dario


I guess you have Console.WriteLine in one of automation programs and you output this data.


This is my automation code :
//Programma Temperatura
const String ESP8266_IP_ADDRESS = "192.168.0.52";
const String NODE_ADDRESS = "N1S0";
/*
  This code is running one time when program is enabled
*/
public void Setup()
{
}
/*
  This code is running periodicaly when program is enabled. 
  Cron job detirmine running period.
*/
public void Run()
{
  String temp = QueryServer("GETTEMP");
  float response = (Single.Parse(temp) / 10);
  Console.WriteLine(response);
  ModuleHelper.SetProperty("Virtual", NODE_ADDRESS, "Sensor.Temperature", response.ToString());
  EventHelper.SetEvent("Virtual", NODE_ADDRESS, "Sensor.Temperature");
}
private static string QueryServer(String message)
{
try
	{
		Console.WriteLine("TCP client command: " + message + "\r\n");
		Int32 port = 43333;
		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);
		
		data = new Byte[256];
		String responseData = String.Empty;
		Int32 bytes = stream.Read(data, 0, data.Length);
		responseData = System.Text.Encoding.ASCII.GetString(data, 0, bytes);
		// Close everything.
		stream.Close();
		client.Close();
		return responseData;
	}
	catch(Exception e)
	{
		Console.WriteLine(e.StackTrace + "\r\n");
	}
return "0.00";
}

Is it something wrong ?
Thanks
Dario


No, this is just info. Console.WriteLine is in other automation program.

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

8 years 10 months ago #1781 by cdj
So i must search in all automation program where's console writeline?

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

Time to create page: 0.599 seconds

Forum latest

  • No posts to display.