Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback not called #28

wackazong opened this issue Oct 9, 2016 · 1 comment

Callback not called #28

wackazong opened this issue Oct 9, 2016 · 1 comment


Copy link

@wackazong wackazong commented Oct 9, 2016

Python newbie question: I try to wrap the xBee connection into a class. But the callback gets never called if it is a class method. If it is not in a class it works fine. What can I do?

class Receiver:
def enter(self):
self.serial_port = serial.Serial('/dev/ttyUSB0', 115200)
self.xbee = ZigBee(self.serial_port, escaped=True, callback=self.handlePackets)'Receiver: enter')
return self
def exit(self ,type, value, traceback):'Receiver: exit')
def handlePackets(data):'Receiver: packet incoming')

Copy link

@hansmosh hansmosh commented Oct 10, 2016

It's hard to say what is wrong since your comment doesn't have any indentation, but try adding self to def handlePackets(self, data):.

Questions like this are better asked on a site like GitHub Issues are generally meant for reporting issues with the code in this repository, not with individual issues with using it.

@hansmosh hansmosh closed this Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants