Lurker News
Hey HN!

A few years ago someone kept trying to steal my motorcycle, so I decided to make a small camera with really long battery life to catch them.
The hardware/software is totally open source, but the companion app only supports macOS currently. (I'm a big fan of native apps, and didn't want to block releasing on Linux/Windows support.)
I wrote some blog posts about the process:
PCB design: https://toaster.llc/blog/pcb
Enclosure design: https://toaster.llc/blog/enclosure
Image pipeline: https://toaster.llc/blog/image-pipeline
Rainproofing: https://toaster.llc/blog/rainproofing
Source: https://github.com/toasterllc/Photon

Comments (299) 87 threads

Earlier comments
laweijfmvo9 replies#
> exclusively for Mac

Why not just have it connect as a generic mass-storage device?

Suppafly#
Yeah, even if you're a mac guy, it doesn't make sense to make hardware that is mac only.
jackstraw14#
It looks like the companion app is in the App Store, but yeah if it's going to be open source then I don't understand either.
rasz2 replies#
Saw it on EEVBlog, even owning a Mac is not sufficient if its not the latest OS version. SD Card doesnt store pictures in windows readable format either.
davekeck3 replies#
Dang I haven't mustered the courage to watch Dave's critique yet!

I wrote/tested Photon Transfer (the companion app) on macOS 10.15 (Intel), so it should work on that and above. If not it's a bug that I need to fix!

rasz#
I cant find the video now somehow (otherwise would link it). TLDR: he loved it, both idea and design, but could test due to Mac store requirements.
CamperBob2#
He gave you a pretty good review, I thought. I'd have been interested in the camera myself if it supported Windows.

Given the rate at which the data flows -- nothing at all for a long time, then a burst that isn't particularly time-sensitive, then nothing at all again for a while -- I wonder if the right way to do something like this is with LoRA. That way the camera could be mounted someplace hard to access, with no need for a file system at all. There would then be a separate receiver module that could listen for traffic from multiple cameras and store it for later access by a PC/Mac/whatever.

zelse#
Your handling of folks' feedback in this thread is impressively graceful, fwiw.
miahi#
I (as a non-mac user, but impulse buyer of odd camera gear) appreciate the "exclusively for Mac" label put just after the fold. I usually have to read pages (about software) on HN for minutes before finding out (in a footer or "get it here" link) that it's Mac-only. This way I just know it's not for me and I can continue with my boring life.
davekeck10 replies#
Totally fair question! My reasons were:

1. To maximize Photon's battery life I tried to make the hardware do the absolute minimum to record imagery. To that end, Photon stores images on an unformatted SD card (ie one huge linear array of bytes) which is easy and fast to index into.
2. A 16-bit MSP430 handles writing the image data, and the MSP430's codespace is 99% exhausted without dealing with the complexities of a filesystem like FAT32, so adding support for a filesystem wouldn't currently fit. (This line of MSP430, MSP430FR2433, has a maximum of 16 KB of FRAM, but perhaps I could use a different line.)
3. Photon stores images as RAW image data that require post-processing to view the images. Since I wanted to provide a polished app to view the imagery anyway, I figured I'd just make it a requirement.
I'm not saying those are all particularly good reasons, but that was my reasoning anyhow.

tredre36 replies#
It's pretty cool that your MSP handles the SD Card directly!

Personally I think you should keep the focus on a polished mac app. For other platforms you can do just the bare minimum with a web app that uses WebUSB. People will bitch that it's Chromium only but, I mean, chromium has 95% market share outside Apple world (and I say this as a FF user).
A hardware solution could be to add a cheap microcontroller that would handle the usb port. It wouldn't be powered by the battery, only USB and it would act as a proxy between the raw sd card and the computer. Presenting a mass storage to the computer with folders, converting images to PNGs. Such capable MCUs are very cheap (rp2040, esp32-s3) but it certainly adds complexity to your project...

