pxt-microbit icon indicating copy to clipboard operation
pxt-microbit copied to clipboard

datalogger simulator erases most data when the log is full

Open microbit-carlos opened this issue 5 months ago • 2 comments

Describe the bug A simple programme logging data rapidly will fill the datalog storage fairly quickly. Running the programme in the the simulator, when the "data full" event is raised, it seems to erase all previous data except the last row.

Downloading the CSV file also downloads only the last log, so all the previous simulated data is lost.

To Reproduce Load this programme, go into the datalog simulator and wait until the programme is full, should a bit less than 5 minutes, can be left in the background.

datalogger.onLogFull(function () {
    basic.showIcon(IconNames.Skull)
})
datalogger.mirrorToSerial(true)
basic.showIcon(IconNames.Happy)
basic.forever(function () {
    datalogger.log(
    datalogger.createCV("y", input.acceleration(Dimension.Y)),
    datalogger.createCV("x", input.acceleration(Dimension.X))
    )
})

This shows the programme working as expected:

Image

And the "datalog full" event has been configured to also show a skull on the display:

Image

At this point only the last row is available.

Expected behavior Historial datalog data to be available

micro:bit version (please complete the following information): N/A

Desktop (please complete the following information):

Chrome 138 on macOS

Additional context

Tested on MakeCode Live and Beta:

makecode.microbit.org version: 7.1.56 Microsoft MakeCode version: 11.4.43 microbit runtime version: v2.2.0-rc6 codal-microbit-v2 runtime version: v0.3.0

microbit-carlos avatar Jul 08 '25 17:07 microbit-carlos

@microbit-carlos is this is a regression from live?

abchatra avatar Jul 08 '25 18:07 abchatra

No, it's the same in both.

microbit-carlos avatar Jul 08 '25 18:07 microbit-carlos