AllskyTeam / allsky

A Raspberry Pi operated Wireless Allsky Camera

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[ENHANCEMENT] Support sensor temperature on RPi cameras that support it

EricClaeys opened this issue · comments

For cameras that do NOT support it, the take/save dark images settings should be hidden.

Hi Eric, not sure if the RPi HQ camera supports this yet or not. This post from a while ago said there is one, but sounded a little complicated to get it working: https://forums.raspberrypi.com/viewtopic.php?t=288962
If that does prove to be complicated, could we simply use temp as read out from any secondary temp sensor? For example, I have an Adafruit pressure/humidity/temp sensor. I read it out, write it to text, then add it to my overlay so I can see system health. I've put the sensor on the backplane of the RPi camera board - not perfect, but gives a rough idea of the temp of the board by thermocoupling the sensor to the rear bolt. Maybe we could just point the dark "temp" to a 1-line text file?

It's easy: add --metadata /tmp/metadata.json as an extra command, then it will save temperature. (Alongside other metrics which might be useful as EXIF data)

Output:

{
    "ExposureTime": 26999600,
    "SensorTimestamp": 2316881492000,
    "ScalerCrop": "(0, 0)/4056x3040",
    "ColourCorrectionMatrix": [ 2.035740, -0.803706, -0.232033, -0.390240, 1.975115, -0.584876, -0.090693, -0.611450, 1.702143 ],
    "FocusFoM": 1027,
    "ColourTemperature": 3591,
    "ColourGains": [ 1.000000, 1.600000 ],
    "DigitalGain": 1.000015,
    "AeLocked": false,
    "SensorTemperature": 35.000000,
    "Lux": 0.002712,
    "FrameDuration": 27000228,
    "SensorBlackLevels": [ 4096, 4096, 4096, 4096 ],
    "AnalogueGain": 16.000000
}

We haven't had a chance yet to support reading the sensor temperature on RPi cameras that support it.
When we implement it, we'll use the --metadata option as @schoerg mentioned, then read the file it produces and pass on whatever the SensorTemperature is to the dark capture and dark subtract programs as well as the overlay module.

There's a Discussion item (probably closed) where I talk about how to implement dark frames on RPi cameras for those technically inclined to do so.

@astrobrothers, using an external temperature sensor probably won't work very well. The main reason for sensor temperature (other than FYI) is to pick the correct dark frame. An external sensor's temperature might be quite a bit different which could make subtracting dark frames even worse.