0

I use MQTT (Mosquitto) and several ESP8266 for sensoring issues.

I want that the clients also can "subsribe" to trigger actions on the clients.

The MQTT Server is placed in a VLAN of my main router. Beside this VLAN another router (let's call it ESP Router) is connected to the main router (all intralan).

The WiFi clients from the ESP router cann connect to the MQTT server via 1883.

But if I want to subscribe topics on the WiFi clients I need port forwarding on the ESP Router. I just can port forward a specific port to a specific port/address. How can I portforward to this complete WiFi subnet? I am using Mikrotik routers.

closed as unclear what you're asking by Bence Kaulics, hardillb, Sean Houlihane, MatsK, Helmar Jun 3 at 17:13

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    If you are looking for help in how to configure a specific router then the question is off topic for IoT and should be asked on Super User (with a LOT more detail e.g. a diagram of your network layout) – hardillb May 23 at 7:46
2

If the clients can connect to the broker then you shouldn't need anything else.

MQTT works over TCP, it's a single persistent bidirectional connection.

The flow is:

  • client connects
  • client subscribed
  • when matching message arrives, broker sends message over existing connection to client
  • if no messages arrive in keep alive period, broker pings client, client responds

Not the answer you're looking for? Browse other questions tagged or ask your own question.