BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Temperature and Humidity Sensor on a Self-Hosted Cloud

Hi Community!

I just wanted to share with you this easy proejct I made with an Arduino Uno with an Ethernet Shield, an AM2302 sensor, an old Beaglebone and Blynk. I hope you enjoy it. I published the details on hackster.io.

Any constructive comments are welcome!
Thanks.

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.

Pete.

1 Like

Hi Pete

Thanks for taking the time to read the article and comment on it.

I don’t think the Blynk Local Server is acting as a DHCP server. And you’re right that I forgot to mention the registration step and also that maintaining a local server is no easy task. At the moment I don’t plan to access the sensor data from outside of my network so it doesn’t have a public IP address, but I may do it in the future to automate some things based on the readings. And that brings to the table the challenge of making the server secure, which is not trivial. So it’s worth mentioning as well.

I’ll edit the article to clarify this points.

And change 1000L by 2000L or more. This is because the AM2302, unlike the DHT11, needs to wait at least 2 seconds (= 2000 milliseconds) in between measurements.

This is not your fault, but I’m compelled to enlighten you on my crusade against the DHT11! :crossed_swords: :joy:

The DHT11 doesn’t work well with a sample rate of 1 Hz! I know it says so in the Blynk examples, some
datasheets and on many other forums, but it doesn’t! (read my previous posts on the subject for more info)

That’s all! :slight_smile: