Janus Gateway and datachannels using a raspberry pi

80 views Asked by At

I’ve recently configured a Janus Gateway server and successfully connected a raspi to the video room using UV4l.

What I’m trying to do: I’m trying to implement datachannels so I can send information to the raspi by connecting to Janus with another computer via browser.

What is configured: The raspi has a python script that should detect messages sent via /tmp/uv4l.socket I’m able to see the script work when it connects to the Janus Gateway room but I can’t receive any further data.

Using examples from the room plugin I created a function to try and send data via datachannels directly in the video room

function sendData() {
let data = “test”;

let message = {
textroom: “message”,
transaction: Janus.randomString(12),
room: myroom,
ptype: “publisher”,
text: data,
ack: true,
};
console.log(“Sent”);

sfutest.data({
text: JSON.stringify(message),
error: function(reason) { bootbox.alert(reason); },
success: function() { $(‘#datasend’).val(‘’); }
});
}

The problem: Listening to /tmp/uv4l.socket in the raspi doesn’t return any data (aside from the first connection to Janus) regardless of what videoroom/textroom I connect and use the senddata function using another computer. The raspi can only be connected with a publisher option as when I try to connect with publisher and subscriber I get an invalid ptype error in UV4L.

Any help appreciated: I’m not sure if it’s the function that is wrong, or it’s because I need the raspi to connect in both publisher and subscriber mode, so any insights or help will be appreciated.

Thanks in advance!

I've tried connecting with several browser types to Janus and creating other types of similar functions to try and send any type of data to no avail.

I can get datachannels to work via textroom plugin but only browser to browser (no raspi) but even then the /tmp/uv4l.socket did not listen to anything.

If I connect directly to the UV4L webserver I can get datachannels to work perfectly, but my intent is to connect the raspi to janus gateway and send commands via browser to the raspi.

0

There are 0 answers