v1Pi CNCjs Pendants

Just thought i’d drop a note here for others that are looking to use pendants with CNCjs. Here’s how I set up both tinyweb and shopfloor on my v1pi - instructions should work for stock CNCjs as well.

First log into your Pi and clone the repository locally:

$ git clone https://github.com/cncjs/cncjs-shopfloor-tablet.git
$ git clone https://github.com/cncjs/cncjs-pendant-tinyweb.git

If you want, you could change to a tagged release branch. However, if you are running Marlin firmware (as I am), it hasn’t made it to any tagged releases as of the time of this post.

Add the following to your ~/.cncrc file:

  "mountPoints": [
    {
      "route": "/pendant",
      "target": "/home/pi/cncjs-pendant-tinyweb/src"
    },
    {
      "route": "/tablet",
      "target": "/home/pi/cncjs-shopfloor-tablet/src"
    }
  ]

Restart CNCjs:

sudo service cncjs restart

NOTE Running on a Pi3, I have seen some oddness - if CNCjs isn’t running after the restart try stopping and starting again (reboot works also). For some reason sometimes the restart doesn’t re-bind the ports.

sudo service stop cncjs
sudo service start cncjs

That should be it. Both should be available now (my v1pi has been renamed to mpcnc):

http://mpcnc.local:5080/pendant

http://mpcnc.local:5080/tablet

If you’re interested in developing your own pendant, there is a boilerplate here: https://github.com/cncjs/cncjs-pendant-boilerplate

5 Likes

Thank you! This is great info. Great enough I am thinking of adding it to the v1pi docs.

Here are a couple notes:

  1. You should clone those repos on the pi, not your laptop/computer. You can see later, they are put in the /home/pi/ directory.
  2. You can start, stop, restart the service from the landing page. Those buttons map straight to sudo service calls.
  3. Your address is mpcnc.local but that must be because you’ve changed your hostname. The default is v1pi.local.

Still. This is a really great addition. I had some trouble getting the .cncrc file to be used after the image booted the first time. I would love to actually put one or both of these into the image already. I know you can specify mount points in the cli arguments, but I would much rather have a decent default .cncjs file in the image already.

Thanks again.

4 Likes

Nice!

I’ve been running both of these pendants as well, but I just edited the start script in /etc/ to include the command line options.

Using the .cncrc file is a better approach.

Thanks for sharing…I should have too, but it didn’t occur to me…and I haven’t been cnc’ing lately due to other priorities, so haven’t really tested it much.

1 Like

What does your cncrc file look like? When I add that to mine, cncjs stops working.

1 Like

Are you trying to get my “secret”? :shushing_face:

{
    "state": {
        "checkForUpdates": true,
        "controller": {
            "exception": {
                "ignoreErrors": false
            }
        },
        "widgets": {
            "connection": {
                "autoReconnect": false
            }
        }
    },
    "secret": "nonyobusiness",
    "mountPoints": [
        {
          "route": "/pendant",
          "target": "/home/pi/cncjs-pendant-tinyweb/src"
        },
        {
          "route": "/tablet",
          "target": "/home/pi/cncjs-shopfloor-tablet/src"
        }
    ]
}

Notice that I put it before the last }, and I added a comma to the last thing in my file (which was the secret in my file).

2 Likes

Thanks! Forgot the comma…

Woo!

2 Likes

How stable are these?

Do they both have good use cases?

I am wondering again if I should work to integrate these into the pi (not running a web browser and X on the v1pi, but adding these modules).

1 Like

I’m just getting started with cnc.js so I don’t really know enough yet, but these do look useful.

Same, but want to start using this to control the cnc and not just a sender.

I decided to check them out after scrounging an old kindle fire tablet from someone.

The standard CNCjs interface was a bit too cluttered for the tablet. I foresee using the shop floor tablet interface on the fire as the primary interface to my lowrider.

I already had a “watch” directory set up, as a NFS mounted directory from my home file server (also a pi). This makes it easy to do the CAD/CAM on one computer and just save the gcode file to the CNC watch directory, ready for use.

I think that would be a nice feature.

There are some other cool options…like the PS3, and GPIO pendant interfaces, but those are hardware dependent.

The Shop Floor Tablet, and Tiny Web interfaces are just alternate web pages, and therefore pretty hardware generic.

1 Like

I have onedrive set up on my desktop and the laptop in the barn. I drop my cnc stuff in there.

1 Like

My question was, is there one of these that is clearly more useful than the other. I guess I’ll have to just try them both.

They don’t take up much room, I can see a use for both depending on what you’re using to control it with. The pendant is exactly what I was envisioning when I did the A.R.M. terminal enclosure. Still need to get that out to the shop and wired up. Maybe this morning, but my brother and niece are coming down to visit for the weekend.

1 Like

This is what I was thinking (take 2 they’re small…8^)

I’m running both simultaneously. It’s possible to have a all 3 interfaces open and in use simultaneously (i.e. standard CNCjs, Shopfloor Tablet, and TinyWeb).

I haven’t really worked with them yet, but I think I like the TinyWeb interface the best.

Unfortunately, (unless I’m missing something) it lacks the ability to load gcode files from a watch directory, and also the ability to enter arbitrary gcode commands, so I’m leaning toward using the Shopfloor Tablet interface.

The consequence of extra stuff isn’t space (to a point), it is mostly the additional complexity. But it is also cpu and memory resources, which may not have an impact until someone opens the address. I’m not sure.

I’ll try them out and see if I can even force the initial config before I worry too much about it.

My workflow so far is to use the main CNCjs interface to load the gcode from my computer, then go out to the machine and use tinyweb on my phone to set the machine position, reset 0, and start the job. I’m planning on using a modified shopfloor for the 7 inch touch screen on mine at the machine, at which point i’ll probably stop using tinyweb.

3 Likes

I’m liking the look of shopfloor. Would be easier than trying to use the standard web interface with my phone. Does it have a probe function for Z or the ability to add one? I’ve become pretty reliant on the probe.

hey thanks for this update(not sure if theres a newer way now) i have got it loaded in web browser, ive tried to use it with a 7" touch screen connected to pi (its a waveshare) i bought when i got my pi4 4gb to run octodash for octoprint, ive since changed to using it for cnc now. How could i run it with cncjs? ive followed your tutorial but when i go to restart the pi, im getting back to the desktop nothing loads up on the lcd like it should? im not sure where to go from here or its just not gonna work? haha thanks!~

Does it work if you then open a browser to the localhost:5080/tablet or pendant?

Because then all you are missing is starting the browser at login. I use kiosk mode in the chromium browser for this on a similar project.