@chrishamm tested and it works great. Super fast when compared to M36. Thank you again for your help
Best posts made by AndMaz
-
RE: [Feature Request] GCode to check if file exists
-
[Request] Add `recursiveDelete` to param to `GET /rr_delete`
Is is possible to add a
recursiveDelete
(default tofalse
) toGET /rr_delete
? At the moment it's doesn't seem to be possible to remove a dir if it contains something inside. I would like to avoid overloading HTTP server with a bunch of delete reqs. -
Q: How to check the type of a variable?
Is there a way to check the type of a variable? Something like
typeof(global.fanSpeed)
and result would bebool
,int
,float
,string
,DateTime
,object
orarray
If this is not possible atm, can you please add this feature? It will help a lot with params validation
Latest posts made by AndMaz
-
RE: M122 software reset code field and its values
@dc42 @droftarts @jay_s_uk sorry for the spam, can we expect, in near future, RAM-related data exposed via Object-Model or, at least, a way to redirect M122 data to a specific file?
We're going to PROD in few months and I would like to sort this memory issue by then
-
RE: M122 software reset code field and its values
@droftarts will any of the above be possible?
-
RE: M122 software reset code field and its values
@dc42 if exposing this data via HTTP API is not an option, is it possible to redirect the output of
M122
to a file?Something like
echo >"my-file.txt" M122
orM122 F"my-file.txt"
? -
RE: M122 software reset code field and its values
@dc42 thank you for the detailed explanation. I'll keep an eye on the
Never Used RAM
BTW would be possible to expose memory related vars via Object-Model?
Extracting data from M122 is prone to error. I need to update my regex for each firmware version.
Would be super useful to have a consistent API that exposes this kind of data via HTTP
-
RE: M122 software reset code field and its values
@jay_s_uk You're right. I'm on
3.5.0-beta.4
but this also happens with other versions=== Diagnostics === RepRapFirmware for Duet 2 WiFi/Ethernet version 3.5.0-beta.4 (2023-06-08 23:39:39) running on Duet Ethernet 1.02 or later Board ID: <BOARD-ID> Used output buffers: 2 of 26 (24 max) Error in macro line 183 while starting up: I2C transmission error === RTOS === Static ram: 23236 Dynamic ram: 79896 of which 12 recycled Never used RAM 1432, free system stack 184 words Tasks: NETWORK(1,ready,27.9%,242) HEAT(3,nWait,0.1%,331) Move(4,nWait,0.0%,364) MAIN(1,running,72.0%,709) IDLE(0,ready,0.0%,29), total 100.0% Owned mutexes: === Platform === Last reset 01:01:20 ago, cause: software Last software reset at 2023-12-07 11:58, reason: OutOfMemory, Gcodes spinning, available RAM 16, slot 0 Software reset code 0x41c3 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0041f000 BFAR 0xe000ed38 SP 0x200021e8 Task MAIN Freestk 943 ok Stack: 2001993c 004103d3 200197bc 00400247 200197bc 00000000 000000cc 00400299 00000000 20002288 00000000 20002280 200022d4 0040018d 00000000 00411d7f 20004bb4 40090000 200040f4 ffffffed 00000002 00473fac 200023f8 20002400 00000000 20002288 00000000 Error status: 0x00 Aux0 errors 0,0,0 MCU temperature: min 52.0, current 52.6, max 53.3 Supply voltage: min 23.6, current 23.7, max 23.8, under voltage events: 0, over voltage events: 0, power good: yes Heap OK, handles allocated/used 297/187, heap memory allocated/used/recyclable 6144/5844/1812, gc cycles 119
@dc42 said in M122 software reset code field and its values:
It's easy to run out of memory on Duet 2 if a lot of conditional GCode expressions and/or global variables are used.
Yep, I have 174 global variables in total and my
.g
files have a loooot of conditional expressions. I guess that's the source of my problemBTW what's the meaning of
Never used RAM 1432, free system stack 184 words
? Is it reserved for something? I mean, why theOutOfMemory
error if there's 1432 of never used RAM? -
RE: M122 software reset code field and its values
Hi @dc42 Here's an example:
Last reset 00:00:29 ago, cause: software Last software reset at 2023-12-07 11:58, reason: OutOfMemory, Gcodes spinning, available RAM 16, slot 0 Software reset code 0x41c3 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0041f000 BFAR 0xe000ed38 SP 0x200021e8 Task MAIN Freestk 943 ok Stack: 2001993c 004103d3 200197bc 00400247 200197bc 00000000 000000cc 00400299 00000000 20002288 00000000 20002280 200022d4 0040018d 00000000 00411d7f 20004bb4 40090000 200040f4 ffffffed 00000002 00473fac 200023f8 20002400 00000000 20002288 00000000
Also, can you explain the
available RAM 16
?16
was the available memory when the reset happened? -
RE: M122 software reset code field and its values
Sorry to intrude. I'm also having random reboots. Is there any docs about the
Software reset code
field and its values? I would like to understand what's going on with my Duet. -
RE: [Freature Request] GCode to create a copy of a file
@gloomyandy I'm collecting telemetry every 10 secs so yeah, that definitely puts Duet under stress.
Re collecting the M122 data. Is there any docs for the
Software reset code
Error status
andAux0 errors
? I would like to understand the meaning of the reported vars=== Platform === Last reset 17:44:30 ago, cause: power up Last software reset time unknown, reason: User, Gcodes spinning, available RAM 2276, slot 0 Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a Error status: 0x00 Aux0 errors 0,0,0
Note This was taken just now and without any OOM
-
RE: [Freature Request] GCode to create a copy of a file
@gloomyandy apologies for the delay, I missed you reply.
Thank you, I'll try your approach.
Also have you worked out what is causing your OOM problem? It might be worth reporting it, it would be far better to avoid whatever is causing the issue rather than having to work around it. In particular if RRF is crashing while you are writing your restoration.g file then you have the additional risk of corrupting the underlying file system, which is almost certainly not good. Additionally all of this writing to the SD card will be creating wear on the card, best to not need to do it if you can.
I agree with you, this is solution is far from perfect. Re the OOM problem, I'm not entirely sure what's causing it. It happens randomly so I cannot pinpoint the exact reason. While printing I'm constantly monitoring and collecting telemetry from the Duet (my arch can be seen in an old ticket that I've opened https://forum.duet3d.com/topic/31420/rr_reply-multiple-clients-same-machine )
In addition to printing and being monitored, the user might "ask" Duet to perform some additional tasks via HTTP API. I guess that this might be too much for Duet to handle and the OOM happens.
But it would be great to know exactly what's the scenario that causes OOM. Do you know a way of debugging this kind of issues?
-
[Freature Request] GCode to create a copy of a file
Hi
Is can you please add a gCode command to create a copy of a file? It can also be a
M471
with a flag that preserves the source file.Use case: When a print job is running I'm periodically flushing vars (via
echo >>
) to a file to create a restoration point in case of an OOM reboot, which happens quite often in my case. The problem is that sometimes the Duet reboots while the flushing process is still running and, thus, the restoration file gets corrupted. To handle this scenario I would like the keep a copy of the last successful restoration point.ATM, what I'm doing is the following:
- call
flush.g
that will createrestoration.g
@/sys
dir - move
restoration.g
into a/backup
dir, viaM471
that "deletes" the file from the/sys
- call
flush.g
again to create newrestoration.g
- call