SHT4XTEMP(4)

πŸ“¦ version 11.0, in nixpkgs unstable

πŸ’– SHT4XTEMP(4) β€” the kernel interfaces manual, but make it cute

okay so bestie, you're looking at sht4xtemp β€” that's the man page name, and it lives in the Kernel Interfaces Manual section 4 (iykyk, section 4 is where the driver girlies live πŸš—βœ¨). It's literally the whole page for the Sensirion SHT40/SHT41/SHT45 sensor chip driver, and we're gonna go through every single line together, no skipping, no cap.


πŸ¦‹ NAME

sht4xtemp β€” the driver for the Sensirion SHT40/SHT41/SHT45 sensor chip, and it talks to the chip over the I2C bus. That's it, that's the whole vibe. She's a driver, she reads humidity and temperature, she's iconic. πŸŒ‘οΈπŸ’§


✨ SYNOPSIS

sht4xtemp* at iic? addr 0x44

that's the config line, copy it exactly, don't be cute with it πŸ’…


🌸 DESCRIPTION

So the sht4xtemp driver gives you measurements from the SHT40/SHT41/SHT45 humidity/temperature sensors, and it does it through the envsys(4) framework (that's the sensor framework, she's the main character of the sensor world πŸ‘‘).

The sht4xtemp addr argument picks the address on the iic(4) bus β€” that's how you tell the kernel where on the I2C bus your chip is hanging out.

And here's the fun part: you can change the resolution, the heater controls, and the crc validity through sysctl(8) nodes. Yes bestie, there are knobs. There are SO many knobs. Let's open them all up. 🎁


πŸŽ€ SYSCTL VARIABLES

These are the sysctl(3) variables the driver hands you, one by one, and I'm obsessed with each of them:

  • hw.sht4xtemp0.resolutions β€” lists out all the resolutions the driver and the chip support. She's just showing you the menu, you don't order from this one, you just look at it 😌
  • hw.sht4xtemp0.resolution β€” this is where you actually set the resolution, aka the number of bits used for %RH and temperature. Bestie, use one of the strings listed in hw.sht4xtemp.resolutions β€” don't just freestyle a string, she will not know what you mean.
  • hw.sht4xtemp0.ignorecrc β€” if you set this, the crc calculation for %RH and temperature gets ignored. like, completely skipped. yes, on purpose. that's the whole point of the node πŸ™ˆ
  • hw.sht4xtemp0.heateron β€” turns the heater on and off. and okay, important caveat incoming: the heater is turned on right before the measurement and runs for a pulse width of time. then the measurement is taken and the heater is turned off. there's no way to keep the heater running with this chip. none. she said what she said. πŸ”₯
  • hw.sht4xtemp0.heaterstrength β€” from 1 to 3, this is how much energy goes into the heater. higher number = more power used. simple as that ⚑
  • hw.sht4xtemp0.heaterpulses β€” lists the valid heater pulses that the driver and chip support. the menu again πŸ’«
  • hw.sht4xtemp0.heaterpulse β€” set the heater pulse length. use one of the strings listed in hw.sht4xtemp.heaterpulses β€” same rule as before, pick from the list, don't invent πŸ’…
  • hw.sht4xtemp0.debug β€” now THIS one only shows up if the driver was compiled with SHT4X_DEBUG. if it's there, you can use it to set the debugging level. if it's not there, don't go looking for it πŸ•΅οΈβ€β™€οΈ
  • hw.sht4xtemp0.readattempts β€” okay so here's the lore: to read %RH or temperature, the chip requires that the command be sent, then a delay must be observed before a read can be done to get the values back. those delays are documented in the datasheet for the chip (go read it if you're nosy, we respect that). the driver will attempt to read back the values readattempts number of times. the default is 10, which should be more than enough for most purposes. ten tries, she's persistent, we love that for her 🫢

🌈 SEE ALSO

every one of these, in this order, no gatekeeping:


πŸ’œ HISTORY

The sht4xtemp driver first appeared in NetBSD 10.0. she's not old, she's fresh, she's new on the scene ⭐


🧚 AUTHORS

The sht4xtemp driver was written by Brad Spencer <brad@anduin.eldar.org> β€” thank you Brad, king behavior, we appreciate you πŸ‘‘


and that's the whole page bestie, every single flag, node, default and caveat, nothing dropped, nothing invented πŸ’–

okay so the cute sign-off: this page came to you from the Debian build of the manual, dated September 28, 2021, and the page itself is SHT4XTEMP(4) β€” that's the source and version and date all wrapped up in one little bow πŸŽ€ stay hydrated, check your crc, and never try to keep that heater running πŸ’…βœ¨

πŸ“¦ where this page comes from