Troubleshooting
Why FUXA stores InfluxDB V2 points at one second spacing
Short answer
FUXA's InfluxDB V2 storage adapter creates its write client with second precision, so millisecond timestamps are truncated to whole seconds and same-second samples overwrite each other, leaving points one second apart. Change the precision argument in server/runtime/storage/influxdb/index.js from s to ms, redeploy the runtime, and confirm raw points spaced at the acquisition period; polling and tag storage settings stay untouched.

On this page
Your FUXA project reads a device on a subsecond cycle and hands selected tags to storage on the same rhythm, yet every point lands in InfluxDB V2 no closer together than one second, whatever interval you set. The acquisition settings are not the fault. The FUXA storage adapter creates its InfluxDB write client with second precision, so each millisecond timestamp is truncated to whole seconds before the point is sent, and every sample inside a second overwrites the one before it. The correction is a single argument: millisecond precision in server/runtime/storage/influxdb/index.js, then a redeploy of the runtime. This article gives the checks that isolate the writer, the exact change, and the test that proves new points keep their spacing.
Why same-second samples collapse into one point #
The InfluxDB V2 write API takes a timestamp precision alongside the organization and bucket: the unit in which the timestamps on that write path are interpreted. The documented choices are nanoseconds, microseconds, milliseconds and seconds, and the FUXA adapter passes seconds.
FUXA acquires on millisecond time — its local SQLite path stores UNIX timestamps in milliseconds — so the writer receives a value finer than its declared unit, and the subsecond part is converted away before the point leaves the client.
Identity does the rest. InfluxDB defines a point by its measurement, its tag set and its timestamp, and a write that repeats all three replaces the earlier field values instead of adding another sample. Five writes scheduled within a single clock second all truncate to the same timestamp, so one point survives carrying the last value and the other four samples are gone. This is a rule of the store rather than a FUXA quirk: it is the same behavior behind why Telegraf writes one InfluxDB point from 80 MQTT entries when the timestamps repeat.
Worked example: five writes per second for tag press_01, because 1000 ms ÷ 200 ms = 5. The sample timestamps in UNIX milliseconds are 1719878540000, 1719878540200, 1719878540400, 1719878540600 and 1719878540800. At second precision each is divided by 1000 and truncated: 1719878540800 ÷ 1000 = 1719878540.8, which becomes 1719878540, and the same truncation maps all five timestamps onto 1719878540. One identity, one point, last value wins. The next stored point lands on 1719878541, so adjacent stored points differ by 1719878541000 - 1719878540000 = 1000 ms, exactly the coarse spacing you observe. At millisecond precision the timestamps pass through untouched: 1719878540400 - 1719878540200 = 200 ms between neighbors.
Settings to leave alone while you diagnose #
Hold these steady while you test; each looks guilty and none of them chooses the timestamp unit:
- The device polling period and the tag storage interval — both 200 ms in the setup where this behavior was confirmed. They decide how often values are read and when FUXA hands one to storage; neither selects the write unit, so tightening them again cannot recover lost resolution.
- The InfluxDB organization, bucket and token. Once a separate client has written subsecond points into the same bucket and read them back, the bucket is cleared as the limit.
- A container restart on its own. It re-creates the writer with the same
sargument and reproduces the fault; restarts matter after the correction, not instead of it. - The trend display. A panel that aggregates coarsely, or one that never renders subsecond times, can hide spacing the bucket actually holds, so judge storage by raw points only.
Prove the writer is the cause #
Two comparisons isolate the fault to the write call. Switch the DAQ storage to SQLite for a short window: in the tested installation the same tags then stored with UNIX timestamps in milliseconds and successive deltas at the acquisition period, which clears the polling loop, the storage schedule and FUXA's timestamp generation. Then query the InfluxDB bucket raw, with no aggregation function and no windowing, and difference the timestamps of one tag: the coarse spacing is present in the raw data, so it is not a display artifact.
| Test | Result that matters | What it rules out |
|---|---|---|
| Raw query of one tag, adjacent timestamps differenced | Nearest pair sits at the reported minimum | Display or query aggregation |
| Same tags through SQLite storage | Millisecond UNIX timestamps, deltas matching the device cycle | Acquisition and scheduling |
| Separate client writes two subsecond points into the same bucket and reads them back | Both points return with their subsecond timestamps | Server, bucket and token |
These checks assume the values themselves are plausible. If points are misshaped or fields are missing rather than mistimed, that is a different fault, and the MQTT JSON shape troubleshooting guide for FUXA and InfluxDB covers that path.
Change the write precision to milliseconds #
The fault sits in server/runtime/storage/influxdb/index.js. Find the call that builds the writer, client.getWriteApi. In the build where the fix was confirmed it sat at line 44; locate it by content, because line numbers move between releases. Its third argument is the timestamp precision, given as s. Make it ms and leave the organization and bucket arguments untouched:
writeApi = client.getWriteApi(settings.daqstore.organization, settings.daqstore.bucket, 'ms');
The call you are replacing is identical except that its precision reads s.
Deploy the change the way you normally ship this application. In the tested setup FUXA and InfluxDB V2 both ran as containers on one machine, so the corrected file belongs in the build that produces the FUXA image; an edit made only inside a running container disappears at the next replacement. Restart the runtime afterwards so it constructs the writer with ms, and record the application revision you patched, because a later project update may already carry the millisecond precision or may overwrite a local edit.
Verify new points at the acquisition spacing #
Keep the polling period and the tag storage interval as they are; the correction touches only the writer. Drive the tag with a changing signal, because a constant value makes an overwrite invisible — every collapsed sample looks the same anyway.
After the restart, query raw points for one tag and difference adjacent timestamps: delta_t_ms = timestamp_next_ms - timestamp_current_ms, both integers taken from the stored points. Deltas should now sit at the acquisition period, with the fractional-second digits present. Check that the points fall inside your test window too: a unit mismatch on a write path moves points in time, so timestamps outside the window mean the units still disagree somewhere.
Two limits to expect. The correction does not rebuild history: points recorded before the change keep their coarse timestamps, and values lost to same-second overwrites stay lost. An interval is also a schedule, not a metronome, so occasional jitter or gaps deserve their own diagnosis once systematic coarse quantization is gone.
If you prove the bucket with your own test client, give every test point its own timestamp: points sharing one keep only the last record, the same identity rule that leaves only the last record of a Node-RED array write in the bucket.
Finally, recreate the FUXA container from your deployment artifact and repeat the raw query. That proves the correction survives replacement instead of living only in a patched filesystem.
The decision for each outcome #
- Raw InfluxDB timestamps coarser than the storage schedule while the SQLite comparison shows deltas at the acquisition period: apply the
msprecision correction inserver/runtime/storage/influxdb/index.jsand redeploy. This is the fault confirmed in the tested installation. - Raw InfluxDB timestamps coarse and SQLite coarse as well: the truncation is not on the write path, so leave the adapter alone and check the tag's storage schedule and logging trigger in FUXA, then re-run the raw query.
- Raw points carry subsecond spacing but the trend still looks coarse: the writer is already correct; fix the panel's aggregation window or query resolution instead.
- Points land outside the expected time window: the timestamp units still disagree on the write path, so align the unit of the timestamps your build produces with the precision argument before trusting the data.
Questions asked
Which timestamp precisions does the InfluxDB V2 write API accept?
Four documented values: ns for nanoseconds, us for microseconds, ms for milliseconds and s for seconds. The value sets the unit in which the server reads the epoch timestamps on that write request. The argument must match the unit of the timestamps the application produces; a mismatch either discards the subsecond part or shifts points far from their true time.
Does the precision change affect points already stored?
No. Existing points keep the timestamps they were written with, so history recorded before and after the change stays readable on one time axis. Nothing is re-timed or re-created; the correction acts only on the write path from the restart onward. A query window that spans the change returns coarse points before it and subsecond points after it.
Why did the same tags store at full resolution in SQLite?
The SQLite storage path writes the application's UNIX timestamps in milliseconds exactly as they arrive, with no precision conversion anywhere on that path. The truncation exists only on the InfluxDB write call, which is why the fault appeared in one storage target and not the other.
Can the dashboard still look coarse after the fix?
Yes. A panel that aggregates over a window of one second or coarser can hide millisecond spacing the bucket actually holds, and some dashboards never render subsecond times. Query the raw points and difference their timestamps before you judge the correction by a chart.

