Shapeoko 3 XXL + Raspberry Pi 3 + CNCJS + Tablet


(Yacine Filali) #1

I received my Shapeoko 3 XXL 2 weeks ago and have been putting it through it’s paces. One of the things I didn’t like with the normal setup was having to lug my laptop into the garage where my S3 lives. That led me to look at grblweb on a raspberry pi which was easy enough to get going: http://xyzbots.com/grblweb.html

Grblweb was ok and worked nicely with the shapeoko, but I didn’t like the user interface much especially the preview pane. You also can’t customize the different panels/widgets, and it doesn’t support the shuttle express, also the nodejs code is just too old and hard to maintain or modify.

A better alternative which I did not see mentioned much is CNCJS:

Here is how I got it working on the Pi3:
1- I installed the latest Raspbian OS on the PI3
1a- If you know how, tell your wireless router to always assign the same IP address to the MAC address of the Raspberry Pi. Alternatively, configure wifi on the pi to be a static IP so you can easily login to it via a web browser.
2a- Give a nice short name to your pi by running raspi-config from a terminal, then Install avahi-daemon on your raspberry pi: “sudo apt-get install avahi daemon”. This will let you find it via that short name pus “.local”. I named mine pi3 and I get to it by typing “pi3.local” into safari on the ipad (bookmarked).
2- I installed nodejs and cncjs using the git instructions (since I’d like to customize it a bit). If you don’t plan on modifying it, use the simpler default instructions)

My current workflow:
1- On my mac, I use fusion 360 to post process using the carbide 3d profile.
2- I open “http://pi3.local” in a browser and click “Upload Gcode” in CNC.JS and pick the gcode file.

