Python ja Tellsticknet

Liittynyt
09.10.2018
Viestejä
548
Moro!

Liittyy toki myös kotiautomaatioon, mutta kokeillaan täällä. Tarkoituksena olisi saada toimimaan Tellstick Net paikallisesti mqtt-palvelin kanssa homeassistantissa. Kirjasto toimii kyllä, Tellstick Net löytyy ja kertoo myös anturitietoja, mutta kun pitäisi saada mqtt toimimaan, niin ei.

Järki loppuu Pythonin kanssa. Virheilmoituksesta ei minulle avaudu mitä ohjelma vaatti.

Asennan palikat Ubuntu 20.04 oheisen sivuston ohjeen mukaan
- Ohjeet: ImportError when running tellsticknet mqtt · Issue #32 · molobrakos/tellsticknet
- Git repo: GitHub - christer/tellsticknet: Interface to a Tellstick Net device on the local network (käyttää uudempaa amqtt-kirjastoa, kun ohjeen repo käyttää hbmqtt)

Kun ajaa tellsticknet mqtt -d, niin itkee seuraavaa:
Koodi:
24-06-10 17:56.31  INFO (MainThread) [tellsticknet.__main__] Debug is on
24-06-10 17:56.31 DEBUG (MainThread) [asyncio] Using selector: EpollSelector
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.__main__] checking for config file /home/coolbiz/.local/bin/tellsticknet.conf
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.__main__] checking for config file /home/coolbiz/.local/bin/.tellsticknet.conf
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.__main__] checking for config file /home/coolbiz/tellsticknet.conf
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.mqtt] Found 2 devices in config
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.mqtt] Client id is tellsticknet_tellsticklocal_1718042191.116892
24-06-10 17:56.31 DEBUG (MainThread) [amqtt.client.plugins] Loading plugins for namespace amqtt.client.plugins
24-06-10 17:56.31 DEBUG (MainThread) [amqtt.client.plugins]  Loading plugin packet_logger_plugin = amqtt.plugins.logging:PacketLoggerPlugin
24-06-10 17:56.31 DEBUG (MainThread) [amqtt.client.plugins]  Initializing plugin packet_logger_plugin = amqtt.plugins.logging:PacketLoggerPlugin
24-06-10 17:56.31 DEBUG (MainThread) [amqtt.client.plugins]  Plugin packet_logger_plugin ready
24-06-10 17:56.31  INFO (MainThread) [tellsticknet.discovery] Discovering tellstick devices ...
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.util] Sending to sock <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 0)> <broadcast>:30303
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.util] Sending packet to <broadcast>:30303
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.util] Wrote data to sock <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 48325)>: b'D'
24-06-10 17:56.31  INFO (MainThread) [tellsticknet.mqtt] Connecting
24-06-10 17:56.31 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-2' coro=<run.<locals>.mqtt_task() done, defined at /home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/mqtt.py:507> exception=ClientException("Missing connection parameter 'uri'") created at /home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/mqtt.py:529>
source_traceback: Object created at (most recent call last):
  File "/home/coolbiz/.local/bin/tellsticknet", line 8, in <module>
    sys.exit(app_main())
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/__main__.py", line 263, in app_main
    asyncio.run(main(args), debug=debug)  # pylint: disable=no-member
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 603, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
    self._run_once()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1851, in _run_once
    handle._run()
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/__main__.py", line 176, in main
    await run(partial(discover, ip=ip), config)
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/mqtt.py", line 529, in run
    loop.create_task(mqtt_task())
Traceback (most recent call last):
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/mqtt.py", line 510, in mqtt_task
    await mqtt.connect(uri=mqtt_url, cleansession=False)
  File "/home/coolbiz/.local/lib/python3.8/site-packages/amqtt/client.py", line 160, in connect
    self.session = self._initsession(uri, cleansession, cafile, capath, cadata)
  File "/home/coolbiz/.local/lib/python3.8/site-packages/amqtt/client.py", line 561, in _initsession
    raise ClientException("Missing connection parameter 'uri'")
