Need help with Janus and Datachannels with a raspi

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!

Uv4l is not our project, you may want to contact their support for help on that.

But Janus Gateway is and I’m not sure if it’s part of the problem.
Regarding Janus:

  • Do you need to be connected as a publisher AND subscriber to be able to receive data via datachannels?
  • Does the senddata function seem correct? I’m using sfutest.data as it’s declared in the videoconference plugin attachment.

In the VideoRoom, datachannels are monodirectional: publisher can only send data, subscribers can only receive data. TextRoom datachannels are bidirectional, so use those if you can’t open more than one.

Thanks for the clarification, I really appreciate it!

Do you have any suggestions of other software aside uv4l that could be used to connect to Janus from a raspberry pi to send video and receive data on datachannels?