12 ms·
SonyShell – An effort to “SSH into my Sony DSLR”
- beligum 1y agoI wanted to use my new Sony DSLR (a6700) in the same way as I use my server: by ssh'ing into it. This is a one day hackaway helper built on Sony’s official Camera Remote SDK. It sort of mimics an ssh session by connecting to my Sony over Wi-Fi, listens for new photos or specific events... and runs scripts on them. Thank you Sony, for not forgetting the Linux fan base. And thank you ChatGPT for freshening up my c++ skills!
- SAI_Peregrinus 1y agoNitpick: that's a DSLM, or just "mirrorless" camera. There's no reflex mirror, so it's not a DSLR.
- delta_p_delta_x 1y agoThe more common initialism/abbreviation is MILC, or mirrorless interchangeable-lens camera.
- Lammy 1y agoI'm sad that Electronic Viewfinder, Interchangeable Lens (EVIL) didn't catch on
- anArbitraryOne 1y agoOoh that's funny. And I say that as an EVF lover
- simondotau 1y agoWrong words are commonplace in English, perhaps my favourite being “modern art” referring to art from 100 years ago. Long story short: don’t worry about it.
- a96 1y agohttps://en.wikipedia.org/wiki/Modern_art https://en.wikipedia.org/wiki/Modern_art https://en.wikipedia.org/wiki/Contemporary_art https://en.wikipedia.org/wiki/Contemporary_art
- JdeBP 1y agoI wouldn't thank ChatGPT too enthusiastically. As always for LLMs, it has given you code that is rife with common pitfalls (because, after all, they massively plagiarize sources where people post poor code). For examples: It does not follow the Linux rules for pathname separators, but mixes in Windows-isms. It doesn't properly check whether std::atomic<bool> is actually signal safe on the target architecture. Its unique filename generation has an all-too-common failure mode. It passes by reference only to then make local value copies anyway. It does not correctly follow the XDG Base Directory Specification.
- beligum 1y agoLast time I hand started a c++ project was 10+ years ago so let's say it got the ball moving ;) Feel free to help cleanup a bit of my mess if you want, would love to work on this project together with others!
- pjmlp 1y agoSome stuff that could be improved with modern C++, Instead of static bool file_exists(const std::string &p) { struct stat st{}; return ::stat(p.c_str(), &st) == 0; } Use the filesystem API, std::filesystem::exists(path); -- https://en.cppreference.com/w/cpp/filesystem.html https://en.cppreference.com/w/cpp/filesystem.html
- beligum 1y agoty!
- HardwareLust 1y agoCan you control the camera via script/CLI? Things like releasing the shutter, focus, apeture, etc?
- constantcrying 1y agoMy trust in a project which can not identify the most important characteristic of the hardware used is pretty low. The A6700 is not, in any way, a DSLR camera.
- beligum 1y agoYou are correct.
- astrange 1y agoPeople think all professional cameras are called "SLRs". A rangefinder is a higher quality camera than an SLR ever was and a full frame mirrorless probably has better quality than a DSLR, in both cases because it's easier to design lenses for them. A medium format camera can be better than all of those.
- CrispyKerosene 1y agoRespectfully, its not that simple. I dont think you know what you are talking about.
- exidy 1y agoI think it's better to steelman rather than assert ignorance on the part of the person you're replying to. It is true that people these days associate the DSLR form-factor with professional photography, despite the heavy use of rangefingers by those such as Robert Capa etc not that long ago. And it is also true that both rangefinders and mirrorless ILCs avoid the need for retrofocus designs which in theory should make for higher-quality lenses at the same weight, or similar quality and a lower weight. As for "better" this is often a matter of preference and it's okay for people to have different preferences. For me personally, I wish there was more experimentation in ILC form factor, it seems most (with a few notable exceptions) ape the pentaprism hump even if they don't contain one.
- Etheryte 1y agoI think it's easy to see what they mean, even if you don't agree with them. I think it puts too much emphasis on glass as there's so much more that goes into getting a shot. I do pick up my old film cameras every now and then for enjoyment, but if I have to get a shot, I'm always taking the newest thing I have. It's hard to beat multiple stops of stabilization in the lens and the body along with the black magic of modern sensors.
- baobun 1y agoAside if author is around: You may want to rename it to not include "Sony" in the name. If the project gets popular and catches their eye it might become a headache. Suggestions: DShelLR, dshr, dslr-sh, camshell
- beligum 1y agoIt's late, but still up. Thanks for the heads up ;)
- beligum 1y agoDone!
- dtgriscom 1y agoNice: https://github.com/goudvuur/sonyshell https://github.com/goudvuur/sonyshell now automatically redirects to https://github.com/goudvuur/sonshell https://github.com/goudvuur/sonshell . (Didn't know you could do that.)
- typpilol 1y agoDid you have to set it up? Or automatic when you rename?
- underlines 1y agothat's a feature of github when renaming repos
- metadat 1y agoCan it be "Sny" or "Slony" (Simpsons nod)? Keep a fragment in, please, for discoverabilities sake!
- NewJazz 1y agoJust list the devices it has been tested with in the readme.
- givemeethekeys 1y agoMy recent research: - Canon has a REST API, and the most affordable API supporting cameras. - Fujifilm has an API, but not REST based, but it goes all the way back to the X-T3. Unfortunately, using it voids your warranty if there is a warranty. - Sony has an API as well but mostly newer cameras. - Blackmagic (video cameras) has a REST API, but their most affordable API-supporting cameras are meant for studio use, which isn't ideal for general use.
- beligum 1y agoI can't speak for other brands, but I started this project by digging into the LCD menu of my camera, discovering "auth", "user", "pass" and wanted to know what protocol they used to authenticate remote logins. That's when I discovered the camera just uses ssh-style auth. As a part time sysadmin, it gave me the idea to try to "log into" the camera and here we are.
- varenc 1y agoThis doesn't actually use ssh at all right? By ssh-style auth you just mean a username and password? Seems to work great for the intended use case regardless !
- beligum 1y agoI'm guessing, but AFAIK, the camera runs some sort of sshd demon you log into, so I wouldn't be surprised it really does use ssh under the hood.
- Spastche 1y agoany info about Nikon?
- jiggawatts 1y agoNikon hasn't yet figured out how WiFi works, let alone a REST API! They're firmly stuck in the early 1990s in terms of system software.
- g-mork 1y agothe A7R has a background FTP function but the problem is Wifi is deadly unreliable and low bandwidth for transferring huge files. for camera automation I've found it much easier to write to SD card then handle import in batches
- dave8088 1y agoMulti thousand dollar pro camera and they can’t figure out the WiFi. Sony’s unwillingness to provide any material firmware updates is so disappointing.
- Etheryte 1y agoUnfortunately it isn't just Sony, every Canon I've ever owned has had trash wifi. It must be one of those teams in an org that's an afterthought of an afterthought.
- StrangeDoctor 1y agoVery interesting project, I wish I had gone down this route instead of the undocumented hell of usb PTP with hundreds of edge/corner case work arounds.
- jauntywundrkind 1y agoThe fact that USB ptp is some baseline is kind of exceedingly great, even if yeah in practice it'a a huge mess of vendor extensions tacked on. I like trying to have some collaboration & specs! It's a monster oh sure but gphoto2 probably wouldn't have come about, as a sick compendium of all camera backs & vendor extensions, if there wasn't a common thread, common binding for cameras! Once you go from USB to IP you're (generally) untethered unmoored from anything shared! What's done here is super admirable & super neat. But it's even more spelunking into the unknown than USB ptp imo! Thankfully there's some pretty old school direct on-the-line protocols that are kinda just working! It's interesting to me at least to navel gaze over. The attempt to have common tools versus the just doing whatever. One of my favorite connectivity solutions ever was the Nvidia Shield Controller (2015). A wifi (wifi direct/wifi-p2p at that!) video gaming controller. With audio that uses ozproto's stack, a usb-over-ip setup! Something about just tunneling USB being conceptually easier to reason about & do than deciding what IP services to make for a controller is so elegant and neat and weird. https://github.com/devmapal/nvidia-shield-controller-driver https://github.com/devmapal/nvidia-shield-controller-driver
- ge0rg 1y agoWhen reverse-engineering some of the Samsung NX camera firmware files, I found USB-PTP code that implements different custom remote commands <https://chaos.social/@ge0rg/114723076401717110 https://chaos.social/@ge0rg/114723076401717110> but I'm not deep enough into PTP to make sense of them. Is there anywhere a group focusing on understanding and re-implementing custom PTP protocols?
- SchemaLoad 1y agoIt is surprising that after all these years, there is still no good way to transfer files between two devices over USB. MTP exists but it was never widely supported and it seems like even the support it did have is slowly rotting as the answer became just connect everything to cloud storage.
- SoftTalker 1y agoWhen I read the first word of the title I immediately thought this was going to be about a new rootkit.
- beligum 1y agoSorry to disappoint you ;)
- jiffage13 1y agoExcited to see this develop. Sony quietly removed the PAL/NTSC switch on some recent FX3/J1 firmwares — a really user-hostile move for anyone trying to avoid lighting flicker or needing flexible frame rates. The only practical “fix” I see in the wild is paying grey-market sellers (using leaked service tools I presume) to flip the 'region blob' so the menu comes back. Is sonshell likely to be a useful vector for a more freely available solution? Not sure what level of access it actually offers i.e. is firmware/policy blobs readable/manipulable, and can persistent changes be made?
- beligum 1y agoI'm afraid the only thing I do is use the official SDK to wirelessly log in to the camera. No firmware hacking at all. That said, if the SDK offers a setting the LCD menu on the camera doesn't, it would be fairly trivial to change it, yes.
- josephg 1y agoNice work! I've wanted something like this while shooting, since people want to see what the photos I'm taking look like and all the software I've tried seems kinda bad. Does this work better than the built-in FTP client software in the cameras? I've been tempted to just run an FTP server on my ipad which automatically shows all uploaded photos.
- beligum 1y agoFunny you ask, since the a6700 doesn't have ftp support and it mainly was the reason I started this app in the first place. Also, wiring into the command structure with little shell callbacks offers me a LOT more flexibility than initially thought.
- josephg 1y agoWhat a weird choice! An FTP client implementation is tiny. I guess they figure FTP uploads are mostly used for professional sports photography, and they don't think people will buy the a6700 for that. (Or they don't want people buying the a6700 for that sort of professional use.) Nice work in any case. My cameras have FTP, but using sony's remote protocol seems like a lot more fun. Its probably more reliable, too. (And I wouldn't be surprised if you can do more advanced stuff with it, like download low resolution proxies before downloading the high res images).
- k33n 1y agoSo... if you have guests on your network or are otherwise connected to a network with lots of people on it, can they just grab all your photos this way?
- beligum 1y agoAs of now, yes, but luckily auth support is on my todo list SOON ;)
- underlines 1y agoReading the title, I thought: finally someone rooted/jailbroke sony cameras. On Canon you can run Magic Lantern, an extensive mod that adds many features to Canon cameras. Even Samsung N1 had SD Card loadable mods before they moved away from the camera market. Rooting sony seems impossible, I never saw someone Working on it Since their Fullframe lineup launched.
- kuschku 1y ago> Rooting sony seems impossible, I never saw someone Working on it Since their Fullframe lineup launched. On some cameras, including the older firmwares for the current cameras, https://github.com/ma1co/Sony-PMCA-RE https://github.com/ma1co/Sony-PMCA-RE gives you a root shell.
- underlines 1y agoYes, aware of that, and nothing recent works with it, the last progress sadly was years ago. I guess DMCA/Sony Lawyers and the relatively low market share for expensive cameras is the main reason why a PlayStation, an iPhone or a Nintendo Jailbreak is more appealing to reverse engineers than a Sony Camera Jailbreak.
- bayindirh 1y agoActually, half of the problem is vertical integration inside Sony cameras. It's all Sony from sensors to DSPs, and everything is designed and built by them. The current firmware looks like a embedded Linux system designed for fast boot and is largely immutable, so the thing is pretty tightly secured down. You can put the board to flash mode and update the firmware, but that's all apparently. Someone over DPReview was taking deltas of the file trees between firmware update packages to guess what has been updated, but going one step further was nigh impossible. Sony doesn't even bin the DSPs from model to model, but create model-specific ones with different model numbers, and solder DRAM on top of them for latency and signal quality, so the cameras are complete black boxes. The only missing thing is a complete epoxy pour over the board, but that thing gets hot and needs the case as a heat-sink, so it's not possible at this stage.
- heyitsmave 1y ago[dead]
- mschuster91 1y agoHeh, looks like the old OpenMemories hack [1] might actually have a successor now for modern cameras? The old Sony lineup actually didn't just have a Linux kernel to run its base operating system, they actually included a bastardized Android layer on top of that so people could develop apps - but it died out pretty soon, so Sony removed it after the Mark 2 models and with it went the entrypoint for rooting. [1] https://github.com/ma1co/OpenMemories-Framework/blob/master/docs/Cameras.md https://github.com/ma1co/OpenMemories-Framework/blob/master/...
- geerlingguy 1y agoNeat project, the one thing I still don't understand is how it's still so hard to wirelessly get photos on and off professional/prosumer cameras. We had EyeFi cards back in the day, and I could configure them to (flakily, but given enough time, it worked) automatically upload RAW image files to a local FTP server while I was out shooting an event. Years later, and a bunch of janky apps that mostly work with low-res JPEGs or if you fiddle with them, maybe RAW files, are the best that Canon, Nikon, and Sony have to offer first-party :(
- beligum 1y agoBelieve it or not, but I'm old enough to have used Eye-Fi cards back in the day and its shitty performance inspired me to hack away on this project in the first place!
- stratosmacker 1y agoOh shit we're old now?
- matrss 1y agoMy Sony a7iii can definitely upload to FTP by itself, JPEG and RAW. That is my primary means of getting images off of it. I would have appreciated if it did WebDAV though, then I could make it push to Nextcloud directly...
- Hilift 1y agoIt is a strange market. There are some apps that include support for specific DSLR models. This one supports specific Canon and Nikon models: https://sparkosoft.com/sparkocam-features https://sparkosoft.com/sparkocam-features
- 0xffany 1y agoWhy change the title from Sony camera to Sony DSLR when the repository is specifically targeting Sony mirrorless cameras, not DSLRs...
- ladyanita22 1y agoDidn't know these run Linux
- fooqux 1y agoI wish my Olympus had something like this. They are considerably more customer hostile than other brands in both software and accessories. The app for those cameras is not even laughable; it's just depressing. And it can't be tethered to computers like every other camera system. Sigh.
- vladvasiliu 1y agoWhich Olympus is that? My OM1 can be tethered. I tried shooting with the camera connected over USB to a Windows computer, and it worked perfectly. It also claims it's able to do the same via wifi when you connect it to an access point (instead of its integrated AP mode). I don't really have a use for this functionality, so I didn't bother to type my wifi password on the camera to try it out, so I can't comment on how well it works. I've just tried this with darktable/Linux, and it also seems to work. It's somewhat slower than with the Olympus software under Windows, but I can change random parameters, such as shutter speed, aperture, and white balance. I can move the focus manually, which will trigger the zoom-in helper (it's how the camera is configured to behave when manipulating it directly). Taking a picture copies both JPG and RAW files (camera is setup to capture both) instantly. Edit: on an iPhone, I can use PhotoSync instead of the OI Share app to retrieve pictures over Wi-Fi. It's quite slow, though. My iPhone is too old to support direct USB-C connections, so I haven't tried that, though I intend to try iy tomorrow with a friend's phone.
- fooqux 1y agoOoo, I'll need to look into this again. I worked with the devs from Darktable / gphoto a few years ago trying to get it to work and both sides eventually gave up because the output from the camera was just so far from any spec. I've got a EM1mk2. I just tried it again with Darktable on Linux and it didn't immediately work. But now that I know it's supposedly possible I can look into permission issues or the like. I'll go through Darktables' troubleshooting steps for this.
- vladvasiliu 1y agoDoes the camera actually support tethering? I also have a pen-f, and I don't have such an option when I connect it to a computer. I can only do it via the phone app, and it never worked well. The om1 works better with the app. Apparently, when connecting to an external AP, it supports WPS, both PIN and button, instead of typing the full password. My AP doesn't support any form of WPS and I mistyped my password. That's five minutes of my life I won't get back... Interestingly, the transfer from the camera seems slower with OM Capture than with Darktable, but it can configure basically all the camera's settings, including the High-Res, HDR bracketing, etc. It can also tell the camera to not save the files on its card (or configure which format goes on which card).
- Akashic101 1y agoI "only" have a A6000, any idea if it works with that camera as well?
- beligum 1y agoFeel free to try it out! Please let me know if it does, I'll add the cam to the supported list. If not, send me the error in a github issue and I'll have a look.