How to listen to different UDP ports on the same address within the same process in Node.js
I'm writing a Node.js app to control a small drone. Here are the instructions from the SDK:
Use Wi-Fi to establish a connection between the Tello and PC, Mac, or mobile device.
Send Command & Receive Response
Tello IP: 192.168.10.1 UDP PORT: 8889 <<-->> PC/Mac/Mobile
Step 1: Set up a UDP client on the PC, Mac, or mobile device to send and receive message from the Tello via the same port.
Step 2: Before sending any other commands, send 'command' to the Tello via UDP PORT 8889 to initiate SDK mode.
Receive Tello State
Tello IP: 192.168.10.1 -->> PC/Mac/Mobile UDP Server: 0.0.0.0 UDP PORT: 8890
Step 3: Set up a UDP server on the PC, Mac, or mobile device and check the message from IP 0.0.0.0 via UDP PORT 8890. Steps 1 and 2 must be completed before attempting step 3.
Receive Tello Video Stream
Tello IP: 192.168.10.1 -->> PC/Mac/Mobile UDP Server: 0.0.0.0 UDP PORT: 11111
Step 4: Set up a UDP server on the PC, Mac, or mobile device and check the message from IP 0.0.0.0 via UDP PORT 11111.
Step 5: Send 'streamon' to the Tello via UDP PORT 8889 to start streaming. Steps 1 and 2 must be completed before attempting step 5.
The Command & Receive part works like a charm and I am sending and receiving datagrams to/from the drone on port 8889. My problem is that it looks like I'm not receiving any State or Video Stream messages on the other ports and I'm pretty sure that it's not a problem with the drone but something I'm not setting up properly with Node. Can anyone see where the problem is in my implementation. Here is my code:
tello.ts
import dgram from 'dgram';
export class Tello {
private LOCAL_IP_ = '0.0.0.0';
private TELLO_IP_ = '192.168.10.1';
private COMMAND_PORT_ = 8889;
private commandSocket_ = dgram.createSocket('udp4');
private STATE_PORT_ = 8890;
private stateSocket_ = dgram.createSocket('udp4');
private VIDEO_PORT_ = 11111;
private videoSocket_ = dgram.createSocket('udp4');
constructor() {}
startCommandSocket() {
this.commandSocket_.addListener('message', (msg, rinfo) => {
const message = msg.toString();
console.log(`from ${rinfo.address}: ${message}`);
});
this.commandSocket_.bind(this.COMMAND_PORT_, this.LOCAL_IP_, () => {
console.log('Started listening on the command socket');
});
}
startStateSocket() {
this.stateSocket_.addListener('message', (msg, rinfo) => {
const message = msg.toString();
console.log(`from ${rinfo.address}: ${message}`);
});
this.stateSocket_.bind(this.STATE_PORT_, this.LOCAL_IP_, () => {
console.log('Started listening on the state socket');
});
}
startVideoSocket() {
this.videoSocket_.addListener('message', (msg, rinfo) => {
console.log('receiving video');
const message = msg.toString();
console.log(`from ${rinfo.address}: ${message}`);
});
this.videoSocket_.bind(this.VIDEO_PORT_, this.LOCAL_IP_, () => {
console.log('Started listening on the video socket');
});
}
private sendCommand_(command: string) {
// As this is sent over UDP and we have no guarantee that the packet is received or a response given
// we are sending the command 5 times in a row to add robustess and resiliency.
//for (let i = 0; i < 5; i++) {
this.commandSocket_.send(command, this.COMMAND_PORT_, this.TELLO_IP_);
//}
console.log(`sending command: ${command} to ${this.TELLO_IP_}`);
}
/**
* Enter SDK mode.
*/
command() {
this.sendCommand_('command');
}
/**
* Auto takeoff.
*/
takeoff() {
this.sendCommand_('takeoff');
}
/**
* Auto landing.
*/
land() {
this.sendCommand_('land');
}
streamVideoOn() {
this.sendCommand_('streamon');
}
streamVideoOff() {
this.sendCommand_('streamoff');
}
...
}
index.ts
import { waitForSeconds } from './utils';
import { Tello } from './tello'
const main = async () => {
const tello = new Tello();
tello.startCommandSocket();
await waitForSeconds(1);
tello.command();
await waitForSeconds(1);
tello.startStateSocket();
await waitForSeconds(1);
tello.startVideoSocket();
await waitForSeconds(1);
tello.streamVideoOn();
await waitForSeconds(1);
tello.takeoff();
await waitForSeconds(10);
tello.land();
};
main();
javascript node.js typescript udp dji-sdk
add a comment |
I'm writing a Node.js app to control a small drone. Here are the instructions from the SDK:
Use Wi-Fi to establish a connection between the Tello and PC, Mac, or mobile device.
Send Command & Receive Response
Tello IP: 192.168.10.1 UDP PORT: 8889 <<-->> PC/Mac/Mobile
Step 1: Set up a UDP client on the PC, Mac, or mobile device to send and receive message from the Tello via the same port.
Step 2: Before sending any other commands, send 'command' to the Tello via UDP PORT 8889 to initiate SDK mode.
Receive Tello State
Tello IP: 192.168.10.1 -->> PC/Mac/Mobile UDP Server: 0.0.0.0 UDP PORT: 8890
Step 3: Set up a UDP server on the PC, Mac, or mobile device and check the message from IP 0.0.0.0 via UDP PORT 8890. Steps 1 and 2 must be completed before attempting step 3.
Receive Tello Video Stream
Tello IP: 192.168.10.1 -->> PC/Mac/Mobile UDP Server: 0.0.0.0 UDP PORT: 11111
Step 4: Set up a UDP server on the PC, Mac, or mobile device and check the message from IP 0.0.0.0 via UDP PORT 11111.
Step 5: Send 'streamon' to the Tello via UDP PORT 8889 to start streaming. Steps 1 and 2 must be completed before attempting step 5.
The Command & Receive part works like a charm and I am sending and receiving datagrams to/from the drone on port 8889. My problem is that it looks like I'm not receiving any State or Video Stream messages on the other ports and I'm pretty sure that it's not a problem with the drone but something I'm not setting up properly with Node. Can anyone see where the problem is in my implementation. Here is my code:
tello.ts
import dgram from 'dgram';
export class Tello {
private LOCAL_IP_ = '0.0.0.0';
private TELLO_IP_ = '192.168.10.1';
private COMMAND_PORT_ = 8889;
private commandSocket_ = dgram.createSocket('udp4');
private STATE_PORT_ = 8890;
private stateSocket_ = dgram.createSocket('udp4');
private VIDEO_PORT_ = 11111;
private videoSocket_ = dgram.createSocket('udp4');
constructor() {}
startCommandSocket() {
this.commandSocket_.addListener('message', (msg, rinfo) => {
const message = msg.toString();
console.log(`from ${rinfo.address}: ${message}`);
});
this.commandSocket_.bind(this.COMMAND_PORT_, this.LOCAL_IP_, () => {
console.log('Started listening on the command socket');
});
}
startStateSocket() {
this.stateSocket_.addListener('message', (msg, rinfo) => {
const message = msg.toString();
console.log(`from ${rinfo.address}: ${message}`);
});
this.stateSocket_.bind(this.STATE_PORT_, this.LOCAL_IP_, () => {
console.log('Started listening on the state socket');
});
}
startVideoSocket() {
this.videoSocket_.addListener('message', (msg, rinfo) => {
console.log('receiving video');
const message = msg.toString();
console.log(`from ${rinfo.address}: ${message}`);
});
this.videoSocket_.bind(this.VIDEO_PORT_, this.LOCAL_IP_, () => {
console.log('Started listening on the video socket');
});
}
private sendCommand_(command: string) {
// As this is sent over UDP and we have no guarantee that the packet is received or a response given
// we are sending the command 5 times in a row to add robustess and resiliency.
//for (let i = 0; i < 5; i++) {
this.commandSocket_.send(command, this.COMMAND_PORT_, this.TELLO_IP_);
//}
console.log(`sending command: ${command} to ${this.TELLO_IP_}`);
}
/**
* Enter SDK mode.
*/
command() {
this.sendCommand_('command');
}
/**
* Auto takeoff.
*/
takeoff() {
this.sendCommand_('takeoff');
}
/**
* Auto landing.
*/
land() {
this.sendCommand_('land');
}
streamVideoOn() {
this.sendCommand_('streamon');
}
streamVideoOff() {
this.sendCommand_('streamoff');
}
...
}
index.ts
import { waitForSeconds } from './utils';
import { Tello } from './tello'
const main = async () => {
const tello = new Tello();
tello.startCommandSocket();
await waitForSeconds(1);
tello.command();
await waitForSeconds(1);
tello.startStateSocket();
await waitForSeconds(1);
tello.startVideoSocket();
await waitForSeconds(1);
tello.streamVideoOn();
await waitForSeconds(1);
tello.takeoff();
await waitForSeconds(10);
tello.land();
};
main();
javascript node.js typescript udp dji-sdk
1
Although that won't solve your issue, just a small thing I noticed: you don't need to bind your COMMAND_PORT to local port 8889. You need to send() commands to port 8889, but your client socket can be opened in any port really.
– Lucio Paiva
Jan 1 at 16:01
1
Your local servers seem to be correct. I suggest you try opening a UDP client and sending some messages to your local ports 8890 and 11111 to make sure they're working properly. You may find out that the problem is something else.
– Lucio Paiva
Jan 1 at 16:03
@LucioPaiva As per your recommandations I have started a seperate Node process on my computer and did a simple socket.send('Foo', 8890) and socket.send('Bar', 11111) and both were picked up by my app. My understanding of UDP networking is quite limited. Was that a relevant test? What does that indicate? Does that mean that my code is fine and there is something else preventing the Tello from communicating with my app? If so, any idea what the problem could be?
– neoflash
Jan 1 at 19:02
1
Cool, that showed your UDP servers are working. Next I would try running that separate Node process from another machine to see if the servers are still reachable if accessed remotely. If they are, then I would probably take another look at the drone documentation to see if I missed something.
– Lucio Paiva
Jan 1 at 21:26
add a comment |
I'm writing a Node.js app to control a small drone. Here are the instructions from the SDK:
Use Wi-Fi to establish a connection between the Tello and PC, Mac, or mobile device.
Send Command & Receive Response
Tello IP: 192.168.10.1 UDP PORT: 8889 <<-->> PC/Mac/Mobile
Step 1: Set up a UDP client on the PC, Mac, or mobile device to send and receive message from the Tello via the same port.
Step 2: Before sending any other commands, send 'command' to the Tello via UDP PORT 8889 to initiate SDK mode.
Receive Tello State
Tello IP: 192.168.10.1 -->> PC/Mac/Mobile UDP Server: 0.0.0.0 UDP PORT: 8890
Step 3: Set up a UDP server on the PC, Mac, or mobile device and check the message from IP 0.0.0.0 via UDP PORT 8890. Steps 1 and 2 must be completed before attempting step 3.
Receive Tello Video Stream
Tello IP: 192.168.10.1 -->> PC/Mac/Mobile UDP Server: 0.0.0.0 UDP PORT: 11111
Step 4: Set up a UDP server on the PC, Mac, or mobile device and check the message from IP 0.0.0.0 via UDP PORT 11111.
Step 5: Send 'streamon' to the Tello via UDP PORT 8889 to start streaming. Steps 1 and 2 must be completed before attempting step 5.
The Command & Receive part works like a charm and I am sending and receiving datagrams to/from the drone on port 8889. My problem is that it looks like I'm not receiving any State or Video Stream messages on the other ports and I'm pretty sure that it's not a problem with the drone but something I'm not setting up properly with Node. Can anyone see where the problem is in my implementation. Here is my code:
tello.ts
import dgram from 'dgram';
export class Tello {
private LOCAL_IP_ = '0.0.0.0';
private TELLO_IP_ = '192.168.10.1';
private COMMAND_PORT_ = 8889;
private commandSocket_ = dgram.createSocket('udp4');
private STATE_PORT_ = 8890;
private stateSocket_ = dgram.createSocket('udp4');
private VIDEO_PORT_ = 11111;
private videoSocket_ = dgram.createSocket('udp4');
constructor() {}
startCommandSocket() {
this.commandSocket_.addListener('message', (msg, rinfo) => {
const message = msg.toString();
console.log(`from ${rinfo.address}: ${message}`);
});
this.commandSocket_.bind(this.COMMAND_PORT_, this.LOCAL_IP_, () => {
console.log('Started listening on the command socket');
});
}
startStateSocket() {
this.stateSocket_.addListener('message', (msg, rinfo) => {
const message = msg.toString();
console.log(`from ${rinfo.address}: ${message}`);
});
this.stateSocket_.bind(this.STATE_PORT_, this.LOCAL_IP_, () => {
console.log('Started listening on the state socket');
});
}
startVideoSocket() {
this.videoSocket_.addListener('message', (msg, rinfo) => {
console.log('receiving video');
const message = msg.toString();
console.log(`from ${rinfo.address}: ${message}`);
});
this.videoSocket_.bind(this.VIDEO_PORT_, this.LOCAL_IP_, () => {
console.log('Started listening on the video socket');
});
}
private sendCommand_(command: string) {
// As this is sent over UDP and we have no guarantee that the packet is received or a response given
// we are sending the command 5 times in a row to add robustess and resiliency.
//for (let i = 0; i < 5; i++) {
this.commandSocket_.send(command, this.COMMAND_PORT_, this.TELLO_IP_);
//}
console.log(`sending command: ${command} to ${this.TELLO_IP_}`);
}
/**
* Enter SDK mode.
*/
command() {
this.sendCommand_('command');
}
/**
* Auto takeoff.
*/
takeoff() {
this.sendCommand_('takeoff');
}
/**
* Auto landing.
*/
land() {
this.sendCommand_('land');
}
streamVideoOn() {
this.sendCommand_('streamon');
}
streamVideoOff() {
this.sendCommand_('streamoff');
}
...
}
index.ts
import { waitForSeconds } from './utils';
import { Tello } from './tello'
const main = async () => {
const tello = new Tello();
tello.startCommandSocket();
await waitForSeconds(1);
tello.command();
await waitForSeconds(1);
tello.startStateSocket();
await waitForSeconds(1);
tello.startVideoSocket();
await waitForSeconds(1);
tello.streamVideoOn();
await waitForSeconds(1);
tello.takeoff();
await waitForSeconds(10);
tello.land();
};
main();
javascript node.js typescript udp dji-sdk
I'm writing a Node.js app to control a small drone. Here are the instructions from the SDK:
Use Wi-Fi to establish a connection between the Tello and PC, Mac, or mobile device.
Send Command & Receive Response
Tello IP: 192.168.10.1 UDP PORT: 8889 <<-->> PC/Mac/Mobile
Step 1: Set up a UDP client on the PC, Mac, or mobile device to send and receive message from the Tello via the same port.
Step 2: Before sending any other commands, send 'command' to the Tello via UDP PORT 8889 to initiate SDK mode.
Receive Tello State
Tello IP: 192.168.10.1 -->> PC/Mac/Mobile UDP Server: 0.0.0.0 UDP PORT: 8890
Step 3: Set up a UDP server on the PC, Mac, or mobile device and check the message from IP 0.0.0.0 via UDP PORT 8890. Steps 1 and 2 must be completed before attempting step 3.
Receive Tello Video Stream
Tello IP: 192.168.10.1 -->> PC/Mac/Mobile UDP Server: 0.0.0.0 UDP PORT: 11111
Step 4: Set up a UDP server on the PC, Mac, or mobile device and check the message from IP 0.0.0.0 via UDP PORT 11111.
Step 5: Send 'streamon' to the Tello via UDP PORT 8889 to start streaming. Steps 1 and 2 must be completed before attempting step 5.
The Command & Receive part works like a charm and I am sending and receiving datagrams to/from the drone on port 8889. My problem is that it looks like I'm not receiving any State or Video Stream messages on the other ports and I'm pretty sure that it's not a problem with the drone but something I'm not setting up properly with Node. Can anyone see where the problem is in my implementation. Here is my code:
tello.ts
import dgram from 'dgram';
export class Tello {
private LOCAL_IP_ = '0.0.0.0';
private TELLO_IP_ = '192.168.10.1';
private COMMAND_PORT_ = 8889;
private commandSocket_ = dgram.createSocket('udp4');
private STATE_PORT_ = 8890;
private stateSocket_ = dgram.createSocket('udp4');
private VIDEO_PORT_ = 11111;
private videoSocket_ = dgram.createSocket('udp4');
constructor() {}
startCommandSocket() {
this.commandSocket_.addListener('message', (msg, rinfo) => {
const message = msg.toString();
console.log(`from ${rinfo.address}: ${message}`);
});
this.commandSocket_.bind(this.COMMAND_PORT_, this.LOCAL_IP_, () => {
console.log('Started listening on the command socket');
});
}
startStateSocket() {
this.stateSocket_.addListener('message', (msg, rinfo) => {
const message = msg.toString();
console.log(`from ${rinfo.address}: ${message}`);
});
this.stateSocket_.bind(this.STATE_PORT_, this.LOCAL_IP_, () => {
console.log('Started listening on the state socket');
});
}
startVideoSocket() {
this.videoSocket_.addListener('message', (msg, rinfo) => {
console.log('receiving video');
const message = msg.toString();
console.log(`from ${rinfo.address}: ${message}`);
});
this.videoSocket_.bind(this.VIDEO_PORT_, this.LOCAL_IP_, () => {
console.log('Started listening on the video socket');
});
}
private sendCommand_(command: string) {
// As this is sent over UDP and we have no guarantee that the packet is received or a response given
// we are sending the command 5 times in a row to add robustess and resiliency.
//for (let i = 0; i < 5; i++) {
this.commandSocket_.send(command, this.COMMAND_PORT_, this.TELLO_IP_);
//}
console.log(`sending command: ${command} to ${this.TELLO_IP_}`);
}
/**
* Enter SDK mode.
*/
command() {
this.sendCommand_('command');
}
/**
* Auto takeoff.
*/
takeoff() {
this.sendCommand_('takeoff');
}
/**
* Auto landing.
*/
land() {
this.sendCommand_('land');
}
streamVideoOn() {
this.sendCommand_('streamon');
}
streamVideoOff() {
this.sendCommand_('streamoff');
}
...
}
index.ts
import { waitForSeconds } from './utils';
import { Tello } from './tello'
const main = async () => {
const tello = new Tello();
tello.startCommandSocket();
await waitForSeconds(1);
tello.command();
await waitForSeconds(1);
tello.startStateSocket();
await waitForSeconds(1);
tello.startVideoSocket();
await waitForSeconds(1);
tello.streamVideoOn();
await waitForSeconds(1);
tello.takeoff();
await waitForSeconds(10);
tello.land();
};
main();
javascript node.js typescript udp dji-sdk
javascript node.js typescript udp dji-sdk
asked Jan 1 at 14:04
neoflashneoflash
1,2781932
1,2781932
1
Although that won't solve your issue, just a small thing I noticed: you don't need to bind your COMMAND_PORT to local port 8889. You need to send() commands to port 8889, but your client socket can be opened in any port really.
– Lucio Paiva
Jan 1 at 16:01
1
Your local servers seem to be correct. I suggest you try opening a UDP client and sending some messages to your local ports 8890 and 11111 to make sure they're working properly. You may find out that the problem is something else.
– Lucio Paiva
Jan 1 at 16:03
@LucioPaiva As per your recommandations I have started a seperate Node process on my computer and did a simple socket.send('Foo', 8890) and socket.send('Bar', 11111) and both were picked up by my app. My understanding of UDP networking is quite limited. Was that a relevant test? What does that indicate? Does that mean that my code is fine and there is something else preventing the Tello from communicating with my app? If so, any idea what the problem could be?
– neoflash
Jan 1 at 19:02
1
Cool, that showed your UDP servers are working. Next I would try running that separate Node process from another machine to see if the servers are still reachable if accessed remotely. If they are, then I would probably take another look at the drone documentation to see if I missed something.
– Lucio Paiva
Jan 1 at 21:26
add a comment |
1
Although that won't solve your issue, just a small thing I noticed: you don't need to bind your COMMAND_PORT to local port 8889. You need to send() commands to port 8889, but your client socket can be opened in any port really.
– Lucio Paiva
Jan 1 at 16:01
1
Your local servers seem to be correct. I suggest you try opening a UDP client and sending some messages to your local ports 8890 and 11111 to make sure they're working properly. You may find out that the problem is something else.
– Lucio Paiva
Jan 1 at 16:03
@LucioPaiva As per your recommandations I have started a seperate Node process on my computer and did a simple socket.send('Foo', 8890) and socket.send('Bar', 11111) and both were picked up by my app. My understanding of UDP networking is quite limited. Was that a relevant test? What does that indicate? Does that mean that my code is fine and there is something else preventing the Tello from communicating with my app? If so, any idea what the problem could be?
– neoflash
Jan 1 at 19:02
1
Cool, that showed your UDP servers are working. Next I would try running that separate Node process from another machine to see if the servers are still reachable if accessed remotely. If they are, then I would probably take another look at the drone documentation to see if I missed something.
– Lucio Paiva
Jan 1 at 21:26
1
1
Although that won't solve your issue, just a small thing I noticed: you don't need to bind your COMMAND_PORT to local port 8889. You need to send() commands to port 8889, but your client socket can be opened in any port really.
– Lucio Paiva
Jan 1 at 16:01
Although that won't solve your issue, just a small thing I noticed: you don't need to bind your COMMAND_PORT to local port 8889. You need to send() commands to port 8889, but your client socket can be opened in any port really.
– Lucio Paiva
Jan 1 at 16:01
1
1
Your local servers seem to be correct. I suggest you try opening a UDP client and sending some messages to your local ports 8890 and 11111 to make sure they're working properly. You may find out that the problem is something else.
– Lucio Paiva
Jan 1 at 16:03
Your local servers seem to be correct. I suggest you try opening a UDP client and sending some messages to your local ports 8890 and 11111 to make sure they're working properly. You may find out that the problem is something else.
– Lucio Paiva
Jan 1 at 16:03
@LucioPaiva As per your recommandations I have started a seperate Node process on my computer and did a simple socket.send('Foo', 8890) and socket.send('Bar', 11111) and both were picked up by my app. My understanding of UDP networking is quite limited. Was that a relevant test? What does that indicate? Does that mean that my code is fine and there is something else preventing the Tello from communicating with my app? If so, any idea what the problem could be?
– neoflash
Jan 1 at 19:02
@LucioPaiva As per your recommandations I have started a seperate Node process on my computer and did a simple socket.send('Foo', 8890) and socket.send('Bar', 11111) and both were picked up by my app. My understanding of UDP networking is quite limited. Was that a relevant test? What does that indicate? Does that mean that my code is fine and there is something else preventing the Tello from communicating with my app? If so, any idea what the problem could be?
– neoflash
Jan 1 at 19:02
1
1
Cool, that showed your UDP servers are working. Next I would try running that separate Node process from another machine to see if the servers are still reachable if accessed remotely. If they are, then I would probably take another look at the drone documentation to see if I missed something.
– Lucio Paiva
Jan 1 at 21:26
Cool, that showed your UDP servers are working. Next I would try running that separate Node process from another machine to see if the servers are still reachable if accessed remotely. If they are, then I would probably take another look at the drone documentation to see if I missed something.
– Lucio Paiva
Jan 1 at 21:26
add a comment |
2 Answers
2
active
oldest
votes
Did you open your firewall to accept UDP ports 8890 / 11111 ?
Open port 8890/udp and 11111/udp in your laptop firewall to receive Tello telemetry data.
On Linux
$ sudo firewall-cmd --permanent --add-port=8890/udp
$ sudo firewall-cmd --permanent --add-port=11111/udp
On Mac, use System Preferences to open the ports.
Open System Preferences > Security & Privacy > Firewall > Firewall Options
Click the + / Add button
Choose 'node' application from the Applications folder and click Add.
Ensure that the option next to the application is set to Allow incoming connections.
Click OK.
I'm on Windows 10 but you figured out the problem and I was able to open the ports and now everything works perfectly.
– neoflash
Jan 2 at 14:40
add a comment |
Here is the sample code that receives and decodes the h264 video stream provided by Tello SDK team, using the "streamon" command. https://github.com/dji-sdk/Tello-Python.
Please refer to doc/reademe.pdf and the source code under the path of h264 decoder for the specific processing method of the received video stream data.
Before you run the sample code, you should install some dependencies by using the install script.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53996098%2fhow-to-listen-to-different-udp-ports-on-the-same-address-within-the-same-process%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Did you open your firewall to accept UDP ports 8890 / 11111 ?
Open port 8890/udp and 11111/udp in your laptop firewall to receive Tello telemetry data.
On Linux
$ sudo firewall-cmd --permanent --add-port=8890/udp
$ sudo firewall-cmd --permanent --add-port=11111/udp
On Mac, use System Preferences to open the ports.
Open System Preferences > Security & Privacy > Firewall > Firewall Options
Click the + / Add button
Choose 'node' application from the Applications folder and click Add.
Ensure that the option next to the application is set to Allow incoming connections.
Click OK.
I'm on Windows 10 but you figured out the problem and I was able to open the ports and now everything works perfectly.
– neoflash
Jan 2 at 14:40
add a comment |
Did you open your firewall to accept UDP ports 8890 / 11111 ?
Open port 8890/udp and 11111/udp in your laptop firewall to receive Tello telemetry data.
On Linux
$ sudo firewall-cmd --permanent --add-port=8890/udp
$ sudo firewall-cmd --permanent --add-port=11111/udp
On Mac, use System Preferences to open the ports.
Open System Preferences > Security & Privacy > Firewall > Firewall Options
Click the + / Add button
Choose 'node' application from the Applications folder and click Add.
Ensure that the option next to the application is set to Allow incoming connections.
Click OK.
I'm on Windows 10 but you figured out the problem and I was able to open the ports and now everything works perfectly.
– neoflash
Jan 2 at 14:40
add a comment |
Did you open your firewall to accept UDP ports 8890 / 11111 ?
Open port 8890/udp and 11111/udp in your laptop firewall to receive Tello telemetry data.
On Linux
$ sudo firewall-cmd --permanent --add-port=8890/udp
$ sudo firewall-cmd --permanent --add-port=11111/udp
On Mac, use System Preferences to open the ports.
Open System Preferences > Security & Privacy > Firewall > Firewall Options
Click the + / Add button
Choose 'node' application from the Applications folder and click Add.
Ensure that the option next to the application is set to Allow incoming connections.
Click OK.
Did you open your firewall to accept UDP ports 8890 / 11111 ?
Open port 8890/udp and 11111/udp in your laptop firewall to receive Tello telemetry data.
On Linux
$ sudo firewall-cmd --permanent --add-port=8890/udp
$ sudo firewall-cmd --permanent --add-port=11111/udp
On Mac, use System Preferences to open the ports.
Open System Preferences > Security & Privacy > Firewall > Firewall Options
Click the + / Add button
Choose 'node' application from the Applications folder and click Add.
Ensure that the option next to the application is set to Allow incoming connections.
Click OK.
answered Jan 2 at 13:59


