NOOB Question: ESPEasy Infrared Remote and Serial RS232 controller at the same time?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Wookbert
Normal user
Posts: 25
Joined: 06 Nov 2020, 03:17

NOOB Question: ESPEasy Infrared Remote and Serial RS232 controller at the same time?

#1 Post by Wookbert » 27 Nov 2020, 21:01

Sorry for the question, but I'm pretty new to ESPEasy:

I have a Benq W1070+ projector which I'd like to turn on and off via RS232, and a Logitech Z-5500 which I need to control via Infrared (for which I've purchased the Wemos IR shield).

Is it possible to do both with a single ESPEasy unit on a Wemos D1 mini (4M) or will I need to separate units.
ir_v1.0.0_1_16x16.jpg
ir_v1.0.0_1_16x16.jpg (247.97 KiB) Viewed 6974 times
ir_v1.0.0_2_16x16.jpg
ir_v1.0.0_2_16x16.jpg (265.82 KiB) Viewed 6974 times
Last edited by Wookbert on 27 Nov 2020, 21:05, edited 1 time in total.

TD-er
Core team member
Posts: 4527
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NOOB Question: ESPEasy Infrared Remote and Serial RS232 controller at the same time?

#2 Post by TD-er » 27 Nov 2020, 21:05

If you get the ESP to communicate via RS232 with your beamer, then I don't see any reason why it should not work with IR and RS232 at the same time.
I think the first part is the hardest.

One thing that may be an issue is that you should not use Software Serial along with IR as both act on interrupts.
Better use an hardware Serial port.

Wookbert
Normal user
Posts: 25
Joined: 06 Nov 2020, 03:17

Re: NOOB Question: ESPEasy Infrared Remote and Serial RS232 controller at the same time?

#3 Post by Wookbert » 27 Nov 2020, 21:33

Sorry, but I really have almost no knowledge on this whole stuff: What’s the difference? Software Serial uses some of the GPIO pins and emulates the serial protocol in Software, while Hardware Serial uses the UART pins (which has what kind of downsides/consequences?)

TD-er
Core team member
Posts: 4527
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NOOB Question: ESPEasy Infrared Remote and Serial RS232 controller at the same time?

#4 Post by TD-er » 27 Nov 2020, 21:48

Software Serial can use almost any combination of GPIO pins (only a few exceptions)
On ESP8266 there are only 2 HW serial ports:
- Serial0
- Serial1

Serial1 can only send data, no RX, so hardly usable.

Serial0 typically uses GPIO 1 and 3, the same pins you use to flash it.
Serial0 can also be configured to swap pins 1&3 to 13&15.
GPIO-15 does need an extra PNP transistor to make sure it doesn't get pulled up during boot, or else the ESP may not boot if something is connected.

Advantage of using HW serial is that it does handle it all incoming traffic without relying on interrupts.
IR receiving does rely on interrupts too, so it may interact with Software Serial (causing missing bits)

Wookbert
Normal user
Posts: 25
Joined: 06 Nov 2020, 03:17

Re: NOOB Question: ESPEasy Infrared Remote and Serial RS232 controller at the same time?

#5 Post by Wookbert » 01 Dec 2020, 01:50

The interrupts on the Software Serial leads to which problem exactly? Delayed execution (how man ms in worst case?) or no execution (missed commands)?

TD-er
Core team member
Posts: 4527
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NOOB Question: ESPEasy Infrared Remote and Serial RS232 controller at the same time?

#6 Post by TD-er » 01 Dec 2020, 09:41

Software Serial and receiving data from IR use interrupts with the same priority.
And I assume both may disable interrupts temporarily when receiving a sequence of data to make sure they get at least that message.

So on receiving data either one may block the other.

Not sure if sending data via SW serial is also blocking, but I would not be surprised if it were to make sure timing requirements are met.

Wookbert
Normal user
Posts: 25
Joined: 06 Nov 2020, 03:17

Re: NOOB Question: ESPEasy Infrared Remote and Serial RS232 controller at the same time?

#7 Post by Wookbert » 02 Dec 2020, 16:13

Oh, I’ve just realized that I might have created some confusion: I actually have no intention to send commands via IR and RS232 at the exact same time. Sorry for the misleading Topic title. I only want to use the same Wemos D1 mini, to be able to send commands both via IR and RS232, but not in parallel.

Correct me if I'm wrong, but that means that the SW serial related interrupts are actually not a problem.

TD-er
Core team member
Posts: 4527
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NOOB Question: ESPEasy Infrared Remote and Serial RS232 controller at the same time?

#8 Post by TD-er » 02 Dec 2020, 19:08

If the Ir and serial are never being processed at the same time (SW serial sending or receiving) then I don't think there will be a problem.

Wookbert
Normal user
Posts: 25
Joined: 06 Nov 2020, 03:17

Re: NOOB Question: ESPEasy Infrared Remote and Serial RS232 controller at the same time?

#9 Post by Wookbert » 02 Dec 2020, 22:00

Am I correct, that regardless whether I use SW or HW serial, that if I need a proper RS232, I'll need a RS232-TTL board, like discussed here?

Search-Link AliExpress

TD-er
Core team member
Posts: 4527
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: NOOB Question: ESPEasy Infrared Remote and Serial RS232 controller at the same time?

#10 Post by TD-er » 02 Dec 2020, 22:04

You mean a level converter?
It is better to use it if the signal levels are not at the same level as the ESP uses.
Some devices indeed need to have the signal levels at levels higher than 3v3.
For those you better use such a level converter.

Wookbert
Normal user
Posts: 25
Joined: 06 Nov 2020, 03:17

Re: NOOB Question: ESPEasy Infrared Remote and Serial RS232 controller at the same time?

#11 Post by Wookbert » 19 Jan 2021, 04:06

I've meanwhile figured out — don't forget I'm still a NOOB — how the IR part works:
ESPEasy IR Setup.png
ESPEasy IR Setup.png (119.51 KiB) Viewed 2771 times
By sending e.g http://10.0.1.88/control?cmd=IRSEND,NEC,10EF58A7 I can increase the volume of my nearby Logitech Z5500 surround system. So far, so good.

I've also received a couple of those MAX3232-RS232-TTL Converters for my goal to control the BENQ W-1070+ projector using the very same ESP8266 unit.
MAX3232-RS232-TTL-Converter.jpg
MAX3232-RS232-TTL-Converter.jpg (83.05 KiB) Viewed 2771 times

Question now is how to connect and configure that in addition to my IR setup?
  • Hardware-wise RX gets wired to TX, and TX to RX? (Plus VCC and GND of course.)
  • What to do in software, in the ESPEasy Web-UI?


Wookbert
Normal user
Posts: 25
Joined: 06 Nov 2020, 03:17

Re: NOOB Question: ESPEasy Infrared Remote and Serial RS232 controller at the same time?

#12 Post by Wookbert » 21 Jan 2021, 19:34

FYI, here is the serial protocol of my BenQ W-1070+ (same protocol across all printer).

The W-1070+ has a 9-pin D-Sub as described on p. 4. Serial commands are ASCII and on p. 8.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 20 guests