Add location and battery / media status feature#13
Add location and battery / media status feature#13Mat931 wants to merge 2 commits intoStaacks:mainfrom
Conversation
|
Hi Mat, Sebastian Thanks for your work! I notice that:
I'm also refactoring the BLE code, splitting the characteristics code in different file, because the CameraBLE file is becoming huge.. but I still don't like the result.. you can see the WIP here: https://github.com/wise86-android/alpharemote/tree/splitBleImplementation |
|
Yeah, I am having the same problem. So, a little update from my side: I found some time to work on the app during my vacation. Mostly minor bugs that I noticed while using the app myself and a few new features (see current beta release which will become version 1.1 in a few days/weeks). I only found time to look over this PR and think a bit about it and unfortunately, the problem will be (like with some other features) that I cannot test this on my camera. My a6400 has the following services/charcteristics:
(The non-standard UUIDs are of course based on 8000xxxx-xxxx-ffff-ffff-ffffffffffff. The brackets show if a characteristic can be read, written and/or supports indication or notification) So, unless you (Mat) want to maintain these features (which might become quite frustrating as I suspect that things will be interefering with other models), I cannot really implement anything from the 0xcc00 service until I get a new camera (which I did not plan for anytime soon). Next time I find some time for this, I want to implement the location service, though. Unfortunately, there are also a few differences as I do not have characteristics 0xdd30 (location lock), 0xdd31 (location enabled), 0xdd32 (time correction), 0xdd33 (area adjustment). From your code it seems like I can ignore the latter two, but what about the other two? Do you have to write them for your camera to accept location updates? What if you do not write one of them or is this a method to switch between BLE remote and BLE location service? (My a6400 can only do either and you have to switch manually in the menu.) My plan would be to write these characteristics if they exists and ignore them otherwise. Would that work? And one more thing: You write that reading the camera name always fails. Do you mean that on your camera 0x2a00 does not provide the camera name? Love it when manufactures have better ideas than using the standard... Any idea what the cheapest camera with the newer interface might be? Maybe I could get a broken camera that has become unusable for photography but that could be used for BLE testing. But those are probably still too expensive just for that as they have a value for their spare parts... |
|
Hi, I can of course help with testing code with my camera and fixing bugs. My Android dev experience is still limited, especially when it comes to UI stuff. Location lockFor the 0xdd30 - 0xdd33 characteristics (location lock etc) there should be 3 toggle switches in the settings that only appear when the camera has the location service. I didn't know how to implement that yet. I think this is important if the user wants to use more than one phone with the camera without unpairing. Reading the camera nameThis only fails with this PR, maybe I somehow broke it. I just tested it with 1.00 and it shows the camera name. Cheapest camera with new featuresYou can try the ZV-1F or the ZV-1 II. They are both compatible with the official app but it's hard to say if they have the location service. Testing resultsI've been testing this PR over the past months and it works great and doesn't drain the phone battery. I don't use the remote feature very often. A few more things I noticed:
New firmwareThere is a firmware update available for my camera (1.03 -> 2.00) which also requires a new version of the official app. I didn't update yet so I don't know if it will break anything related to the location service. |
I think you should be able to read the characteristics and write the flags depending on if the camera support it (https://github.com/Saschl/camera-gps/blob/main/app/src/main/java/com/saschl/cameragps/service/LocationSenderService.kt#L126 and following lines). I'm developing an app that focuses on the location part (and just stumbled upon your app now, could have saved myself some work :D ). The code is quite messy unfortunately, but I think the idea should be there.
If it does not contain them, just ignore and continue. I could confirm that works with a user that has a ZV-E10 and some A7 which both use the creators' app as I also only own the 6400. |
|
I tested this on my ILCE-7RM5 (Sony A7RV) with firmware version 3.01. I built and ran this PR but found that it could connect and trigger photos but the location wasn't being applied. If I get time I'll try to dig further. EDIT: it worked once, but not reliably. |
|
Thanks for testing the PR. Here are a few things you can try:
|
Yeah I did these both already.
I'll try again to do more thorough testing to see.
Yes that's what I look out for (and also then after taking a photo on the review screen it'll show the coordinates if it's geotagged), I found it was unreliable, sometimes it got the location other times not.
Yes
Yes I generally always run a GPS tracker app in the background to ensure that location updates are current and have the best accuracy.
I don't think I had my camera paid to any other device. I also tested a similar app https://github.com/mlapaglia/AlphaSync to provide location updates, but encountered an issue that makes it unusable mlapaglia/AlphaSync#2. After using it the camera won't turn on again after being turned off, only taking the battery out resolves it. |
This is still work in progress and not ready to be released
CameraBLE.kt
cameraandlocation, renamed existing characteristics to include the wordremoteCameraState.kt
AlphaRemoteService.kt
CompanionDeviceHelper.kt
Testing
ToDo
fixes #8