433mhz, infrared IR to and from MQTT on ESP8266

The Wio Node seems a little too stripped down for me to try and work with, I do have one the larger Link modules, in the short docs they have about running Arduino on it they mention this:

Number 6 here: Advanced User Guide · Seeed-Studio/Wio_Link Wiki · GitHub

One thing must be noticed that the power supply of Grove sockets is controlled by a MOSFET switch which is gated by GPIO 15. So you must pull up GPIO 15 in your Arduino sketch to power on the Grove system:

pinMode(15, OUTPUT);
digitalWrite(15, 1);

How would I go about doing this in the code?

just add it in the setup() of openmqttgateway.ino

Hi All

I’m the creator of Remoty, is a ESP8266 infrared, I’m looking for help, first let me tell you something about my idea/goal, the firmware in the board is connected to my server/cloud. Via web you can create controls and connect the board with alexa (skill in pending). Also I planning to release a full public API. As you can see my gold is huge just for one person.

I already made a small batch (40 boards), and of course you can flash any firmware on the board, you dont need use my firmware or my server.

My question are
do you know any website that I can use to sell the board?
can you help to connect the board and my cloud service with the home assistant? of course everything will be opensource

The board has a RGB led, 4 IR led (1 watt power) and 1 IR receiver. If you think that this post is spam or something bad let know and I’ll try to remove it.

Thanks

thanks for that. I got board flashed, I don’t have the bluetooth module yet. but when I plug in the board I get a message over MQTT:

home/OpenMQTTGateway/LWT Online

looking to try and figure out how their grove ports on the board match up the the pins.

from their docs, the wio link grove ports line up like this:

    "D0": { "type": "GPIO", "pin": 14 },
    "D1": { "type": "GPIO", "pin": 12 },
    "D2": { "type": "GPIO", "pin": 13 },
    "A0": { "type": "ANALOG", "pin": 17 },
    "I2C0": { "type": "I2C", "pinsda": 4, "pinscl": 5 },
    "UART0": { "type": "UART", "pintx": 1, "pinrx": 3 }

I’m guessing I would need to modify the OpenMQTTGateway code to link up the right pins for the bluetooth. I’m thinking maybe use the “UART0” port and pins 1 and 3 or the “I2C0” port - pins 4 and 5? I would do this in the config_BT.h file? (Note I’m only looking to use this with Bluetooth, and not any other sensors)

Ah I got a DHT sensor I had already working by changing the ClassicWiring to use Pin 14 which maps to the Digital0 port on the WioLink. Number coming in are a little crazy though:

home/DHTtoMQTT/dht1/hum 1280.00
home/DHTtoMQTT/dht1/temp 563.20
home/DHTtoMQTT/dht1/hum 1408.00
home/DHTtoMQTT/dht1/temp 537.60
home/DHTtoMQTT/dht1/hum 1459.20
home/DHTtoMQTT/dht1/temp 537.60

Do you use the dht11 or dht22?

if you use dht11, you should modify to dht11 in ZsensorDHT.ino

2017-09-14_152623

thanks that solved it. Now waiting on my bluetooth modules to arrive.

One question, I have 2 boards, and when I had both online, all I was getting was the Online message. I think I ended up changing the Gateway Name one one. What is the proper way to configure multiple gatweways?

I got my HM-11 module in today. I’ve connected to my board, and believe I have the pins set right. The HM-11 is getting power, and I was able to connect to it via an ios Bluetooth scanning app. but I’m not getting anything out over MQTT.

Anyway to figure out what is happening? I don’t have serial connection board yet to get a serial connection to the board. should have one next week.

I suppose you could start a Kickstarter but you might hit a wall sadly. People who do DIY know how to cable 4 ir led and the other might simply buy a broadlink rm 3 mini for 15€.

Maybe integrate an rf receiver/transmitter module as well as some luminosity/temperature/humidity/… sensor and you might have a neat product :slight_smile:

This remind me a project I’m familiar with :slight_smile:

1 Like

Yep, but nothing commercial I’m aware of yet :slight_smile:
Would make it accessible for non-DIY people.

PIR sensor addon is available here for test purposes

Thank you to OP and everyone for this gateway.
I got this error trying to compile it.

>     Arduino: 1.8.3 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)"
> 
>     C:\Users\DanialD4\Downloads\Arduino\OpenMQTTGateway\ZgatewayIR.ino: In function 'boolean IRtoMQTT()':
> 
>     ZgatewayIR:66: error: 'USECPERTICK' was not declared in this scope
> 
>            rawCode = rawCode + (results.rawbuf[i] * USECPERTICK);
> 
>                                                     ^
> 
>     exit status 1
>     'USECPERTICK' was not declared in this scope
> 
>     This report would have more information with
>     "Show verbose output during compilation"
>     option enabled in File -> Preferences.

