@jcsb1994 said in Uploading and running files from G code commands:
learning bash doesnt seem too long.
I would need the project to be cross platform. Is bash only usable with linux?
bash works pretty much everywhere its installed, but the stty command and using redirects to send data to the serial port isn't very portable outside of linux, nor the autodetection of the correct usb-serial port.
you can do the same in c/c++ though
get the size of the file to be sent
send the M559 command with the filename and size over serial
send the contents of the file over serial after having sendt M559
once the duet has received the correct number of bytes according to the filesize it will store the file and return a "Done saving file" and "ok" string.
you also need to sort out choosing, opening, and closing the serial port for the duet.
I am not sure I understand the solution you offered. The duet was connected to a Pi's USB (which is linux so bash works) and then the Pi was connected to your computer?
I log in to the pi over the network/ssh, so for all intents and purpose I'm using the pi as a linux computer with the Duet connected over its serial usb.