title: Cannot get WebRTC to work with UV4L and janus
body: <p>I'm trying to set up video stream via WebRTC from raspberry pi. I'm using a USB webcam, UV4L and Janus to accomplish the same. WebRTC is not working.</p>
  
  <p>I've followed steps outlined <a href="https://planb.nicecupoftea.org/2015/10/17/hackspace-hat-quick-install-or-audio-and-video-streaming-from-a-raspberry-pi-to-a-remote-or-local-webrtc-compatible-browser/" rel="nofollow noreferrer">here</a>, except that I'm using uv4l instead of gstreamer. I've installed janus gateway on another (Ubuntu) machine on the same network.</p>
  
  <p>My janus (on Ubuntu) when started shows this:</p>
  
  <pre><code>$ /opt/janus/bin/janus -F /opt/janus/etc/janus
  Janus commit: 1e06290078268279ca69d5aaf0a76831973b3457
  Compiled on:  Tue Jan 30 00:53:34 IST 2018
  
  ---------------------------------------------------
    Starting Meetecho Janus (WebRTC Gateway) v0.3.0
  ---------------------------------------------------
  
  Checking command line arguments...
  Debug/log level is 4
  Debug/log timestamps are disabled
  Debug/log colors are enabled
  Adding 'vmnet' to the ICE ignore list...
  Using 192.168.1.101 as local IP...
  [WARN] Token based authentication disabled
  Initializing recorder code
  Initializing ICE stuff (Full mode, ICE-TCP candidates disabled, IPv6 support disabled)
  STUN server to use: stun.l.google.com:19302
  ICE handles watchdog started
    &gt;&gt; 74.125.200.127:19302 (IPv4)
  Testing STUN server: message is of 20 bytes
    &gt;&gt; Our public address is 49.35.222.150
  Crypto: OpenSSL pre-1.1.0
  Fingerprint of our certificate: D2:B9:31:8F:DF:24:D8:0E:ED:D2:EF:25:9E:AF:6F:B8:34:AE:53:9C:E6:F3:8F:F2:64:15:FA:E8:7F:53:2D:38
  [WARN] Data Channels support not compiled
  Event handler plugins folder: /opt/janus/lib/janus/events
  [FATAL] [janus.c:main:3687]     Couldn't access event handler plugins folder...
  Plugins folder: /opt/janus/lib/janus/plugins
  Loading plugin 'libjanus_streaming.so'...
  Sessions watchdog started
  JANUS Streaming plugin initialized!
  Loading plugin 'libjanus_recordplay.so'...
  Streaming watchdog started
  JANUS Record&amp;Play plugin initialized!
  Loading plugin 'libjanus_sip.so'...
  Record&amp;Play watchdog started
  JANUS SIP plugin initialized!
  Loading plugin 'libjanus_videoroom.so'...
  SIP watchdog started
  JANUS VideoRoom plugin initialized!
  Loading plugin 'libjanus_textroom.so'...
  VideoRoom watchdog started
  JANUS TextRoom plugin initialized!
  Loading plugin 'libjanus_voicemail.so'...
  TextRoom watchdog started
  JANUS VoiceMail plugin initialized!
  Loading plugin 'libjanus_audiobridge.so'...
  VoiceMail watchdog started
  JANUS AudioBridge plugin initialized!
  Loading plugin 'libjanus_videocall.so'...
  AudioBridge watchdog started
  JANUS VideoCall plugin initialized!
  Loading plugin 'libjanus_nosip.so'...
  VideoCall watchdog started
  JANUS NoSIP plugin initialized!
  Loading plugin 'libjanus_echotest.so'...
  NoSIP watchdog started
  JANUS EchoTest plugin initialized!
  Transport plugins folder: /opt/janus/lib/janus/transports
  Loading transport plugin 'libjanus_pfunix.so'...
  EchoTest watchdog started
  [WARN] Unix Sockets server disabled (Janus API)
  [WARN] Unix Sockets server disabled (Admin API)
  [WARN] No Unix Sockets server started, giving up...
  [WARN] The 'janus.transport.pfunix' plugin could not be initialized
  Loading transport plugin 'libjanus_http.so'...
  HTTP webserver started (port 8088, /janus path listener)...
  [WARN] HTTPS webserver disabled
  [WARN] Admin/monitor HTTP webserver disabled
  [WARN] Admin/monitor HTTPS webserver disabled
  JANUS REST (HTTP/HTTPS) transport plugin initialized!
  HTTP/Janus sessions watchdog started
  </code></pre>
  
  <p>This is how I start the UV4L on pi:</p>
  
  <pre><code>pi@raspberrypi:~ $ uv4l --driver uvc --device-id 046d:082b --server-option '--max-streams=25' --server-option '--max-threads=29' --server-option '--port=8090' --server-option '--janus-gateway-url=http://192.168.1.101:8088'
  &lt;notice&gt; [core] Trying to loading driver 'uvc' from built-in drivers...
  &lt;notice&gt; [core] Loading driver 'uvc' from external plug-in's...
  &lt;notice&gt; [driver] Video functionality 'Webcam C170' recognized at 046d:082b
  &lt;notice&gt; [core] Device detected!
  &lt;notice&gt; [core] Registering device node /dev/uv4l
  pi@raspberrypi:~ $
  </code></pre>
  
  <p>Accessing <a href="http://PIIP:8090/stream/video.mjpeg" rel="nofollow noreferrer">http://PIIP:8090/stream/video.mjpeg</a> shows the stream from home network. An interesting point to note, when uv4l is started, it does not cause any new log to show up on janus window. Is it so that my configuration is incorrect/incomplete?</p>
  
  <p>Finally, when I access the link <a href="http://ip-of-server/janus-gateway-streamtest.html" rel="nofollow noreferrer">http://ip-of-server/janus-gateway-streamtest.html</a> , clicking on Start button does nothing. Similarly, <a href="http://serverip/streamingtest.html" rel="nofollow noreferrer">http://serverip/streamingtest.html</a> shows a link (RPWC, as configured in janus) for streaming, but when we click on "Watch or listen", it shows nothing.</p>
  
  <p>I'm sure some setting up is incorrectly done.. Which is that?</p>
  
  <p><strong>EDIT 1:</strong></p>
  
  <p>After a comment, I confirmed to check again if setting in <a href="http://piip:8090/janus" rel="nofollow noreferrer">http://piip:8090/janus</a> is correctly set, which it was (see image below) and I clicked on Start button</p>
  
  <p><a href="https://i.stack.imgur.com/XjcTC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XjcTC.png" alt="enter image description here"></a></p>
  
  <p>I tried to open the <a href="http://192.168.1.101/videoroomtest.html" rel="nofollow noreferrer">http://192.168.1.101/videoroomtest.html</a>, I'm able to see my feed, BUT - I was assuming that janus would behave more like a signalling server, in my case, it seems that janus is behaving as replay/replying server. Ideally, if the connection is established, and then if janus server goes down, then the streaming should still not break. However, I manually stopped janus, and the streaming stopped. How do I configure uv4l to use janus as signalling, and not as a relaying server (like TURN). Also, this is what I get on janus console:</p>
  
  <pre><code>Creating new session: 4606856182184138
  Creating new handle in session 4606856182184138: 2281485457416758
  Creating new handle in session 4606856182184138: 6811320978768068
  [6811320978768068] Creating ICE agent (ICE Full mode, controlling)
  [6811320978768068] The DTLS handshake has been completed
  WebRTC media is now available
  [WARN] [6811320978768068] Not video and not audio? dropping (SSRC 1029175205)...
  </code></pre>