I manage to get it working the first time.
This time I try to include dht11 and try to flash it the 2nd time but got the error instead.
I’m sorry if I’m noob but please explain it like I’m 5. :smile:
Thank you.

Hello,

It’s more likely you didn’t take the good libraries version corresponding to the OpenMQTTGateway code, the best way to proceed is to take the version pointed in the libraries folder of the source code.

Some explanations about why I added RFM69 to the gateway:

Yes you are right, I tried to launch a kickstart, and yes I hit a wall, I think that the idea is good but Is too much just for one person. The project is complete. The only part missing is the box :disappointed:, any person can use it. The setup takes less than 2 minutes. The process is very simple also you can go to the web console, add a remote control for your TV, DVD, etc.

if you have an Alexa, you can use the skill to turn on/off your tv, DVD etc. but also you can mute/pause increase/decrease the volume even change the input. Ex Alexa change input to HDMI1 on TV,

Also, I working on the possibility to add activities, for example when you say Alexa turn on Netflix, this will turn on the TV, Turn on the Roku, change the input on the TV, etc etc, The idea is that via the web you can set up the steps to do.

Yes, I know that there are solutions, but I want to make the process simple. I created a new topic take a look here Remotsy at ESP8266 infreared device

Hey, it’s working. Thank you so much.
It’s weird. I downloaded the respected library from the release version using your library repo and couldn’t work but when I download the zip it work.
Same as your code, many error pop-up if I use the release version.
Or maybe it’s just me who didn’t know how github work.

Strange, I removed all the libraries, redownloaded them and recompiled without any issue

Yeah, I mean which one of the github page should I click if I want the source code? The release tab or the ‘clone or download’ tab?
Note that the gateway already working, I’m just asking something about the github page.
I notice the code from the version 0.3.1 on the release tab is different from the one on ‘clone or download’ tab.
Anyway, thanks for the help.
I have a few other questions, but I’ll probably asking it later.

You should download a stable release, the master and beta releases are for tests only

@1technophile

Hi, I’ve tested during weekend the ADC reading. The sketch didn’t compile for Arduino Mega (error below) however it compiled fine for NodeMCU v3. Probably I don’t have all the libraries but I haven’t investigated further.

It has worked quite reliably, there were differences in value readings compared to the other sketch that I’m using for ADC (Bruh code) however these are quite normal and acceptable as the ADC is not calibrated (also Bruh code updates the light level immediately if changed).

Initially I thought 30s between readings would be an issue however I realized that it simply doesn’t need a quicker update for light level as the sunset doesn’t occur in one second :slight_smile: and I haven’t modified the sketch to decrease it. Anyway, also the MQTT broker is happier with publishing at this rate.

Although, for automations that need instant update reading from light sensor (such as to get feedback from the light bulbs after turning on or off) I think it should be modified to a 1/4 of a second or lower however it just need to modify the sketch. Also, a low response time is needed if using for stuff like open door sensors (in combination with a magnetic hall sensor).

I have an issue on the NodeMCU boards I have: on both v0.4 and 0.3 bluetooth module (non-genuine HM10) and (occasionally) RF receiver (superheterodyne type) the MQTT connection gets reset. This does not trigger full reboot of NodeMCU but only disconnects the MQTT connection and reconnects and it takes a few seconds (3 - 4 at max) to reconnect.

I wouldn’t have observed this if not for the board being connected to an IR blaster with an AC unit. When the NodeMCU gets reset, it loads the code for the MQTT switch (it has retain flag) and sends the IR code to the AC (and AC has a buzzer).

I think there was someone else with a similar problem with the bluetooth module.

This does not occur on the Arduino Mega (v.30) but only on the NodeMCU. It might be a defective board problem (I’m using generic boards and they also have wrong prints for D1 pin on both D1 and D2) however it’s not a sampling aspect. I have tested on 3 units out of the 10 units batch and they all get reset.

Arduino: 1.8.3 (Windows 7), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

C:\Users\Documents\Arduino\libraries\NewRemoteSwitch\NewRemoteReceiver.cpp: In static member function ‘static void NewRemoteReceiver::interruptHandler()’:

C:\Users\Documents\Arduino\libraries\NewRemoteSwitch\NewRemoteReceiver.cpp:45:53: error: cannot convert ‘NewRemoteCode’ to ‘unsigned int’ in argument passing

#define CALLBACK_SIGNATURE (_callback)(receivedCode)

                                                 ^

C:\Users\Documents\Arduino\libraries\NewRemoteSwitch\NewRemoteReceiver.cpp:194:7: note: in expansion of macro ‘CALLBACK_SIGNATURE’

   CALLBACK_SIGNATURE;

   ^