Ubidots Community

[SOLVED] Identifying Static ip

Hi Jota,
I have working on purplish to Ubidots example it work fine , but I’d like to identifying static IP. How can I do it.

Best wishes.

Hi there, you can reference the fixed ips available to connect for data sending here. I strongly advise you to use DNS endpoints instead of fixed ips, because they may change in the future.

All the best

Thank you Jota for replay, I mean using static IP to connect with local router. Because I planning to make condition if internet is stopped send data through wireless to PLC. The protocol of used PLC is (POINT TO POINT) which require fixed IP.

Best regards

Greetings @tony, to identify an external IP is a custom configuration that is related with every device, so there is not a ‘recipe’ in this case. You should reference your device manual to know how to sniff available ips in your local network.

All the best.

Greeting Jota, as I mention to you, my device is known it’s router we can identify ips from to I put this command in difinition of code “IPAddress staticIP224_60(192,168,1,80);”
and this command " WiFi.config(staticIP224_60);" in void setup() but this yield “Attempting MQTT connection…failed, rc=-2 try again in 3 seconds”


Greetings, according to the Pubsubclient docs, an return code equals to -2 means that your broker endpoint is unreachable. You should check your local network or broker settings to know if the final endpoint is available in the LAN and if your PLC broker accepts MQTT type connections.

I would like to give additional hints, but your as your question is related with a custom configuration and not with Ubidots, this issue is something out of my support scope.

All the best.