Strange behaviour.

Moderator: leecollings

Post Reply
mhko
Posts: 13
Joined: Wednesday 13 January 2016 20:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Strange behaviour.

Post by mhko »

Hi.
I am new to the home automation thing and to Domoticz.:-)
So fare i have made 2 nodes, one ethernet gateway and setup a PI with the Domoticz server. version V2.3530

The one node is running and logging data as it should.
The other node is my test board, it works from time to time and some times it does not work.
Its the same hardware as the room sensor node.
I have a cap on the radio, and do not think that my issue is related to this. I do not get radio fail on the serial monitor.

to day i have seen that the test board node has filled the mysensor gateway node list with 5 pages of nodes that all are identical. they are updated on the same time.
see my attached picture.
test board node entrys
test board node entrys
test board.png (191.36 KiB) Viewed 1261 times
her is a log from my ethernet gateway:
Log from gateway
Log from gateway
gateway_log.png (12.82 KiB) Viewed 1261 times
does some one have an ideer what is going on?

An other thing that i have been battling with is this test board node is creating to many devices in the device list.
the devices are than only updatet once.
see device list picture:
Device list
Device list
device tab.png (113.49 KiB) Viewed 1261 times
some how the devices 11, 12, 13, 14 are combined to device 15
i understand that the system combines sensors, but is this normal with so many "dummy" devices?

I would very much appreciate if some one hade the time to give me some advice.
hahi
Posts: 12
Joined: Wednesday 08 April 2015 18:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Strange behaviour.

Post by hahi »

Please provide your sketch to have a better idea of what is going on.
mhko
Posts: 13
Joined: Wednesday 13 January 2016 20:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Strange behaviour.

Post by mhko »

hi here is the code from the test board node.
it is not clean. the INA219 is not working and there for is not send over the air.

Code: Select all

// Include Lib:

//INA219
#include <Adafruit_INA219.h>

//HTU21
#include "Adafruit_HTU21DF.h"

// BMP180:
#include <SFE_BMP180.h>
#include <Wire.h>

//Mysensor sending
#include <MySensor.h>
#include <SPI.h>

// Things that need to be defined:
// INA219
Adafruit_INA219 ina219;

//HTU21:
Adafruit_HTU21DF htu = Adafruit_HTU21DF();

//BMP180:
SFE_BMP180 pressure;  // You will need to create an SFE_BMP180 object, here called "pressure":
#define ALTITUDE 50.0 // Altitude of Terras in meters
 
//Define sensor ID
#define temp_id 0         // Temperatur Dallas sensor ID=0
#define Pressure_id 0     // BMP 180 sensor           ID=1
#define Hygro_Hum_id 2    // HTU21  Hyd               ID=2
#define Hygro_temp_id 3   // HTU21  Temp              ID=3

//Sleep time:

unsigned long SLEEP_TIME = 30000;
 
MySensor gw;
MyMessage msg0(temp_id,V_TEMP);
MyMessage msg1(Pressure_id,V_PRESSURE);
MyMessage msg2(Hygro_Hum_id,V_HUM);
MyMessage msg3(Hygro_temp_id,V_TEMP);
//MyMessage msg4(Voltage_id, V_Voltage);

 
void setup() 
{ 
  Serial.begin(9600);
//INA219
uint32_t currentFrequency;
ina219.begin();  
  

//BMP180:
 (pressure.begin()); // Initialize device.
  gw.begin();

//HTU21:

!htu.begin(); // Initialize device.


//Send the sensor node sketch version information to the gateway
  gw.sendSketchInfo("Test Board", "0.1");
  
//gw.present(temp_id, S_TEMP);      //dallas sensor
  gw.present(Pressure_id, S_BARO);    // BMP180
  gw.present(Hygro_Hum_id, S_HUM);    // HTU 21 humidity
  gw.present(Hygro_temp_id, S_TEMP);  // HTU 21 Temperatur
  //gw.present(Voltage_ID, S_Voltage);  // INA219 Voltage
}
 
