• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


[Fully Supported] DHT11
#51
compiling went okay, seems to be more stable.

But I get the following:
Code:
...

                "dht11": {
                        "name": "Temperatur",
                        "order": 6,
                        "type": 3,
                        "uuid": "0000-00-00-a7-33ebee",
                        "origin": "0000-00-00-a7-33ebee",
                        "protocol": [ "dht11" ],
                        "id": [{
                                "gpio": 7
                        }],
                        "temperature": 30,
                        "poll-interval": 30,
                        "humidity": 50,
                        "gui-show-humidity": 1,
                        "gui-show-temperature": 1,
                        "gui-decimals": 1,
                        "device-humidity-offset": 0,
                        "device-temperature-offset": 0,
                        "device-decimals": 1
                }
        }
}
[Mar 12 18:45:14:325924] pilight-daemon: DEBUG: -- end parsed config file --
[Mar 12 18:45:14:326815] pilight-daemon: INFO: daemon listening to port: 53270
[Mar 12 18:45:14:335742] pilight-daemon: DEBUG: new thread dht11, 1 thread running
[Mar 12 18:45:14:336170] pilight-daemon: DEBUG: new thread socket, 2 threads running
[Mar 12 18:45:14:336501] pilight-daemon: DEBUG: new thread ssdp, 3 threads running
[Mar 12 18:45:14:336845] pilight-daemon: DEBUG: new thread sender, 4 threads running
[Mar 12 18:45:14:337178] pilight-daemon: DEBUG: new thread broadcaster, 5 threads running
[Mar 12 18:45:14:337510] pilight-daemon: DEBUG: new thread 433gpio, 6 threads running
[Mar 12 18:45:14:338080] pilight-daemon: INFO: new client, ip: 127.0.0.1, port: 35483
[Mar 12 18:45:14:338314] pilight-daemon: DEBUG: client fd: 9
[Mar 12 18:45:14:338492] pilight-daemon: DEBUG: client id: 1
[Mar 12 18:45:15:356714] pilight-daemon: DEBUG: dht11 data checksum was wrong
[Mar 12 18:45:16:375858] pilight-daemon: DEBUG: dht11 data checksum was wrong
[Mar 12 18:45:17:394984] pilight-daemon: DEBUG: dht11 data checksum was wrong
[Mar 12 18:45:18:414033] pilight-daemon: DEBUG: dht11 data checksum was wrong
[Mar 12 18:45:19:433082] pilight-daemon: DEBUG: dht11 data checksum was wrong

With dht11 it still works fine..

I guess there line needs some adjustment? Whats the 40 ?
Code:
if((j >= 40) && (dht11_dat[4] == ((dht11_dat[0] + dht11_dat[1] + dht11_dat[2] + dht11_dat[3]) & 0xFF))) {
 
Reply
#52
I just copied the code from the dht11.c file into the protocol. The old code worked perfectly here, this one doesn't.
 
Reply
#53
Whats about the gpio - in the dht11.c file it is also defined, maybe we get it wrong here? So it checks the wrong gpio?
 
Reply
#54
It uses the GPIO pin as defined in the config.
 
Reply
#55
can I help with some data?
 
Reply
#56
No, the problem is that the script you posted also doesn't work here.
 
Reply
#57
Hi!

Okay, we should have come to this earlier...
If the protocol for dht22 works fine, except for the high values..something still is going right with this one.

So I took a look in the protocol.
Simply swap these two lines in dht22.c
Code:
int h = dht22_dat[0] * 256 + dht22_dat[1];
int t = (dht22_dat[2] & 0x7F)* 256 + dht22_dat[3];

for these
Code:
int h = dht22_dat[0] + dht22_dat[1];
int t = (dht22_dat[2] & 0x7F) + dht22_dat[3];

And it runs...
Code:
[Mar 13 00:56:23:314919] pilight-daemon: DEBUG: broadcasted: {"code":{"gpio":7,"temperature":21,"humidity":39},"origin":"receiver","protocol":"dht22"}
[Mar 13 00:56:53:839787] pilight-daemon: DEBUG: broadcasted: {"code":{"gpio":7,"temperature":21,"humidity":39},"origin":"receiver","protocol":"dht22"}
[Mar 13 00:57:24:364654] pilight-daemon: DEBUG: broadcasted: {"code":{"gpio":7,"temperature":22,"humidity":39},"origin":"receiver","protocol":"dht22"}
[Mar 13 00:57:54:889542] pilight-daemon: DEBUG: broadcasted: {"code":{"gpio":7,"temperature":22,"humidity":39},"origin":"receiver","protocol":"dht22"}
[Mar 13 00:58:25:414361] pilight-daemon: DEBUG: broadcasted: {"code":{"gpio":7,"temperature":21,"humidity":39},"origin":"receiver","protocol":"dht22"}
[Mar 13 00:58:55:939184] pilight-daemon: DEBUG: broadcasted: {"code":{"gpio":7,"temperature":21,"humidity":39},"origin":"receiver","protocol":"dht22"}

Did I miss something or is it that easy?

Good night Wink
 
Reply
#58
Are we talking about a small change in the dht22 protocol so it works for the dht11?
 
Reply
#59
Yes, just edit these lines and it works - I need to test a little more but it was stable yesterday for about 20min

Edit: Can you post here if/when edited the development branch?
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  [Partially Supported] TFA / Conrad Weather Yves 184 3,819 03-31-2019, 05:22 PM
Last Post: curlymo
  [Fully Supported] DHT22 IcedEarth 86 27,845 11-18-2018, 09:33 AM
Last Post: curlymo
  [Fully Supported] Arctech Old Martin 111 31,481 03-27-2018, 04:43 PM
Last Post: genfersee
  [Fully Supported] Clarus Switches Marcin 69 21,253 01-30-2018, 07:10 PM
Last Post: Niek
  [Fully Supported] Remote Control Socket (RC101-U/RC201) Sean 18 9,201 01-04-2018, 06:18 AM
Last Post: ettman8
  [Fully Supported] LM75 and LM76 temperature sensor horst_dieter 64 22,612 11-19-2017, 08:54 PM
Last Post: edepi
  [Fully Supported] No-brand temp/humidity sensor (alecto_ws1700) meloen 57 32,142 12-25-2016, 09:53 PM
Last Post: creamers
Lightbulb [Fully Supported] Kaku Door sensor (AMST-606) geerttttt 50 21,830 11-29-2016, 06:52 AM
Last Post: curlymo
  [Fully Supported] Impuls/SelectRemote Bram 113 43,412 05-28-2016, 02:53 PM
Last Post: Puuu
  [Fully Supported] KAKU ABST-604 (dusk/dawn sensor) Netopyr 15 7,069 03-04-2016, 05:43 PM
Last Post: Niek

Forum Jump:


Browsing: 1 Guest(s)