Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. lorimo
    3. Posts
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by lorimo

    • RE: Node only works on USB not on battery

      @mfalkvidd OK I'll try that. But as expected, there is no suitable capacitor left over in my box.

      posted in Troubleshooting
      lorimo
      lorimo
    • RE: Node only works on USB not on battery

      @gohan the LED does not flash fast. It goes on for a couple of seconds and is off for about half a minute.
      I didn't add a capacitor, is that really necessary? What capacity do you recommend?

      posted in Troubleshooting
      lorimo
      lorimo
    • RE: Node only works on USB not on battery

      @mfalkvidd the main error seems to be (with description from log parser)

      51 TSF:MSG:SEND,3-3-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      Sent Message
      Sender: 3
      Last Node: 3
      Next Node: 255
      Destination: 255
      Sensor Id: 255
      Command: INTERNAL
      Message Type:I_FIND_PARENT_REQUEST
      Payload Type: P_STRING
      Payload Length: 0
      Signing: 0
      Failed uplink counter: 0
      Status: OK (OK=success, NACK=no radio ACK received)
      Payload:
      6152 !TSM:FPAR:NO REPLY
      No potential parents replied to find parent request
      6154 TSM:FPAR
      Transition to Find Parent state

      But this does not help me, because still it works fine if powered direct from FTDI.

      posted in Troubleshooting
      lorimo
      lorimo
    • Node only works on USB not on battery

      My node shows a curious behavior. It's based on a pro mini 3.3V, a DHT22 and a NRF24L01.
      When switching on the battery, the node goes into a boot loop showing up the red LED repeatedly.

      If connected via an FTDI Board to USB it boots up, connects to the gateway and shows up in my domoticz. Then the Sensor data come in correctly as from the other nodes.

      So I think this could not come from the code, it must be something with the wiring. In both cases i find the correct 3.3V on all places. There are no shortcuts i could find. From the FTDI board I need to connect GND, CTS, VCC and DTR for the node to work.

      The battery pack (2x 1.2V 750mAh ) is connected to GND and VCC over a Step-up power converter.

      Any suggestions where to search for the reason?
      Thanks

      posted in Troubleshooting
      lorimo
      lorimo
    • RE: Missing sensor nodes in domoticz

      @alexsh1 yes, I'm sure. Up to now it is only a serial gateway with direct connected sensors.

      posted in Domoticz
      lorimo
      lorimo
    • RE: Missing sensor nodes in domoticz

      Do you love curiosity?
      After nearly a week of running, my gateway stopped working out of the blue.
      I found out, that I am where I began. The same effects as described in the original post, but with the SFE library.

      So I tried it again with the original Adafruit_BMP library and --- it worked !

      Maybe there is something with my hardware. I'll go and get me another Arduino Board from a different manufacturer and try it again.

      posted in Domoticz
      lorimo
      lorimo
    • RE: Missing sensor nodes in domoticz

      @alexsh1 yes, that's what I found out after buying those two devices. But for some early tests and freshen up my rusty programming skills it is good. Maybe I change the hardware for the final installation.
      But it is still curious, that those two libraries won't work together. I tried to understand the code, but up to now did not find a clue, what could be the reason.

      posted in Domoticz
      lorimo
      lorimo
    • RE: Missing sensor nodes in domoticz

      @sundberg84 So I found the error while using the SFE_BMP180 library: there is a need for a short delay before the getPressure(). So now it works.

      But why not with the Adafruit_BMP085 library I do not understand.

      Thanks a lot.

      posted in Domoticz
      lorimo
      lorimo
    • RE: Missing sensor nodes in domoticz

      @sundberg84 still searching for a solution.
      I tried to rewrite the sketch, starting from the working single sensor gateway with the humidity sensor. In the domoticz log I can see the messages from the sensor come in and the value is updated. Then I added line by line the necessary code for the pressure sensor.
      The "present(ID, S_BARO);" did not have any results, but the humidity still updates. After adding the "send(msgBaro.set(pressure, 0));" the data delivery stopped (does it make any difference here to have a "0" instead of "1" for the ack? It's the only difference to your script I found.)
      It's the same the other way around: starting from the gateway only with the pressure sensor. As soon as I add the send command the function stops.

      This led me to the idea, that there must be something wrong with the present() or the library. I searched for another library for the BMP180 sensor and fond https://github.com/sparkfun/BMP180_Breakout. And it worked directly. The only problem is, that now the values are incorrect. I get 867hPa instead of 1018hPa.

      Thanks for your help!

      posted in Domoticz
      lorimo
      lorimo
    • RE: Missing sensor nodes in domoticz

      @sundberg84 the connection is a regular USB cable which works fine on other devices too.
      But I am one step ahead: I changed the sketch for only using the humidity sensor and it worked as expected. The values come in and I see them in the domoticz log, also the "last seen" in the dashboard updates.
      Then I did the same for the pressure sensor and it didn't work. For this the solution was really easy: a type mismatch. I defined "pressure" as "long" and "lastBaro" as "float". After changing both to "float" the single sensor gateway woks fine. I see the pressure sensor in the devices list and the values are collected.

      But when I connect both sensors, still nothing works.

      posted in Domoticz
      lorimo
      lorimo
    • RE: Missing sensor nodes in domoticz

      @sundberg84 that's right, domoticz updates only after changes, because only then the mysensor node sends data. AFAIK domoticz does not compress the incoming data. In the gateway log there are value changes every few seconds, so there should something happen.

      @mfalkvidd I experimented with the DHT sensor directly connected to the raspberri Pi running domoticz. Then the "last seen" changed with every updated value. So I expected this to happen with the MySensor node also.

      After waiting some more time the values of temperature and humidity are still unchanged but that can not be correct.

      posted in Domoticz
      lorimo
      lorimo
    • RE: Missing sensor nodes in domoticz

      @GertSanders Thanks, I tested with 500ms and now also added a wait(500) before each send() but without success.
      I found an additional interesting point: On the hardware setup page for the nodes the "last seen" time stamp for the childs changes with each send (blinking LED on Arduino) but on the dashboard the "last seen" stays at the time when I plugged the Arduino in. And the sensor value does also not change within domoticz.

      posted in Domoticz
      lorimo
      lorimo
    • RE: Missing sensor nodes in domoticz

      @mfalkvidd thank you, I added a delay before every present(), but that didn't change anything.

      @sundberg84 your example is mostly the same as mine. I think I used this or a copy of it as basis for mine.
      What I do not understand is, that I can't define a MySensor variable (" MySensor gw; "). Maybe it is not needed within a gateway. So I can not use the begin() command.

      posted in Domoticz
      lorimo
      lorimo
    • Missing sensor nodes in domoticz

      Hi everybody,

      for my start with mysensors I try to setup a serial gateway with sensors connected directly (no radio) to the arduino. But the sensors don't show up completely in domoticz. I have a DHT22 humidity sensor and a bmp180 for air pressure.
      In domoticz I can setup the gateway and see all three childs (T, H, P) in the hardware node setup with a "last seen" time stamp a few seconds ago and updating once in a while. But in the devices list only temperature and humidity show up. So I don't see the pressure data. I believe, there must be a mistake in my sketch. Has anybody an idea? Thanks.

      On the serial monitor the log seems good:

      0;255;3;0;14;Gateway startup complete.
      0;255;3;0;11;Humidity, Pressure
      0;255;3;0;12;1.0
      0;0;0;0;7;Raum 1 H
      0;1;0;0;6;Raum 1 T
      0;2;0;0;8;Raum 1 P
      0;1;1;0;0;20.3
      T: 20.30
      0;0;1;0;1;57.7
      H: 57.70
      0;2;1;0;4;100988.0
      P: 100988
      

      From the domoticz log :

      2016-02-27 16:10:19.090 MySensors: Using serial port: /dev/ttyUSB0
      2016-02-27 16:10:19.710 Incoming connection from: 192.168.2.100
      2016-02-27 16:10:20.695 MySensors: Node: 0, Sketch Name: Humidity, Pressure
      2016-02-27 16:10:20.696 MySensors: Node: 0, Sketch Version: 1.0
      2016-02-27 16:10:23.697 (Gateway_1) Temp (Raum 1 T)
      2016-02-27 16:10:24.696 (Gateway_1) Temp + Humidity (Raum 1 H) 
      

      And here is my sketch:

      // Enable serial gateway
      #define MY_GATEWAY_SERIAL
      
      // Flash leds on rx/tx/err
      #define MY_LEDS_BLINKING_FEATURE
      // Set blinking period
      #define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Enable inclusion mode
      #define MY_INCLUSION_MODE_FEATURE
      // Enable Inclusion mode button on gateway
      #define MY_INCLUSION_BUTTON_FEATURE
      
      // Set inclusion mode duration (in seconds)
      #define MY_INCLUSION_MODE_DURATION 60 
      // Digital pin used for inclusion mode button
      #define MY_INCLUSION_MODE_BUTTON_PIN  3 
      
      #define DHTPIN A0
      #include <SPI.h>
      #include <MySensor.h>  
      #include <DHT.h>
      #include <Adafruit_BMP085.h>
      #include <Wire.h>
      
      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1
      #define CHILD_ID_BARO 2
      unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
      
      DHT dht;
      Adafruit_BMP085 bmp;
      float lastTemp = -1;
      float lastHum = -1;
      float lastBaro = -1;
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      MyMessage msgBaro(CHILD_ID_BARO, V_PRESSURE);
      
      void setup() { 
        dht.setup(DHTPIN);
        bmp.begin();
      }
      
      void presentation() {
       sendSketchInfo("Humidity, Pressure", "1.0");
       present(CHILD_ID_HUM, S_HUM, "Raum 1 H");
       present(CHILD_ID_TEMP, S_TEMP, "Raum 1 T");
       present(CHILD_ID_BARO, S_BARO, "Raum 1 P");
      }
      
      void loop() { 
        delay(dht.getMinimumSamplingPeriod());
      
        // Fetch temperatures from DHT sensor
        float temperature = dht.getTemperature();
        if (isnan(temperature)) {
            Serial.println("Failed reading temperature from DHT22");
        } else if (temperature != lastTemp) {
          lastTemp = temperature;
          send(msgTemp.set(temperature, 1));
          Serial.print("T: ");
          Serial.println(temperature);
        }
        
        // Fetch humidity from DHT sensor
        float humidity = dht.getHumidity();
        if (isnan(humidity)) {
            Serial.println("Failed reading humidity from DHT22");
        } else if (humidity != lastHum) {
            lastHum = humidity;
            send(msgHum.set(humidity, 1));
            Serial.print("H: ");
            Serial.println(humidity);
       }
      
       //Fetch Pressure
       long pressure = bmp.readPressure();
       pressure = pressure / pow((1.0 - ( 106 / 44330.0)),5.255);
       if (isnan(pressure)) {
          Serial.println("Failed reading pressure from BMP180");
          } else if (abs(pressure - lastBaro) > 10) { 
          send(msgBaro.set(pressure, 1));
          lastBaro = pressure;
          Serial.print("P: ");
          Serial.println(pressure);
          }
      }
      
      posted in Domoticz
      lorimo
      lorimo