Dronekit-sitl 无法绑定到默认端口 5760。

huangapple go评论68阅读模式
英文:

Dronekit-sitl fails to bind on default port 5760

问题

在我的Windows 10计算机上,我已经在Python 3虚拟环境中安装了dronekit-sitl,并且以前通过运行 dronekit-sitl copter 来使用它,没有任何问题。然而,从今天开始,我遇到了一个似乎是权限问题的情况,当尝试执行ArduCopter sitl时。

$ dronekit-sitl copter
os: win, apm: copter, release: stable
SITL已经下载并解压。
准备启动。
执行:C:\Users\kyrlon\.dronekit\sitl\copter-3.3\apm.exe --home=-35.363261,149.165230,584,353 --model=quad -I 0
SITL-0> 在-35.363261,149.165230,584,353处以1.0的速度启动四旋翼模型
SITL-0.stderr> 为0绑定端口5760
启动草图 'ArduCopter'
在端口5760上绑定失败 - 操作不允许
开始SITL输入

不确定是什么导致了新的操作权限问题,我尝试重新启动一个新的Python环境,但即使完全关闭计算机后,我仍然遇到了上面显示的错误。

英文:

I have dronekit-sitl installed in a python3 virtual environment on my Windows 10 machine and have used it before by running dronekit-sitl copter with no issues. However, as of today I am running across what seems to be a permission issue when trying to execute the ArduCopter sitl.

$ dronekit-sitl copter
os: win, apm: copter, release: stable
SITL already Downloaded and Extracted.
Ready to boot.
Execute: C:\Users\kyrlon\.dronekit\sitl\copter-3.3\apm.exe --home=-35.363261,149.165230,584,353 --model=quad -I 0
SITL-0> Started model quad at -35.363261,149.165230,584,353 at speed 1.0
SITL-0.stderr> bind port 5760 for 0
Starting sketch 'ArduCopter'
bind failed on port 5760 - Operation not permitted
Starting SITL input

Not sure what might have triggered a new operation permission issue, and I tried to start over with a fresh Python environment, but even after a complete PC shutdown, I am still having the error as shown above.

答案1

得分: 1

It turns out that having docker on my system was the culprit and excluding the port I was attempting to use as mentioned in this SO post that led me to this github issue. Running the command in an elevated terminal:

netsh interface ipv4 show excludedportrange protocol=tcp

Provided me the results of the following excluded ports:

协议 tcp 端口排除范围

起始端口    终止端口
----------    --------
      1496        1595
      1658        1757
      1758        1857
      1858        1957
      1958        2057
      2058        2157
      2180        2279
      2280        2379
      2380        2479
      2480        2579
      2702        2801
      2802        2901
      2902        3001
      3002        3101
      3102        3201
      3202        3301
      3390        3489
      3490        3589
      3590        3689
      3693        3792
      3793        3892
      3893        3992
      3993        4092
      4093        4192
      4193        4292
      4293        4392
      4393        4492
      4493        4592
      4593        4692
      4768        4867
      4868        4967
      5041        5140
      5141        5240
      5241        5340
      5357        5357
      5358        5457
      5458        5557
      5558        5657
      5700        5700
      5701        5800
      8005        8005
      8884        8884
     15202       15301
     15302       15401
     15402       15501
     15502       15601
     15602       15701
     15702       15801
     15802       15901
     15902       16001
     16002       16101
     16102       16201
     16202       16301
     16302       16401
     16402       16501
     16502       16601
     16602       16701
     16702       16801
     16802       16901
     16993       17092
     17093       17192
     50000       50059     *

* - Administered port exclusions.

Turns out that docker or possibly Hyper-V excluded the range that included 5760:

5701        5800

And as mentioned from the github issue, I probably resolved this issue before after a set number of restarts that incremented the port ranges, or possibly got lucky in the past starting dronekit-sitl before docker ran on my system.
Either way, to resolve this issue of Operation not permitted, running the command as admin:

net stop winnat
net start winnat

solved the issue with dronekit-sitl without having to specify a different port besides the default 5760.

英文:

It turns out that having docker on my system was the culprit and excluding the port I was attempting to use as mentioned in this SO post that led me to this github issue. Running the command in an elevated terminal:

netsh interface ipv4 show excludedportrange protocol=tcp

Provided me the results of the following excluded ports:

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
      1496        1595
      1658        1757
      1758        1857
      1858        1957
      1958        2057
      2058        2157
      2180        2279
      2280        2379
      2380        2479
      2480        2579
      2702        2801
      2802        2901
      2902        3001
      3002        3101
      3102        3201
      3202        3301
      3390        3489
      3490        3589
      3590        3689
      3693        3792
      3793        3892
      3893        3992
      3993        4092
      4093        4192
      4193        4292
      4293        4392
      4393        4492
      4493        4592
      4593        4692
      4768        4867
      4868        4967
      5041        5140
      5141        5240
      5241        5340
      5357        5357
      5358        5457
      5458        5557
      5558        5657
      5700        5700
      5701        5800
      8005        8005
      8884        8884
     15202       15301
     15302       15401
     15402       15501
     15502       15601
     15602       15701
     15702       15801
     15802       15901
     15902       16001
     16002       16101
     16102       16201
     16202       16301
     16302       16401
     16402       16501
     16502       16601
     16602       16701
     16702       16801
     16802       16901
     16993       17092
     17093       17192
     50000       50059     *

* - Administered port exclusions.

Turns out that docker or possibly Hyper-V excluded the range that included 5760:

5701        5800

And as mentioned from the github issue, I probably resolved this issue before after a set number of restarts that incremented the port ranges, or possibly got lucky in the past starting dronekit-sitl before docker ran on my system.
Either way, to resolve this issue of Operation not permitted, running the command as admin:

net stop winnat
net start winnat

solved the issue with dronekit-sitl without having to specify a different port besides the default 5760.

huangapple
  • 本文由 发表于 2023年2月19日 00:59:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/75494908.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定