Esp8266 and arduino uno

hey guys, i have got my nodemcu to work with mqtt and openhab2 finally. but there’s one thing i want to ask.
is there any solution for using arduino uno with openhab using one of those esp8266-01 modules??
the esp8266 and arduino uno are connected via the TX and RX pins.

i tried this is on my own but i am not a coder by any means so till now is what i have done is the the esp8266 send the payload TEXT to the serial monitor and i can see it easily. but i want arduino to recieve the text and do the programmed actions. but i am not able to do that. is there any other solution?

Not sure that I am fully following. Do you want the ESP8266 just to serve for wifi access and the arduino actually do some controlling of some devices?
The ESP8266 can do almost everything the arduino can do (plus wifi etc). Alternatively you can have some shields for arduino for internet access, there are even implementations on how an arduino CAN serve as a MQTT broker. Not sure what you want to achieve, and whether this is the right forum; there is boatloads of advice on programming ESP8266 with the arduino IDE out there.

1 Like

i want to controll my arduino uno through openhab using esp8266. my solution was that the esp connects to the mqtt server and receives and sends the payload like any other esp would do but i connected the arduino to its tx and rx pins so that it forwards the payload messages from the mqtt broker to arduino and vice versa.

Hi Sai_Khurana,
I’m also waiting for my arduino ESP8266 Relay :slight_smile:
Hope this thread will help you [OH2] Control ESP8266 Relay using MQTT Eventbus

1 Like

I am sure that is possible somehow, but again I think this is the wrong
forum (Arduino forums or esp8266 centers forums may be better) and frankly,
not sure anyone tried that. You are more likely to find solutions that are
Arduino only or Esp8266 only, combining them that way may make sense only
in very limited circumstances if at all.
Both systems are flexible enough to do the job you want though, but I would
expect that the programming needs to be done by yourself. Good luck.

Actually, the ESP8266 was originally designed to be an Arduino WiFi shield. Well, it may not have been designed as such but that was definitely one of the first uses it was put to in the hacker community.

It was only later that hackers discovered a way to get them to run Arduino code and to act like a microcontroller. So OP’s approach is not novel or unexpected.

But, @Sai_Khurana, I’ll second the recommendation to post to an Arduino/ESP8266 forum. There are lots of Arduino and ESP users on this forum but you will reach a far broader audience of users able to help you on a special purpose forum.

1 Like

I never tried my esp8266-01 as an arduino shield once I discovered I could program it directly, I just used the esp in place of the uno. I had it working with a local mqtt broker and openhab however then I realised the 01 is really lacking in sufficient easily accessible gpio. I now use a (few) wemos d1 and fund that much more capable