Skip to content

I2C and 1-Wire sensors

/stm.cgi?dswrite

Read or set DS ID depending on parameters.

To read subsequent IDs to variable <--#dsid-->, which can be find under key dsid in /json/dsi2c.json:

GET /stm.cgi?dswrite=0

To set DS ID on chosen position:

GET /stm.cgi?dswrite=A:B
  • A determines for which position the ID is set, integer 1-8 (DS1-DS8)
  • B is the ID to set, string (in form of XX:XX:XX:XX:XX:XX:XX:XX, where X is 0-9, A-F)

Example:

http://192.168.1.100/stm.cgi?dswrite=1:0:0:0:0:0:0:0:0

/stm.cgi?i2csensors

Set up the I2C sensors.

GET /stm.cgi?i2csensors=A
  • A determines which sensors are selected, integer 1-24 (5 bits - first four are primary sensor NONE, BME280, AM2320, HTS221, of which only one can be set to 1 at the time, the 5th one is secondary sensor SPS30)

Example:

http://192.168.1.100/stm.cgi?i2csensors=1

/stm.cgi?i2csfreq

Set the communication frequency with the I2C sensor.

GET /stm.cgi?i2csfreq=A
  • A is the frequency in kHz, integer 5-100

Example:

http://192.168.1.100/stm.cgi?i2csfreq=20