amqtt.client.ClientException: Missing connection parameter 'uri'
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.util] Reading from <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 48325)>
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.util] No data available on socket yet
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.util] Data available on socket
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.util] Reading from <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 48325)>
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.util] Got data from sock <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 48325)>: (b'TellStickNet:ACCA54019906:KCXRUNFA2J:17', ('10.10.10.150', 30303))
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.discovery] Got b'TellStickNet:ACCA54019906:KCXRUNFA2J:17' from 10.10.10.150:30303
24-06-10 17:56.31  INFO (MainThread) [tellsticknet.discovery] Found TellStickNet device with firmware 17 at 10.10.10.150
24-06-10 17:56.31 DEBUG (MainThread) [tellsticknet.controller] Created controller: Controller@10.10.10.150 (acca54019906)
24-06-10 17:56.31  INFO (MainThread) [tellsticknet.mqtt] Controller found
24-06-10 17:56.36 DEBUG (MainThread) [tellsticknet.__main__] Poller 5.000000 Took 5.005390
^C24-06-10 17:56.39 DEBUG (MainThread) [asyncio] Close <_UnixSelectorEventLoop running=False closed=False debug=True>
Mitä teen väärin?

Ja tilanne ei muutu, vaikka käyttäisin tuoreempaa ubuntua (22.04).
 
Liittynyt
17.10.2016
Viestejä
5 673
Ainakin itselleni pisti silmään virhe "exception=ClientException("Missing connection parameter 'uri'")" eli yhtäkkiä tuosta voisi veikata että varmaankin mqtt-brokerin osoite puuttuu tai sitten koodissa on jotain pielessä. Joka tapauksessa amqtt.client haluaa parametrin "uri" jota se ei saa.
 
Liittynyt
09.10.2018
Viestejä
548
Taitaa liittyä käyttäjänimeen ja salasanaan mqtt-palvelimella. Mulla nämä toimii sisäverkossa ja en ole nähnyt tarpeelliseksi laittaa käyttäjänimeä/salasanaa. Kun määrittelen "väärät" niin vikakoodi on eri..