Now everything below is on my tablet (any tablet with a browser, I use an old iPad):
3- I walk over to my S3 and turn it on. I then tap the homing button. (notice the gcode uploaded from desktop appears on the iPad preview ready to run.
4- I click go to G28 position (opposite corner from home for me, you can also set G28 and G30 positions to anything you want through cncjs).
5- I move the machine to the corner of my stock and zero out the working offsets. I store this in G30 if I will be running multiple jobs on the same position stock.
6- I raise Z, turn on the Dewalt, and tap the play button above the preview window. At this point CNCJS shows me the position of the bit in the preview window in sync with what the machine is doing.
7- I drink beer while waiting for the job to finish (I still like to watch it do it’s thing)

Hit me with any questions while this is still fresh in my memory!


Options for linux?
(Chris Rafuse) #2

Did you ever have GRBL show an unsupported command when using CNCJS ? I generated GCode from MeshCAM and using it through Carbide Motion I had no issues, but using the same code through CNCJS GRBL won’t recognize the G1 A0 Z-8.5 F600 command at the beginning.


(Rob Grzesek) #3

Hey Chris-

Use the Shapeoko post from MeshCAM and it won’t output an ‘A’ variable.

-Rob


(Chris Rafuse) #4

Thanks Rob!

I totally forgot about the file type (post config) drop down in the save option.

I figured out that was the only command unrecognized command after trolling through the g-code with some shell utilities. All seems to be good now.


(Jim Amos) #5

@yfi

Thanks for this post. I always enjoy learning about new workflow possibilities and alternative software options and I am intrigued with your setup. I’m trying to wrap my head around all this and I have a few newbie Q’s:

  • You mention “now everything below is now on my tablet”… The Fusion360 post process transfer from MAC to iPAD happens how?

  • Your Pi3 and/or iPAD is running CNCJS?

  • The Pi3 connects to your GRBL controller via USB and is a WiFI PU node to faciliate G-code file transfer and sending?

Thanks in advance…


(Yacine Filali) #6

@jimidi CNC.JS is running on the raspberry pi only. Nothing is installed on the mac or the iPad. So when I upload the gcode to it via my mac web browser, all I have to do is open the iPad web browser to the pi3’s address and what I uploaded on the mac shows up on the iPad as well. Same works with my phone browser, btw. The last screenshot in my post above shows the iPad web browser with cnc.js on it.

The Pi3 has builtin wifi and is connected by USB to the Shapeoko. I turn off my Shapeoko when not using it, but you do need it to be turned on for the cnc.js interface to allow you to upload gcode. Since it’s a web based interface, I can basically use any device with a good web browser to control and checkup on jobs.


(Stuart) #7

Hi yfi,
This setup looks great, I think I will do the same!
I currently use bcnc off a netbook, and when I load a big file, a 12x12 relief caring for example, the software gets super slo2 and laggy, have you had any issues like this at all?


(Yacine Filali) #8

Not at all, the raspberry pi doesn’t really do any work other than stream the gcode to the machine so it doesn’t need a lot of power. The visualization is happening in the web browser and that can be turned off if you don’t want to see it or if your browser machine is too slow. It’s been very smooth so far.


(EJ Ciramella) #9

I’ve been trying to follow these steps (and am grateful to have something to follow), however, I have a question for you.

Seems like no matter what I do, while running 1.9.13, I constantly get this:

Error opening serial port “/dev/ttyAMA0”: Error: Error: Permission denied, cannot open /dev/ttyAMA0

I’m curious - does the shapeoko need to be powered up and connected prior to booting cncjs? I’ve followed all the debugging steps on the various github pages, but to no avail.


(EJ Ciramella) #10

I guess I should add - I was hoping to connect the Shapeoko 3 via USB to the raspberry pi.

Is this what you did or did you use some kinda hat?


(Yacine Filali) #11

It sounds like you need to run cncjs as root or preferably add the user to the dialout group:

My rpi3 is connected directly to the Shapeoko3 via USB. It does need to be powered on for it to be detected by cncjs, but you don’t need to have it on all the time. When you open the browser session, you can have it open the USB connect (top left panel for me).


(Pierre LaFromboise) #12

I think you may have missed the step for configuring Production Process Manager to run as root. Make sure you follow the steps in the PM2 section of cnc.js pi guide: https://cnc.js.org/docs/rpi-setup-guide/


(EJ Ciramella) #13

Interesting…

I was following along with the github instructions originally:

There’s no mention of PM2. Also, interestingly enough, seems like that runs as the specified user. In the case of the documentation, it’s specifying the “pi” user and it’s home directory:

“startup systemd -u pi --hp /home/pi”

The pm2 bits are there to show how to build a node app into the SOP service start/stop.

I’m probably missing something.


(EJ Ciramella) #14

I cat’d “/etc/groups” and can see that the “pi” user is part of the dialout group.


(EJ Ciramella) #15

@yfi huh - also - not sure why, but I never see anything usb related in the drop down (ttyAMA0 only). Should that be ttyUSBsomething?


(EJ Ciramella) #16

For what it’s worth, it’s a permissions thing…somewhere.

I became the root user, updated root’s .bashrc to source the npm dir out of the “pi” user’s home directory, and boom - worked fine (well, still says /dev/ttyAMA0 and makes no reference to anything USB - can’t tell if that’s how on the system that’s how it represents USB).

This isn’t great, should never have a root process like this running, it should be a non-privileged user IMHO, but more to come…


(EJ Ciramella) #17

Ok, so yes, running as root grants access to various ports.

I still haven’t figured out how to do this as a non-privileged user (the “pi” user is in all the correct groups). I’m wondering if it’s something new in rasbian “stretch”?

I’m familiar with Carbide motion, so when I finally had a moment today to connect and try everything out, I was a bit surprised that while CNCJS identified a Carbide port (I assumed it was the board) and connected and was happy, I couldn’t jog or home the Shapeoko at all. In fact, all the arrow keys were greyed out. Is there something I need to do to jog it around?

Is there something else I need to do? I read somewhere on the CNCjs page about setting the GRBL version - I’m not positive how to verify what came on the board (I’ve not flashed it or upgraded it at all). Is there a quick way to check?


(Pierre LaFromboise) #18

From CNCjs you can see the GRBL version by clicking the “info” icon in the GRBL module:

grbl

That will open a modal window with two tabs. The “Controller Settings” tab will show the version:

grbl_v

I don’t know if a certain GRBL version is required as I’ve always used 1.1 with CNCjs. I did, however, have to upgrade the board to get there. You can find instructions for updating here.

I’d also note, that whenever I connect to the Shapeoko with CNCjs I need to first perform a homing operation before the jogging arrows will “unlock”.


(EJ Ciramella) #19

Hmm - a bunch to digest here.

I clicked the homing button, but it did nothing.

I have a few other things I want/need to try before I go about flashing the board.


(EJ Ciramella) #20

Poked around a bit more tonight, but still having some issues.

I still can’t jog or home the machine, but it is finding a Carbide endpoint. Any suggestions?

49 PM07 PM