How to access MQTT broker within multiple routers

I have two routers in my house 1 on the first floor and the second one on the second floor, The booth routers are connected through an ethernet cable, I have a home assistant instance that connected to the router on the second floor and I have a sensor which connected to the router first floor, Now I need to read sensor values from home assistant but when I try to connect to the MQTT local IP it’s refuse the connection because in the first router the IP is not for MQTT.

How I can access the MQTT broker which connected to the first router by using the second router?

This is a networking issue. You have a few options but I don’t know your specific situation.
The easiest thing to do would to put one of your routers (if it supports it) into a bridge mode.

From what I understand, you should not set up the upstairs router as a router, but just as a wifi access-point
In that way it will just be one network, re-using the dhcp from the main router :wink:

If your router is not capable of acting as AP, maybe re-flash it with OpenWRT or DD-WRT?
I use both my old isp routers as wifi AP’s using both openwrt (on a D-Link) and ddwrt (on a linksys), as my EdgeX router doesn’t have wifi capabilities :yum: