SMBMSG(8)
π SMBMSG(8) β the group-chat guide
okay so bestie, welcome to smbmsg(8), from the System Manager's Manual, and honestly? she's giving "tiny tool, big personality" energy. let's get into it β¨
πΈ NAME πΈ
smbmsg β send or receive messages over an SMBus π
π SYNOPSIS π
smbmsg [-f dev] -p
smbmsg [-f dev] -s slave [-F fmt] [-c cmd] [-w] [-i incnt] [-o outcnt]
[outdata ...]
β¨ DESCRIPTION β¨
so the smbmsg utility is literally your little messenger between you and an SMBus β see smbus(4) for the lore π«
smbmsg has two different modi of operation (yes, modi, she's fancy). the first form up in the synopsis is the "probe" era π β you use it to probe the devices chilling on the SMBus. how? by sending each valid device address one receive byte, and one quick read message, respectively. devices that actually respond to these requests get displayed by their device address, followed by the strings 'r', 'w', or 'rw' β for devices that are readable, writeable, or both, readable and writeable, respectively. the only valid additional option for this modus of operation (besides the -p option that chooses the modus, obviously) is -f dev. more on that below π
β οΈ bestie, serious warning time: probing the bus is risky, since individual devices could perform unwanted actions upon receiving one of the mentioned messages. like, for example, if a particular SMBus device considers any write operation issued to it as a request to power off the system, the probing would trigger this action. yeah. π so probe responsibly.
the second form in the synopsis is the free-spirit one π¦ β you use it to send or receive arbitrary messages to or from individual devices. this might be useful to explore individual devices on the SMBus, or maybe even to write short shell scripts performing maintenance operations on the bus. main character energy fr fr π
any data values on the command-line are integer values in the range 0 through 255 for byte values, or 0 through 65535 for word values. and you can specify them using standard 'C' notation (prefix 0 for octal interpretation, or 0x for hexadecimal interpretation) β cute and classic π§
since the low-order bit of the device address of SMBus devices selects between read and write operations, only even-numbered slave addresses can exist on the bus. that's just how she is π
the options are as follows:
-F fmtβ specify theprintf(3)format to be used for displaying input data. this option is ignored in messages that do not read any input from the SMBus device. the format defaults to'0x%02x'for byte input operations, and to'0x%04x'for word input operations. for multi-byte input (block read), the same format is used for each individual byte read from the SMBus. consistent queen π-c cmdβ this is the value of the command byte to be issued as part of the SMBus message.-f devβ this specifies that dev should be used as the connection to the SMBus, rather than the default of/dev/smb0. pick your fav π«Ά-i incntβ an SMBus message should be generated to read incnt bytes from the device.-o outcntβ an SMBus message should be generated to write outcnt bytes to the device. the data values to write are expected to follow all of the options (and their arguments) on the command-line, where the number of data bytes must match the outcnt value. no skipping, no vibes-based counting π-pβ this selects the probe bus modus of operation. π-s slaveβ the slave parameter specifies which SMBus device to connect to. this option also selects the transfer messages from/to device modus of operation, where a slave address is mandatory. she's a package deal π-wβ this option specifies that IO operations are word operations, rather than byte operations. either incnt, or outcnt (or both) must be equal 2 in this case. note that the SMBus byte order is defined to be little-endian (low byte first, high byte follows). low byte walked so high byte could run β¨
not all argument combinations make sense in order to form valid SMBus messages. if no -c cmd option has been provided, the following messages can be issued:
quick readβ incnt0, outcnt-quick writeβ incnt-, outcnt0receive byteβ incnt1, outcnt-send byteβ incnt-, outcnt1
note in particular that specifying 0 as a count value has a different meaning than omitting the respective option entirely. they are not the same girl, do not confuse them π
if a command value has been given using the -c cmd option, the following messages can be generated:
read byteβ-w: no, incnt1, outcnt-write byteβ-w: no, incnt-, outcnt1read wordβ-w: yes, incnt2, outcnt-write wordβ-w: yes, incnt-, outcnt2process callβ-w: yes, incnt2, outcnt2block readβ-w: no, incntβ₯ 2, outcnt-block writeβ-w: no, incnt-, outcntβ₯ 2
π¦ FILES π¦
/dev/smb0β the default device to connect to, unless-f devhas been provided. she's the default for a reason π
π EXIT STATUS π
exit status is 0 on success, or according to sysexits(3) in case of failure. so if it's not 0, go read sysexits(3) and have your moment π
π₯ EXAMPLES π₯
typical usage examples of the smbmsg command include:
smbmsg -f /dev/smb1 -p
probe all devices on the SMBus attached to /dev/smb1. go say hi to everybody π
smbmsg -s 0x70 -i 1
issue a receive byte message to the device at address 0x70, and display the received byte using the default format. cute and simple π
smbmsg -s 0x70 -c 0xff -i 1 -F %d
issue a read byte message to the device at slave address 0x70, using 255 (0xff) as the command-byte to send to the device, and display the result using the custom format '%d'. customized, personalised, iconic π
smbmsg -s 0xa0 -c 0 -o 1 0x80
send a write byte message to the slave device at address 0xa0, using 0 as the command-byte value, and 0x80 as the byte to send (after the command). assuming this might be a Philips PCF8583 real-time clock, this would stop the clock. yeah she can do that π³
smbmsg -s 0xa0 -c 1 -i 6 -F %02x
send a block read command to device at address 0xa0, and read 6 bytes from it, using hexadecimal display. again, assuming a PCF8583 RTC, this would display the fractions of second, seconds, minutes, hours, year/date, and weekday/month values. since this RTC uses BCD notation, the actual values displayed were decimal then. history lesson AND a read command, we love a multitasker πβ¨
smbmsg -s 0xa0 -c 2 -o 5 0x00 0x07 0x22 0x16 0x05
send a block write command to device at address 0xa0. for the PCF8583 RTC, this would set the clock to Sunday (2004%4)-05-16 22:07:00. time travel but make it SMBus β°π¦
π DIAGNOSTICS π
diagnostic messages issued are supposed to be self-explanatory. she tells you what's wrong, you just gotta listen π
β SEE ALSO β
printf(3), sysexits(3), smb(4), smbus(4)
the SMBus specification, http://www.smbus.org/specs/ β go read the source material bestie, iykyk π
π HISTORY π
the smbmsg utility first appeared in FreeBSD 5.3. a legend was born π
πΈ AUTHORS πΈ
the smbmsg utility and this manual page were written by JΓΆrg Wunsch. thank you for your service π«Ά
and that's the whole page, bestie π this edition is from Debian, dated May 16, 2004, filed under SMBMSG(8) β go forth and message some SMBus devices, responsibly, periodt β¨π¦π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2004 Joerg Wunsch
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms