Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request : GPS location #8

Open
alex-quiniou opened this issue Nov 30, 2024 · 11 comments
Open

Request : GPS location #8

alex-quiniou opened this issue Nov 30, 2024 · 11 comments

Comments

@alex-quiniou
Copy link

Hi

Thanks for pour app ! The official app from Sony is a burden to use.

Is there any way to use GPS data from our phone to be send like the official app do ?

@alex-quiniou alex-quiniou changed the title Re qu'est : GPS location Request : GPS location Nov 30, 2024
@Staacks
Copy link
Owner

Staacks commented Nov 30, 2024

I have this on my todo list, but I downgraded it to "low priority".

The reason is that my α6400 does not allow geotagging and Bluetooth remote at the same time. They are two separate settings and cannot both be enabled. IMHO, this is extremely stupid and just a lazy decision by Sony because they expect their users to use the Bluetooth connection on their phone for geotagging OR the physical Bluetooth remote. They did not think of a case where a single device would provide both functions.

Therefore, implementing this in my app means that you can switch the setting on the camera without juggling apps, but you still have to go through the settings manually. Since the point of using my remote over the official app is that it is always on and just available when needed and since the point of geotagging is pretty much also that it is always on and just logs the location, most users will have to prioritize one of both features over the other unless they want to dig into their camera's setting everytime.

So, the interesting question is: What camera do you have and does it have the same restriction?
I think it would be interesting to collect feedback on different camera models in this issue.

@alex-quiniou
Copy link
Author

Oh that more complex than i though.

I have the same model as yours.
Ilce 6400.

@Mat931
Copy link

Mat931 commented Dec 4, 2024

Hi!

I'm also looking for an open-source app that can sync the GPS location and time/date to my camera (ILCE-6700). I even thought about learning Android app development to write my own but then I discovered this app on F-Droid. If you want to integrate that feature into your app I'm willing to help. I already started reverse-engineering the BLE characteristic and data format used to send the GPS location and time to the camera. There is also a way to read the battery % and remaining number of photos from the camera. I don't have much experience yet when it comes to writing Android apps.

Are you interested in collaboration to add these features to your app?

@Staacks
Copy link
Owner

Staacks commented Dec 5, 2024

Sounds very interesting. I would very much like to include everything that we can squeeze out of Bluetooth. So, what do you have? And is there a device that uses the additional info or did you just poke at the GATT server to see what falls out?

@Mat931
Copy link

Mat931 commented Dec 5, 2024

I got the data by capturing BLE packets between my phone and the camera and looking which parts of the data are changing between packets. I didn't try sending custom data to the camera yet. But for the time/location packet it was easy to guess which bytes are the lat/longitude, time and date after knowing the expected values.

Here's what I know so far:

Service UUID: 0x8000dd00dd00ffffffffffffffffffff, UUID: 0xdd30
Written to the camera once (after connecting)
Data: 0x01
Unknown

Service UUID: 0x8000dd00dd00ffffffffffffffffffff, UUID: 0xdd31
Written to the camera once (after connecting)
Data: 0x01
Unknown

Service UUID: 8000cc00cc00ffffffffffffffffffff, UUID: 0xcc0a
Read from the camera once (after connecting)
Data: "1.03"
Firmware Version (in ascii format)

Service UUID: 8000cc00cc00ffffffffffffffffffff, UUID: 0xcc0b
Read from the camera once (after connecting)
Data: "ILCE-6700"
Camera Model (in ascii format)

Service UUID: 0x8000dd00dd00ffffffffffffffffffff, UUID: 0xdd11
Written to the camera every 10s
Data: 0x005d0802fc030000101010XXXXXXXXXXXXXXXX07e80b16121e2a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c0000
	index 0-10: unknown (same for all packets)
	index 11-14: latitude (int32, unit: 1/10000000 degrees north)
	index 15-18: longitude (int32, unit: 1/10000000 degrees east)
	index 19-25: date and time in UTC
		index 19-20: year
		index 21: month
		index 22: day of month
		index 23: hour
		index 24: minute
		index 25: second
	index 26-94: unknown (same for all packets)


Service UUID: 0x8000cc00cc00ffffffffffffffffffff, UUID: 0xcc10
Read from the camera once directly (after connecting) and then via BLE notifications
Data: 0x11000002030001000a000000005400000000	84% charging
      0x110000020300010005000000005600000000	86% not charging
	index 0: data length?
	index 8: charging status + some additional info, maybe which battery icon to display?
	index 13: battery percentage

Service UUID: 0x8000cc00cc00ffffffffffffffffffff, UUID: 0xcc0f
Read from the camera once directly (after connecting) and then via BLE notifications
Could be interesting for remaining pictures on the sd card, needs more work

I hope this helps. If you have any questions or want me to test something feel free to ask :)

@Staacks
Copy link
Owner

Staacks commented Dec 5, 2024

Nice, thanks a lot. At the moment I plan to publish the current stable version in the next few days (i.e. put version 1.00 on social media, publish a blog entry, Youtube video etc.) and then see if some urgent problems pop up. It think that GPS might be an interesting project over the holidays :)

