Cross Platform Graphical Gcode Sender

Post Reply
Will Winder
Posts: 435
Joined: Fri Apr 20, 2012 2:40 pm
Location: Hudson, MA
Contact:

Cross Platform Graphical Gcode Sender

Post by Will Winder » Wed Jun 27, 2012 2:52 am

After seeing the screenshots of "GcodeSender" it looked like a very nice application. The only problem was I couldn't use it on the OSX or Linux laptops I plan to use with my machine.

So today I spent a few hours and started porting GcodeSender to a cross platform language. I decided to go with Java. Unfortunately the serial communication API isn't baked into the JDK like I had hoped, so there is a separate library which will need to be installed (RXTX). Not quite as nice as GcodeSender's .exe that just works.

If anyone is interested in giving it a try, the source is available on github, the project should open right up with the latest version of Netbean: https://github.com/winder/Universal-G-Code-Sender

There is already a lot of it working, in fact the command mode that I mainly wanted for testing commands is already implemented. ;)
Here it is in OSX running a couple commands:
Screen shot 2012-06-26 at 10.39.13 PM.png
Screen shot 2012-06-26 at 10.39.13 PM.png (61.73 KiB) Viewed 4775 times
ShapeOko #367: Dual-Y drive, Belt on outside, 1000mm Y-Axis, DW660 Spindle, Nema-23 X/Y motors.

Primary developer on Universal Gcode Sender.

lasershark1
Posts: 143
Joined: Sun Apr 22, 2012 1:52 am

Re: Cross Platform Graphical Gcode Sender

Post by lasershark1 » Wed Jun 27, 2012 4:12 am

