Is it normal for the Theta V to always time out when trying to execute commands?
I’m just trying to connect from an Android app, take a picture, download and save it. I used the code from the SDK and imported it, but it’s not very stable. Timeouts occur literally all the time. When setting the capture mode, taking the picture and downloading it. Sometimes it works without any hitch, but that’s about once in every 10 tries.
Is there something I’m missing with the development of apps using this product. I’m connecting via Wifi, then using HttpAsyncClient to post and get responses from the device.
So the Theta V when connected to my PC works perfectly fine. No interruptions, command runs every time. When using the HttpConnector from the sample app in v2.1 API sample It times out on setImageCaptureMode everytime when trying to take a picture. Below is the info about the device I’m testing on.
I tried to use startSession on the Theta V but that doesn’t work as well. I thought maybe I needed to do that but that made no difference.
I always get “java.net.ConnectException: Failed to connect to /192.168.1.1:80”
When the Android phone is connected to the THETA with Wi-Fi, there is a security window that pops up and asks if you want to stay connected to a Wi-Fi connection that has no Internet access. Did you select, “Stay Connected?”
That is probably serving the same purpose. thanks for this additional information. I’ve seen the problem with disconnect on different Android devices, but usually there’s a way to resolve it.
The notification window comes from the Android OS. I’m not sure it comes up on all phones. I’ll find a screenshot and post it here.
Hopefully, the forceConnectToWifi() will resolve your problem.
BTW, as you like to tinker with the camera, you should join the partner program to put your THETA V into developer mode. Start the process here. The main advantage is that you can then put your camera into developer mode and access the internal Android OS. The partner program is free. There doesn’t appear to be a downside to joining as far as I can tell.
It appears to be an issue with the Android device that I am working with, but that’s not to say it can’t happen on other devices. I’m on a Samsung Galaxy S7 Edge .
After selecting the Theta from the Wifi Settings Screen , there is a small period of time where the device is determining Internet connectivity. During this period of time, all queries to the Theta appear to be blocked, hence the SocketException I was receiving. Once the device has established the connectivity to the Internet (which is none, when connected to the Theta), I can communicate with the Theta.
Some points to note, I was using the WifiManager class to determine whether I was connected, halting all communication until it reported a state of COMPLETED through WifiManager.connectionInfo.supplicantState . Though the connection was COMPLETED, it still would fail. This is because of the Internet connection testing as I described above. It happens after the connection is fully established.
I thought a more elegant solution would be to look at the supplicantState in more detail using WiFiInfo.getDetailedStateOf(…), but it never reached a fully completed state here either, always returning OBTAINING_IPADDR even after Internet connectivity had been determined.
Ultimately, my solution was to attempt ‘camera.startSession’ over and over again until it succeeded, or the WiFi SSID changed to a host other than a Ricoh Theta. It doesn’t take more than a few seconds for the connection to get established, and though its brute force, it works.
I posted in the forums the other day, hoping someone else had a solution. I’ll follow up my post with this answer, so it can help the developer community.
Regarding the above picture, there was discussion around this:
It’s in Japanese, but you can use translate.google.com to copy and paste the short Japanese text into English. The code itself and variables are nicely in English. It’s an old article and may no longer be relevant.
With the new features of Android 5.0 / Lollipop, even if you connect to a Wi - Fi pointer that is not connected to the Internet, it will switch to mobile data communication.
→ Reference: Function introduction of Android 5.0 (Lollipop): Function to automatically switch to mobile data communication when Wi-Fi can not access the Internet added | Gadget communication