Giter Site home page Giter Site logo

udi-polyglot-interface's People

Contributors

einstein42 avatar exking avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jimboca

udi-polyglot-interface's Issues

No traceback from some errors

I don't get a traceback for this unless I run in the foreground. We need polyglot to print this to make user debugging possible.

pi@rpi3-2:~/.polyglot/nodeservers/HarmonyHub $ ./harmony_hub.py
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/home/pi/.local/lib/python3.5/site-packages/paho/mqtt/client.py", line 2650, in _thread_main
    self.loop_forever(retry_first_connection=True)
  File "/home/pi/.local/lib/python3.5/site-packages/paho/mqtt/client.py", line 1481, in loop_forever
    rc = self.loop(timeout, max_packets)
  File "/home/pi/.local/lib/python3.5/site-packages/paho/mqtt/client.py", line 1003, in loop
    rc = self.loop_read(max_packets)
  File "/home/pi/.local/lib/python3.5/site-packages/paho/mqtt/client.py", line 1284, in loop_read
    rc = self._packet_read()
  File "/home/pi/.local/lib/python3.5/site-packages/paho/mqtt/client.py", line 1849, in _packet_read
    rc = self._packet_handle()
  File "/home/pi/.local/lib/python3.5/site-packages/paho/mqtt/client.py", line 2305, in _packet_handle
    return self._handle_publish()
  File "/home/pi/.local/lib/python3.5/site-packages/paho/mqtt/client.py", line 2500, in _handle_publish
    self._handle_on_message(message)
  File "/home/pi/.local/lib/python3.5/site-packages/paho/mqtt/client.py", line 2647, in _handle_on_message
    self.on_message(self, self._userdata, message)
  File "/home/pi/.local/lib/python3.5/site-packages/polyinterface/polyinterface.py", line 200, in _message
    self.inConfig(parsed_msg[key])
  File "/home/pi/.local/lib/python3.5/site-packages/polyinterface/polyinterface.py", line 372, in inConfig
    watcher(config)
  File "/home/pi/.local/lib/python3.5/site-packages/polyinterface/polyinterface.py", line 527, in _gotConfig
    self.start()
  File "/home/pi/development/udi-harmony-poly/harmony_hub_nodes/HarmonyController.py", line 85, in start
    if vl.amount == 1:
NameError: name 'vl' is not defined

Warnings

Hi, I had an issue with polyinterface been used inside udi polyglot this week.

I'm using a lib wrote in python that in some point generates a warning message, I was receiving errors like this:

WARNING:py.warnings:./poly.py:102: DeprecationWarning: deprecated

2018-07-13 10:53:56,923 ERROR    ERROR:polyinterface.polyinterface:WARNING:py.warnings:./poly.py:102: DeprecationWarning: deprecated
2018-07-13 10:53:56,923 ERROR    ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:WARNING:py.warnings:./poly.py:102: DeprecationWarning: deprecated
2018-07-13 10:53:56,923 ERROR    ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:WARNING:py.warnings:./poly.py:102: DeprecationWarning: deprecated
2018-07-13 10:53:56,923 ERROR    ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:WARNING:py.warnings:./poly.py:102: DeprecationWarning: deprecated
2018-07-13 10:53:56,923 ERROR    ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:WARNING:py.warnings:./poly.py:102: DeprecationWarning: deprecated
2018-07-13 10:53:56,923 ERROR    ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:WARNING:py.warnings:./poly.py:102: DeprecationWarning: deprecated
2018-07-13 10:53:56,923 ERROR    ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:ERROR:polyinterface.polyinterface:WARNING:py.warnings:./poly.py:102: DeprecationWarning: deprecated

I got it fix adding in my code this:

import warnings
warnings.filterwarnings("ignore")

Could you take a look into this? I can provide more info if needed.

MQTT disconnected and socket errors due to timeout

I restarted a nodeserver and MQTT reconnected:

2018-02-12 10:35:22,712 INFO     Connecting to MQTT... localhost:1883
2018-02-12 10:35:22,791 INFO     MQTT Connected with result code 0 (Success)
2018-02-12 10:35:22,793 INFO     MQTT Subscribing to topic: udi/polyglot/ns/4 -  MID: 1 Result: 0
2018-02-12 10:35:22,794 INFO     MQTT Subscribing to topic: udi/polyglot/connections/polyglot -  MID: 2 Result: 0

