Hardware for connecting an RS232 serial device to wifi

The instructions say to enter the serial port and baud rate not an IP address.

It’s a bit confusing…It does describe how to set up a direct serial port, but not how to use a serial bridge…

However, it does seem to support it:

Home Assistant BenQ projector integration

Home Assistant integration that supports sending commands to BenQ projectors over the serial interface or serial to network bridges like esp-link.

PS, Searched some more and came up with these:

But I am not sure you can use socat on HAOS :thinking: PJLink shouldn’t be an issue though :wink:

@nickrout
It is very confusing, as his currernt configuration does seem to understand it needs to use a telnet connection :thinking:

So maybe it is either serial port + baudrate or ip-address + port ?

edit…just checked the source, and indeed it accept both serial port + baudrate as well as ip-address + port:

    conf_type = CONF_TYPE_SERIAL
    if CONF_TYPE in entry.data:
        conf_type = entry.data[CONF_TYPE]

    if conf_type == CONF_TYPE_TELNET:
        host = entry.data[CONF_HOST]
        port = entry.data[CONF_PORT]

        # Test if we can connect to the device.
        projector = BenQProjectorTelnet(host, port)

        # Open the connection.
        if not await hass.async_add_executor_job(projector.connect):
            raise ConfigEntryNotReady(f"Unable to connect to device {host}:{port}")
    else:
        serial_port = entry.data[CONF_SERIAL_PORT]
        baud_rate = entry.data[CONF_BAUD_RATE]

        # Test if we can connect to the device.
        try:
            projector = BenQProjectorSerial(serial_port, baud_rate)

So I guess if he changes the 8000 to 23 (or 2323), it should work :ok_hand:

That seems to make sense.

It also seems we miss the first screenshot :smiley:
image

With this one, everything makes sense :thinking:

Serial:
image

Network:
image

1 Like

Perhaps someone should submit a PR for the readme.

1 Like

I used your tool to flash esp-link! You made it very easy :slight_smile:

When ports are auto-filled, I typically defer to the default. When I get home I’ll try 23, then try 2323 if that fails. Fingers crossed :smiley:

Indeed, the instructions could use some clarification. Once I get everything settled here, I’ll submit a readme PR to clarify what’s needed for others in the future.

Hehe…that was they general idea behind it, good to know it works!!
:smiley:

if you are using mine the port are 23 and 2000 (i changed the port as the app i use is stuck on port 2000 )

Using port 23 got me a step further. It seems to have found esp-link but is now having issues connecting to the projector.

Logger: benqprojector.benqprojector
Source: /usr/local/lib/python3.12/site-packages/benqprojector/benqprojector.py:277
First occurred: 09:57:08 (4 occurrences)
Last logged: 10:01:17

Failed to get projector command prompt, is your projector properly connected?

I swapped the TX & RX pins, tried again, and got the same error. Same with trying port 2000. All attempts were made with the projector powered on.

i’ve read somewhere the projector’s network should be in standby mode

(whatever that means…i don’t have one)

and port 23 and 2000 are the same, so it doesn’t matter which one you use :wink:

Tried again with the projector in standby mode, same result:

Logger: benqprojector.benqprojector
Source: /usr/local/lib/python3.12/site-packages/benqprojector/benqprojector.py:277
First occurred: 09:57:08 (7 occurrences)
Last logged: 19:48:54

Failed to get projector command prompt, is your projector properly connected?

Here are my pin connections. I’ve tried swapping TX/RX on the 8266 with the same result:

In the esp-link settings, I enabled SLIP for serial connections and have MQTT disabled. Do I need MQTT enabled? What should I try next?

Sorry…can’t be of much further help here (as I don’t own a Benq Projector)

But I am pretty sure SLIP needs to be disabled; it only allows the board to initiate a connection.
And Benq uses a TelNet connection, initiated from HA.
Also MQTT is not used.

You could try some different GpIO settings:
image
These are for my ESP01-s, which I use with my PelletStove,
Not sure exactly what settings to use for your ESP12-F :thinking:

I disabled SLIP and tried again with the same results. I also attempted using each of the pre-set profiles, once with UART normal and once reversed.

I went through the projector settings again and couldn’t find anything about enabling or disabling RS232. Enabling the 12v trigger didn’t change anything, as expected.

All of this is with TX wired to esp RX, and RX wired to esp TX.

Kinda feels like I’m missing a step somewhere. Is there config I need to apply to the serial bridge uC? Or settings/config for esp-link that tells it how to communicate with the projector? Unplugging the uC from the 8266 yields the same error message I keep seeing in the HASS logs:

