Git Product home page Git Product logo

pilight's People

Contributors

davidlp avatar mcdeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pilight's Issues

pypi package version and reconnect version 0.1.1

Hi maintainers,

Due to a reconnect issue with various domotica platforms I checked today what's causing the reconnections from failing. it seem that the pypi version of pilight python client (this project) is used quite a lot in pre-build docker images with version 0.1.1 however that pypi version does not have the reconnect feature that i see present in the latest source code. (i also checked the source code from the pip package its actually not 0.1.1. (even tough the package is version 0.1.1) it seems but an version older at least). I did a manual patch on the pipy package installed file with the pilight.py from this repo and the issue is fixed. perhaps create a new version to release and a new pypi package so future images will work with the reconnect?

Version determination raises exception

The version is determined during runtime and can lead in faulty installations to an exception rendering this library not usable (e.g. in hackish virtual environments).
Since the version determination is not important the exceptions should be caught.

pilight crashes at init connection

Hello,

Im trying to integrate Home Assistant with pilight.
You lib is used bij HaSS to connect to the API. For some reason pilight daemon crashes when this lib connects to it. See https://forum.pilight.org/showthread.php?tid=3218 for more info.

With this sample code:

REQUIREMENTS = ['pilight==0.1.1']
from pilight import pilight

host = "127.0.0.1"
port = 5001

pilight_client = pilight.Client(host=host, port=port)

The debug output of pilight is:

[Dec 09 20:39:35:338994] pilight-daemon: DEBUG: cpu: 0.076251%
[Dec 09 20:39:36:99890] pilight-daemon: DEBUG: new client, ip: 10.0.0.6, port: 33772
[Dec 09 20:39:36:100054] pilight-daemon: DEBUG: client fd: 17
[Dec 09 20:39:36:118482] pilight-daemon: DEBUG: new client, ip: 10.0.0.6, port: 33774
[Dec 09 20:39:36:118641] pilight-daemon: DEBUG: client fd: 18

Thread 1 "pilight-daemon" received signal SIGSEGV, Segmentation fault.
__GI_strcmp (p1=<optimized out>, p2=<optimized out>) at strcmp.c:38
38      strcmp.c: No such file or directory.
(gdb) backtrace
#0  __GI_strcmp (p1=<optimized out>, p2=<optimized out>) at strcmp.c:38
#1  0xb67c8c20 in request_handler (req=0x4b3b8) at /home/pi/repos/pilight/libs/pilight/core/webserver.c:892
#2  0xb67cba8c in client_read_cb (req=0x4b3b8, nread=0x4b7fc, buf=0x4b848 "{\"options\":") at /home/pi/repos/pilight/libs/pilight/core/webserver.c:1652
#3  0xb67abe54 in uv_custom_poll_cb (req=0x4b3b8, status=0, events=1) at /home/pi/repos/pilight/libs/pilight/core/eventpool.c:694
#4  0xb678a984 in uv__poll_io (loop=0xb6fa95f8 <default_loop_struct>, w=0x4b3ec, events=1) at /home/pi/repos/pilight/libs/libuv/unix/poll.c:64
#5  0xb6784224 in uv__io_poll (loop=0xb6fa95f8 <default_loop_struct>, timeout=2220) at /home/pi/repos/pilight/libs/libuv/unix/linux-core.c:400
#6  0xb677a8d8 in uv_run (loop=0xb6fa95f8 <default_loop_struct>, mode=UV_RUN_DEFAULT) at /home/pi/repos/pilight/libs/libuv/unix/core.c:362
#7  0x0001cb00 in main (argc=2, argv=0xbefff784) at /home/pi/repos/pilight-dev/pilight/daemon.c:3468
(gdb) frame 0
#0  __GI_strcmp (p1=<optimized out>, p2=<optimized out>) at strcmp.c:38
38      in strcmp.c
(gdb) frame 1
#1  0xb67c8c20 in request_handler (req=0x4b3b8) at /home/pi/repos/pilight/libs/pilight/core/webserver.c:892
892                             } else if(strcmp(&conn->uri[(rstrstr(conn->uri, "/")-conn->uri)], "/") == 0) {
(gdb) frame 2
#2  0xb67cba8c in client_read_cb (req=0x4b3b8, nread=0x4b7fc, buf=0x4b848 "{\"options\":") at /home/pi/repos/pilight/libs/pilight/core/webserver.c:1652
1652                    int x = request_handler(req);
(gdb) frame 3
#3  0xb67abe54 in uv_custom_poll_cb (req=0x4b3b8, status=0, events=1) at /home/pi/repos/pilight/libs/pilight/core/eventpool.c:694
694                                             custom_poll_data->read_cb(req, &custom_poll_data->recv_iobuf.len, custom_poll_data->recv_iobuf.buf);
(gdb) frame 4

Is your lib compatible with version 8 of pilight?
And is there anything I can do to fix this issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.