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

Show all comments

Showing thread 5 of 87

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