UMB communication
40 Snow depth sensor SHM 31, V2.1
Sensor:
The target address for the SHM31 is B001h.
PC:
The class ID for the PC (master unit) is 15 = Fh; the PC ID is e.g. 001d = 01h.
Putting the class and device IDs together gives a sender address of F001h.
The length <len> for the online data request command is 4d = 04h;
The command for the online data request is 23h;
The version number of the command is 1.0 = 10h.
The channel number is in <payload>; as can be seen from the channel list in section Error!
Bookmark not defined. the current snow depth in cm is in channel 604d = 25Ch.
The calculated CRC is 5930h.
Table 16: UMB binary example, query command to the sensor
Table 17: UMB binary example, response from the sensor
T
he received snow depth in cm from channel 604 is 420DFFB1h = 35.4997 cm.
The conversion process follows the rules of IEEE-754 (float) conversion.
9.3.5. Status and error codes in the UMB binary protocol
If the measured value query supplies the <status> 00h, then the sensor is working properly. A
complete list of status and error codes can be found in the description of the UMB protocol. The
following is an extract from the list:
Command successful; no error; all o.k.
Unknown command; not supported by this device
Device not ready; e.g. initialization / calibration running
Measurement variable (+offset) is outside the set display range
Measurement value (physical) is outside the measuring range (e.g. ADC over range)
Error in measurement data or no valid data available
Device / sensor is unable to execute valid measurement due to ambient conditions