The broken statistics graphs of the 22.03.3 release is because a defective nut plugin logic. After some javascript improvement, it will be fixed for the upcoming snapshot.
Therefore my question now becomes academic. And in that sense, there are so many combinations of parameters for creating an rrd, so it's a matter of understanding how it's implemented in OpenWrt.
I already read the wiki you linked, but it didn't give me enough clues on how the statistics is expecting the rrd in order to be processed. On the other hand, another doc from the same author provided me more hints on how to specify the creation parameters, and in fact, after some guessing comparing collectd/rrdtool config with that doc, and guessing that a constant-resolution graphs would make more sense, I managed to create an rrd of the same size as expected (12856B):
rrdtool create temperature-ups.rrd --step 30 \
DS:temperature:GAUGE:300:0:100 \
RRA:AVERAGE:0.1:1:288 \
RRA:AVERAGE:0.1:10:288 \
RRA:AVERAGE:0.1:70:288 \
RRA:AVERAGE:0.1:300:288 \
RRA:AVERAGE:0.1:3650:288
It wasn't plotted by LuCI statistics, though, but at least it got me closer
FWIW: this is how collectd has configured rrdtool:
LoadPlugin rrdtool
<Plugin rrdtool>
DataDir "/tmp/rrd"
RRARows 288
RRASingle true
RRATimespan 7200
RRATimespan 86400
RRATimespan 604800
RRATimespan 2678400
RRATimespan 31622400
</Plugin>
I hadn't paid attention to the dump option of rrdtool. That could help. This build is running rrdtool1 - 1.0.50-5
, and I'm looking at the dump of the AC voltage, data source and the first rra:
<!-- Round Robin Database Dump -->
<rrd>
<version> 0001 </version>
<step> 30 </step> <!-- Seconds -->
<lastupdate> 1680604961 </lastupdate> <!-- 2023-04-04 06:42:41 -04 -->
<ds>
<name> value </name>
<type> GAUGE </type>
<minimal_heartbeat> 60 </minimal_heartbeat>
<min> NaN </min>
<max> NaN </max>
<!-- PDP Status -->
<last_ds> UNKN </last_ds>
<value> 1.3970000000e+03 </value>
<unknown_sec> 0 </unknown_sec>
</ds>
<!-- Round Robin Archives -->
<rra>
<cf> AVERAGE </cf>
<pdp_per_row> 1 </pdp_per_row> <!-- 30 seconds -->
<xff> 1.0000000000e-01 </xff>
<cdp_prep>
<ds><value> NaN </value> <unknown_datapoints> 0 </unknown_datapoints></ds>
</cdp_prep>
<database>
<!-- 2023-04-04 04:19:00 -04 / 1680596340 --> <row><v> 1.2736666667e+02 </v></row>
[and many other time/volt entries for this rra]
Some things are clear from the dump, others need more thinking.
For comparison, here is the dump of the last rrd I've created:
<!-- Round Robin Database Dump -->
<rrd>
<version> 0001 </version>
<step> 30 </step> <!-- Seconds -->
<lastupdate> 1680603679 </lastupdate> <!-- 2023-04-04 06:21:19 -04 -->
<ds>
<name> temperature </name>
<type> GAUGE </type>
<minimal_heartbeat> 60 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 1.0000000000e+02 </max>
<!-- PDP Status -->
<last_ds> UNKN </last_ds>
<value> 0.0000000000e+00 </value>
<unknown_sec> 19 </unknown_sec>
</ds>
<!-- Round Robin Archives -->
<rra>
<cf> AVERAGE </cf>
<pdp_per_row> 1 </pdp_per_row> <!-- 30 seconds -->
<xff> 1.0000000000e-01 </xff>
<cdp_prep>
<ds><value> NaN </value> <unknown_datapoints> 0 </unknown_datapoints></ds>
</cdp_prep>
EDIT:
NaN can be entered manually during the creation if the range is unknown, and the datasource seems to be named "value" for all the databases.