Failed to get projector command prompt, is your projector properly connected?

I’m drawing a blank on troubleshooting next steps. Any ideas?

What is the baudrate?

according benq it should be 9600…

And just out of curiosity, it doesn’t have a lan connection?

1 Like

Projector default is 115200. I tried adjusting it to 9600 in the projector settings, no success. That said, the baud rate in esp-link is fixed at 115200, so it’s unclear if changing the value in my projector’s settings is even capable of having an impact on its own. How would I adjust this in esp-link?

It doesn’t have a discrete network connection. The projector comes with a BenQ-branded Android TV stick that can be installed in a dedicated HDMI port underneath (requires removing the case to install). The stick enables plug-and-play streaming like most smart TVs these days, but the setup process requires linking a Google account and still doesn’t provide projector controls. I don’t want my projector communicating with anything beyond my local network — a sentiment I suspect most people on this board share :grinning:

Hmm…the link I saw it was 9600, but could be 115200…as said, I’m stumbling i the dark here, just trying to think along, but don’t have a projector myself :thinking:

You can adjust it in the console (as well as stop bits and parity)

1 Like

Updated to 9600 on both ends to no avail. Figured I’d also try swapping the TX/RX pins again just in case … and it worked!!! BenQ projector integration added successfully! :raised_hands: :tada: :raised_hands:

It’s a little slow and not entirely reliable, but since this will only be used to control power on/off, I’ll take it! I’m monitoring its power consumption as a proxy for status and will build in some retries as needed.

For posterity:

  • In the BenQ projector settings, set baud rate to 9600
  • In esp-link, set baud rate to 9600
  • Wiring between the ESP-12F and the serial bridge is: TX to TX, RX to RX.
  • Assign a static local IP address to the esp-link device
  • In the HACS setup flow, select “network”, then enter the above static local IP address and port 23.

Thanks a ton @aceindy! I really appreciate the troubleshooting help. Hope to pay it forward soon :slight_smile:

2 Likes

Just mark me as solution :wink:

Hi! Sorry for arriving late at the party. Great to see my BenQ integration is being used. Of course you could have created a GitHub Issue to get your questions resolved, but you figured it out eventually.

Some clarifications on the issues raised.

I don’t own a networked BenQ projector nor do I own a second projector which I can use for testing and development. My only projector is installed on my production HA installation and connected over serial using a serial to USB converter.

I have developed the network support because of popular demand, but since I don’t use it myself I’m dependant on feedback from users who use the integration on a networked projector for further improving the functionality. Also since I only have one projector (which is installed on my ceiling) development and testing is a bit cumbersome.

Port 8000 is used because that’s the port number the networked BenQ projectors are said to work on according to the BenQ documentation, but I never heard from anyone if this works or not. If you use a different solution, like esp-link than the port number of that solution is needed. You figured that out.

Increasing the Baud rate in your projector and the esp-link configuration might improve the responsiveness of your projector.

If you have some Python skills you’re welcome to improve the networking related code.

I’m looking forward to your improvements to the README

Also you can buy me a coffee :wink:

1 Like

Hello there, I’d also like to pick up this topic as I’m very new to the whole Home Automation topic and one thing that bugged me the most is to shutdown every device in the living room by hand :smiley:

So I bought myself a ESP32 C3 which to my understanding does not need ESP-Link, right?

I loaded up ESP Home in Home Assistant, set-up the device and I’m also able to connect to it through HAOS or via the ESP Home Web Interface. A static IP is set.

However I seem to be a little bit on the stupid side of things :smiley:

From my understanding the next step is to connect the ESP32 along with the TTL converter to the Projector, boot it up and connect to the ESP32 via Home Assistant.

I keep facing the “Unexpected error” and I think it is also related to the baud-rate of the device? However I don’t know how to change this, as I don’t have this nice Microcontroller Console from aceindy.

Would someone of you mind, guiding me through this? I’d take the chance to write up a step-by-step guide for future use on your github repo, so no-one else asks the questions again :stuck_out_tongue:

I tried setting the BAUD Rate in ESPHome like this, However I had no luck in getting the connection to work:

substitutions:
  name: esphome-web-831570
  friendly_name: Benq_W2700_Control

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  name_add_mac_suffix: false
  project:
    name: esphome.web
    version: '1.0'

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: arduino

uart:
  tx_pin: GPIO21 
  rx_pin: GPIO20
  baud_rate: 9600

Here is an overview of my setup:

Many thanks in advance!