Help sending GCode to a 3d printer

So, I built a 3d printer from a kit. The preferred software to inderface with the printer is in python. Unfortunately, it's in python 2, apple installs python 3, and attempting to make this software go involved a brief and swiftly abandoned descent into python library hell.

So, I tried writing something in java using usb4java. But I soon realised that this going to get complicated.

Got online, found out about the unix 'screen' command. But no matter what baud rate I specified, I only ever got garbage, and there were these weird 'cant get PTY' messages.

Then I realised: the arduino IDE already has a terminal that talks to the arduino. Can I send gcode with that? And yep - works beautifully. I connect at 250000, send M119, and the printer tells me about its endstops.

But this isn't a solution for sending a file. But, I could write something that uses the stuff that the IDE uses, which I know works.

So: what's a solution for this? Is there some coms software that will run on OSX and on Raspberry Pi, that will talk to a USB device at 250000, that will let you type interactively and will permit you to transmit gcode? That isn't a python app and doesnt involve a load of setup and install?

There are multiple g-code sending software packages available for Linux so the RasPi should be no real issue.

I cannot speak for apple as I dont allow those devices in the house.

UGS is one of my GOTO and is also available for the Pi

It is also available for the MAC

SourceRabbit is another decent package I have used occasionally available for most OS.

Both are quite easy to install and to set up which you would probably have to do with whatever package you go with.

Going to move you to a slightly better location too.

I use a program called Pronterface. As far as I can see it uses Python3. (I have both 2 and 3 on this Linux laptop)

...R

I use minicom on Raspberry Pi as a general purpose COM/terminal program. It looks like lot like Procomm/Telix from back in the days of DOS and BBS. It can send the contents of an ASCII text file. It also has its own scripting language. There is nothing specific to gcode or CNC but it is a handy program for working with serial devices. When faced with a new serial device I start with minicom but switch to Python/PySerial for automating tasks.

sudo apt install minicom

customcontroller:
I use minicom on Raspberry Pi as a general purpose COM/terminal program.

I use minicom but I can't see it having any relevance for sending a GCode file to a 3D printer.

...R

PaulMurrayCbr:
Got online, found out about the unix 'screen' command. But no matter what baud rate I specified, I only ever got garbage, and there were these weird 'cant get PTY' messages.

The unix screen command can also operate as a terminal program but with fewer features than minicom. So I suggest minicom as a better terminal program.

Is there some coms software that will run on OSX and on Raspberry Pi, that will
talk to a USB device at 250000, that will let you type interactively and will
permit you to transmit gcode? That isn't a python app and doesnt involve a load
of setup and install?

The few gcode files for a milling machine I have looked at are ASCII text
files. minicom and most terminal programs can read lines from a text file and
write the lines out a serial port. How well this works in practice with the
OP's printer I do not know.

customcontroller:
The few gcode files for a milling machine I have looked at are ASCII text
files. minicom and most terminal programs can read lines from a text file and
write the lines out a serial port. How well this works in practice with the
OP's printer I do not know.

Yes, Gcode is simple ASCII text.

However the 3D printer programs such as Marlin work with a dialogue between them and the program on the PC so a simple terminal program is not suitable.

...R

@customcontroller

Most senders operate on a BUFFER principle and even that buffer may rely on acknowledgement to the sender that a g-code command was completed or parsed before another set of data is sent.
Using most "terminal" programs would entail the user sitting there throughout the job to send the next batch based on the available room in the buffer or a completed command.
I hate to think how horrendous that task would be in terms of job time and attention span of the user.

Thankfully that task is automated with a "proper" sending program so a user can run a machine "lights out"

Terminal programs still have a place in todays technology but I doubt thier usefulness in these types of application. Suggesting them could send the OP on a wild goose chase.

I have had some success. The arduino IDE uses a library named jssc which is available at giuthub. I wrote a basic java program to send entered text to the printer, and it worked. I am not certain that sending an entire file worked, I'm not certain how the reciever is buffering things, there's CTS and DTR, I'm not sure how they are used.

However, it then occurred to me that surely someone else has already done this. I found this product named 'serial', but it's not free. Seems to work, though. But, it's OSX only and I also need something that runs on the raspberry PI attached to the lasercutter out in the shed.

Probably the next thing to do is to see if the java stuff runs on the 'Pi. If so, it would be worth pursuing to the point that I have something that can send gcode to the lasercutter.

For the PI take a look at OCTOPRINT which acts as a server to the end device and is both wifi and ethernet capable.