John WalickiJohn Walicki
264
264
I'm on Windows 10 but you figured out the problem and I was able to open the ports and now everything works perfectly.
– neoflash
Jan 2 at 14:40
add a comment |
I'm on Windows 10 but you figured out the problem and I was able to open the ports and now everything works perfectly.
– neoflash
Jan 2 at 14:40
I'm on Windows 10 but you figured out the problem and I was able to open the ports and now everything works perfectly.
– neoflash
Jan 2 at 14:40
I'm on Windows 10 but you figured out the problem and I was able to open the ports and now everything works perfectly.
– neoflash
Jan 2 at 14:40
add a comment |
Here is the sample code that receives and decodes the h264 video stream provided by Tello SDK team, using the "streamon" command. https://github.com/dji-sdk/Tello-Python.
Please refer to doc/reademe.pdf and the source code under the path of h264 decoder for the specific processing method of the received video stream data.
Before you run the sample code, you should install some dependencies by using the install script.
add a comment |
Here is the sample code that receives and decodes the h264 video stream provided by Tello SDK team, using the "streamon" command. https://github.com/dji-sdk/Tello-Python.
Please refer to doc/reademe.pdf and the source code under the path of h264 decoder for the specific processing method of the received video stream data.
Before you run the sample code, you should install some dependencies by using the install script.
add a comment |
Here is the sample code that receives and decodes the h264 video stream provided by Tello SDK team, using the "streamon" command. https://github.com/dji-sdk/Tello-Python.
Please refer to doc/reademe.pdf and the source code under the path of h264 decoder for the specific processing method of the received video stream data.
Before you run the sample code, you should install some dependencies by using the install script.
Here is the sample code that receives and decodes the h264 video stream provided by Tello SDK team, using the "streamon" command. https://github.com/dji-sdk/Tello-Python.
Please refer to doc/reademe.pdf and the source code under the path of h264 decoder for the specific processing method of the received video stream data.
Before you run the sample code, you should install some dependencies by using the install script.
edited Jan 2 at 10:05
answered Jan 2 at 7:37


