tygamvrelis / oil_lamp

Gimballed oil lantern motion recording & playback
1 stars 0 forks source link

While recording, momentary switch on controller enclosure to create "flag" in Data and flash Lamp LED and enclosure LED for sync #8

Closed bturep closed 5 years ago

bturep commented 5 years ago

This will be used when the lamp is set up and recording and I am moving camera positions.

bturep commented 5 years ago

Could we also, at the beginning of each recording, have a time date stamp? Something like "hh:mm, dd/mm/yy"? Would this require that the controller always has power to keep an internal clock running? If it is an issue then no worries-- it is very low priority.

tygamvrelis commented 5 years ago

At the moment, file name is of the form ddmmyyyy_hh_mm_ss.dat, e.g. 13052019_22_12_30.dat. I don't think the raspberry pi keeps time when it's off, so we would need an external clock module if you want this time to be accurate. Otherwise, the time will default to some particular value whenever the raspberry pi is powered on. What do you think?

Also, in my work-in-progress branch, I am currently writing a time stamp alongside each data packet: image In plaintext, you can see the time and the status. The time is taken from my laptop. The status is 1 whenever the camera LED is on and is 0 otherwise. This allows you to Ctrl+F for "stat=1" to find all the times when the camera LED is on. Above, you can see a transition in the status, caused by me pressing a button. After that, you see our acceleration and gyroscope data in binary format, which my text editor is desperately trying to interpret as alphanumeric symbols. I played around with logging this data in plaintext, but I found that the file size blew up quickly...the current method with binary data is 96% smaller. Part of the reason I want to keep it smaller is that you said you might want to open up the text files and stitch them together. Your text editor probably won't be able to do that if the files are hundreds of megabytes. Fun fact: my text editor was struggling to open even short data logs when I logged the data in plaintext, so the binary logging was in fact necessary for the dev process. 😄

bturep commented 5 years ago

To your first question, I am open to it-- if it is quick to code, and not too much effort for you, then I think it would be useful (the external clock module)-- and Creatron down the street apparently has a few different options so it is not like I would have to order it in. The reason I think it would be helpful is for when I make multiple recordings, each with their own flags, and I am trying to sort them out come editing day. If it was time stamped to REAL ddmmyyyy_hh_mm_ss, I would simply set my camera to also note time-date.

An alternative would be to make a new .dat file each time the controller is turned off then on again-- (is there a danger of overwriting the previous .dat?) If we do this (maybe this is already what you have programmed) I could just keep track on my own of how many instances I have turned it off and on as I am shooting throughout the day and cross reference with the footage. A bit more of a hassle but totally doable!

Also, would you recommend a program for reading the .dat?

tygamvrelis commented 5 years ago

At the moment I think files will be overwritten if the names are the same, but I could easily add an ascending number to the start or end to uniquify them. I think an external clock sounds like a good idea for convenience though. If we can find one that other people have used with raspberry pi, that would likely be straightforward to integrate (since there should be existing code and guides).

Any text editor can open the .dat file. This extension doesn’t mean anything, it’s just something I made up. On Windows, I’ve been using Sublime Text, but something it accidentally thinks the whole file is binary, so it doesn’t display the plaintext. Whenever this happens, I open the file in Notepad, then close Notepad and open the file in Sublime again. Notepad always seems to display the file contents correctly, but it’s not a favourite of mine.

On May 22, 2019, at 16:59, bturep notifications@github.com wrote:

To your first question, I am open to it-- if it is quick to code, and not too much effort for you, then I think it would be useful (the external clock module)-- and Creatron down the street apparently has a few different options so it is not like I would have to order it in. The reason I think it would be helpful is for when I make multiple recordings, each with their own flags, and I am trying to sort them out come editing day. If it was time stamped to REAL ddmmyyyy_hh_mm_ss, I would simply set my camera to also note time-date.

An alternative would be to make a new .dat file each time the controller is turned off then on again-- (is there a danger of overwriting the previous .dat?) If we do this (maybe this is already what you have programmed) I could just keep track on my own of how many instances I have turned it off and on as I am shooting throughout the day and cross reference with the footage. A bit more of a hassle but totally doable!

Also, would you recommend a program for reading the .dat?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

bturep commented 5 years ago

I grabbed this real time clock today: https://www.creatroninc.com/product/ds3231-real-time-clock-for-raspberry-pi/ https://www.creatroninc.com/upload/DS3231%20Datasheet.pdf

tygamvrelis commented 5 years ago

Okay great, we should be able to integrate it via steps like so: https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi?view=all

tygamvrelis commented 5 years ago

Fixed in #9