Collectd: rrdtool plugin: rrd_update_r failed illegal attempt to update using time

I've tried to monitor ath11k temp sensor a while ago and realized that collectd has difficulties with ath11k sensor (Device: Zyxel NBG7815).

The log is spammed as soon I enable monitoring ath11k_hwmon-isa-c000000 sensor in luci. There is created only one graph (we have 3 sensors) within luci showing some data sporadically (basically its empty):

daemon.err collectd[7221]: rrdtool plugin: rrd_update_r failed: /tmp/rrd/NBG7815/sensors-ath11k_hwmon-isa-c000000/temperature-temp1.rrd: illegal attempt to update using time 1686819473 when last update time is 1686819473 (minimum one second step)

I've found the following issue on Github related to atk10k which looks like its the same for ath11k:

Some outputs:

root@NBG7815:/sys# sensors 
ath11k_hwmon-isa-c000000
Adapter: ISA adapter
temp1:        +62.0°C  

tmp103-i2c-0-70
Adapter: QUP I2C adapter
temp1:        +61.0°C  (low  = -10.0°C, high = +60.0°C)

90000mdio108-mdio-8
Adapter: MDIO adapter
temp1:        +70.4°C  (low  = +10.0°C, high = +60.0°C)  ALARM (HIGH, CRIT)
                       (crit low =  +0.0°C, crit = +70.0°C)

ath11k_hwmon-isa-c000000
Adapter: ISA adapter
temp1:        +80.0°C  

ath11k_hwmon-isa-c000000
Adapter: ISA adapter
temp1:        +59.0°C  

gpio_fan-isa-0000
Adapter: ISA adapter
fan1:           0 RPM  (min =    0 RPM, max = 4500 RPM)
./devices/platform/soc/c000000.wifi/ieee80211/phy1/hwmon4
./devices/platform/soc/c000000.wifi/ieee80211/phy2/hwmon5
./devices/platform/soc/c000000.wifi/ieee80211/phy0/hwmon3

./kernel/debug/ath11k/ahb-c000000.wifi
./devices/platform/soc/c000000.wifi
./bus/platform/devices/c000000.wifi
./bus/platform/drivers/ath11k/c000000.wifi

My question here is if the patch discussed on the Github issue is covering ath11k or not?

 	if ((!subsys || !strcmp(subsys, "platform") ||
 			!strcmp(subsys, "of_platform"))) {
 		/* must be new ISA (platform driver) */
-		if (sscanf(dev_name, "%*[a-z0-9_].%d", &entry->chip.addr) != 1)
-			entry->chip.addr = 0;
+		if (sscanf(dev_name, "%*[a-zA-Z0-9_]%*1[.:]%d", &entry->chip.addr) == 1);
+		else if (sscanf(dev_name, "%x.%*s", &entry->chip.addr) == 1);
+		else entry->chip.addr = 0;
 		entry->chip.bus.type = SENSORS_BUS_TYPE_ISA;
 		entry->chip.bus.nr = 0;

My C knowledge is poor, but for me it looks like it is covered. But it does not work obviously.
If it not covered where to start to find the real issue here?

Hi! Have you managed to fix it?

No. It was easier for me to just grab and rework the fan script from zyxel with fan enabled in DTS. It is monitoring temps of wifi chips as well.

You can access the temps directly:

/sys/devices/platform/soc@0/c000000.wifi/ieee80211/phy0/hwmon*/temp1_input
/sys/devices/platform/soc@0/c000000.wifi/ieee80211/phy1/hwmon*/temp1_input
/sys/devices/platform/soc@0/c000000.wifi/ieee80211/phy2/hwmon*/temp1_input

Running latest stable the path is without "@0".

I have no clue where I would have to integrate this path's to enable collectd/rrdtool to collect the temps for all 3 sensors. My impression was (if I remember correct) that everything depends on "c000000". rrdtool grabs just the first (hwmon/phy0). As there is no other distinction. So it would have to be sth. like c000000 & phy[0-9] to make it work for ath11k.

1 Like