iosswiftip-addresstheta360

How to get the ip address open spherical camera devices and check if connected or not?


I am creating an app where I am using Open spherical camera API to communicate with the camera. I wanted to understand how to get the gateway IP address of the camera and check if the camera is connected with the iPhone.

In a more specific way, I wanted to know the connected wifi network's gateway IP address?


Solution

  • You can use a third-party library FGRoute which provides a method to get the gateway IP address.

    As for checking if camera is connected, you can follow these steps:

    1. Connect to the camera's Wifi network
    2. Check FGRoute.getGatewayIP() for a valid IP address
    3. If IP address is valid then send a command to the camera and check it's response

    If it fails at any stage then, ofcourse, the camera is not connected.


    FYI:

    RICOH THETA API v2.1 conforms to Open Spherical Camera API Version 2.0 by Google, and so you have many commands like camera.getLivePreview that you can send to the camera and check it's response.