foofoo55#
I would suggest the same hardware solution, where the USB powers a device-side presentation of the raw data into a more universal mass storage device. This also allows file transfer to any device without requiring special software. I did something like this in 2008 or so (using a FTDI chip and PIC mcu, and boy was it ever slow).
Rinzler892 replies#
>It's pretty cool that your MSP handles the SD Card directly!

SD cards aren't really black magic since they "speak" SPI, meaning people have been interfacing basic microcontrollers to them since forever.

Continue this thread — 2 replies

davekeck#
> It's pretty cool that your MSP handles the SD Card directly!

The MSP430 is actually the puppet master for an ICE40 FPGA that does the high-speed transfers (102 MHz) between image sensor -> SDRAM -> SD card.
Here's a post about the architecture if you're curious:
https://toaster.llc/blog/architecture
Thanks for the feedback!

qingcharles#
I think open source web app with WebUSB is basically the perfect solution as others can then come in and hack a better UI onto it.
beardyw#
> It's pretty cool that your MSP handles the SD Card directly!

No it isn't. Accessing an SD card from a microcontroller requires you to do that. To use FAT involves more effort, though lightweight libraries are available.

barbs#
Maybe an electron app? I mean, we all love electron, right?
Rinzler892 replies#
Can I ask why you went with a MSP430?

I'm not judging, they were all the rage in low-power embedded applications 10-15 years ago, just feels weird to see it in a modern design today, when the market now is flooded with low-power ARM chips that are way more capable than that, and probably easier to program.

davekeck5 replies#
One main reason I chose the MSP430 was for the FRAM. Photon stores all its state (ie the photo ring buffer indices, and user settings) in one big FRAM struct, which can be read/written just like RAM, but persists across power cycles and crashes.

Another reason was MSP430's low power consumption, but like you said it sounds like ARM has caught up.
Would love to hear about alternative designs -- are there low-power ARM chips that have something like FRAM and don't require erase/programming dances to write data?

Continue this thread — 5 replies

g_p8 replies#
Not the OP, but my understanding (admittedly a few years outdated) is that an MSP430 will, in idle, with sleep states properly set up and low power modes in use, drain a coin cell battery (e.g. CR2032) over a period of years - with the current drawn around 1.5 uA in standby and 0.1uA in RAM retention idle.

That is likely even lower than the effective self discharge rate of a lithium coin cell battery. I don't believe the Arm equivalents like the Cortex M0 can deliver such low absolute current - maybe microamps, but more than an MSP430 from what I can see.
Ref - https://metebalci.com/blog/measuring-the-power-consumption-o...

Continue this thread — 8 replies

laweijfmvo#
Thanks for sharing the explanations, and hey it's open source so someone can make a linux version if they want!
bambax1 reply#
Ok, so an app is needed to get the data from the device to a computer, and you wanted to focus your efforts on a "polished" Mac app. But why not make a non-polished Windows app as well? Or have someone make it?

Also, is the RAW data specific to the device and if so, why? If the device simply used, say, DNG or TIFF, then decoding could be done by external software, and all your own software would have to do would be to read the SD card and produce RAW files...?

davekeck5 replies#
> But why not make a non-polished Windows app as well? Or have someone make it?

If I had more time and money I certainly would!
> Also, is the RAW data specific to the device and if so, why?
To maximize battery life, the hardware does zero processing on the image data; it simply copies the raw pixels output by the image sensor to the unformatted SD card.
> If the device simply used, say, DNG or TIFF, then decoding could be done by external software, and all your own software would have to do would be to read the SD card and produce RAW files...?
True, perhaps I should've used an existing RAW format like DNG and exposed the images as a filesystem. That would require using a different architecture (ie not using an MSP430, like Rinzler89 suggested), and would likely reduce the battery life due to having to maintain a filesystem on the SD card.

Continue this thread — 5 replies

tomcam1 reply#
Love these answers. I declare you officially to be a badass.

