The goal is to act as a gateway between 433Mhz sensors and a MQTT broker or between the MQTT broker and 433Mhz actuators, It enables to:
It can be an interesting part in an home automation system so as to interface sensors and actuators (wall sockets) with software like openhab.
List of compatible sensors here
The interest of putting this gateway to an ESP8266 and not on a raspberry pi is to be able to manage security actions at gateway level (power on a siren, cut power to certain devices) following RF data received by sensors without being dependent to the PI for security related actions.
[EDIT] all infos are now centralized into the github repository take a look at it you will find up to date info about OpenMQTTGateway
You need:
Software:
Hardware
Transmitter signal to pin D2, Receiver signal to pin D1
Here is the schematic:
If you want to increase the range of the receiver XD RF 5V plug its vcc directly to a 5V power supply like on the schema below and not to Vin of your nodemcu, it will considerably increase the range. In this case I disconnect the usb cable as I don't know if the nodemcu can handle the both source of power.
Some pictures:
Download the following libraries from your arduino environment:
Download the code of the gateway:
Upload the sketch to your ESP8266 and open the serial monitor with a speed set to 9600b.
- receive MQTT data from a topic and send RF 433Mhz signal corresponding to the received MQTT data
- publish MQTT data to a different topic related to received 433Mhz signal
It can be an interesting part in an home automation system so as to interface sensors and actuators (wall sockets) with software like openhab.
List of compatible sensors here
The interest of putting this gateway to an ESP8266 and not on a raspberry pi is to be able to manage security actions at gateway level (power on a siren, cut power to certain devices) following RF data received by sensors without being dependent to the PI for security related actions.
[EDIT] all infos are now centralized into the github repository take a look at it you will find up to date info about OpenMQTTGateway
You need:
Software:
- Mosquitto
- Arduino IDE latest version (tested ok with 1.6.10)
- esp8266 board added to the arduino IDE board manager version >= 2.3.0
Hardware
Transmitter signal to pin D2, Receiver signal to pin D1
Here is the schematic:
Some pictures:
Remote control used for the tests
Download the following libraries from your arduino environment:
- RCSwitch
- PubSubClient
- ESP8266WiFi
Download the code of the gateway:
Upload the sketch to your ESP8266 and open the serial monitor with a speed set to 9600b.
Launch or verify that you mosquitto broker is up and running
If the connexion to mosquitto is ok you should see on the serial monitor of the arduino "connected" & "subscription OK to home/MQTTto433/"
If the connexion to mosquitto is ok you should see on the serial monitor of the arduino "connected" & "subscription OK to home/MQTTto433/"
Now you can do some tests to verify that all is working as expected, here is some usefull commands to test gateway with mosquitto from the server, on your mosquitto server:
- Subscribe to the subject for data reiception from RF signal
- Send data by MQTT to convert it on RF signal
Arduino IDE serial data received when publishing data by MQTT
We see that the Arduino receive the value 1315156 on the MQTT subject "MQTTto433" and send the data by RF
Arduino IDE serial data received when receiving data by 433Mhz
We see that the Arduino receive the value 1315156 on the MQTT subject "MQTTto433" and send the data by RF
Arduino IDE serial data received when receiving data by 433Mhz
MQTT subject follow from command line:
pi@raspberrypi ~ $ sudo mosquitto_sub -t home/# -v
home/433toMQTT 1312084
home/433toMQTT 1312095
Enjoy!
Nice! Something I was looking for.
RépondreSupprimerNice indeed! I missed your page when I did the same. I also included a web admin page. See https://github.com/dagrende/cheaperstick.
RépondreSupprimerI have made some notes about issues I am having using your code on your Git page. Unfortunately, it does not appear you have seen them.
SupprimerCe commentaire a été supprimé par un administrateur du blog.
RépondreSupprimerGood description of the project! I developed both the solutions on NodeMCU and Arduino (in both the cases I used the native IDE libraries instead of LUA), but while with Arduino I have a strong signal (operating on a distance of ten meters and more), with NodeMCU I must put the 433mhz trasmitter very close to the receiver. Any idea for so a different behaviour?
RépondreSupprimerDepenfing on your nodemcu the vin voltge can vary, if you have check it with a multimeter. It should be 5v. If you are using an fs1000a emitter you could go up to 12v so as to increase the range. Nevertheless the receiver must stay 5v powered.
Supprimerhello
RépondreSupprimerNot work on esp8266.
serial ms:
MQTT connection...
failed, rc=
-2
try again in 5s
Although mqtt server is running a port the login password is correct. Openhab2 works with this mqtt server and everything connects transmits and receives data.
In the sketch nothing changed downloaded as there is only set in the wifi config data of my network and mqtt server data.
Hello,
SupprimerMay I advise you to go to the chat room so as to request support:
https://gitter.im/OpenMQTTGateway/Questions_support
I can not get the "433toMQTTto433" on the ESP8266 to work with WIFI.
RépondreSupprimer433toMQTTto433 has been replaced by OpenMQTTGateway
Supprimerhello,
RépondreSupprimerjust wanted to say that i've just finished setting up your OpenMQTTGateway project on an ESP8266 coupled with 433RF.
Implementing RF sensors with MQTT has become easy as it gets. I've already installed an arduino that's sending sensor readings with few lines of code and can't wait to add other beacons to the network.
I was meaning to "buy you a coffee", but it seems the link is dead.
Thanks a lot for the project!
Hi, glad to hear that it works ! Yes I removed my BuyMeAcoffee page due to the fact that I can't no longer receive payment. Thanks for the attention
Supprimer