Re: [Mosquitto-users] python daemon - on_message callback not fired

2013-02-05 Thread Alexander Bolotnov
I have just finished re-doing my code to pretty much the same thing. Thanks for assistance. Sasha Bolotnov www.bolotnov.info On Wed, Feb 6, 2013 at 12:14 AM, Roger Light wrote: > It looks like this is an interaction with daemon.runner. I don't know > what is causing it yet, but the modified

Re: [Mosquitto-users] python daemon - on_message callback not fired

2013-02-05 Thread Roger Light
It looks like this is an interaction with daemon.runner. I don't know what is causing it yet, but the modified example below works fine. Cheers, Roger #!/usr/bin/python import mosquitto import config import time class Client(): def __init__(self): self.mc = None print('Clas

Re: [Mosquitto-users] python daemon - on_message callback not fired

2013-02-05 Thread Alexander Bolotnov
Loop (any of the three options) is causing exception: pi@raspberrypi ~/tmp $ ./Mosquitto.py start Class initialization... Creating an instance of MQ client... Successfully created MQ client... Subscribing to topics... Failed to subscribe to topic "voice/all": (0, 1) Failed to subscribe to topic "c

Re: [Mosquitto-users] python daemon - on_message callback not fired

2013-02-04 Thread Roger Light
Dear Alexander, > My problem is that on_message will not get hit. You aren't calling the network processing loop anywhere so only outgoing communication will happen. You should use loop() periodically, loop_start() once to run the network loop in a thread in the background, or loop_forever() to c

[Mosquitto-users] python daemon - on_message callback not fired

2013-02-04 Thread Alexander Bolotnov
Hi, I'm trying to write a little mosquitto python daemon that will run in background and fire actions on messages. Code quoted below. My problem is that on_message will not get hit. I've tried referencing both the Class method and unbound method outside of Client class - no luck. Self-tests messag