Continue this thread — 1 reply

Continue this thread — 5 more replies

Continue this thread — 4 more replies

mysteria1 reply#
Cool project, here's a few comments after a quick glance over:

- There's no license on the code and design files in the Github repo, thus this currently isn't open source but rather "source-available". If you plan to allow others to modify the code and build their own cameras you should add an appropriate license.
- The Mac only support (and it's MacOS only, with no iPad/iPhone support) with a dedicated app to operate it seems to really limit the market for this device. Since all the app does is allow you to view/transfer photos and configure the device you probably could make do with a simple MTP interface for access to the photo files and have a second interface for configuration. Also if you do plan to release this under an OSS license and market it as a hackable + privacy friendly device Linux support is pretty much a requirement.
- Consider using automotive grade ICs to allow the device to function below freezing. The current stuff may be fine for Cali but people in northern states won't be able to use it outdoors in the winter.

kristianp2 replies#
> Linux support is pretty much a requirement

Support isn't required for linux: I think there will be people who will be keen to hack up Linux support based on the open source code available, and the same with Windows. However if "Dave" wants access a larger market, Windows or even Android support would make sense.

romwell#
>Windows or even Android support would make sense.

How about an SD card slot with a configuration in a plaintext file, so that one isn't tied to the software which may or may not be available in the future.
I just got myself a Sony Mavica which shoots photos on a floppy disk, and I can still use it without thinking about which OS my computer runs.
For a camera that boasts battery life in years, needing "exclusive" software (that may or may not be available years down the line) defies the point.

mysteria#
> Support isn't required for linux: I think there will be people who will be keen to hack up Linux support based on the open source code available, and the same with Windows.

I guess this is more of a marketing thing but I wouldn't be interested in buying this as a Linux user even with the other benefits if it came with unknown DIY support. If you're advertising it as an open source device and such then the people willing to play with it and pay a premium are typically Linux makers/hackers. If it's being sold as a Mac only device with a slick interface and app-only control that appeals to a different market entirely.

azinman21 reply#
This looks exceptionally cool. Thank you for writing an excellent Mac app - forget the rest of the hate here.

Do you think this would be appropriate for turning into a long form video? I’m imagining seeing videos of my boys growing and playing where I just periodically dump the camera and eventually sitch it as frames into a movie.
Anyway to know when it’s about to write over itself in storage?

davekeck1 reply#
> Do you think this would be appropriate for turning into a long form video?

Time-lapses are certainly one of the intended use-cases. I still need to add video-export features to the companion app though. Right now it only supports exporting images.
> Anyway to know when it’s about to write over itself in storage?
Currently it silently overwrites the oldest photos once the storage is filled, but I've been thinking it should have a setting to prevent that.
When the battery gets below 2%, the device enters "battery trap", where it stops capturing images and simply blinks the red LED every 5 seconds. Maybe there should be an optional setting to enter that mode when the storage is filled. Would that work for you?

azinman2#
I could always just use ffmpeg to turn into a video.

Blinking when full would work. I think it’d also be helpful to know when that might be- like could I see the expected date somehow based on the rate of capture? Maybe that’s too niche of a feature.

max-ibel1 reply#
Since there is so much anxiety about mac-only -- could you provide a small python file to read out the raw photos on any platform ?

It looks like you could just 'dd if=/dev/disk123 of=/tmp/bigrawfiles' and then postprocess with said python script.
Yes, not as good as a polished apple app, but for many people that really like the hardware and don't mind a bit of DIY, it's maybe enough...

davekeck#
That actually kind of exists currently via "MDCUtil", which should work on both macOS and Linux:

https://github.com/toasterllc/MDCCode/blob/rev10/Tools/MDCUt...
For example:

    $ MDCUtil ImgReadFull  output.cfa
That outputs the raw data stored on the SD card though, so I need to implement converting that to a standard format like DNG.

Load more comments