Hi all!
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!