Unfortunately my α6400 does not have the 0x8000cc00cc00ffffffffffffffffffff service. I have seen this one already in Mark Kirschenbaum's blog post and it looks extremely promising for much more control, but it simply isn't there. I will check again too be absolutely sure, but I think that this is a feature of newer cameras, which (if I have seen this correctly) also use Bluetooth to negotiate a Wifi password (the α6400 displays a QR code). I wish Sony would offer firmware updates...

So, for 0x8000cc00cc00ffffffffffffffffffff we will have to expect some forth and back. Did you check which other cahracteristics there are and what you get when you read them or if there are even some interesting writable ones? For some reason the blog post only mentions network-related characteristics on an α7c.

@Mat931
Copy link

Mat931 commented Dec 5, 2024

Awesome! I'm glad to hear that. I did a bit more research with nRF Connect.

I tried writing to UUID 0xdd30 and 0xdd31. When writing with nRF Connect, I had to change the type from the default "byte array" to "byte" and the value can be 0x00 or 0x01.
0xdd30 seems to prevent writes when set to 0x00, so it must be set to 0x01 first. Otherwise the write to 0xdd31 fails and the old value remains.
0xdd31 makes the "no location" icon on the camera appear when set to 0x01 and disappear when set to 0x00. Note that I didn't provide a location by writing to 0xdd11 yet, that's probably why it's the "no location" icon.
I'm assuming 0xdd31 enables location sync or geotagging and 0xdd30 prevents changes.

Writing 0x01 to 0xcc08 enables Wifi
0xcc09 is probably a status containing info about the SD card and Wifi and it can have different lengths
0xcc06 is the Wifi SSID in ASCII
0xcc07 is the password in ASCII
0xcc0c is the mac address / BSSID in ASCII

All BLE services and characteristics (click to expand)

From nRF Connect, there might be typos. n/r/w = notify/read/write. Not all characteristics with "r" are readable by default, some fail.

8000ff00-ff00-ffff-ffff-ffffffffffff
ff02 n
ff01 w

8000cc00-cc00-ffff-ffff-ffffffffffff
cc02 w
cc03 nr
cc06 r Wifi SSID, only readable if Wifi enabled
cc07 r Wifi Password, only readable if Wifi enabled
cc08 w Writing 0x01 turns on Wifi
cc09 nr SD card and Wifi related status
cc0a r "1.03" (Firmware version)
cc0b r "ILCE-6700" Camera model
cc0c r Wifi BSSID, only readable if Wifi enabled
cc0f nr SD card info
cc10 nr Battery info
cc0e n
cc0d r
cc11 rw
cc12 rw
cc13 w
cc14 w
cc15 r
cc16 r
cc17 r
cc18 w
cc19 n
cc20 n
cca1 nr
cca2 r
cca3 w
cca4 w
cca5 n
cca7 r 
cca8 w
cca9 n
ccaa w
cc23 w
cc24 w
cc25 w
cc26 w
cc27 w
cc28 w
cc29 w
cc2a w
cc2b w
cc2c w
cc34 w
cc2d w
cc2e w
cc2f w
cc30 w
cc31 w
cc32 w
cc33 w
cc40 r 
cc41 r
cc43 r
cc44 r
cc45 r
cc21 nr
cc22 w
cc62 w
cc63 r
cc61 n
cc73 w
cc74 w
cc75 w
cc80 r
cc76 w
cc77 w
cc78 w
cc79 w
cc7a w
cc7b w
cc7c w
cc71 n
cc72 w

8000dd00-dd00-ffff-ffff-ffffffffffff
dd01 n
dd11 w Location and time sync message receiver
dd21 r
dd30 rw 0x00 Location setting change allowed?
dd31 rw 0x00 Location enabled?
dd32 rw 0x01
dd33 rw 0x01

8000ee00-ee00-ffff-ffff-ffffffffffff
ee01 w
ee02 rw

I think the official app switches to Wifi for all the interesting stuff like remote control and image transfer so I'm not expecting a lot of additional functionality in BLE beside what we already know. I haven't used Wifi yet because it doesn't work for me and I don't really need it. (it probably doesn't work because I blocked Internet access for the app)

If you have Discord we can write there (@Mat931)

@Mat931
Copy link

Mat931 commented Dec 27, 2024

Hi again,
I made a demo in Python that can read battery and remaining pictures from the camera and send the GPS location to the camera: https://gist.github.com/Mat931/beebed15f670b1dbb864df9baaa0b4f7

@Staacks
Copy link
Owner

Staacks commented Dec 28, 2024

Thanks a lot! This will certainly help as I cannot test it with my camera.

And sorry, I am not sure if I can get started with this in the next few days as I planned as a project for my son's birthday got a bit out of hand and there is one other small project I want to do first. But it is on my todo list and I am now aiming for mid January.

@alex-quiniou
Copy link
Author

Yay ! Fantastic news !

@natrius
Copy link

natrius commented Feb 27, 2025

Thanks for your app, thanks for releasing on F-Droid (i found it that way) and thanks for trying to implement something that Sony did not! (You can of course hide this comment, still wanted to express my gratitude :) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants