JuKu wrote:You can change the switch setting in the job, just make sure the machine is not moving.
Actually this is not correct... I got burned really badly here, and I could recall the pain but not the exact issue -- until just now.
It is not enough to simply make sure the machine is not moving.
I thought so at first but I was wrong. Way wrong.
You also have to make sure that TinyG has replied to all of your commands BEFORE you issue any command that modifies the eeprom, because TinyG disables interrupts
including those used for serial port flow control while accessing the eeprom. If you only set eeprom variables once when your program first starts up this is easy -- you don't have to wait for any replies since there are none coming to you. But once you start mixing gcode with configuration variable changes you MUST also keep track of what replies the TinyG produces in response to each and every one of your commands. This is not trivial: for example, a single G38.2 command will provoke TWO replies from TinyG, while most other commands provoke only one (and a few provoke none!)
If you don't carefully track these replies and make sure you have all of them before attempting an eeprom update everything will work fine 99.9% of the time. And then, in the middle of the Big Really Important Placement Job you will get this weird bizzarre failure that you spend a week trying to reproduce. And it will ruin a few boards too.
From
here
CAVEAT: At the current time because of various limitations of the Xmega we recommend waiting for each config command to send a response before sending the next command. This gives allows the system to persist the data to EEPROM, during that interval the board cannot reliably receive serial input.
I can confirm that this unreliability is not just theoretical.
The TinyG world is bonkers. I have the scars to prove it.