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

Have been away from my MPCNC for almost a year due to several issues, anyway have started back again and amazed at the progress with the MPCNC by Ryan and Jeffeb3.

I have rewired my MPCNC for dual end stops and touch plate, downloaded the firmware and uploaded to my Arduino/Ramps. All works great through the LCD.

After seeing the new Pi interface from Jeffeb3 I downloaded and installed on P1 3 Model B V1.2, all works great except CNCjs. Using MacBook Pro to communicate wirelessly to the Pi, Octoprint works perfectly. I have tried for almost two days now to try and get CNCjs working with no success. The port used is /dev/tty/ACM0 (same as Octoprint) and the CNCjs console shows that the port is connected, however I am unable to send Gcode commands, jog the MPCNC through the keyboard and unable to run a Gcode file.

Have looked at the CNCjs site and there would appear to be issues in the past with Marlin communications, wondering if anyone else is having the same issues?

Thanks in advance, once again some great progress on the software!!

(Just to add the Pi software I downloaded is the no hotspot version)

This is the main issue I’ve seen:

AFAIK, there hasn’t been a fix yet. I should probably try the latest version though, it’s been a while now.

Try sending ‘G0 X0’ in the command line, after connecting. I think after that, it should sort of work. The marlin support isn’t 100%.

Thanks for the quick reply, I tried your suggestion of G0 X0 - no response from the Arduino.

For information I have setup the Pi with the desktop, added chromium and run the Pi interface from this, works really well with Octoprint, same issues with CNCjs though.

All points to issues with CNCjs itself, I’ll leave this for the moment, I can work through Octoprint as I just need to send Gcode commands for setup.

Thanks again for your support.

 

I think you actually need a move command, so G0 X100 is what I was using when testing. Until that gets fixed, I went back to moving my laptop between the routers and running off repetier.

Downloaded the image and got it all working , strange thing is if I use octoprint I can see the webcam but if I use the cncjs I cannot see the webcam. Any ideas on why ?

Also see nothing on the pi touchscreen which I was going to use to do homing etc , I tried a display with hdmi and nothing except the kernel so I enabled the desktop ? No idea how to get cncj to show on the screen ?

Can anyone offer any help

 

1 Like

I didn’t do much configuration. The webcam streaming address isn’t set in cnc.js. You should be able to get the address from the octoprint settings. Oddly enough. I’ll make a note. I need to spin up a new one for the newer versions and I’ll see if I can add that easily.

You can open a web browser on the desktop and navigate to http://localhost

I didn’t set it up, but there are some neat cnc.js plugins for a tablet. One has less stuff on it, but has big buttons for tablet use. There is also an octoprint plugin for touch screens.

You can also configure the browser to come up on startup. That might help. I would search for “autostart browser rasbperry pi”.

Thank , couldnt find anywhere in cncjs to configure the video stream , will try and do some more research on the tablet plugin, sseens octoprint is a lot better supported than cnjs with regard to setup and use.

I tried 4 times to go the procedure but kept getting errors on the npm install. Your image made rhe process a lot easier thanks.

 

Yeah, installing npm on raspberry pi was the tricky part. There steps I finally took were easy, but they were there 3rd or 4th things I tried. Glad it’s working for you. I’ll see if I can at least post instructions on the camera stuff soon.

Got the pi desktop working on the touchscreen and can access cncjs via my phone logging in but cant work out how to initiate cncjs from the pi desktop .

I can see why windows won the interface to the world. Lol

Looked through the files browser and cant see a exectable for cncjs

 

Those are fighting words :slight_smile:

Just open the browser (midori?) To http://locslhost .

Things are different in Linux. You don’t use the file browser to look for programs. Cnc.js isnt an executable. You’re thinking like a windows user.

Yep a long time windows user drowning in llinux lol .

Worked out this afternoon it is a browser based program and got it working on the screen . Now just need to get the shoptablet software worked out and im good to go .

It is a lot to drink in. No doubt about that. You can Google some general pi or linix tips. You will need the command line more than you’ll need the file browser. Most software gets installed from software manager (apt). I would look for a tutorial to install Google chrome and autostart it in kiosk mode. Then you can ignore the desktop. You’ll learn some basic Linux skills while doing it.

I worked out cromium today but kiosk mode is a good pointer.

Now i just need to get as clean install of tinyweb or shopfloortablet so its usable on the small touchscreen .

Success!!! I finally figured out why I could only ever connect with the hotspot version. Both my pi’s are only 2.4ghz wifi… :oops: I guess only the pi 3 model b+ has 5ghz, I have the plain b and a zero w

I kept trying 5ghz, not even thinking. So everything is groovy now!

Dropping in bonjour to windows makes v1pi.local work easy peasy. Thanks Heffe. Now I am going to try and make a “controller options” page or post or something.

1 Like

Yeah, bonjour is a quick fix. I just can’t talk to how to do it.

Danged newfangled wifi! 802.11b worked just fine!! 8-O

I made a page in the documentation for setting up the webcam in CNC.js:

https://v1pi.readthedocs.io/en/latest/camera-setup.html

Let me know how it goes.

1 Like

Downloaded the new image file and wrote it to a couple of SD cards. Both start okay and connect on both “sides” (Octoprint and CNCjs) but the webcam still only works on the Octoprint side. No error messages that I can see… just a black screen on the CNCjs side. Just to let you know, no joy so far… :frowning:

EDIT: Never mind… it helps if you follow directions. Didn’t type in the proper URL… silly me =8^P

1 Like

Many thanks!

The new image (which is still in testing) isn’t required for the webcam to work, it just has the latest octoprint and cnc.js versions. I also disabled the console serial port, which is needed if the pi serial port is connected to the cnc controller.

Thanks for testing the new image, and the webcam instructions. I think I’ll change the URL formatting so it’s easier to copy and paste. When I copy/pasted, I got the ‘.’ in there too (which won’t work).

1 Like

Great! cant wait to test. Thanks.

I do not see that line in the crontab. Nevermind. I see it now, had to sudo crontab -e

Is it possible to have the hotspot image, and be able to connect to another wi-fi (hotspot not connected)? And by possible, I mean possible for me to do, not expecting you to write any more code.

My issue is when connected to hotspot, my device does not have internet connection.

And Octoprint works good on here, just wish I could get the CNC.js to work. the G1 X0 commands do nothing for me, I will try the timeout/commenting line method.