GRBL on YUN, WIRELESS GRBL

Discussion about the arduino based g-code interpreter, grbl
Sprenkle
Posts: 18
Joined: Wed Jan 15, 2014 5:13 pm

GRBL on YUN, WIRELESS GRBL

Post by Sprenkle » Sun Mar 30, 2014 1:33 am

I have successfully ported the GRBL code to the YUN.

Ever since someone told me about the YUN I have thought why don't I use that as my CNC controller.

All features are intact the only issue is that I am not sure the out pins are working(PIN_REST, PING_FEED_HOLD and PIN_CYCLE_START). I don't use them and doubt they are used much for Shapeoko.

I believe the reason this was not done earlier is because the Yun uses a USB port to connect to your computer instead of a UARTs and with that 4k of code was added, which was too much. Well the Arduino side on the Yun talks to the Linux side through a UARTS, so thats not a problem. I had to change the pin assignments around and some timers. I also had to add some extra code to change stepper directions since the x direction and y direction is on different ports.

My port is at https://github.com/sprenkle/grbl.

I was going to create a cool web site hosted on the Yun that would allow you to upload the gcode at your main computer, then go to the garage with your phone and start up the job. I spend a day on it and decided my Python skills were not up to the task, and Node.js was giving me to much trouble so I gave up and just decided to post about it, In the hopes someone else will do it.

This is what I have done and how far I have gotten. None of this will make sense if you are not a IT guy and even then it probably doesn't.

Actually what I have below is just a very vague idea of how I did it, no work is put into it, but a knowledgeable guy could reproduce what I did with it.

1. Changed the GRBL code to run in Yun.
2. Built the code.
I have a sd card that I save all the files to and that is what I used in the following.
3. Uploaded the grbl.hex to Yun using sftp. (CoffeCup FreeFTP)
3.a need to do some stuff for this I used http://tavendo.com/blog/post/arduino-yun-with-autobahn/ as a guide.
4. Use run-avrdude grbl.hex to program, do not merge bootloader.
5. To talk to GRBL using /dev/ttyATH0
6. I connected to it in a round about way, I did the following.
a. Install pyserial opkg install pyserial
b. Ran tcp_serial_redirect.py -- google it its comes with pyserial.
c. Opened up putty.exe and connect to port created.
7. Once I was connected with putty.exe I did all my setup.
8. Back on my Yun, connect to by using putty ssh.
9. I uploaded the stream.py that is in the GRBL script directory.
10 I then did some milling by running the following command. python stream.py somegcode.nc /dev/ttyATH0


I think I am done with this for the weekend so I decided to post my results. I believe this has a lot of potential.

noproblem
Posts: 60
Joined: Tue Mar 18, 2014 12:10 pm
Location: Jamaica
Contact:

Re: GRBL on YUN, WIRELESS GRBL

Post by noproblem » Sun Mar 30, 2014 12:24 pm

I am excited, I have a YUN sitting on my desk . I was going to use it to control external things on the mill but you have taken it to the next level . please keep Up the great work as I will be keeping my two eyes open on your project .

Here is a very nice wen controller for the YUN maybe you can use some of the code ( not its not mine)
https://github.com/mat-lo/yun-examples

Marvin

Sprenkle
Posts: 18
Joined: Wed Jan 15, 2014 5:13 pm

Re: GRBL on YUN, WIRELESS GRBL

Post by Sprenkle » Sun Mar 30, 2014 12:38 pm

I did not post pictures before. Here they are(turn your head to the left 90 degrees for second). Notice that the Yun has the two big ports, you can't just attach the steppers controller. Other then that its a straight drop in.
photo 2 (1).JPG
photo 2 (1).JPG (38.26 KiB) Viewed 3147 times
photo 1 (1).JPG
photo 1 (1).JPG (44.78 KiB) Viewed 3147 times

Sprenkle
Posts: 18
Joined: Wed Jan 15, 2014 5:13 pm

Re: GRBL on YUN, WIRELESS GRBL

Post by Sprenkle » Wed Apr 02, 2014 1:43 am

I made a video of it in action. I think I might have something runnable from a web site this weekend. I am making pretty good progress on it.

Marvin(or anyone else), you said you have a Yun laying around, I would love to have you try it once I have something that is usable and easy to install. Maybe this weekend. You would not have to connect it to your Shapeoko, just send it commands and see its response. Give me some usability feedback.

noproblem
Posts: 60
Joined: Tue Mar 18, 2014 12:10 pm
Location: Jamaica
Contact:

Re: GRBL on YUN, WIRELESS GRBL

Post by noproblem » Wed Apr 02, 2014 4:36 pm

I am in just pm your email and we can setup a play date , lol I learnt play date from my kids .

Seriously just email time and maybe we can do a Google hangout or Skype and teamviewer

Marvin

bluecamel
Posts: 84
Joined: Fri Feb 07, 2014 5:27 pm

Re: GRBL on YUN, WIRELESS GRBL

Post by bluecamel » Wed Apr 02, 2014 5:27 pm

I also have a Yun and would love to give this a go. I should be able to help out with python and javascript. Hopefully this weekend!
Shapeoko 2 ..::.. DW660 with 3d printed mounts, HDPE version of IC's dust shoe

Sprenkle
Posts: 18
Joined: Wed Jan 15, 2014 5:13 pm

Re: GRBL on YUN, WIRELESS GRBL

Post by Sprenkle » Tue Apr 08, 2014 3:10 am

I think I am done with this project now and thought I would summarize my findings and be done with it. Also thanks Marvin for helping me last weekend and showing me OctaCNC.

GRBL on the YUN is 100% doable.

As far as my code changes the only thing that I am a little worried about is the homing directions bits. It homed perfectly if I did not change the directions but it seemed to home with reverse bits on but then it smashed into a switch, I am not sure it was the switch(its not very solid) or the GRBL. At any rate I believe it would be 100% fixable if indeed it was a problem. I don't use the homing so I don't really care to look at it.

I have my Yun running a TCP/IP to Serial python program and have my computer running a Serial to TCP/IP. I can now run any GCode sender I want that connects to a serial port. I am currently running OctaCnc which is a fork or OcaPrint. It creates a web site that you use to control your Shapeoko. That way I can be in the garage with my Ipad and run my Shapeoko.

If anyone has a Yun and a Shapeoko in hand and must get this running, send me a mesg and I will start a blog on it.

noproblem
Posts: 60
Joined: Tue Mar 18, 2014 12:10 pm
Location: Jamaica
Contact:

Re: GRBL on YUN, WIRELESS GRBL

Post by noproblem » Tue Apr 08, 2014 11:08 am

Hey David

Can you setup blog with instructions - step by step

I got your email but I forgot how to set it up :lol:
Marvin

Sprenkle
Posts: 18
Joined: Wed Jan 15, 2014 5:13 pm

Re: GRBL on YUN, WIRELESS GRBL

Post by Sprenkle » Wed Apr 09, 2014 10:48 am

I am going to write a blog on this next week with hopefully some detailed step by step instructions.

I am also gonna attempt to get OctaPrint(OctaCnc) to run on the Yun again. When I do I will write that up also.

wcritchie
Posts: 4
Joined: Tue Jan 28, 2014 10:38 am

Re: GRBL on YUN, WIRELESS GRBL

Post by wcritchie » Wed Apr 09, 2014 7:30 pm

Octoprint running on the Yun would be an awesome solution. Today I run it on a Pi, the Yun solution would remove one entire device from the equation. I'm extremely interested!
Bill


Sent from my iPad using Tapatalk

Post Reply