433mhz, infrared IR to and from MQTT on ESP8266

Are the ground of your mobile charger and the ground of the esp connected together ?

1 Like

No,
Esp/nodemcu is connected with my PC and my srx882 is connected to my charger,
Do i need to provide external ground between srx82 and esp/nodemcu?

Yes you need

1 Like

Dear 1technophile,
I get the codes now,
thank you very much for you guide,
I was mistaken with ground as i thought it get by external on receiver and with pc on nodemcu, dont know it should be connected to each other with data and ground too.
Dear,
Can I use this to control 4ch relay switch?
Please guide
thanks.

Glad to hear, as said previously all is on the wiki. Please read it and come back to us if you have any questions.

1 Like

Well,
as i go through wiki i think i cannot control 4c relay with openmqttgateway,
it specially desing for sensors, so if my module/relays have sensors like ir or rf than and than only i can control it.
This is what i feel by going through wiki,
only one option is on off Actuator. but dont know really it can go.

In your case your 433mhz relay is a kind of wall switch controlled by RF. You have to copy the value sent by the remote control and publish it to OMG so as to control the relays.

Dear thanks for your time,
I am talking for my another regular 4ch relay,

This thing is great and has been working great. However once a week it forgets my network. Every Sunday I have to open up the MQTT gateway wife and reconfigure the WiFi, any idea why?

you should use (uncomment): “#define ESPWifiManualSetup true” in “User_config.h”. Of course you will need to configure the correct SSID and password there too.

thanks I will that a try.

If I use NodeMCU V3, can I power on RF rec/emit by VU and GND pins and NodeMCU power by USB power supply (PC or adapter) ? Will it work correctly ?

Thanks

I would try first with the vin pin, if it doesn’t work with the 3.3v. I don’t know the Vu pin function. You need to find the datasheet if you want to be sure that the vu pin can support a load.

Hi Guys,

@technophile thank you for the hard work and sharing!

I really appreciate the openMQTTgateway project in combination with Home Assistant. I am moving from a working setup trough Pimatic and an RPI to Home assistant on a server with embedded ESP solutions.

I am having trouble getting the openMQTTgateway working with a RF 433 stack. I am trying to catch RF signals of a kaku AWMT-230. Till now I haven’t got any success.

The current setup is as followed with an:

  • cp2102 esp8266 Nodemcu v2
  • RF receiver srx882 v1.3
  • USB powered via laptop
  • Version 0.8 of openMQTTgateway

I tried multiple configurations but till now cannot activate RF receiving of any form of RF messages (in specific for KAKU but parallel testing clones).

See my setup in the photo, I connected data to D3 (gpio 0) and also tested D2 to be sure.

Even connected the CS with VCC to enable the receiver (conform specs).
See this link: srx882 pins

Configured the modules as followed:
#define ZgatewayRF “RF” //ESP8266, Arduino, ESP32
//#define ZgatewayRF315 “RF315” //ESP8266, Arduino, ESP32
//#define ZgatewayIR “IR” //ESP8266, Arduino, Sonoff RF Bridge
//#define ZgatewayBT “BT” //ESP8266, Arduino, ESP32
#define ZgatewayRF2 “RF2” //ESP8266, Arduino, ESP32
//#define ZgatewaySRFB “SRFB” // Sonoff RF Bridge
//#define Zgateway2G “2G” //ESP8266, Arduino, ESP32
//#define ZactuatorONOFF “ONOFF” //ESP8266, Arduino, ESP32, Sonoff RF Bridge
//#define ZsensorINA226 “INA226” //ESP8266, Arduino, ESP32
//#define ZsensorHCSR501 “HCSR501” //ESP8266, Arduino, ESP32, Sonoff RF Bridge
//#define ZsensorADC “ADC” //ESP8266, Arduino, ESP32
//#define ZsensorBH1750 “BH1750” //ESP8266, Arduino, ESP32
//#define ZsensorTSL2561 “TSL2561” //ESP8266, Arduino, ESP32
//#define ZsensorBME280 “BME280” //ESP8266, Arduino, ESP32
//#define ZsensorDHT “DHT” //ESP8266, Arduino, ESP32, Sonoff RF Bridge
//#define ZgatewayRFM69 “RFM69” //ESP8266, Arduino, ESP32

