Chat freely about anything...

User avatar
By Mike4QL
#47589 I fairly new to Arduino and ESP8266 so there may be an obvious answer to this!

My Setup
    Arduino IDE 1.6.9
    ESP8266 Libraries v2.2.0
    NodeMCU 1.0 (ESP-12E module)

I'm running the WifiClient example and have added the settings for my WiFi. This works flawlessly.

I can connect to various external URLs but client.connect() fails whenever I try to connect to an address on my local subnet.

The address I'm connection to is accessible from other devices on the same subnet. I have even configured port forwarding so I can connect to my router's external IP address and that works OK. I've also tried running the same server (it is Node.js) on a Raspberry Pi instead of Windows but it is unable to connect directly.

It looks as if the connect function is unable to route to addresses on the same subnet. Perhaps it's trying to send all traffic through the default route or gateway.

Has anybody else encountered this? Better still has anybody got a solution?
User avatar
By Mike4QL
#51771 Am I the only one with this problem?

Some more info:

I thought it might be my router. I have been able to set up an independent WifI AP and router and that worked but trying it with yet another one didn't. At one point I discovered an update for the main AP. After installing that it worked for a day and then stopped again.

This is a real head scratcher! Any suggestions welcome since I've pretty much run out of ideas.

I have no problem connecting to the MQTT broker from another computer. Also get the same problem if I put the MQTT broker in the other computer.

The AP that doesn't work is TP-Link Archer C7. Also another old TP-Link doesn't work. I have also tried it with an old Vigor AP700 but that also fails. The one that does work is a TP-Link Nano Router.

This is not restricted to MQTT. I have the same problem if I try to connect to port 80.