I currently use a TinyG v8 with a Raspberry Pi 3 as the host controller.
My goal is use the RPi3 as a host for both ChiliPeppr for my Mill and OctoPrint for my 3D printers. I do not intend to run both machines and thus GUIs simultaneously but to have the RPi configured to run both GUI’s and all their widgets without issues.
I have gotten everything to work fine between both ChiliPeppr and OctoPrint except for the Widget-Cam. I use a Logitech C920 webcam that works fine with the OctoPrint camera widget at first. However, once I added the ChiliPeppr widget-cam to my workspace and give it access to my RPi, it downloads and installs some libraries or drivers that prevent my camera from working at all.
The webcam still shows up under my USB devices on the RPi when plugged in but it does not power up. The default url for the webcam stream through the Octoprint RPi config is http://octopi.local/webcam/?action=stream and when following it, it says error “Page Not Found or Access Denied”
Upon running mjpg_streamer manually through the command line, I get the following response in the photo below:
Does anyone know how to fix this?
The ?action=stream reminds me of the h264 library on Rpi, which you could just use in ChiliPeppr. You could fork the Widget-Cam widget and just have it point to that URL instead of using mjpg_streamer. You could use a macro to load your widget on startup in the tinyg workspace. If you do create it, I think we’d all love to check it out.
Hey John, thanks for getting back so quickly. I’m not sure if I fully understand, I believe OctoPrint uses mjpg_streamer normally. Are you saying don’t worry about having the Chili-peppr widget cam run mjpg_streamer as the Pi is configured to run it anyways on boot and instead fork the widget and have it point to that address?
And, slightly off topic but I’m sure you may know: In one of my TinyG workspaces I am developing, the axes and DRO coordinates are flipped (negative values instead of positive). I home and zero all axis but it doesn’t fix it. +X10 moves the the machine in the correct direction after homing but the coordinates and DRO read X: -10 instead. When I use the standard TinyG workspace, they are correct however. I even reinserted the Axes widget using the same HTML and JS code from the TinyG workspace’s code on Cloud9. Have also reset the board, and zeroed all work coordinate systems!
I have a Pi3 I am playing with for another project and for kicks I put a JSON server on it and it ran TinyGtablet without problems. I was pleasantly surprised.
Ok, so what I’m seeing is positive numbers coming back, but just that your dark theme makes it seem like there’s a negative. LIkewise on negative numbers, your negative disappears. So guess is you have your CSS inverted.
I found the text in the serial port console helped me debug this. Toggle off the funnel icon to see all the {} position data coming back that is otherwise hidden by the filter. Your CSS also hides the text since it’s dark gray on black.
Thanks John, I will try those things and update the CSS as well. The theme is a slight mod of an existing workspace I found so I can’t take all the credit.
As for the spindle widget, started that last night. Have only started messing with HTML, CSS, and JS for about a month so I’m still having to learn a lot. Next task is how to take input data from slider and pass it to JS function to input it into GCode command. Then where the JSON version of the command needs to be sent to… all the different publish addresses/ urls are a bit confusing to me at this time.
I saw that you tried to put inline javascript into the HTML page. Try to not do that as that doesn’t follow the standard approach of ChiliPeppr widgets. Instead make a new method in the Javascript file like setupSpindleControls() and then call that from the init method. Have your setup method use JQuery to attach click events that call other methods. You can see how click events are attached for those standard buttons in the template widget you forked. Then, on those click events just do the chilipeppr.publish(). Look in the macros for more sample code on how to do sending of Gcode. That’s all Javascript you can paste into your widgets.