Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to specify ArduinoOTA TCP port?#8449

Unanswered
877dev asked this question inQ&A
Discussion options

My home network (Unifi) has all the arduino devices on a separate VLAN.
To perform OTA update the following needs to happen:

local network -> arduino network, dst 8266/udparduino network -> local network, dst $yourpick/tcp

Seems thatArduinoOTA.setPort(8266); can specify the UDP port within the sketch, but nowhere I can find for the seemingly random TCP port needed for the other direction, so I can create firewall rule.

Is it possible to specify this in the library files (maybe ArduinoOTA.h uint16_t _ota_port = 0; ? Or even better via ArduinoIDE?

Another option is to set this via editingespota.py in the section:

group.add_option("-P", "--host_port",    dest = "host_port",    type = "int",    help = "Host server ota Port. Default random 10000-60000",    default = random.randint(10000,60000)

But is this a bit dodgy?

Source article which led me here:https://tech.fawk.eu/?p=63&unapproved=9&moderation-hash=fbcaaee59e18b868ceb1e9e21f79b08a#comment-9

You must be logged in to vote

Replies: 2 comments

Comment options

Ok I have it working now, if anyone could advise if there is an issue with this:

Edit this file with IDLE python editor:
C:\Users\USERNAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\tools\espota.py

And change:

  group.add_option("-P", "--host_port",    dest = "host_port",    type = "int",    help = "Host server ota Port. Default random 10000-60000",    default = random.randint(10000,60000)

to whatever port you want i.e. 12345

  group.add_option("-P", "--host_port",    dest = "host_port",    type = "int",    help = "Host server ota Port. Default random 10000-60000",    default = 12345

Anyone see an issue/easier way?

You must be logged in to vote
0 replies
Comment options

I'm using VSCode and platform and was able to change the behavior usingupload_flags adding--host_port=32623 to control DST port.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@877dev@dynek

[8]ページ先頭

©2009-2025 Movatter.jp