The power source for the RF receiver is connected from the VIN and GND of the ESP to VCC and GND of the srx882 v1.3 receiver.

I do not see any message on my bus of the RF receiver but getting messages from node. My powersource is the laptop via USB directly to the ESP. See this output on MQTT:
home/OpenMQTTGateway/LWT Online
home/OpenMQTTGateway/version 0.8
home/OpenMQTTGateway/SYStoMQTT {“uptime”:120,“freeMem”:45824,“rssi”:-27,“SSID”:“3452NN26”,“modules”:“RFRF2”}

I use the following to check mosquitto_sub -h ‘10.0.01’ -t ‘#’ -v

I tried a Lolin ESP other receiver and all kind of combinations units but cannot activate the receiver.

I even tried to enable the CS via direct coupling with the VCC conform spec enabling the srx882.

Nothing seems to work… :frowning:

I really appreciate any suggestions and help, I really want to get this working!

Hello @RoyOltmans,

Here is some try to do:

  • comment also
    #define ZgatewayRF2 “RF2” //ESP8266, Arduino, ESP32

  • check the voltage supplied to the receiver with a multimeter, and if it is not 5v find a suitable power source with the ground linked with the nodemcu one

Thanks for the quick response :smile:, my apologies for my late response.

I commented RF2 and even uncommented it again in the new setup to double check

The config was as followed:
#define ZgatewayRF “RF” //ESP8266, Arduino, ESP32
//#define ZgatewayRF315 “RF315” //ESP8266, Arduino, ESP32
//#define ZgatewayIR “IR” //ESP8266, Arduino, Sonoff RF Bridge
//#define ZgatewayBT “BT” //ESP8266, Arduino, ESP32
//#define ZgatewayRF2 “RF2” //ESP8266, Arduino, ESP32
//#define ZgatewaySRFB “SRFB” // Sonoff RF Bridge
//#define Zgateway2G “2G” //ESP8266, Arduino, ESP32
//#define ZactuatorONOFF “ONOFF” //ESP8266, Arduino, ESP32, Sonoff RF Bridge
//#define ZsensorINA226 “INA226” //ESP8266, Arduino, ESP32
//#define ZsensorHCSR501 “HCSR501” //ESP8266, Arduino, ESP32, Sonoff RF Bridge
//#define ZsensorADC “ADC” //ESP8266, Arduino, ESP32
//#define ZsensorBH1750 “BH1750” //ESP8266, Arduino, ESP32
//#define ZsensorTSL2561 “TSL2561” //ESP8266, Arduino, ESP32
//#define ZsensorBME280 “BME280” //ESP8266, Arduino, ESP32
//#define ZsensorDHT “DHT” //ESP8266, Arduino, ESP32, Sonoff RF Bridge
//#define ZgatewayRFM69 “RFM69” //ESP8266, Arduino, ESP32

The voltage from the nodemcu (single power source) is 4.74v (should be enough), But as suggested separated the power sources. The new power source (seperate USB 5v adapter originally used for a RPI) that delivers 5.15v (should do the trick).
As also discussed in previous post I linked the ground of the 2nd power source to the nodemcu.

Tried the setup with a non KAKU 433 remote and the KAKU switch mentioned in the previous post.

Till now still not getting any results with openMQTT.

So my new (backtracking) step is going to try a simpler RC sketch in the hope the Receiver shows any data. Will come back.

I will document all the details of libs, ide, components, schema’s etc when this works. In the hope no one will have to go trough my en devour :frowning:

If you have any idea what the problem could be please any suggestion or idea.

Maybe @Kirpat could share his setup in a schema, I will double check mine (I think our setup is almost the same).

So just got the simpler code working and received my first 433 Messages :slight_smile: without a secondary power source and a simpler sketch from 1technophile NewRemoteSwitch ShowReceivedCodes from his examples (thanks for this). I had to force to a local library NewRemote.

Funny thing are:

  • The esp gives a error over the serial console, but continues and shows the received codes (so OK for me)
  • The clone 433 remote doesn’t work and AWT kaku switch does (confirming the code)