The later in the log during that restart:

2018-02-12 10:35:46,998 INFO     MQTT Unexpected disconnection. Trying reconnect.
2018-02-12 10:35:57,009 ERROR    MQTT Connection error: An exception of type timeout occured. Arguments:
('_ssl.c:704: The handshake operation timed out',)
2018-02-12 10:35:57,010 WARNING  /home/pi/.local/lib/python3.5/site-packages/polyinterface/polyinterface.py:252: ResourceWarning: unclosed <ssl.SSLSocket fd=4, family=AddressFamily.AF_INET6, type=2049, proto=6, laddr=('::1', 43765, 0, 0), raddr=('::1', 1883, 0, 0)>
2018-02-12 10:36:08,019 WARNING  /home/pi/.local/lib/python3.5/site-packages/paho/mqtt/client.py:1509: ResourceWarning: unclosed <ssl.SSLSocket fd=4, family=AddressFamily.AF_INET6, type=2049, proto=6, laddr=('::1', 49243, 0, 0), raddr=('::1', 1883, 0, 0)>
2018-02-12 10:36:20,029 WARNING  /home/pi/.local/lib/python3.5/site-packages/paho/mqtt/client.py:1509: ResourceWarning: unclosed <ssl.SSLSocket fd=4, family=AddressFamily.AF_INET6, type=2049, proto=6, laddr=('::1', 41079, 0, 0), raddr=('::1', 1883, 0, 0)>
2018-02-12 10:36:34,043 WARNING  /home/pi/.local/lib/python3.5/site-packages/paho/mqtt/client.py:1509: ResourceWarning: unclosed <ssl.SSLSocket fd=4, family=AddressFamily.AF_INET6, type=2049, proto=6, laddr=('::1', 43705, 0, 0), raddr=('::1', 1883, 0, 0)>
2018-02-12 10:36:52,049 WARNING  /home/pi/.local/lib/python3.5/site-packages/paho/mqtt/client.py:1509: ResourceWarning: unclosed <ssl.SSLSocket fd=4, family=AddressFamily.AF_INET6, type=2049, proto=6, laddr=('::1', 35589, 0, 0), raddr=('::1', 1883, 0, 0)>
2018-02-12 10:37:18,064 WARNING  /home/pi/.local/lib/python3.5/site-packages/paho/mqtt/client.py:1509: ResourceWarning: unclosed <ssl.SSLSocket fd=4, family=AddressFamily.AF_INET6, type=2049, proto=6, laddr=('::1', 35833, 0, 0), raddr=('::1', 1883, 0, 0)>

and in the polyglot log it shows:

2018-2-12 10:35:17 - info: NS: Starting Local NodeServer Camera profile number 4
2018-2-12 10:35:22 - info: MQTTS: Client Connected: Camera
2018-2-12 10:35:22 - debug: MQTTC: Message: udi/polyglot/connections/4: {"connected":true,"node":"4"}
2018-2-12 10:35:22 - info: Camera(4): Processing command: connected
2018-2-12 10:35:23 - info: Camera(4): NodeServer Connected.
2018-2-12 10:41:30 - info: MQTTS: Client Disconnected: Camera
2018-2-12 10:41:30 - info: MQTTS: Client Disconnected: MiLightNodeServer
2018-2-12 10:41:30 - info: MQTTS: Client Disconnected: HarmonyHub
2018-2-12 10:41:30 - info: MQTTS: Client Disconnected: polyglot_frontend-ojYGC
2018-2-12 10:41:30 - info: MQTTS: Client Disconnected: polyglot
2018-2-12 10:41:32 - debug: ISY: 200 - http://192.168.86.64:80/rest/profiles/ns/0/connection/
2018-2-12 10:41:32 - debug: ISY: 200 - http://192.168.86.64:80/rest/profiles/ns/0/connection/
2018-2-12 10:41:35 - info: MQTT attempting reconnection to broker...
2018-2-12 10:41:36 - info: MQTTS: polyglot authenticated successfully.
2018-2-12 10:41:36 - info: MQTTS: Client Connected: polyglot

In the polyglot web page it shows my 2 node servers as connected, but in the Admin Console all 3 nodeserver controllers are ST=False

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.