[3.5b1+ Heap Fix] Reset-loop after creating custom arrays
-
@Diamondback I assume you are creating all those arrays in code in or called by config.g. Yes a M122 after power cycling would still be useful provided that you haven't done any sort of software reset (M999, Emergency Stop, or firmware upgrade). Alternatively, if you remove the SD card while it is in its reset loop, you will probably be able to connect via USB and do M122 from there.
PS - are you sure the board is resetting? Is the Status LED blinking steadily 0.5sec on and 0.5sec off? If so then it's probably an issue with the arrays being too large to pass back in the object model, and RRF being unable to reply to the HTTP request from DWC.
-
@dc42 The contents above are all in a single macro file that in this case I execute manually from DWC (for debugging purposes), but yes, ultimately it will be automatic from config.g.
I'll gather a M122 after power cycling then, it's not trivial for me to connect a PC via USB to it, printer is too far away from the desktop, however, if it's gonna be super helpful, I can try to connect my laptop.
-
@dc42 said in [3.5b1+ Heap Fix] Reset-loop after creating custom arrays:
PS - are you sure the board is resetting? Is the Status LED blinking steadily 0.5sec on and 0.5sec off? If so then it's probably an issue with the arrays being too large to pass back in the object model.
No I'm not at all, I was just assuming by the behavior of DWC. I guess I will do the laptop thing then
-
@Diamondback I just tried running that macro on my 6HC bench setup running your config. It doesn't crash for me. However, in the OM viewer only some of the global variables are shown.
-
@dc42 Try duplicating a bunch of those "frame" arrays, my config.g contains a few other non array globals, maybe there's just some hard limit on the number on globals or soemthing? My code above works for me if I comment line 47 and then it crashes again if I manually send that line via DWC.
Edit: looks like I currently have overall 68 globals in the OM viewer.
-
@Diamondback if you open the browser debugging console, you may be able to see why DWC doesn't connect. Possibly because RRF is returning either 501 errors or bad JSON. In my case I think RRF is truncating the info about globals in the OM. It might be that the truncation isn't always clean when the next item due to be added to the reply is a large array.
-
@dc42 Looks like a 503
PollConnector.ts:251 GET http://192.168.1.31/rr_model?key=global&flags=d99vn 503 (Service Unavailable) (anonymous) @ PollConnector.ts:251 request @ PollConnector.ts:156 (anonymous) @ PollConnector.ts:211 setTimeout (async) fe.onload @ PollConnector.ts:210 load (async) (anonymous) @ PollConnector.ts:157 request @ PollConnector.ts:156 (anonymous) @ PollConnector.ts:203 Promise.then (async) fe.onload @ PollConnector.ts:201 load (async) (anonymous) @ PollConnector.ts:157 request @ PollConnector.ts:156 updateLoop @ PollConnector.ts:456 await in updateLoop (async) doUpdate @ PollConnector.ts:719 setTimeout (async) scheduleUpdate @ PollConnector.ts:288 reconnect @ PollConnector.ts:372 await in reconnect (async) reconnect @ index.ts:204 await in reconnect (async) wrappedActionHandler @ vuex.esm.js:851 dispatch @ vuex.esm.js:516 boundDispatch @ vuex.esm.js:406 onConnectionError @ index.ts:222 wrappedActionHandler @ vuex.esm.js:851 dispatch @ vuex.esm.js:516 boundDispatch @ vuex.esm.js:406 ie.dispatch @ vuex.esm.js:779 onConnectionError @ index.ts:930 wrappedActionHandler @ vuex.esm.js:851 dispatch @ vuex.esm.js:516 boundDispatch @ vuex.esm.js:406 onConnectionError @ BaseConnector.ts:160 doUpdate @ PollConnector.ts:721 setTimeout (async) scheduleUpdate @ PollConnector.ts:288 reconnect @ PollConnector.ts:372 await in reconnect (async) reconnect @ index.ts:204 await in reconnect (async) wrappedActionHandler @ vuex.esm.js:851 dispatch @ vuex.esm.js:516 boundDispatch @ vuex.esm.js:406 onConnectionError @ index.ts:222 wrappedActionHandler @ vuex.esm.js:851 dispatch @ vuex.esm.js:516 boundDispatch @ vuex.esm.js:406 ie.dispatch @ vuex.esm.js:779 onConnectionError @ index.ts:930 wrappedActionHandler @ vuex.esm.js:851 dispatch @ vuex.esm.js:516 boundDispatch @ vuex.esm.js:406 onConnectionError @ BaseConnector.ts:160 doUpdate @ PollConnector.ts:721 load (async) (anonymous) @ PollConnector.ts:157 request @ PollConnector.ts:156 (anonymous) @ PollConnector.ts:211 index.ts:916 Error: Operation failed (Reason: Service Unavailable) at new ExtendableBuiltin (app.d7c67f8a.js:306:290824) at new NetworkError (errors.ts:24:3) at new OperationFailedError (errors.ts:50:3) at fe.onload (PollConnector.ts:217:14) onConnectionError @ index.ts:916 wrappedActionHandler @ vuex.esm.js:851 dispatch @ vuex.esm.js:516 boundDispatch @ vuex.esm.js:406 onConnectionError @ BaseConnector.ts:160 doUpdate @ PollConnector.ts:721 setTimeout (async) scheduleUpdate @ PollConnector.ts:288 reconnect @ PollConnector.ts:372 await in reconnect (async) reconnect @ index.ts:204 await in reconnect (async) wrappedActionHandler @ vuex.esm.js:851 dispatch @ vuex.esm.js:516 boundDispatch @ vuex.esm.js:406 onConnectionError @ index.ts:222 wrappedActionHandler @ vuex.esm.js:851 dispatch @ vuex.esm.js:516 boundDispatch @ vuex.esm.js:406 ie.dispatch @ vuex.esm.js:779 onConnectionError @ index.ts:930 wrappedActionHandler @ vuex.esm.js:851 dispatch @ vuex.esm.js:516 boundDispatch @ vuex.esm.js:406 onConnectionError @ BaseConnector.ts:160 doUpdate @ PollConnector.ts:721 setTimeout (async) scheduleUpdate @ PollConnector.ts:288 reconnect @ PollConnector.ts:372 await in reconnect (async) reconnect @ index.ts:204 await in reconnect (async) wrappedActionHandler @ vuex.esm.js:851 dispatch @ vuex.esm.js:516 boundDispatch @ vuex.esm.js:406 onConnectionError @ index.ts:222 wrappedActionHandler @ vuex.esm.js:851 dispatch @ vuex.esm.js:516 boundDispatch @ vuex.esm.js:406 ie.dispatch @ vuex.esm.js:779 onConnectionError @ index.ts:930 wrappedActionHandler @ vuex.esm.js:851 dispatch @ vuex.esm.js:516 boundDispatch @ vuex.esm.js:406 onConnectionError @ BaseConnector.ts:160 doUpdate @ PollConnector.ts:721 load (async) (anonymous) @ PollConnector.ts:157 request @ PollConnector.ts:156 (anonymous) @ PollConnector.ts:211
-
@Diamondback You are using too many and/or too large global variables. Is there any reason you need to make all of them global, wouldn't it suffice to make some of them local using
var
?I guess the only way to fix this from our side would be to make model queries of the
global
key sequential but we need to discuss again how this could be achieved. -
@chrishamm Many of my globals are used to store data about filament settings (retraction speed/length, PA tuning etc) and tool settings (nozzle sizes, materials, etc), some of them are multiplied by 4 since I have 4 tools on my TC. Lots of them purely exist because we currently cannot assign individual array elements.
And then there's the "image" data for my 8x8 dotstar grid, where it doesn't really make sense to define the same arrays over and over again, so that's why those are globals.
I can certainly find ways to work around this limitation and once we can set single array elements, the issue will probably go away for me anyway.
Ultimately it still seems like something that should be fixed eventually (or at least changed in some way so that DWC is still usable)What's the limiting factor here? Overall JSON length of all the OM data? Count of globals?
-
@Diamondback I was generally referring to your "image" data but of course I don't know where else you reference it. The limiting factor is the maximum output size per (HTTP) request, the JSON response of
rr_model?key=global
exceeds the current maximum so only HTTP code 503 is returned. -
@chrishamm Alright, I will cut some names down in length then and see if I can make it work. As mentioned, at some point this issue should solve itself for me since I then can simply convert a lot of the x4 globals into an array and do some other cleanups.
Thank you
-