Macro file reading via Serialport
-
Hi,
How can I edit what is written in macro files using serial terminal?
Eg:-
"doorlock.g" is the macro file
We want to read and edit that file via serial terminal since it's in a remote
location.Is it possible to do with any of the built in commands?
Regards
Siva -
@Siva not that i'm aware of
-
@Siva the only way I can think of doing it is by using a nasty hack that would leave the Duet unbootable if the serial link is lost at the wrong moment.
To edit the file you would need to download the file to your remote PC, edit it, and then upload it again. There is a facility to upload files over serial, so that isn't a problem. However, there isn't currently a facility to download files over serial; except that the M503 command will download config.g. So you could do the following:
- Rename /sys/config.g to configsave.g using the M471 command;
- Rename the file you want to edit to /sys/config.g
- Use M503 to download it
- Rename config.g back to its original filename
- Rename configsave.g back to config.g
- Edit the file on the PC
- Upload it using M559, M560 or M28
Alternatively, if you keep up-to-date copies of the files that you might want to edit on the remote PC, you could just edit the local copy and then upload it.
-
@dc42 Thanks for those steps.
We are using "Duet3 6HC" in our products. Is it possible to build a binary file with sys folder included so that we don't need to use SDcard anymore?
Thanks
Siva -
@Siva yes it's possible to do that, although we haven't tested that configuration on a board that supports networking, so there might be some more work to do to get the FTP and HTTP servers working.
Can you tell me a little more about your application and why you want to run without a SD card? Where would you keep the files containing the jobs to be run?
-
@dc42 We don't want our customers to access "config and macros files" on the SD Card.
Duet is connected to another hardware via serial port which receives latest firmware updates from the remote server.When we add more feature to our products, we have to update all our devices including Duet. In case of duet this includes updating Config/macro files on the SDCard.
When the customer click update on the UI(user interface) this should update all the hardware with latest Firmware's.
Currently we can update the Duet Firmware via "bossa" integrated into our application. This doesn't contain "sys" folder which includes macros and config files.
In Eclipse when we build it outputs ".bin" in this folder
If we can somehow integrate "sys" folder during build, so that we don't have to use SDCard.
I am not sure how easy to do this but this is one of the feature we need before we actually release our product.
Thanks
Siva -
@Siva we can look at doing a build configuration that embeds the system files in the binary, but I'd like to make sure that you are aware of the consequences of not having a writable SD card, which include (but are not limited to)
- No resume-after-power-fail support
- No support for accelerometers
- No support for tuning closed loop motors
- No logging of events that you might wish to record
- Pausing a job will take some time, because when you send data over a serial link there is no provision to cancel pending moves in the motion queue (other than emergency stop)
-
@dc42 Thanks this is now resolved by David.
-
-