ut330t
v1.0.0
Published
JS/TS library to interface with the UT330T USB temperature logger
Maintainers
Readme
ut330t
This is a simple JS/TS library to interface with the UT330T USB temperature logger.
The UT330T is a nifty little USB temperature logger that I purchased to monitor
the temperature of my root cellar. Problem is the software that comes with it is
Windows only. So I decided to reverse engineer the protocol and write a little
library to interface with it. Reverse engineering was done by sniffing the USB
traffic between the official Windows software and the device using SerialMon. I
made multiple captures while changing various settings in the official software
to get a good idea of how the protocol works. Those captures are included in
the captures directory.
The names of the functions (i.e. getDeviceParameters etc) are taken from strings I found in one of the dlls that comes with the software.
The protocol is rather quirky, like when encoding a date it'll write each "component" of the date as a separate byte. So the year 2025 is encoded as 0x05 (20+5) followed by month, day, hour, minute, and second each in their own byte. Having reverse engineered a few protocols in the past I expected the date to be encoded as seconds since some epoch for efficiency.
There's also some apparent bugs in the protocol, like when requesting the config date it'll say that the message length is 7 bytes when it's actually 6
Examples
Configure the device to log once every hour and start logging when the play button is pressed
const client = await Client.autoDiscover()
if (!client) {
throw new Error("No device found")
}
const deviceParameters = await client.getDeviceParameters()
console.log("Current device parameters:")
console.log(deviceParameters.toString())
deviceParameters.startMode = "key"
deviceParameters.samplingInterval = 3600
const newParams = await client.setDeviceParameters(deviceParameters)
console.log("Updated device parameters:")
console.log(newParams.toString())
await client.close()