Android & iOS scan network for Raspberry Pi?

2019-09-02 00:46发布

问题:

I want my Android and iOS (Swift to be specific) apps to connect to the Raspberry Pi in the network. Of course I can set a fix IP for the Pi and hardcode the IP to the apps, but I would like to know how to do it more dynamically.

What do I need to do on both sides to allow the apps to discover the Pi?

回答1:

If you are connected over Wifi(Access Point) then you can discover devices using SSDP protocol.which does multicast at 1900 port and whoever has joined to particular group will receive and can respond back with information.It can be implemented both side App as well as Pi.