void loop(){
//INA219
 float shuntvoltage = 0;
 float busvoltage = 0;
 float current_mA = 0;
 float loadvoltage = 0;
 float power = 0;
 shuntvoltage = ina219.getShuntVoltage_mV();
 busvoltage = ina219.getBusVoltage_V();
 current_mA = ina219.getCurrent_mA();
 loadvoltage = busvoltage + (shuntvoltage / 1000);
 power = current_mA * loadvoltage;
 Serial.print("Bus Voltage: "); Serial.print(busvoltage); Serial.println(" V");
 Serial.print("Shunt Voltage: "); Serial.print(shuntvoltage); Serial.println(" mV");
 Serial.print("Load Voltage: "); Serial.print(loadvoltage); Serial.println(" V");
 Serial.print("Current: "); Serial.print(current_mA); Serial.println(" mA");
 Serial.print("Power: "); Serial.print(power); Serial.println(" mW");
 Serial.println("");
  


//BMP180
//Set status:
char status;
  double T,P,p0,a;

status = pressure.startTemperature();
  if (status != 0)
  {
    // Wait for the measurement to complete:
    delay(status);

    // Retrieve the completed temperature measurement:
    // Note that the measurement is stored in the variable T.
    // Function returns 1 if successful, 0 if failure.

    status = pressure.getTemperature(T);
    if (status != 0)
    {
      // Print out the measurement:
      Serial.print("temperature: ");
      Serial.print(T,2);
      Serial.println(" deg C, ");
            
      // Start a pressure measurement:
      // The parameter is the oversampling setting, from 0 to 3 (highest res, longest wait).
      // If request is successful, the number of ms to wait is returned.
      // If request is unsuccessful, 0 is returned.

      status = pressure.startPressure(3);
      if (status != 0)
      {
        // Wait for the measurement to complete:
        delay(status);

        // Retrieve the completed pressure measurement:
        // Note that the measurement is stored in the variable P.
        // Note also that the function requires the previous temperature measurement (T).
        // (If temperature is stable, you can do one temperature measurement for a number of pressure measurements.)
        // Function returns 1 if successful, 0 if failure.

        status = pressure.getPressure(P,T);
        if (status != 0)
        {
          // Print out the measurement:
          
          Serial.print("absolute pressure: ");
          Serial.print(P,2);
          Serial.println(" mb, ");
          
          // The pressure sensor returns abolute pressure, which varies with altitude.
          // To remove the effects of altitude, use the sealevel function and your current altitude.
          // This number is commonly used in weather reports.
          // Parameters: P = absolute pressure in mb, ALTITUDE = current altitude in m.
          // Result: p0 = sea-level compensated pressure in mb

          p0 = pressure.sealevel(P,ALTITUDE); // we're at 1655 meters (Boulder, CO)
          Serial.print("relative (sea-level) pressure: ");
          Serial.print(p0,2);
          Serial.println(" mb, ");
        }
        else Serial.println("error retrieving pressure measurement\n");
      }
      else Serial.println("error starting pressure measurement\n");
    }
    else Serial.println("error retrieving temperature measurement\n");
  }
  else Serial.println("error starting temperature measurement\n");
Serial.println(htu.readHumidity());
Serial.println(htu.readTemperature());  
Serial.println("wait for new reading");
Serial.println();

   //delay(5000);  // Pause for 5 seconds.


     //gw.send(msg0.set(temp,1));     // dallas sensor
     
     gw.send(msg1.set(P,2));
    
     gw.send(msg2.set(htu.readHumidity(),1));
    
     gw.send(msg3.set(htu.readTemperature(),1)); 
     
gw.sleep(SLEEP_TIME);
   
     
}
mhko
Posts: 13
Joined: Wednesday 13 January 2016 20:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Strange behaviour.

Post by mhko »

Hi again.
I am still struggeling geting this to work.

can any body help me with this log?

0;0;3;0;14;Gateway startup complete.Finished
GET / HTTP/1.1Finished
Host: 192.168.0.110:5003Finished
Connection: keep-aliveFinished
Cache-Control: max-age=0Finished
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8Finished
Upgrade-Insecure-Requests: 1Finished
Safari/537.36Finished
Accept-Encoding: gzip, deflate, sdchFinished
Accept-Language: da,de;q=0.8,en-GB;q=0.6,en;q=0.4,nl;q=0.20;0;3;0;9;send: 0-0-0-0 s=0,c=0,t=0,pt=0,l=0,sg=0,st=fail:Finished

0;0;3;0;14;Gateway startup complete.Finished
0;0;3;0;2;Get Version0;0;3;0;2;1.5.3Finished
0;0;3;0;2;Get Version0;0;3;0;2;1.5.3
0;0;3;0;14;Gateway startup complete.Finished
GET /favicon.ico HTTP/1.1Finished
Host: 192.168.0.110:5003Finished
Connection: keep-aliveFinished
Safari/537.36Finished
Accept: */*Finished
Referer: http://192.168.0.110:5003/Finished
Accept-Encoding: gzip, deflate, sdchFinished
Accept-Language: da,de;q=0.8,en-GB;q=0.6,en;q=0.4,nl;q=0.20;0;3;0;9;send: 0-0-0-0 s=0,c=0,t=0,pt=0,l=0,sg=0,st=fail:Finished
0;0;3;0;9;read: 1-1-0 s=1,c=1,t=4,pt=7,l=5,sg=0:993.76
1;1;1;0;4;993.76
0;0;3;0;9;read: 1-1-0 s=2,c=1,t=1,pt=7,l=5,sg=0:52.0
1;2;1;0;1;52.0
0;0;3;0;9;read: 1-1-0 s=3,c=1,t=0,pt=7,l=5,sg=0:20.6
1;3;1;0;0;20.6


date gateway recives data for the sensor, i can see that in the serial monitor and in MYScontroller, but the data does not registrat in Domoticz.
Today i hade 18 pages of unknown devices in my device list.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest