Browse Source

Merge branch 'main' of github.com:grindylow/ahoy

pull/4/head
Martin Grill 3 years ago
parent
commit
dd085e4a69
  1. 2
      tools/rpi/ahoy.conf.example
  2. 3
      tools/rpi/ahoy.py

2
tools/rpi/ahoy.conf.example

@ -1,6 +1,8 @@
[mqtt]
host = 192.168.84.2
port = 1883
user = bla
password = blub
[dtu]
serial = 99978563412

3
tools/rpi/ahoy.py

@ -18,9 +18,12 @@ cfg = ConfigParser()
cfg.read('ahoy.conf')
mqtt_host = cfg.get('mqtt', 'host', fallback='192.168.1.1')
mqtt_port = cfg.getint('mqtt', 'port', fallback=1883)
mqtt_user = cfg.get('mqtt', 'user', fallback='')
mqtt_password = cfg.get('mqtt', 'password', fallback='')
radio = RF24(22, 0, 1000000)
mqtt_client = paho.mqtt.client.Client()
mqtt_client.username_pw_set(mqtt_user, mqtt_password)
mqtt_client.connect(mqtt_host, mqtt_port)
mqtt_client.loop_start()

Loading…
Cancel
Save