Working wiring (power source is my laptop):

Response in NewRemoteSwith/ShowReceivedCodes:

Code: 27985018 Period: 267
unit: 0
groupBit: 0
switchType: 0
Code: 27985018 Period: 267
unit: 0
groupBit: 0
switchType: 0
Code: 27985018 Period: 267
unit: 0
groupBit: 0
switchType: 0
Code: 27985018 Period: 267
unit: 0
groupBit: 0
switchType: 0
Code: 27985018 Period: 267
unit: 0
groupBit: 0
switchType: 0
Code: 27985018 Period: 266
unit: 0
groupBit: 0
switchType: 1
Code: 27985018 Period: 267
unit: 0
groupBit: 0
switchType: 1
Code: 27985018 Period: 267
unit: 0
groupBit: 0
switchType: 1

So now I will return to the openMQTT sketch to combine the whole setup. When I get everything working I will post the versions, wiring and steps I took.


Short update, I cloned a new setup and fixed the pin to D1 (5) making the setup comparable with the NewRemoteSwitch ShowRecievedCode Example.

Also started adding debug and extra prints, still not getting any response on my serial console and MQTT bus.

Very strange because the added code is very close to NewRemoteSwitch ShowReceivedCode.

Below the code I added that should print the 433Msges:
void rf2Callback(unsigned int period, unsigned long address, unsigned long groupBit, unsigned long unit, unsigned long switchType) {

rf2rd.period=period;
rf2rd.address=address;
rf2rd.groupBit=groupBit;
rf2rd.unit=unit;
rf2rd.switchType=switchType;
rf2rd.hasNewData=true;
// Print the received code.
Serial.print("Code: “);
Serial.print(address);
Serial.print(” Period: “);
Serial.println(period);
Serial.print(” unit: “);
Serial.println(unit);
Serial.print(” groupBit: “);
Serial.println(groupBit);
Serial.print(” switchType: ");
Serial.println(switchType);

}

This code should dump the calls of the switch on the Serial console.

Hello,
if it is working with newremoteswitch code you should uncomment ZfgatewayRF2 and comment ZgatewayRF and user_config.h.

Hi,

Thnx for the quick response the tips and your patience, I think I am getting closer to the solution (but not yet there).

For now it is still not working with openMQTT, funny thing is that the NewRemoteReceiver doesn’t receive any address data in openMQTT (even with the correct interrupt configs). I am debugging my config and dumping address data directly from the newremotereceiver lib. If I do the same with a lightweight ShowCode example of NewRemote itself it does show address data in openmqtt it doesn’t.

Could it be that NewRemoteReceiver is somehow blocked in OpenMQTT or the interrupt is overwritten. I used Interrupt 0, 15, 4 and 5 and tested pin D1,D2, D8 and D3 with no results in my NodeMCU v2. D2 and D1 work so Interrupt 4 should do the trick but no results yet.

I got the messages in the example ShowCode of NewRemoteReceiver on D1 and D2 not D3 (did not test D8).

This is the response in my serial console (also getting response on MQTT, no messages of the KAKU):
WiFi ok with manual config credentials
OpenMQTTGateway mac:
84:.:…:…:…
OpenMQTTGateway ip:
10.0.0.10
1883
Connecting to MQTT by IP adress
10.0.0.1
RF_EMITTER_PIN
3
RF_RECEIVER_PIN
4
ZgatewayRF2 setup done
MQTT_MAX_PACKET_SIZE
1024
Setup OpenMQTTGateway end
MQTT connection…
Connected to broker
Subscription OK to the subjects

setup config_RF.h pin config is:
#ifdef ESP8266
#define RF_RECEIVER_PIN 4 // D2 on nodemcu
#define RF_EMITTER_PIN 3 // RX on nodemcu

user config modules only ZgatewayRF2 is enabled.

I tried a vanilla dll simple config of version 0.8 even tried version 0.6 and 0.5.

Any suggestion would be much appreciated :slight_smile:

Hello,

If it works with newremoteswitch library it should be ok with OMG keeping the same pins.

This is strange

Is it possible that you have several versions of newremoteswitch library on your pc and in standalone case you use a different version compared to OMG case?