while connecting to the Theta camera through my iOS application.the user, who is on iOS version 17.4.1 is experiencing a timeout error with the following details:
While attempting to connect to the RICOH THETA X camera via Wi-Fi from my application, I encounter intermittent API failures. The camera details are as follows:
Firmware Version:2.51.0
Manufacturer: Ricoh Company, Ltd.
Model: RICOH THETA X
GPS: Enabled
Gyro: Enabled
Uptime: 32 seconds
Occasionally, the API calls fail with the following errors:
1.Error 1:**
Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server."
UserInfo={
_kCFStreamErrorCodeKey=61,
NSUnderlyingError=0x2800e13b0 {
Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)"
UserInfo={
_NSURLErrorNWPathKey=satisfied (Path is satisfied),
interface: en0[802.11], ipv4, dns,
_kCFStreamErrorCodeKey=61,
_kCFStreamErrorDomainKey=1
}
},
_NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <8409EE14-264C-4B78-9FAD-845E0A1C10DB>.<1>,
_NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <8409EE14-264C-4B78-9FAD-845E0A1C10DB>.<1>"
),
NSLocalizedDescription=Could not connect to the server.,
NSErrorFailingURLStringKey=https://192.168.1.1/osc/info,
NSErrorFailingURLKey=https://192.168.1.1/osc/info,
_kCFStreamErrorDomainKey=1
}
Error 2:
Error: Optional(Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline."
UserInfo={
_kCFStreamErrorCodeKey=50,
NSUnderlyingError=0x300e4d0b0 {
Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)"
UserInfo={
_NSURLErrorNWPathKey=unsatisfied (Local network prohibited),
interface: en0[802.11], ipv4, constrained, uses wifi,
_kCFStreamErrorCodeKey=50,
_kCFStreamErrorDomainKey=1
}
},
_NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <78703E09-9F17-4275-88A4-0A1EDC3D854D>.<1>,
_NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <78703E09-9F17-4275-88A4-0A1EDC3D854D>.<1>"
),
NSLocalizedDescription=The Internet connection appears to be offline.,
NSErrorFailingURLStringKey=http://192.168.1.1/osc/info,
NSErrorFailingURLKey=http://192.168.1.1/osc/info,
_kCFStreamErrorDomainKey=1
})
I am looking for assistance in understanding and resolving these connectivity issues.
Try use theta-client with your camera and mobile phone. If theta-client fails, then open an issue on GitHub. If it works, try to use the software as a reference.
@Anjali_Nirmale Two quick questions about your Wi-Fi environment:
Are you testing in an area with multiple other networks? Some level of intermittent interference is possible if there are multiple networks nearby.
The X can connect over Wi-Fi at 2.4 GHz and 5 GHz frequency bands. Which are you currently using? If you connect at 5 GHz, it may help the connection stability.
@jcasman hi, when there are multiple other networks available, we sometimes encounter the “could not connect to server " error msg for extended period.
we are seeing the " The Internet connection appears to be offline” error when we connect to theta camera via WiFi? since communication with the theta camera doesn’t require internet access. I m curious about the reason behind this.
Correct, you are not connecting to the Internet. You are using Wi-Fi to connect to the THETA. But with other Wi-Fi networks in the area, there can be some level of interference.
@Anjali_Nirmale I don’t see any errors here. It looks to me like you are properly connected to your THETA. “No Internet Connection” is correct. You are connected to the THETA, not the Internet.
Here is an example from my iPhone 12, connecting to a THETA X. With this connection, I can control the THETA.
@jcasman yes. I agreed then sometimes these errors. happen…what do you think might be the root cause of these issues? I have tried to reproduce it with multiple network as well but it have been unable to do so
I think the best thing to try is to use theta-client to try and replicate the error and then open an issue on GitHub.
I’m not an experienced iOS developer, so I can’t be of too much assistance. I think we’ll either need to wait for someone from the community, or you can establish community with RICOH engineers on GitHub.
I’ve been searching Stackoverflow and found the question below. However, be aware that I do not develop with iOS.
It seems like the implication is that there is some security configuration in iOS development to allow more stable non-secure “http” instead of defaulting to “https” when some event occurs. We can speculate that the event is something like “loss of connection to the THETA X”. However, this is just a speculation.
We can speculate on possible causes by using ChatGPT.
Below is from ChatGPT.
When developing for iOS, your app attempts to use HTTPS instead of HTTP due to Apple’s App Transport Security (ATS) policy, which was introduced to enhance the security of network connections in iOS apps. Here are some key points about ATS:
App Transport Security (ATS): Introduced in iOS 9, ATS enforces secure connections between an app and the web services it communicates with. This means that by default, iOS apps are required to use HTTPS connections to ensure data is encrypted in transit, protecting it from interception and tampering.
Security Enhancements: HTTPS ensures that the data sent and received by your app is encrypted, providing confidentiality and integrity. It helps protect user information from being accessed by malicious actors.
ATS Requirements: ATS requires the use of TLS (Transport Layer Security) with specific configurations, such as:
Minimum TLS version of 1.2
Strong cipher suites
Valid certificates signed by trusted certificate authorities (CAs)
Configuring ATS Exceptions: While ATS is the default, you can configure exceptions in your app’s Info.plist file if you need to connect to a server that does not support HTTPS. However, this is generally discouraged as it reduces the security of your app.
Here’s an example of how to configure an exception in the Info.plist file to allow HTTP connections:
@Craig hi thanks for always responding promptly and investing time in troubleshooting this with me… but I already added all that info.plist so that app can communicate with the app…some user is experience this issue more after updating the new 17.4.1 iOS…still checking why this happing.
@jcasman when you report to RICOH, make note that Mikhail also reported the problem is November of 2023 and also in March of 2024. So, if there is a way to provide assistance, it would be useful to at least two commercial developers building real-world apps. It’s a difficult problem as it does not appear to be consistent.