Has anyone been able to get the webcam widget inside ChiliPeppr working with a

Has anyone been able to get the webcam widget inside ChiliPeppr working with a raspberry pi camera board? @Jarret_Luft , I noticed something on the shapeoko forums that said you were looking into it. Any luck?

I got super close but it only worked in Firefox, not Chrome. I posted a comment on this blog about my attempts to get Chrome’s VP8 codec working. Check out http://www.rs-online.com/designspark/electronics/blog/building-a-raspberry-pi-2-webrtc-camera

interesting. so it seems there has been improvement on this front in a couple of places. I installed uv4l according to these instructions (http://www.linux-projects.org/modules/sections/index.php?op=viewarticle&artid=14) and I’ve got webRTC working on the pi2 no problem! looks like very low delay also. And i’m running in init3. Not sure how to get from this to CP though.

Uv4l is Video4Linux and not related to WebRTC. What are you using as your WebRTC stack on pi2? My link uses the Janus gateway which is fairly impressive software.

so, i’ve got an address for a webRTC server on the pi that is serving up the video. is there a way to point the webrtcserver widget to the ip and port instead of trying to get it from localhost?

You’re going to have to fork the webcam widget to get it to go. As far as I know WebRTC does not use IP addresses and ports as direct video links (although maybe you can coerce it). Instead WebRTC relies on a known server address in the cloud to act as a STUN/TURN server to pierce through firewalls if need be. So, is your WebRTC stack acting as a TURN/STUN server. That server then creates a 2-way peer to peer data channel for negotiation and video feed setup. The video stream becomes a product of that data channel.

I see that video4linux just got some level of webrtc as of March 22nd, so that is super exciting, but the question is what level of WebRTC? Does it include a STUN/TURN server or is it simply a VP8 video stream?

well according to this (http://www.linux-projects.org/modules/sections/index.php?op=viewarticle&artid=18), the separate streaming server in uv4l is also acting as a STUN server. So, I think I would just need some way to configure that widget to point to it rather than whatever it is pointing to now. At least I think… I’m new to WebRTC.

The ChiliPeppr Webcam widget uses PeerJS which is a Javascript library that uses PeerJS’s STUN/TURN server in the cloud (ala the whole cloud argument) because it’s a guaranteed known entity. Then each end-point including the client and video server can know where to connect. Once you lose a known address, which is what you are asking about, you have to rework the whole thing. So, I would say fork the widget. Drop the peerJS dependency and just copy the code included in the sample page that you said you already saw working for your uv4l implementation.

ahh ok. so, it can’t be a configurable widget where you can go to advanced and specify the address of the server to use?

WebRTC’s base model is for some other form of calling such as an email address or phone number and that a known cloud server be used to negotiate. That’s why the webcam widget requires you to be logged in, so it can use the primary key of your email address to negotiate. If you want to do an IP address I think that’s cool, but you’d just have to essentially bypass some of the WebRTC design decisions and then yes, you could do an advanced mode. You up for giving it a try?

sure. do i need to fork the webRTC Server widget, or the “Workspace - WebRTC Server” widget?

No. Just fork the webcam widget or perhaps fork that MJPEG widget that Jarret’s referring to. The WebRTC Server widget and WebRTC Server Workspace are the equivalent of your uv4l server, but in the form of a Javascript server instead of your command line server. You already have the server in place. It’s the client you need to create. I would perhaps add your advanced mode to the current Webcam widget and then I can just upgrade the base webcam widget to be your new codebase so it has the flexibility of both approaches.

nevermind, i think if I understood you correctly, you’re saying i could make a new client widget to have similar code to what i already have in my browser for streaming it locally.

Wow. 250% CPU usage on uv4l to serve up a live WebRTC video stream. No wonder this would never work on Raspi 1. I wonder if this can run in parallel to Serial Port JSON Server given this CPU load.

i’m running it right now with SPJS and shuttle and doesn’t seem to have any problems. there’s 4 cores in it, so it seems to be ok. haven’t put a load on SPJS though.

got it working! Screenshot here: https://dl.dropboxusercontent.com/u/57148026/chilipeppr_with_raspicam.PNG

and forked workspace using the prototype widget here: http://chilipeppr.com/grbl_raspicam

the forked widget is here, but I just hacked the existing one, so there is all sorts of stuff the needs to get removed / cleaned up: http://jsfiddle.net/lordmundi/jrrhjnak/

I got it working too. This is awesome. I’ve been waiting 6 months to get the Raspberry Pi camera (which is an amazing camera) to work with WebRTC and thus inside ChiliPeppr! Thanks for the tip Frank. Had you not found uv4l’s recent launch from 13 days ago we would not know we could do this. Now, what about audio? Hearing stepper motors move is pretty important for remote monitoring from your deck while your machine runs in the basement.

it is supposed to support audio… i think it defaults to off, but i think in the man page they show how to enable it

Hi - so to get this working: in addition to running the forked workspace (grbl_raspicam) - what is needed to run on the rasperry pi? Getting my Pi today and can’t wait to set it up to run with my CNC :smiley:

I think all you need is uv4l. Do a search for uv4l and raspberry pi and you should find instructions.