12-11-2019, 10:02 PM
I will test this later this week.
Thread Rating:
[Solved] Strange receive problem with 433Mhz Receiver and pilight 8.1.5
|
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;
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;
./pilight-raw --linefeed -C /etc/pilight/config2.1.json --pulsesperline 10
Possibly Related Threads... | |||||
Thread | Author | Replies | Views | Last Post | |
pilight-debug format | Rschnauzer | 2 | 190 |
12-17-2020, 07:09 PM Last Post: Rschnauzer |
|
pilight-flash not working | danny | 14 | 2,369 |
12-12-2020, 10:00 AM Last Post: tox |
|
pilight does not start, Deamon is not found. | Dekkertje | 6 | 281 |
12-08-2020, 06:55 PM Last Post: Dekkertje |
|
Failed pilight-send that say they succeeded | hepcat72 | 2 | 192 |
12-05-2020, 05:30 PM Last Post: hepcat72 |
|
apt.pilight.org/dists/stable/main/binary 301 Moved Permanently | Rschnauzer | 6 | 438 |
11-23-2020, 01:49 PM Last Post: Rschnauzer |
|
bridging pilight and mosquitto | hansrijn2 | 5 | 674 |
10-26-2020, 06:31 PM Last Post: hansrijn2 |
|
problem publish to pilight MQTT server | Emiks5 | 4 | 886 |
08-31-2020, 07:45 PM Last Post: Emiks5 |
|
pilight for Raspbian Buster (raspberry pi 4) ? | starob | 32 | 11,943 |
08-10-2020, 09:12 AM Last Post: simanuel |
|
pilight switch node in node-red | framp | 0 | 744 |
06-24-2020, 10:01 PM Last Post: framp |
|
pilight-control | TML | 13 | 2,291 |
05-27-2020, 07:51 AM Last Post: curlymo |