simonmitchell / rocc

A Swift framework for remote control of digital Cameras
MIT License
120 stars 15 forks source link

Investigate 404 error on RX100-M2 #21

Closed simonmitchell closed 4 years ago

simonmitchell commented 4 years ago

Steps to reproduce:

Try and connect to RX100-M2

Actual behavior:

getVersions call returns a 404 (Not found)

Expected behavior:

Should be able to connect correctly to the device.

iOS/macOS version:

N/A

Camera manufacturer and model:

Sony RX100-M2

Other questions

Does the issue still occur after updating your Camera's Firmware?

Unsure...

simonmitchell commented 4 years ago

Logs attached here:

2019-12-05T15:41:01Z [RequestController] Request: http://10.0.0.1:10000/sony/camera
2019-12-05T15:41:01Z [RequestController] 
URL: http://10.0.0.1:10000/sony/camera
Method: POST
Request Headers: ["Content-Type": "application/json"]
Body: {"method":"getVersions","params":[],"version":"1.0","id":1}

Response Status: 404
Response Body: {"error":[404,"Not Found"]}

We possibly just need to check for the model at this point and for known models (Only RX100 M2 at this point), we either ignore this error, or don't make the call in the first place!

simonmitchell commented 4 years ago

Might be able to gleam something from here: https://github.com/parasquid/RX100M2. Might be worth contacting the owner of that repo too! Let's see if he's still active on GitHub... @parasquid 👋🏻

simonmitchell commented 4 years ago

First attempt is being made, I'm removing the getVersions call exclusively for the RX100 M2 and running a build of Camrote for my tester to try. It may be that it still fails at a subsequent call, but it should at least resolve this issue! I may implement an additional check for a 404 error at a later date to catch this on other cameras that it may not yet have been reported for!

parasquid commented 4 years ago

Heya! Sorry for the super late reply, I'm on utc+8 and from my experience with working with colleagues from the other side of the world, half-day lag times in comms can be quite a challenge :)

I'll have to check my camera; it's possible the firmware may have been revised and the more recent devices don't have this api call anymore. I've made the gem while on a vacation trip in Bali, wanting to capture a sunset time-lapse way back in 2014, so things might have changed by then.

simonmitchell commented 4 years ago

Heya, absolutely no worries! It was a bit cheeky to even pull you back in to be honest 😝 Yes, I bet that's a massive challenge! Ohhhh wow, haha nice to have the capability to just code yourself something like that! Hope you caught some awesome footage.

Thanks for coming back to me, I imagine that is the case... I've made a subsequent change so will hear back from beta testers shortly!

simonmitchell commented 4 years ago

Turns out the 404 was caused because instead of appending the camera service type to the actions url like for modern cameras resulting in https://{ip_address}:{port}/sony/camera as the base url. On the affected cameras you need to hit https://{ip_address}:{port}/camera!

simonmitchell commented 4 years ago

Next piece of the puzzle... it seems like while the newer cameras have a getEvent function, the RX 100 M2 has receiveEvent. I’m hoping this works in the same way as getEvent in that you just call it with a Boolean as to whether you want it to poll or not for events!

Will need some sort of check to see which call we should be using. I’m tempted to do it based on camera model, but I’m fairly sure I have some users of the M2 who have a fully working app and don’t want to break it for them! For that reason I’m going to make a call to getAvailableApiList when the first event is fetched to check which API call is available! I’ll then cache this result for later calls so we’re not hammering the camera too much.

simonmitchell commented 4 years ago

Closing, as it seems the official Sony API supports the same functionality that we do now!