forked from esprfid/esp-rfid
-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Ingmar Joern edited this page Sep 13, 2020
·
3 revisions
Welcome to the esp-rfid wiki! this is not the offitial esp-rfid wiki, it is more or less a faq for me and could help you as well.
To use MQTT to trigger the relay you have to send a JSON string including the IP of the ESP-RFID.
To test it you can try mosquitto_pub on linux:
mosquitto_pub -h Your.MQTT.Broker.IP -t testrfid -m '{"doorip":"192.168.xxx.xxx","cmd":"opendoor"}'
To get a list of users from the ESP-RFID:
- start listening for mqtt messages with the topic YOUR-ESP-RFID-Topic/send example:
mosquitto_sub -h MQTT.Broker.IP -t testrfid/send
- send a message to the ESP-RFID including its IP:
mosquitto_pub -h MQTT.Broker.IP -t testrfid -m '{"doorip":"192.168.xxx.xxx","cmd":"listusr"}'
in the listening window you'll get the answer to the request:
{"command":"userfile","uid":"123456756","user":"Inge","acctype":1,"validuntil":2145916800}