libretiny icon indicating copy to clipboard operation
libretiny copied to clipboard

Expanding tuya config in docs

Open lmcd opened this issue 1 year ago • 4 comments

It turns out that Tuya device configuration, as seen in the Tuya Pinout Config page of the docs is documented more fully on the official Tuya website.

See here: https://developer.tuya.com/en/docs/iot/product-firmware-information-configuration-instructions?id=K9s9rhj59ov2z

By cross-referencing another dump here, and matching default values, we can discern what some of the undocumented fields are: https://www.elektroda.com/rtvforum/topic4000734.html

gmkr, gmkg, gmkb = Gamma gmwr, gmwg, gmwb = White balance

We could update the docs on your website with the more extensive descriptions from the Tuya website.

lmcd avatar Dec 06 '23 03:12 lmcd

For lights there seem to be a detailed description of UPK keys here (it's for bluetooth but I don't think it matters).

szupi-ipuzs avatar Dec 06 '23 22:12 szupi-ipuzs

There is also source code that details exactly how these values are used: https://github.com/tuya/tuya-iotos-embeded-sdk-wifi-ble-bk7231n

For example, I was wondering what a gamma value of 1-100 represents, and found that the gamma correction algorithm is actually implemented here, based on the gmkr, gmkg, gmkb, gmwr, gmwg, gmwb config values

lmcd avatar Dec 06 '23 22:12 lmcd

Oh WOW, I never realized that some of the keys are in the public SDK! That's great, I'll try to add more keys to the docs.

kuba2k2 avatar Dec 07 '23 12:12 kuba2k2

A few more definitions that seem to be missing, based on https://github.com/tuya-cloudcutter/tuya-cloudcutter.github.io/blob/master/devices/lsc-3008407-led-light-strip-1.0.18.json :

  • CS: SPI CS pin
  • SCL: SPI SCK pin
  • miso: SPI MISO pin
  • mosi: SPI MOSI pin
  • mic: Microphone input pin (in this specific case it's a low resolution/quality mic used for equaliser animation purposes)
  • micproc: I suspect this is a type definition for a microphone processor, or maybe a sampling rate
  • irpin: yet another IR pin definition
  • irfuncs: a set of IR functions. Mapping is unclear, seems to assign numeric values to IR bytes.

fonix232 avatar Dec 12 '23 11:12 fonix232