CNCjs on RPi is suddenly unreliable

RPi is an excellent platform. I’ve hosted CNCjs on it for a year and successfully limited the sawdust my fancy laptop has to breath. But all of a sudden it drops connection within 10mins of operation. The code is already loaded onto the RPi so program execuation can continue but I lose all link to the laptop and thus can’t load the next program.

So a bit of background:

Rpi 4 with a hardwire ethernet cable to the router which emits garage wifi, laptop on wifi. Use:


in laptop browser to connect to RPi a safe distance away from the dust machine. From there I can upload .NC files, jog machine, complete control.

Like I said this has worked for over a year, where I can upload to the RPi start the program and restart the laptop and regain connection with disrupting the machine or Rpi. Now once I loose connection it isn’t until I restart the laptop, RPi and router that I get the connection back, for 10mins…

I’m about half knowledgeable on this stuff but I’m a little stumped as to what changed and how I can rectify/prevent this in the future.

Is it possible that the laptop is going to sleep or even a security program is interfering with your Pi connection?

Unfortunately no. The laptop is plugged in and doesn’t sleep when left unattended. While I’m using it is will drop connection.

Also 10mins is more of a fuzzy time estimate.

do you loose only the connection to the CNCjs server on the Pi, or the access to the Pi altogether ? (I assume the latter, sinec you mention lossing “all link to the laptop” ?)

If it’s a loss of Ethernet comms, you may be able to find clues in the system logs (/var/log/syslogxxx.log), by inspecting them right after the problem (after rebooting everything if that’s what it takes to access those logs)

You mean that the Pi is able to keep running cncjs and cutting continues, even after you lose contact?

That would rule out power failure as a possibility, leaving some kind of network issue.

So you have three devices here, I’d try to isolate the problem to one of them. Fortunately, this should be an easy check.

When the connection drops out, try connecting to cncjs with another device on Wifi, like your phone. There are a few possibilities:

  • Your phone connects to cncjs and wifi: this would indicate that your laptop is having issues.
  • Your phone fails to connect to wifi: this would indicate that the router is failing for some reason.
  • Your phone fails connects to wifi but fails to connect to cncjs: this might indicate that the Raspberry Pi’s network connection is dropping out.

Once you know where the failure is, diagnosing it should be much more straightforward.


And try just pinging the Pi from the laptop to see if there’s even network connectivity.

I tried this for a while and found it to be unsatisfactory. I had timeouts sporadically (windows 10 laptop/RPI4), but what I disliked the most was needing to have both a laptop and the Pi in my shop. And inevitably the Windows 10 machine would need to do updates when I wanted to run a job. I tried running just the Pi in kiosk mode, but that was a poor experience. So I switched to gSender and have been extremely happy with its performance.

1 Like

@chilinski What do you mean when you say kiosk mode? Like desktop vs CLI/headless?

It’s been a few days since I’ve tried this due to reliability concerns and I don’t want to claim the wrong things here. I’ll try again and report back.

What to watch for:
Try alternate devices on wifi. connecting to RPi and internet in general
Ping Rpi from laptop
Settings in router?
ipconfig on RPi

@Tyson. I was running it where the entire process was done on the Pi, and it was connected to a keyboard, mouse and monitor. I had it halt it the middle of jobs frequently. I had been running CNCjs for months on a windows 10 laptop in my shop, but, as I said, it seemed every time I wanted to do something, windows would want updates and I just got fed up with that. It worked fine without issues on the lappy. I then tried running headless on the Pi, but that still meant I needed a machine in the shop to connect to it to jog, load jobs, etc. I wanted the laptop out of the shop, so I switched. gSender is able to run well on the Pi, although its visualizer can’t keep up with where the spindle actually is.

Windows updates are nearly always untimely. I recommend you use this option if it happens when you want to do something long running:

I do not trust that pause option.
I have watched W10 install critical updates while paused and during the set active hours. The PC was not idle, I was rendering a terrain, Windows update found out it should update while the CPU was working hard, all 12 cores running at 90%+.


Although I’ve not experienced this, I think its probably better advice than mine, given how aggressive these updates can be.

Also, can I have your Ryzen CPU please?

I had Windows install Fall Creators Update for a second time after I had rolled back to 1703 and manually disabled the Update Service.

Since then, I’ve found that the only reliable way to keep Microsoft from updating my machine (I can’t stand how styluses are handled in new versions: Impossible to select text in Edge or draw in Macromedia Freehand using stylus · Issue #17 · TheJoeFin/Windows10-Community · GitHub, and despair of what I’ll do when my current machine dies) is to keep the hard drive so full that Microsoft can’t download the next update — it’s a nuisance constantly dealing w/ the disk warnings, but unless they start actively deleting things, this machine will stay at 1703.

1 Like

About to go camping, I will reply when I get back.

I have seen lots of complaints about the stylus handling, guess Microsoft likes to fix things that’s not broken.

1 Like

I’m pretty sure it was done in support of the Surface Duo — dumbing down the stylus to the lowest common denominator to match the behaviour of Android devices w/ capacitive styluses.

Apparently, uninstalling touch restores the nice stylus behaviour, and some folks have been able to uninstall Windows Ink, so I guess worst case is I could go back to a 3rd party handwriting recognition program.

Have you tried switching to a metered connection? it stopped all updates from downloading for me. I get the annoying popup saying windows can’t download the update but it’s easy to ignore.

For my cnc I use a cheap fanless mini pc that I never let access the internet so it never even tries to load updates. I have to plug in a usb to transfer files to it but it is always stable locked in time

Yes, Fall Creators Update was force-downloaded to my machine over a connection I’d set to metered.

Bring laptop to garage, plug Shapeoko USB into RPi, turn on and connected. (CNCjs server loads on start up from some .rc file I edited). But for some reason none of my commands were being processed.

The console to the right is what “Connected” looked like. All code and no motion. No response when requested to home, reset, unlock or home again. So I typed this.

After only 5 minutes the server stop working officially. That’s when I snapped the pic.

On second attempt I could access raspberrypi:8000 on my phone but it dropped out the same instant the laptop browser did.

Snapshot of the router.

Ping from laptop to RPi