Machriam / PlantMonitor

GNU Affero General Public License v3.0
1 stars 0 forks source link

Get current temperature of IR-Camera #76

Closed Machriam closed 1 month ago

Machriam commented 1 month ago

AGC_UNIT_ID = 3 OEM_UNIT_ID = 4 RAD_UNIT_ID = 5 SYS_UNIT_ID = 6 VID_UNIT_ID = 7

def call_extension_unit(devh, unit, control, data, size): return libuvc.uvc_get_ctrl(devh, unit, control, data, size, 0x81)

See https://github.com/groupgets/purethermal1-firmware/wiki/Lepton-CCI-through-UVC-extension-units

def command_id_to_control(commandId): return ((commandId & 0x00ff) >> 2) + 1

def get_temperature(devh): buffer = create_string_buffer(2) call_extension_unit(devh, SYS_UNIT_ID, command_id_to_control(0x10), buffer, len(buffer)) return int.from_bytes(buffer.raw,byteorder="little")



- The control Ids can be found in [Lepton Interface Specification](https://github.com/Machriam/PlantMonitor/blob/76-current-temperature-of-ir/Confluence/Documents/LeptonSoftwareInterface.pdf)
github-actions[bot] commented 1 month ago

Changes of Pull Request #77

Commit messages for #76