• 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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Strange receive problem with 433Mhz Receiver and pilight 8.1.5
#11
I will test this later this week.
 
Reply
#12
What do the logs say when it staggers after applying this patch:
Code:
diff --git a/daemon.c b/daemon.c
index 7a085c92..29bf93cc 100644
--- a/daemon.c
+++ b/daemon.c
@@ -2631,11 +2631,13 @@ void openconsole(void) {
 #endif
 
 static void pilight_abort(uv_timer_t *timer_req) {
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     exit(EXIT_FAILURE);
 }
 
 #ifdef MQTT
 static void ping(uv_timer_t *handle) {
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     mqtt_ping(handle->data);
 }
 
@@ -2754,6 +2759,7 @@ static void mqtt_callback(struct mqtt_client_t *client, struct mqtt_pkt_t *pkt,
 #endif
 
 static void pilight_stats(uv_timer_t *timer_req) {
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     int watchdog = 1, stats = 1;
     // double itmp = 0.0;
     {
@@ -2822,6 +2828,7 @@ static void pilight_stats(uv_timer_t *timer_req) {
 }
 
 static void generate_uuid(uv_timer_t *timer_req) {
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     int nrdevs = 0, x = 0;
     char **devs = NULL, *p = NULL;
     if((nrdevs = inetdevs(&devs)) > 0) {
diff --git a/libs/pilight/core/http.c b/libs/pilight/core/http.c
index a57899cb..19440db1 100644
--- a/libs/pilight/core/http.c
+++ b/libs/pilight/core/http.c
@@ -542,6 +542,8 @@ static void poll_close_cb(uv_poll_t *req) {
 }
 
 static void timeout(uv_timer_t *req) {
+    
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     struct request_t *request = req->data;
     void (*callback)(int, char *, int, char *, void *) = request->callback;
     void *userdata = request->userdata;
diff --git a/libs/pilight/core/mqtt.c b/libs/pilight/core/mqtt.c
index 818c88e4..27fd1df4 100644
--- a/libs/pilight/core/mqtt.c
+++ b/libs/pilight/core/mqtt.c
@@ -1014,6 +1014,8 @@ int mqtt_pkt_disconnect(struct mqtt_pkt_t *pkt) {
 }
 
 static void mqtt_client_timeout(uv_timer_t *handle) {
+    
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
 #ifdef _WIN32
     uv_mutex_lock(&mqtt_lock);
 #else
@@ -1035,6 +1039,8 @@ static void mqtt_client_timeout(uv_timer_t *handle) {
 }
 
 static void mqtt_message_resend(uv_timer_t *handle) {
+    
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
 #ifdef _WIN32
     uv_mutex_lock(&mqtt_lock);
 #else
diff --git a/libs/pilight/core/ntp.c b/libs/pilight/core/ntp.c
index 3122d564..361d34fa 100644
--- a/libs/pilight/core/ntp.c
+++ b/libs/pilight/core/ntp.c
@@ -100,6 +100,8 @@ static void close_cb(uv_handle_t *handle) {
 }
 
 static void ntp_timeout(uv_timer_t *param) {
+    
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     /*
      * Make sure we execute in the main thread
      */
@@ -126,6 +128,8 @@ static void ntp_timeout(uv_timer_t *param) {
 }
 
 static void restart(uv_timer_t *req) {
+    
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     nr = 0;
     ntpsync();
 }
@@ -195,6 +199,8 @@ static void on_send(uv_udp_send_t *req, int status) {
 }
 
 static void loop(uv_timer_t *req) {
+    
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     /*
      * Make sure we are called from the main thread
      */
diff --git a/libs/pilight/lua_c/async/timer.c b/libs/pilight/lua_c/async/timer.c
index 0b2350f3..df59b26a 100644
--- a/libs/pilight/lua_c/async/timer.c
+++ b/libs/pilight/lua_c/async/timer.c
@@ -370,6 +370,7 @@ static void plua_async_timer_object(lua_State *L, struct lua_timer_t *timer) {
 }
 
 static void timer_callback(uv_timer_t *req) {
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     struct lua_timer_t *timer = req->data;
     char name[512], *p = name;
     memset(name, '\0', 512);
diff --git a/libs/pilight/lua_c/wiringx.c b/libs/pilight/lua_c/wiringx.c
index cc0fee08..ca5ed7fa 100644
--- a/libs/pilight/lua_c/wiringx.c
+++ b/libs/pilight/lua_c/wiringx.c
@@ -414,10 +414,13 @@ int plua_wiringx_pin_mode(struct lua_State *L) {
 }
 
 static void plua_wiringx_poll_timer(uv_timer_t *req) {
+    
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     struct lua_wiringx_gpio_t *data = req->data;
     int nr = data->data.rptr, idx = data->data.idx;
 
     if(nr == 1) {
         return;
     }
 
diff --git a/libs/pilight/protocols/API/cpu_temp.c b/libs/pilight/protocols/API/cpu_temp.c
index 412aeaf0..6b0d9310 100644
--- a/libs/pilight/protocols/API/cpu_temp.c
+++ b/libs/pilight/protocols/API/cpu_temp.c
@@ -55,6 +55,8 @@ static pthread_mutex_t lock;
 static pthread_mutexattr_t attr;
 
 static void *thread(void *param) {
+    
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     struct protocol_threads_t *node = (struct protocol_threads_t *)param;
     struct JsonNode *json = (struct JsonNode *)node->param;
     struct JsonNode *jid = NULL;
diff --git a/libs/pilight/protocols/API/datetime.c b/libs/pilight/protocols/API/datetime.c
index 6029c332..c1cee685 100644
--- a/libs/pilight/protocols/API/datetime.c
+++ b/libs/pilight/protocols/API/datetime.c
@@ -68,6 +68,8 @@ static char *format = NULL;
 static pthread_mutex_t lock;
 
 static void *thread(void *param) {
+    
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     char UTC[] = "UTC";
     struct protocol_threads_t *thread = (struct protocol_threads_t *)param;
     struct JsonNode *json = (struct JsonNode *)thread->param;
diff --git a/libs/pilight/protocols/API/openweathermap.c b/libs/pilight/protocols/API/openweathermap.c
index 5603617a..4cd142ab 100644
--- a/libs/pilight/protocols/API/openweathermap.c
+++ b/libs/pilight/protocols/API/openweathermap.c
@@ -533,6 +533,7 @@ static void thread(uv_work_t *req) {
 }
 
 static void *update(void *param) {
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     /*
      * Make sure we execute in the main thread
      */
diff --git a/libs/pilight/protocols/API/sunriseset.c b/libs/pilight/protocols/API/sunriseset.c
index 5ee75577..16bc48af 100644
--- a/libs/pilight/protocols/API/sunriseset.c
+++ b/libs/pilight/protocols/API/sunriseset.c
@@ -310,6 +310,7 @@ static unsigned long min(unsigned long a, unsigned long b, unsigned long c) {
 }
 
 static void *thread(void *param) {
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     uv_timer_t *task = param;
     struct data_t *settings = task->data;
     struct tm tm;
diff --git a/libs/pilight/protocols/API/wunderground.c b/libs/pilight/protocols/API/wunderground.c
index a39e3d19..ed3d74fe 100644
--- a/libs/pilight/protocols/API/wunderground.c
+++ b/libs/pilight/protocols/API/wunderground.c
@@ -659,6 +659,7 @@ static void thread(uv_work_t *req) {
 }
 
 static void *update(void *param) {
+    logprintf(LOG_DEBUG, "==== %s %d ====", __FILE__, __LINE__);
     uv_timer_t *timer_req = param;
     struct data_t *settings = timer_req->data;
 

This patch could also be usefull instead of the previous one:
Code:
diff --git a/libs/pilight/lua_c/wiringx.c b/libs/pilight/lua_c/wiringx.c
index cc0fee08..95c0c2f4 100644
--- a/libs/pilight/lua_c/wiringx.c
+++ b/libs/pilight/lua_c/wiringx.c
@@ -32,6 +32,10 @@
#include "../core/log.h"

struct lua_wiringx_t;
+struct {
+       unsigned long first;
+       unsigned long second;
+} timestamp;

typedef struct lua_wiringx_gpio_t {
        struct lua_wiringx_t *parent;
@@ -417,10 +421,23 @@ static void plua_wiringx_poll_timer(uv_timer_t *req) {
        struct lua_wiringx_gpio_t *data = req->data;
        int nr = data->data.rptr, idx = data->data.idx;

+       struct timeval tv;
+       gettimeofday(&tv, NULL);
+
+       timestamp.first = timestamp.second;
+       timestamp.second = 1000000 * (unsigned int)tv.tv_sec + (unsigned int)tv.tv_usec;
+
+       int duration = (int)((int)timestamp.second-(int)timestamp.first);
+       if(duration < 248000) {
+               logprintf(LOG_NOTICE, "plua wiringx timer too delayed: %d", duration);
+       }
+
        if(nr == 1) {
                return;
        }

+       logprintf(LOG_DEBUG, "number pulses gathered %d", nr);
+
        data->data.idx ^= 1;
        data->data.rptr = 1;
This should be even more informative at the moment. It tells us when the wiringx timer is actually delayed or not as you suggest.

And can you check how pilight-raw performs when started like this:
Code:
./pilight-raw --linefeed -C /etc/pilight/config2.1.json --pulsesperline 10
 
Reply
#13
thank you curlymo, i try today or tomorrow at latest
 
Reply
#14
I made some videos from my terminal with pilight-raw 8.1.4 and 8.1.5 nightly. You can see the difference. I'm very busy at the moment, so I can test your patch only in the next few days.

The files are too big as attachment, i uploaded them to a cloud:

https://frankyscloud.spdns.de/index.php/...fzjPLfTRa0

PW: pilight
 
Reply
#15
I see, but i don't care about false positives like all the noise. I care about the false positives. If i look the second nr 7 of pilight815_nightly_pulseperline10.mp4 i see what i want to see, the reception of a possible true signal.
 
Reply
#16
yes, with pilight-receive 8.1.5 there are a lot of false positives namely "secudo-smoke-sensor". With 8.1.4 not so often or very rare.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  pilight for Raspbian Buster (raspberry pi 4) ? starob 31 7,311 08-04-2020, 06:57 PM
Last Post: PPacman
  pilight switch node in node-red framp 0 239 06-24-2020, 10:01 PM
Last Post: framp
  pilight-control TML 13 906 05-27-2020, 07:51 AM
Last Post: curlymo
  API Requests by HTTP from other devices fore use in pilight scootermacro 2 415 05-10-2020, 08:19 AM
Last Post: scootermacro
  Can't send or receive on Raspberry Pi Zero W ChristophH 12 836 04-09-2020, 06:34 PM
Last Post: curlymo
  pilight-send seems successful but doesn't actually send RF signal ayeyebrazov 37 3,141 03-31-2020, 01:02 PM
Last Post: curlymo
  pilight 8.1.5 not working on Raspberry pi after reboot beejayf 4 852 03-08-2020, 12:14 AM
Last Post: beejayf
  pilight cpu usage possibly associated with noticeable sluggishness? hepcat72 4 907 01-28-2020, 08:02 PM
Last Post: hepcat72
  apt.pilight.org stable Release' is not signed. thomasol 2 945 01-23-2020, 11:34 PM
Last Post: thomasol
  pilight and SIGNALduino cc1101 Caleus 0 696 01-19-2020, 09:13 AM
Last Post: Caleus

Forum Jump:


Browsing: 1 Guest(s)