Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

IoT home project setup

Mon Jul 08, 2019 2:08 pm

I used pi to control IoT things at home. I have 3 raspberry Pi to control various things. I have a router.

so if I want an APP from outside to control things at home, it sends a http request with my home router IP address.

1)router gets the http request from outside and I want the router to broadcast a message to all if the condition is met. For example the http request has a parameter string of token=IoT. I want the router to broadcast the message from the http request. For example, location=pi 3.
So, this way only raspberry pi 3 will respond.
How do I set up the router to perform above function. If router cannot do that, do I need to implement a dedicated pi to serve as IoT server to implement the above logic. The outer just pass everything to my dedicated pi IoT server, which will do the broadcast to the network at home.

2)if my router doesn't have a fixed IP address, then I need to periodically send the IP address to cloud so phone APP from outside can send http request. How often I need to do that? updating the IP address to cloud? Can my router able to send the IP address or I need the dedicated IoT Pi Server to do that?

Posts: 1440
Joined: Thu Oct 09, 2014 2:50 am

Re: IoT home project setup

Mon Jul 08, 2019 7:34 pm

You might want to look at VPNs to eliminate having to update the cloud with your IP. If used properly, they are also more secure than having direct access from the web or wifi.

Posts: 15825
Joined: Tue Jul 17, 2012 3:02 pm

Re: IoT home project setup

Mon Jul 08, 2019 8:47 pm

Be aware that half the well known VPNs in the world are not secure. They are owned by a very small handful of mysterious companies in China.

If you use a VPN better to run it on your own cloud server instance.
Memory in C++ is a leaky abstraction .

Posts: 1
Joined: Mon Jun 17, 2019 5:34 am

Re: IoT home project setup

Fri Jul 19, 2019 4:48 am

If I understand you correctly.

1) Although some router do support webhooks, I recommend against relying on the router for message broadcasting for the reason that routers are not the strong point for such tasks. Instead, you should port-forwarding your router to one of your computers (acting as the message broadcaster) and implement your broadcasting logic there. A fully programmable application server will give you ultimate control of how it should work.

2) Google "dynamic DNS" you should be able to find a handful of solutions that offers you a static Domain name (free or paid) and point it to your real IP address by periodically syncing the local IP address to the remote DNS server. I heard services like Namecheap has started offering such services. Since you're in China, one thing you could encounter is that the IP update might not be able to reach out of the GFW, a decent VPN such as ExpressVPN or Lantern etc. either installed on your application server or your router should be able to take care all possible "networking problems". More China VPN choices.

Posts: 1
Joined: Mon May 04, 2020 7:05 am

Re: IoT home project setup

Tue May 05, 2020 6:36 am

The recommended way is to go to the Virtual Server in your router's setting and create Port Forwarding entries for your devices. Your logic implementation will be seamless this way as compared to when you are using the router to broadcast your command.
As for the router's IP, you can use a Taiwan VPN to get a dedicated IP to eliminate this issue, as others have suggested. People are having their reservations about the reliability of Chinese VPNs; ironically the paid VPN services in China are all foreign based, and so are the Taiwan and HK ones. So you should be safe in that regard, if you choose to go for that option.

Return to “General discussion”