Oliver OuOliver Ou
37414
37414
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53996098%2fhow-to-listen-to-different-udp-ports-on-the-same-address-within-the-same-process%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Although that won't solve your issue, just a small thing I noticed: you don't need to bind your COMMAND_PORT to local port 8889. You need to send() commands to port 8889, but your client socket can be opened in any port really.
– Lucio Paiva
Jan 1 at 16:01
1
Your local servers seem to be correct. I suggest you try opening a UDP client and sending some messages to your local ports 8890 and 11111 to make sure they're working properly. You may find out that the problem is something else.
– Lucio Paiva
Jan 1 at 16:03
@LucioPaiva As per your recommandations I have started a seperate Node process on my computer and did a simple socket.send('Foo', 8890) and socket.send('Bar', 11111) and both were picked up by my app. My understanding of UDP networking is quite limited. Was that a relevant test? What does that indicate? Does that mean that my code is fine and there is something else preventing the Tello from communicating with my app? If so, any idea what the problem could be?
– neoflash
Jan 1 at 19:02
1
Cool, that showed your UDP servers are working. Next I would try running that separate Node process from another machine to see if the servers are still reachable if accessed remotely. If they are, then I would probably take another look at the drone documentation to see if I missed something.
– Lucio Paiva
Jan 1 at 21:26