kipe / enocean

Python library for EnOcean serial protocol
MIT License
72 stars 103 forks source link

example stops when using contact switch #17

Closed pancho-villa closed 8 years ago

pancho-villa commented 8 years ago

Hello,

I setup my raspberry pi to to run the example with the transceiver hooked up to listen for events from the starter kit contact switch, temperature sensor, and rocker switch. The temp and rocker work fine, but when I activate the contact switch the example_enocean.py file stops with:

2016-02-02 09:09:29,547 - enocean.communicators.Communicator - DEBUG - 01:81:19:2D->FF:FF:FF:FF (-58 dBm): 0x01 ['0xd5', '0x0', '0x1', '0x81', '0x19', '0x2d', '0x80'] ['0x1', '0xff', '0xff', '0xff', '0xff', '0x3a', '0x0'] {} 2016-02-02 09:09:29,558 - enocean.communicators.SerialCommunicator - INFO - SerialCommunicator stopped

What is going on?

kipe commented 8 years ago

Could you try changing the example like this:

        if p.type == PACKET.RADIO and p.rorg == RORG.BS1:
            # alternatively you can select FUNC and TYPE explicitely
            # p.select_eep(0x00, 0x01)
            # parse it
            for k in p.parse_eep(0x00, 0x01):
                print('%s: %s' % (k, p.parsed[k]))
pancho-villa commented 8 years ago

Excellent, that worked! Thanks

kipe commented 8 years ago

Great! I think this might be related to the EEP-issue described in issue #16.