Would be nice if we could see out typed commands in the response window (to reference what we've typed already), as well as using the up arrow key to scroll through a command history...

Will Winder
Posts: 435
Joined: Fri Apr 20, 2012 2:40 pm
Location: Hudson, MA
Contact:

Re: Cross Platform Graphical Gcode Sender

Post by Will Winder » Wed Jun 27, 2012 11:42 am

I added the entered commands to the bottom text field, in the screenshot its the line with ">>>" in front of it. Good idea about command history, I'll see what I can do!
ShapeOko #367: Dual-Y drive, Belt on outside, 1000mm Y-Axis, DW660 Spindle, Nema-23 X/Y motors.

Primary developer on Universal Gcode Sender.

Will Winder
Posts: 435
Joined: Fri Apr 20, 2012 2:40 pm
Location: Hudson, MA
Contact:

Re: Cross Platform Graphical Gcode Sender

Post by Will Winder » Thu Jun 28, 2012 1:32 pm

I now have all the main functions completed. My program should be functionally identical to GcodeSender, but cross platform and faster. I used the algorithm in stream.py which tracks the GRBL buffer and makes sure it always has another command ready to go without waiting for the sender program.

The only parts not yet implemented are "stop" and the "override speed" option.

If anyone would like to try it I've packaged up the jar file which you can get here:
https://github.com/winder/Universal-G-C ... /downloads

You will need to install RXTX for it to work.
ShapeOko #367: Dual-Y drive, Belt on outside, 1000mm Y-Axis, DW660 Spindle, Nema-23 X/Y motors.

Primary developer on Universal Gcode Sender.

Will Winder
Posts: 435
Joined: Fri Apr 20, 2012 2:40 pm
Location: Hudson, MA
Contact:

Re: Cross Platform Graphical Gcode Sender

Post by Will Winder » Sun Jul 01, 2012 6:21 pm

Version 1.0 is finished! It has all the functionality of GcodeSender, but is cross platform. Please let me know if you give it a try and if you have any issues.

I used the same buffer algorithm as Sender.py so commands are sent as quickly as GRBL can process them.
I also added a command history, so you can use the up/down arrows to cycle through previously entered commands.

Ideally you will have RXTX installed, however, I think I found a way to get it to work without installing the library (including the platform specific library next to the program).

Here are the downloads:
Windows: https://github.com/downloads/winder/Uni ... indows.zip
OSX: https://github.com/downloads/winder/Uni ... .0-OSX.zip
Linux: https://github.com/downloads/winder/Uni ... -Linux.zip
ShapeOko #367: Dual-Y drive, Belt on outside, 1000mm Y-Axis, DW660 Spindle, Nema-23 X/Y motors.

Primary developer on Universal Gcode Sender.

bobt
Posts: 132
Joined: Tue Apr 17, 2012 7:08 pm

Re: Cross Platform Graphical Gcode Sender

Post by bobt » Sun Jul 01, 2012 6:56 pm

Ok this may be a stupid question. Will any of these versions run on my android tablet as it has a usb port. I was just wondering if java would run on it. It would be real neat to just whip out my tablet and use it as a controller on my ShapeOko and just drive all the other guys nuts with it. I mean just download the g-code file by wifi and bataboom batabang we start ShapeOko'ing and blow some minds.

Bob Teeter
"What Box???" ShapeOko #397

Will Winder
Posts: 435
Joined: Fri Apr 20, 2012 2:40 pm
Location: Hudson, MA
Contact:

Cross Platform Graphical Gcode Sender

Post by Will Winder » Sun Jul 01, 2012 7:19 pm

Bob, that would be cool. But this won't run on android. I might make an iOS remote control app at some point, but I have no android devices (or experience making android apps).
ShapeOko #367: Dual-Y drive, Belt on outside, 1000mm Y-Axis, DW660 Spindle, Nema-23 X/Y motors.

Primary developer on Universal Gcode Sender.

bobt
Posts: 132
Joined: Tue Apr 17, 2012 7:08 pm

Re: Cross Platform Graphical Gcode Sender

Post by bobt » Sun Jul 01, 2012 7:42 pm

Will - I was just out on google and there are development apps that will take the java source code and build a java(equiv) app for the android. I have an Acer A200 running Ice Cream Sandwich. May be we can work out a way to make your code run on it. That would be a killer app to run. Walmart sells the A200 8Gb for about $325.00 but I added a micro sd card to it also for enough storage. I really like the tablet even if its not apple. I can hook it up to my windows box with a usb cable and write to the storage. I also can hook up a usb device and drive it. The other thing that it does is bluetooth. I wonder if there is a bluetooth interface on the arduino. And save a cable connection. Just think download a file on wifi and send it to the Shapeoko on bluetooth. And mother thought I would never amount to any thing. RIGHT!!!!

Bob Teeter
"What Box???" ShapeOko #397

alpha
Posts: 174
Joined: Thu Apr 12, 2012 2:49 pm

Re: Cross Platform Graphical Gcode Sender

Post by alpha » Sun Jul 01, 2012 7:45 pm

Hello,

I'm using Mint 64bit Linux and to get your program to work I had to do the following:

1. I created a start.sh script:

Code: Select all

LD_LIBRARY_PATH=`pwd`/
export LD_LIBRARY_PATH
java -jar "Universal G-Code Sender.jar"
I had to do this because it was not finding the library.

After it found the library it always crashed when writing to the com port, so 2. I copied "librxtxSerial.so" and "librxtxSerial64.so" from my "arduino-1.0.1/lib" directory and this fixed it. I only did send the $ command and it returned the list. Because I'm adding dual drive right now my ShapeOko is not functioning, but I will test with the hello world file later.

Thanks for the program! I would like to play with code, but I never used Java much... I guess I will need to download NetBeans again :)

bobt
Posts: 132
Joined: Tue Apr 17, 2012 7:08 pm

Re: Cross Platform Graphical Gcode Sender

Post by bobt » Sun Jul 01, 2012 8:07 pm

Yup - just check Google. There is lots of Bluetooth stuff for arduino and android available. This might be just the killer app combination that I have been looking for. Just think. Sitting across the room I just download my g-code file from my design computer and then look across the room to verify that the unit is safe to use. Then just stand there and fire it off remotely. WOW...

Bob Teeter
"What Box???" ShapeOko #397

Post Reply