Skip to main content

Connection to the socket

To connect to the socket, you'll need a security token. Instructions for obtaining this token can be found in the 'Getting Started' section.

Our subscription service operates through the Socket.io library, which leverages websockets as a transport protocol. While it's possible to connect using plain websockets, please be aware that connecting with plain websockets would require you to implement a ping-pong mechanism to avoid potential disconnections. We strongly recommend utilizing a Socket.io library for a smoother experience. Not all socket.io client libraries will work as expected, the server uses verion 4.6, check first compatibilities with the selected client library.

It's important to note that not all Socket.io client libraries will function as expected. Our server utilizes version 4.6, so we advise you to first check for compatibility with your chosen client library to ensure a seamless connection."

Javascript - client versioon 4.x https://socket.io/docs/v4/client-api/

Python - client versioon 4.x https://python-socketio.readthedocs.io/en/latest/client.html

Step 1: Connect to the socket

SOCKET URL: https://cloud.rigi.tech

Js example:

const socketIOClient = require("socket.io-client");
var io = socketIOClient;
const url="https://cloud.rigi.tech";
const token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjcmVhdGVkQXQiOjE1NTgwMTc0MTkzNzQsInVwZGF0ZWRBdCI6MTU1ODAxNzQxOTM3NCwiaWQiOjEsImVtYWlsIjoiY25wMTk4NEBnbWFpbC5jb20iLCJ1c2VybmFtZSI6ImNhcmxvcyIsImluaXRpYWxSb3V0ZSI6bnVsbCwicm9sZSI6MSwiaWF0IjoxNjI4NjEzNjk5LCJleHAiOjE2NDMwMTM2OTl9.pr-iNy3o_RG5Fzwqu80tNzVltKddbB09RTx9aEOTaeI"
const socket = io(url+"?token="+token, {
transports: ['websocket']
});
socket.on('connect', (s) => {
console.debug("connected")
});

Step 2: Using the socket

Once you have successfully established a connection, you can begin subscribing to topics to receive real-time drone data and send commands to the drone. Detailed information on these actions can be found in the following sections.