When you update a previous post with updated code it’s useful if you make a post saying that you’ve done that, because we aren’t notified when. you make an edit.
Normally, the Ethernet.begin command would specify the DNS server, gateway and subnet mask, like this…
Ethernet.begin(mac, ip, dns, gateway, subnet);
Gateway would normally be the IP address of your router, the DNS server could be the same, or something like 184.108.40.206
Subnet mask for a 192.168.1.x would be 255.255.255.0 but it’s not clear whether that is the IP address range you’re using.
I suspect that your device is connecting to your MQTT server, as its internal to your network, but that it doesn’t know how to get packets to the outside world, and if it does how to resolve the Blynk cloud server.
On a side note, there might be a better way to use Blynk. My home automation system uses MQTT only code on my devices, and Node-Red with the Blynk plug-in as the gateway to communicate with Blynk.
More info here if you’re interested in this approach…
I replaced the code with the entire Ethernet.begin(mac, ip, dns, gateway, subnet) and declared the correct data for each statement but still the same result. No connection to the Blynk server but still good connection with my MQTT server. Next thing i’m gonna try is use the node-red as i’m allready use this for the visualisation and control of my home automatisation.
I’m now running blynk using node-red and it’s working fine. Strange that it’s not running in the Arduino code but atleast i found a way around it. Thanks for helping me and suggesting this other sollution.
I love the simplicity of using Node-Red to amalgamate the data coming from multiple ‘devices’ into one Blynk device dashboard.
I also like the fact that, if you write your device code sensibly, Node-Red can be your rules engine and you can make the vast majority of your functionality changes in Node-Red rather than having to update the sketches running on your devices.
As far as the original issue is concerned, I still think it’s an issue of getting the device to ‘see’ the outside world via your router, then being able to resolve the Blynk server via a DNS server.