v1pi: Raspberry Pi Image with Octoprint and CNC.js (and wifi hotspot)

they cant both be connected at once. Also make sure you don’t have hardware flow control enabled.

The wiring shouldn’t have anything to do with it (except for the usb).

yeah, I remember having an issue where I couldn’t connect when octoprint was connected so I’ve been testing this with the Octoprint stopped but it will still crash. From what I can observe the cursor in the console within CNC.js appears to freeze as soon as I try to send a command to the CNC so it appears it’s trying to do something and when it can’t do it crashes. Where would I set hardware flow control? Also, is this still the best way to check the logs to see what is happening?

journalctl -u cncjs.SERVICE

In the connection settings in cncjs, I think.

That is the main log.

So I powered up the Pi without even connecting my cnc via USB and after 4 minutes (or less) the CNC.js service crashed. I don’t see anything in the log when I execute that “journalctl” command. Where else should I be looking for clues as to why this is happening? Is there a chance the sd card is bad? I just don’t get why it isn’t working now. I’m running on a Pi4 if that makes any difference

edit: also “hardware flow control” has never been enabled

I’m not sure. You can try updating it. You can also try posting the issue or looking for a similar issue in the cncjs github.

yeah, I updated everything I could on the Pi I was hoping to have some log info but I’ve yet to find instructions on how to view the cnc.js specific logs Oddly enough the cnc.js service hasn’t crashed yet… I’m not sure if doing the Pi updates made a difference or not but fingers crossed that was the problem. I would still like to know if there is another way to view logs specific to the cnc.js service if there is a way. Otherwise thanks so much for your quick response to my questions @jeffeb3

Hi all,

I have a little bit of a strange problem.
Yesterday I installed a power-button on my raspberry pi 4 using this guide:

After that, and a lot of troubleshooting, I found out that everytime I booted my Rambo board with firmware V1CNC_Rambo_DualLR_2.0.7.2_510 my pi was going down. This only happens after I installed the button and the scripts. It was already running a half year succesfully.

After some troubleshooting I noticed then when booting up my Rambo board somehow the script get executed that should only be executed when pressing the button. I edited the scripts so the Pi doesn’t get a shutdown but writes something to a file and also that happens when the Rambo gets booted. So somehow the Rambo board triggers the shortings on pin 5 and 6 (GPIO 3 and GND).

Someone any idea how to fix this?

Do you have a pull up on those pins? IIRC, you can assign an internal pullup. But maybe adding one on the outside will make the noise go away. Just a guess.

Ok this is all new for me but for what I understand from a youtube video is that the Pi has build-in pull-up resistors which can be enable through code.

When I check the scrips provided by the tutorial I see the following line which make’s me think it is enabled:
GPIO.setup(3, GPIO.IN, pull_up_down=GPIO.PUD_UP)

I’m using the following button:

The wires are directly connected at the pin 5 and 6 of the Pi.

Do I need to add a external resistor between the button and the Pi?

Check the code first. If it was already set as pullup, then add a resistor (bigger than 1kohm) between the gpio pin and 3.3V. when the button isn’t pressed, the pin will be pulled up. When it is pressed, there will be a very small current, but the gpio will be triggeeing as ground.

Hi Jeff,

thanks for the rapid responses!!

The code is:
GPIO.setup(3, GPIO.IN, pull_up_down=GPIO.PUD_UP)

So from my understanding it is already set als pullup.
As you suggested I added resistor(s). I only have 330 ohm laying around so I first tried it with one 330 ohm resistor, didn’t make any difference. Then I put 4 times 330 ohm in series behind each other to get above the 1k ohm. Also didn’t made any differences.

Tried the resistors at pin 5 and pin 6, didn’t do anything besides that pressing the button doesn’t work anymore with the 4 resistors at pin 5.

Hmm. That doesn’t sound good. I wonder what is going on. My fear is that there is too much current coming from the pi to the rambo. If it were emi noise, I would expect the pullup would have worked.

I rerouted the wires of the button a little bit and the problem has disappeared.
That would suggest you we’re right about the emi noise right?

second thing I added is that I have to press the button for at least 3 seconds before the shutdown command will be executed.
I guess the short EMI noise spikes won’t be as long as a couple of seconds.

2 Likes

Oh, that is a great idea. Why didn’t I think of that.

1 Like

I’m curious if there is a preferred way to update cnc.js (octoprint for that matter as well) on v1pi? I have it running my new mpcnc through an old pi zero and it’s running great. Just looking through the change logs for cnc.js and it looks like some updates could be applicable. Figured I’d ask before I go probing. Thanks in advance and thank you overall for your awesome work!

1 Like

I’ll say this, don’t follow the upgrade instructions outlined on cnc.js’s site. That’s a quick way to “break all the things” -ville. Just in case anyone was wondering (he said as etcher erases the evidence in the background).

That npm command is exactly how I upgraded in the past. I wonder if the version of node I was using is too old now.

Thats exactly what it asked me to update, then a spiral of updates happened. Ultimately it borked completely and I threw in the towel with a fresh copy of v1pi.

2 Likes

ok i seem to be having a issue with v1pi.
I can connect to it using CNCJS using /dev/ttyACM0 at 250000 baud rate.
But in Octoprint using the same connection /dev/ttyACM0 at 250000 baud rate.
I get the “Could not autodetect printer” and doesnt connect. I have disconnected CNCJS when trying to connect to Octoprint

ok so i see some form of connection with rpi/Octoprint using /dev/ttyACM0 at 250000 baud rate.
Using terminal i get:
Recv: Not SD printing
Recv: X:97.9200 Y:92.4200 Z:5.0000 Count X:51362 Y:44635 Z:0
Recv: X:97.9200 Y:92.4200 Z:5.0000 Count X:51362 Y:44635 Z:0
Recv: X:97.9200 Y:92.4200 Z:5.0000 Count X:51362 Y:44635 Z:0
There was a timeout while trying to connect to the printer
Changing monitoring state from “Connecting” to “Offline”
Connection closed, closing down monitor
So they are talking to eachother but it disconnects?