The reason to do this is because the local server doesn’t support DHCP as the Blynk cloud does.
That’s rather an odd statement. If you believe that the Blynk cloud server is acting as a DHCP server for your Arduino device then you should probably do some reading-up about local IP address allocation and DNS resolution of URLs.
Once the server is running and you uploaded the modified sketch to the Arduino board, go to the app in your phone and logout from the Blynk cloud by clicking on the icon with the exit door. Login again, but this time select a custom server and put the IP address and port of your local server.
If people follow this process then their Arduino device will fail to connect to the local server. The correct sequence should be:
- log out of cloud account
- enter local server IP
- create an account on the local server
- create project, and add a device
- use the Auth code for this project in your sketch
I think it’s also worth mentioning to users that this isn’t a “self hosted cloud” server. It’s a local server within your own network, and the app can’t access the data from the Blynk server unless you use the public IP of your internet connection (assuming you have a static public IP) or a DDNS URL in the custom server settings of the app. This will require port forwarding by the router, and a DDNS update client on your network if you don’t have a static IP.
For many people, spending a small amount on some Blynk energy is probably much easier (and cheaper) than setting-up a local server, configuring their router and DDNS settings - and of course maintaining these on an ongoing basis.