GET osc/info return me 404 error but I'm connected to device

Since 3 weeks, I’m not able to get camera info. Before it’s worked well. I got the following error

error

It appears on iPhone 12 pro but not on Android.

On network I’m connected like this
(“Pas de connexion à internet” means I’ve no access to internet)

Ricoh connexion

My cameras are up-to-date, my code was not edited

I’m using Xamarin forms to create my app (hybrid c# framework to build app)

Anyone have an idea of what happened and why I got 404 whereas I’m connected to device. Thank you in advance.

You shouldn’t need headers on a GET, but I would try it if I were you.

Overview

[API (e.g. POST /osc/commands/execute)] HTTP/1.1
Host: [IP address]:[HTTP port]
Content-Type: application/json;charset=utf-8
Accept: application/json
Content-Length: [Content length]

{
  ...
  Input to each API
  ...
}

Does it work from curl?

curl --request GET \
  --url http://192.168.1.1/osc/info \
  --header 'Content-Type: application/json;charset=utf8'


Other Ideas

  • press and hold the power button on the camera. What model is it?
  • force shutdown of background process. press and hold power and wifi
  • reset wifi to 2.4GHz. Press and hold Wi-Fi button

It’s possible you set the camera to 5GHz and your mobile app is trying at 2.4GHz or the camera is at 2.4GHz (maybe lost the settings) and your phone is at 5GHz.

Hello @craig and thank’s for your help, I tried to make request with curl and like android it’s working well.


I’m using ricoh theta Z1 and SC2, both occurs error.

Other ideas

  • “press and hold the power button on the camera” => it just turn on my camera as the following picture
    idea 1

  • “force shutdown of background process. press and hold power and wifi” => light of camera was blue when it was turning on and a few seconds later was turning off. Does I made the good manipulation ? (Before this step camera was turned off)

  • “reset wifi to 2.4GHz. Press and hold Wi-Fi button” => it just enabled bluetooth like this
    idea 3

How to be sure camera is set to 2.4GHz.

Thank’s a lot

Can you upgrade your firmware?

This is from your camera. The most recent firmware is 2.00.1 for the Z1. You are running 1.60.1.

https://support.theta360.com/en/download/firmware/z1/

Can you connect to the camera with the official RICOH THETA mobile app as a baseline test?

If so, you can see the Wi-Fi GHz in the camera settings.

With an API, it is this:

Notice of website closure

For the Z1, you can reset using the Wi-Fi and Mode buttons. See video above.

Does your mobile app connection code work with other HTTP API testing sites such as:

https://jsonplaceholder.typicode.com/

https://picsum.photos/

Hi @craig,

I upgraded firmware

I’ve followed your guide to Force Shutdown, Wi-Fi Reset, Settings Reset using insomnia like this

but I still have this issue on iOS devices.

On Ricoh app it’s working well, and in settings I found 2.4 GHz

I noticed when I build my app to iOS devices it’s working but after several use, or next day I got 404 error.

I can show you my code C# language, if you want, but nothing has changed

Do you have any others suggestions, thank’s a lot !

Can you download the free, official RICOH THETA app to the same phone and see if the official mobile app works?

Download | RICOH THETA

What version of iOS are you using?

On the iPhone XS and 12 pro, can you use a browser like Chrome or Safari (from the phone) and access http://192.168.1.1/osc/info (this is a GET)

I tried to use official Ricoh Theta mobile app, it work’s well.

I’m on iOS 15.2.1

When I’m using chrome I’m able to get info like this

What does that mean ?

Do you have additonal debugging information from your Xamarin Forms app? Can you test the Xamarin Forms GET with another http server that is http, not https. When you test it on a non-THETA HTTP make sure it is using the insecure http without the s on iOS.

Visual Studio Feedback

Are you using the NSUrlSession for the HttpClient Implementation?

HttpClient and SSL/TLS Implementation Selector for iOS/macOS - Xamarin | Microsoft Docs

Thank’s a lot I will try it this week end and go back. Have a nice week-end !

1 Like

For testing, disable network security on the iOS version of your app to isolate the problem. turn on debugging logs and see if there is any exception thrown when you try to connect to the camera.

Sorry for the late reply, I made additional tests

Do you have additonal debugging information from your Xamarin Forms app? Can you test the Xamarin Forms GET with another http server that is http, not https

I’ve no additionnal logs during launching app, I’ve not iphone with current error but I can access to logs using this. So when I get iPhone back, I will tell you.

When you test it on a non-THETA HTTP make sure it is using the insecure http without the s on iOS

I used http://192.168.1.1/osc/info

Are you using the NSUrlSession for the HttpClient Implementation?

For testing, disable network security on the iOS version of your app to isolate the problem

Disable network security

I also made a test with another iPhone 12 pro max which version is 15.2.1 and it work’s, but why on the first one it fails ?

Each time I build app on the iPhone 12 pro it worked during 1 or 2 days and after error appears

Wow, this is tough to isolate the problem. If you get the error logs, I can discuss with RICOH. I don’t have the same hardware to test and can’t replicate the problem. However, hopefully there is something useful in the logs.

Yes I agree, I will come back once I have logs

Hi @craig last week I found a solution instead of using HttpClient, I used WebRequest to make an API call.

I just used WebRequest for this endpoint GET http://192.168.1.1/osc/info

Thank you for your help

2 Likes

Thanks for posting the solution. In other languages, I’ve also noticed some differences between the HTTP client packages. I suspect that the SC2 and the Z1 have a slightly different behavior compared to a reference HTTP server. I’ve noticed significant differences between the SC2 and Z1 in how it handles open HTTP connections for camera.getLivePreview. How the internal camera server handles the headers and errors may differ.

Thanks again for posting the solution. I’m sure it will help other people.

Hi, We have been having a few customers also getting 404 error when connecting to Z1 and iPhone 14. Not all customers have this issue. Do we know why httpClient is not working for some?

@Winnie_Wen Are your customers end users or developers? Can you describe when they are getting an error? They are using the RICOH THETA mobile app on their iPhone 14 and it can’t connect to their Z1? Or have you built your own app? You say it’s a 404 page not found error?

Is the Z1 firmware updated to version 2.30.1?

Compare the behavior with the RICOH THETA official mobile app on iOS.

Can you replicate the error on iOS with Z1 firmware 2.30.1?

Yes, Z1 firmware is up to date. When I say customers meaning customers using our app that we build. In our app we make http request to osc/info. I see a 404 error.

It has no problem with Ricoh Theta official mobile app.

Can your application connect to insecure http (not https)? How did you configure the insecure http security exception?

on the iOS device, can you open up a browser (like chrome) with http://192.168.1.1/osc/info ?

Do you have any other error than the 404 if you apply a debugger to the app?

Make sure there is no typo and it is http:// (not https://)

Are you applying a header?

theta-api-specs/overview.md at main · ricohapi/theta-api-specs · GitHub

In particular, does your http request have this:

Content-Type: application/json;charset=utf-8
1 Like