Skip to content

Commit

Permalink
port_io: removed mqtt publishing on button press
Browse files Browse the repository at this point in the history
This crashed the ESP because the IRQ-handler must not allocate any
memory. Hence mqtt status and manually changed relay status will not
be in sync.
  • Loading branch information
mattzzw committed Jan 20, 2019
1 parent 1b88013 commit e81803a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions obi_socket/port_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ def button_on_off_callback(pin):
toggle_output(cfg.RELAY)
# set LED according to output
set_output(cfg.LED_R, get_output(cfg.RELAY))

# FIXME: This crashes the ESP because irq handlers must not allocate memory!
'''
# publish mqtt status
if (get_output(cfg.RELAY)):
obi_mqtt.publish_status(obi_mqtt.mqtt_client, obi_tools.load_cfg(), 'on')
else:
obi_mqtt.publish_status(obi_mqtt.mqtt_client, obi_tools.load_cfg(), 'off')
'''
else:
# check for long_press
pr_time = utime.ticks_ms()
Expand Down

0 comments on commit e81803a

Please sign in to comment.