GRBL on YUN, WIRELESS GRBL
Posted: 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.
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.