Koodi:
24-06-10 18:53.03  INFO (MainThread) [tellsticknet.__main__] Debug is on
24-06-10 18:53.03 DEBUG (MainThread) [asyncio] Using selector: EpollSelector
24-06-10 18:53.03 DEBUG (MainThread) [tellsticknet.__main__] checking for config file /home/coolbiz/.local/bin/tellsticknet.conf
24-06-10 18:53.03 DEBUG (MainThread) [tellsticknet.__main__] checking for config file /home/coolbiz/.local/bin/.tellsticknet.conf
24-06-10 18:53.03 DEBUG (MainThread) [tellsticknet.__main__] checking for config file /home/coolbiz/tellsticknet.conf
24-06-10 18:53.03 DEBUG (MainThread) [tellsticknet.mqtt] Found 2 devices in config
24-06-10 18:53.03 DEBUG (MainThread) [tellsticknet.mqtt] Client id is tellsticknet_tellsticklocal_1718045583.1023693
24-06-10 18:53.03 DEBUG (MainThread) [amqtt.client.plugins] Loading plugins for namespace amqtt.client.plugins
24-06-10 18:53.03 DEBUG (MainThread) [amqtt.client.plugins]  Loading plugin packet_logger_plugin = amqtt.plugins.logging:PacketLoggerPlugin
24-06-10 18:53.03 DEBUG (MainThread) [amqtt.client.plugins]  Initializing plugin packet_logger_plugin = amqtt.plugins.logging:PacketLoggerPlugin
24-06-10 18:53.03 DEBUG (MainThread) [amqtt.client.plugins]  Plugin packet_logger_plugin ready
24-06-10 18:53.03 DEBUG (MainThread) [asyncio] Close <_UnixSelectorEventLoop running=False closed=False debug=True>
Traceback (most recent call last):
  File "/home/coolbiz/.local/bin/tellsticknet", line 8, in <module>
    sys.exit(app_main())
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/__main__.py", line 263, in app_main
    asyncio.run(main(args), debug=debug)  # pylint: disable=no-member
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/__main__.py", line 176, in main
    await run(partial(discover, ip=ip), config)
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/mqtt.py", line 503, in run
    mqtt_url = get_mqtt_url()
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/mqtt.py", line 114, in get_mqtt_url
    config = dict(
ValueError: dictionary update sequence element #4 has length 0; 2 is required
 
Liittynyt
17.10.2016
Viestejä
5 673
Nyt tuossa vaikuttaisi olevan joku konfiguraatiotiedosto-ongelma ilmeisesti, kun jonkun asian pituus on 0 kun haluaisi 2. Voi tietty olla että jos konfiguraatiosta puuttuu esimerkiksi joku asetus niin se lukee noita jotenkin väärin ja antaa epämääräisiä ilmoituksia.

Ja vaikka tuo pyöriikin sisäverkossa niin olen muutaman kerran törmännyt siihen että mqtt vaatii käyttäjänimen ja salasanan toimiakseen oikein, jotkut softat on ilmeisesti koodattu niin että ei ole ajateltu että joku käyttäisi anonyymisti.
 
Liittynyt
09.10.2018
Viestejä
548
Nyt tuossa vaikuttaisi olevan joku konfiguraatiotiedosto-ongelma ilmeisesti, kun jonkun asian pituus on 0 kun haluaisi 2. Voi tietty olla että jos konfiguraatiosta puuttuu esimerkiksi joku asetus niin se lukee noita jotenkin väärin ja antaa epämääräisiä ilmoituksia.

Ja vaikka tuo pyöriikin sisäverkossa niin olen muutaman kerran törmännyt siihen että mqtt vaatii käyttäjänimen ja salasanan toimiakseen oikein, jotkut softat on ilmeisesti koodattu niin että ei ole ajateltu että joku käyttäisi anonyymisti.
Täytyy huomenna uusilla silmillä laittaa käyttäjätunnus ja salasana kuntoon ja kokeilla uudelleen. Kiitos avusta!

(helpottaa kun kirjoittaa ajatuksensa ja ongelmansa auki ja horisee toisen kanssa, niin helpompi purkaa asiaa auki)
 
Liittynyt
09.10.2018
Viestejä
548
Auttoi ja ei auttanut. Virheilmoitus muuttui. Ohjelmisto kirjautuu jo mqtt brokerille, mutta jostain syystä pudottaa hanskat..

Koodi:
24-06-11 16:43.41  INFO (MainThread) [tellsticknet.__main__] Debug is on
24-06-11 16:43.41 DEBUG (MainThread) [asyncio] Using selector: EpollSelector
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.__main__] checking for config file /home/coolbiz/.local/bin/tellsticknet.conf
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.__main__] checking for config file /home/coolbiz/.local/bin/.tellsticknet.conf
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.__main__] checking for config file /home/coolbiz/tellsticknet.conf
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.mqtt] Found 2 devices in config
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.mqtt] Client id is tellsticknet_tellsticklocal_1718124221.2749429
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client.plugins] Loading plugins for namespace amqtt.client.plugins
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client.plugins]  Loading plugin packet_logger_plugin = amqtt.plugins.logging:PacketLoggerPlugin
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client.plugins]  Initializing plugin packet_logger_plugin = amqtt.plugins.logging:PacketLoggerPlugin
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client.plugins]  Plugin packet_logger_plugin ready
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.mqtt] MQTT credentials loaded from /home/coolbiz/.config/mosquitto_pub
24-06-11 16:43.41  INFO (MainThread) [tellsticknet.discovery] Discovering tellstick devices ...
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] Sending to sock <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 0)> <broadcast>:30303
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] Sending packet to <broadcast>:30303
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] Wrote data to sock <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 53770)>: b'D'
24-06-11 16:43.41 WARNING (MainThread) [asyncio] Executing <Task pending name='Task-1' coro=<main() running at /home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/__main__.py:176> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f0761dd22e0>()] created at /usr/lib/python3.8/asyncio/base_events.py:422> cb=[_run_until_complete_cb() at /usr/lib/python3.8/asyncio/base_events.py:184] created at /usr/lib/python3.8/asyncio/base_events.py:595> took 0.105 seconds
24-06-11 16:43.41  INFO (MainThread) [tellsticknet.mqtt] Connecting
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client] Connect to: mqtt://username:password@10.10.10.120:1883
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] Reading from <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 53770)>
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] No data available on socket yet
24-06-11 16:43.41 DEBUG (MainThread) [asyncio] <asyncio.TransportSocket fd=7, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('10.10.10.140', 44022), raddr=('10.10.10.120', 1883)> connected to 10.10.10.120:1883: (<_SelectorSocketTransport fd=7 read=polling write=<idle, bufsize=0>>, <asyncio.streams.StreamReaderProtocol object at 0x7f0761de14c0>)
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client.plugins] Plugins len(_fired_events)=1
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] Data available on socket
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] Reading from <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 53770)>
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] Got data from sock <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 53770)>: (b'TellStickNet:ACCA54019906:KCXRUNFA2J:17', ('10.10.10.150', 30303))
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.discovery] Got b'TellStickNet:ACCA54019906:KCXRUNFA2J:17' from 10.10.10.150:30303
24-06-11 16:43.41  INFO (MainThread) [tellsticknet.discovery] Found TellStickNet device with firmware 17 at 10.10.10.150
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.controller] Created controller: Controller@10.10.10.150 (acca54019906)
24-06-11 16:43.41  INFO (MainThread) [tellsticknet.mqtt] Controller found
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client.plugins] Plugins len(_fired_events)=1
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] tellsticknet_tellsticklocal_1718124221.2749429 Starting reader coro
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Handler tasks started
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Begin messages delivery retries
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] End messages delivery retries
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Handler ready
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Executed machine preparation callbacks before conditions.
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Initiating transition from state new to state connected...
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Executed callbacks before conditions.
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Executed callback before transition.
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Exiting state new. Processing callbacks...
24-06-11 16:43.41  INFO (MainThread) [transitions.core] Finished processing state new exit callbacks.
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Entering state connected. Processing callbacks...
24-06-11 16:43.41  INFO (MainThread) [transitions.core] Finished processing state connected enter callbacks.
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Executed callback after transition.
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Executed machine finalize callbacks
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client] connected to 10.10.10.120:1883
24-06-11 16:43.41  INFO (MainThread) [tellsticknet.mqtt] Connected to MQTT server
24-06-11 16:43.41  INFO (MainThread) [tellsticknet.mqtt] Connected to MQTT server
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.mqtt] Setting up devices
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client] Watch broker disconnection
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Task cancelled, reader loop ending
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Broker closed connection
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Reader coro stopped
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Stopping 0 puback waiters
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Stopping 0 pucomp waiters
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Stopping 0 purec waiters
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Stopping 0 purel waiters
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] waiting for tasks to be stopped
24-06-11 16:43.41 DEBUG (MainThread) [asyncio] Close <_UnixSelectorEventLoop running=False closed=False debug=True>
Traceback (most recent call last):
  File "/home/coolbiz/.local/bin/tellsticknet", line 8, in <module>
    sys.exit(app_main())
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/__main__.py", line 263, in app_main
    asyncio.run(main(args), debug=debug)  # pylint: disable=no-member
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/__main__.py", line 176, in main
    await run(partial(discover, ip=ip), config)
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/mqtt.py", line 545, in run
    devices = [
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/mqtt.py", line 548, in <listcomp>
    if e.get("controller", controller.mac_address).lower()
AttributeError: 'NoneType' object has no attribute 'get'
 
Liittynyt
18.10.2016
Viestejä
1 791
Onkos sulla jossain lähdekoodia esillä?
Pahon mqtt client moduuli käytössä vai mikä?
Edit: eiku alotusviestissähän noi näkyy olevankin näköjään... :smoke:
 
Liittynyt
18.10.2016
Viestejä
1 791
Auttoi ja ei auttanut. Virheilmoitus muuttui. Ohjelmisto kirjautuu jo mqtt brokerille, mutta jostain syystä pudottaa hanskat..

Koodi:
24-06-11 16:43.41  INFO (MainThread) [tellsticknet.__main__] Debug is on
24-06-11 16:43.41 DEBUG (MainThread) [asyncio] Using selector: EpollSelector
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.__main__] checking for config file /home/coolbiz/.local/bin/tellsticknet.conf
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.__main__] checking for config file /home/coolbiz/.local/bin/.tellsticknet.conf
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.__main__] checking for config file /home/coolbiz/tellsticknet.conf
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.mqtt] Found 2 devices in config
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.mqtt] Client id is tellsticknet_tellsticklocal_1718124221.2749429
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client.plugins] Loading plugins for namespace amqtt.client.plugins
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client.plugins]  Loading plugin packet_logger_plugin = amqtt.plugins.logging:PacketLoggerPlugin
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client.plugins]  Initializing plugin packet_logger_plugin = amqtt.plugins.logging:PacketLoggerPlugin
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client.plugins]  Plugin packet_logger_plugin ready
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.mqtt] MQTT credentials loaded from /home/coolbiz/.config/mosquitto_pub
24-06-11 16:43.41  INFO (MainThread) [tellsticknet.discovery] Discovering tellstick devices ...
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] Sending to sock <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 0)> <broadcast>:30303
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] Sending packet to <broadcast>:30303
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] Wrote data to sock <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 53770)>: b'D'
24-06-11 16:43.41 WARNING (MainThread) [asyncio] Executing <Task pending name='Task-1' coro=<main() running at /home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/__main__.py:176> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f0761dd22e0>()] created at /usr/lib/python3.8/asyncio/base_events.py:422> cb=[_run_until_complete_cb() at /usr/lib/python3.8/asyncio/base_events.py:184] created at /usr/lib/python3.8/asyncio/base_events.py:595> took 0.105 seconds
24-06-11 16:43.41  INFO (MainThread) [tellsticknet.mqtt] Connecting
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client] Connect to: mqtt://username:password@10.10.10.120:1883
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] Reading from <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 53770)>
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] No data available on socket yet
24-06-11 16:43.41 DEBUG (MainThread) [asyncio] <asyncio.TransportSocket fd=7, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('10.10.10.140', 44022), raddr=('10.10.10.120', 1883)> connected to 10.10.10.120:1883: (<_SelectorSocketTransport fd=7 read=polling write=<idle, bufsize=0>>, <asyncio.streams.StreamReaderProtocol object at 0x7f0761de14c0>)
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client.plugins] Plugins len(_fired_events)=1
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] Data available on socket
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] Reading from <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 53770)>
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.util] Got data from sock <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 53770)>: (b'TellStickNet:ACCA54019906:KCXRUNFA2J:17', ('10.10.10.150', 30303))
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.discovery] Got b'TellStickNet:ACCA54019906:KCXRUNFA2J:17' from 10.10.10.150:30303
24-06-11 16:43.41  INFO (MainThread) [tellsticknet.discovery] Found TellStickNet device with firmware 17 at 10.10.10.150
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.controller] Created controller: Controller@10.10.10.150 (acca54019906)
24-06-11 16:43.41  INFO (MainThread) [tellsticknet.mqtt] Controller found
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client.plugins] Plugins len(_fired_events)=1
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] tellsticknet_tellsticklocal_1718124221.2749429 Starting reader coro
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Handler tasks started
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Begin messages delivery retries
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] End messages delivery retries
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Handler ready
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Executed machine preparation callbacks before conditions.
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Initiating transition from state new to state connected...
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Executed callbacks before conditions.
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Executed callback before transition.
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Exiting state new. Processing callbacks...
24-06-11 16:43.41  INFO (MainThread) [transitions.core] Finished processing state new exit callbacks.
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Entering state connected. Processing callbacks...
24-06-11 16:43.41  INFO (MainThread) [transitions.core] Finished processing state connected enter callbacks.
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Executed callback after transition.
24-06-11 16:43.41 DEBUG (MainThread) [transitions.core] Executed machine finalize callbacks
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client] connected to 10.10.10.120:1883
24-06-11 16:43.41  INFO (MainThread) [tellsticknet.mqtt] Connected to MQTT server
24-06-11 16:43.41  INFO (MainThread) [tellsticknet.mqtt] Connected to MQTT server
24-06-11 16:43.41 DEBUG (MainThread) [tellsticknet.mqtt] Setting up devices
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.client] Watch broker disconnection
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Task cancelled, reader loop ending
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Broker closed connection
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Reader coro stopped
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Stopping 0 puback waiters
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Stopping 0 pucomp waiters
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Stopping 0 purec waiters
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] Stopping 0 purel waiters
24-06-11 16:43.41 DEBUG (MainThread) [amqtt.mqtt.protocol.handler] waiting for tasks to be stopped
24-06-11 16:43.41 DEBUG (MainThread) [asyncio] Close <_UnixSelectorEventLoop running=False closed=False debug=True>
Traceback (most recent call last):
  File "/home/coolbiz/.local/bin/tellsticknet", line 8, in <module>
    sys.exit(app_main())
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/__main__.py", line 263, in app_main
    asyncio.run(main(args), debug=debug)  # pylint: disable=no-member
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/__main__.py", line 176, in main
    await run(partial(discover, ip=ip), config)
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/mqtt.py", line 545, in run
    devices = [
  File "/home/coolbiz/.local/lib/python3.8/site-packages/tellsticknet/mqtt.py", line 548, in <listcomp>
    if e.get("controller", controller.mac_address).lower()
AttributeError: 'NoneType' object has no attribute 'get'
Ootkos sää tuon tellsticknet.conf tiedoston konffannu oikein?
 
Liittynyt
09.10.2018
Viestejä
548
Ootkos sää tuon tellsticknet.conf tiedoston konffannu oikein?
Mielestäni kyllä. Eaimerkkitiedostoa puukotin niin, että poistin ylimääräiset ja korjasin oman anturini id:n tellduslivestä.

Täytyy tarkistaa ja vaikka vaihtaa toiseen anturin id:hen.
 
Liittynyt
09.10.2018
Viestejä
548
Mielestäni kyllä. Eaimerkkitiedostoa puukotin niin, että poistin ylimääräiset ja korjasin oman anturini id:n tellduslivestä.

Täytyy tarkistaa ja vaikka vaihtaa toiseen anturin id:hen.
.conf -tiedosto oli väärin tehty. Tai siis viimeisen anturin jälkeen ei saa olla "---" -erotinta. Ne kun poisti, niin lähti pelaamaan.

Kiitos osallistuneille!
 
Liittynyt
18.10.2016
Viestejä
1 791
.conf -tiedosto oli väärin tehty. Tai siis viimeisen anturin jälkeen ei saa olla "---" -erotinta. Ne kun poisti, niin lähti pelaamaan.

Kiitos osallistuneille!
Sitähän mä aattelin, kun toi rivi mikä tuon virheen antaa ei pysty luomaan oliota Devices luokasta oliota ja crashaa siihen kun ei ole get atribuuttia. Kuka tuon ohjelman on aikoinaan kirjoittanut olisi voinut tutustua virheeen käsittlyyn ja laittaa ulostamaan vähän kuvaavampi virhe ilmoitus. :smoke:
 
Liittynyt
09.10.2018
Viestejä
548
Sitähän mä aattelin, kun toi rivi mikä tuon virheen antaa ei pysty luomaan oliota Devices luokasta oliota ja crashaa siihen kun ei ole get atribuuttia. Kuka tuon ohjelman on aikoinaan kirjoittanut olisi voinut tutustua virheeen käsittlyyn ja laittaa ulostamaan vähän kuvaavampi virhe ilmoitus. :smoke:
Jep. Ja muutenkin on ohjeet olemattomat tähän. Anturit pelaa, mutta nyt tapellaan itseoppivien pistokkeiden kanssa..
 
Toggle Sidebar

Statistiikka

Viestiketjut
245 261
Viestejä
4 279 945
Jäsenet
71 635
Uusin jäsen
Fima

Hinta.fi

Ylös Bottom