oxan / esphome-stream-server

Stream server (serial-to-wifi bridge) for ESPHome
Other
201 stars 86 forks source link

can use muti serial? #23

Closed raxel0510 closed 1 year ago

raxel0510 commented 2 years ago

ESP32 have 3 uart can use uart1 port:5000 uart2 port:5001???

mc0110 commented 2 years ago

Thanks for this amazing tool! Sorry for my stupid question - I tried to connect the stream-server with 2 uarts - this can as yaml validated, but the code isn't executable.

RoganDawes commented 1 year ago

It is definitely possible to run multiple stream servers, even if you do have to change the code a little to allow it. I took a copy of this code a couple of years ago, modified the constructor to accept a port parameter rather than defaulting to a set port, and simply created two stream servers. Not sure if the current code has been updated to allow the same, but it is not difficult to do yourself.

oxan commented 1 year ago

Yes, this is possible:

uart:
  - id: uart1
    # ...
  - id: uart2
    # ...

stream_server:
  - uart_id: uart1
    port: 5000
  - uart_id: uart2
    port: 5001