Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does OTA work in arduino-cli? #69

Closed
brusherru opened this issue Oct 19, 2018 · 4 comments · Fixed by #1333
Closed

Does OTA work in arduino-cli? #69

brusherru opened this issue Oct 19, 2018 · 4 comments · Fixed by #1333
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@brusherru
Copy link

I see networkBoards list when I call arduino-cli board list --format json, but it's always empty, even when I see the board in the Arduino IDE.

I tested it with esp8266:esp8266:wifi_slot board on MacOS Sierra.

I see that you are using monitor.Network() in the board/list.go, so I assume it should work. But it's not.

Is this a real bug or it just not implemented yet?

@brusherru brusherru changed the title Is OTA works in arduino-cli? Does OTA work in arduino-cli? Oct 30, 2018
@LucaCerina
Copy link

+1 on this issue. The code seems to already support OTA, but boards are not listed.

I have a MKR1010 which is correctly recognized for OTA by Arduino IDE, while CLI (preview 0.32) does not list it.

@unixbigot
Copy link

unixbigot commented Jan 6, 2019

Here's a makefile snippet that provides a temporary workaround for doing OTA with the CLI:

Use make find to list network boards, and make ota to upload. Make ota takes board hostname, eg make ota DEVICE=alice. If you want to skip the zeroconf query and use the ip, do make ota IP=1.2.3.41

ota: $(OBJ)
	@if [ -z "$$IP" ] ; then \
		IP=`avahi-browse -ptr  "_arduino._tcp" | egrep ^= | cut -d\; -f4,8,9 | grep ^$$DEVICE | cut -d\; -f2` -p `avahi-browse -ptr  "_arduino._tcp" | egrep ^= | cut -d\; -f4,8,9 | grep ^$$DEVICE | cut -d\; -f3` ;\
	fi ;\
	python $(OTAPROG) -i $(IP) "--auth=$(OTAPASS)" -f $(OBJ)

find:
	@if [ `uname -s` = Darwin ] ; then \
		dns-sd -B _arduino._tcp ;\
	else \
		avahi-browse -ptr  "_arduino._tcp" | egrep ^= | cut -d\; -f4,8,9 ;\
	fi

@thekunalsaini

This comment was marked as spam.

@rsora
Copy link
Contributor

rsora commented Mar 3, 2020

@brusherru @thekunalsaini
Roberto from Arduino Team here,
Currently OTA support is not included in the CLI.
Our plan is to implement a "Pluggable discovery" feature in the near future that will allow to support OTA.

Workarounds are possible as @unixbigot reported, but there is no CLI native support ATM.

Cheers!

@rsora rsora mentioned this issue May 20, 2020
per1234 pushed a commit that referenced this issue Nov 16, 2020
* Fixing issues uncovered by stronger compiler warnings
* Adding const qualifier for parameter 'char * fmt' -> 'const char * fmt' thereby eliminating -Wwrite-strings warnings
* Adding missing cases to switch statements
* Removing unused variable 'index'
* Reording initialisation order of ArduinoIoTCloud in order to eliminate '-Wreorder' warnings
* Adding const qualifier for parameter 'char * fmt' -> 'const char * fmt' thereby eliminating -Wwrite-strings warnings
* Prefixing 'connection' with an underscore -> '_connection' in order to be consistent with all other member variables
* Preventing multiple definitions of SECRET_PASS mutually overwriting one another by prefixing the correct connection type
* Changing type of timeout intervals to type unsigned long - otherwise there is a type inconsistency and probable bug when checking the connection time interval
* Removing duplicate ERROR case
* Adding missing cases and simplifying code
* Changing type of timeout intervals to type unsigned long - otherwise there is a type inconsistency and probable bug when checking the connection time interval
* Using default clause for missing switch statements (no constant defined for state DISCONNECTING)
* Fix -Wreorder error
* Simplifying WifiConnectionManager
* Replacing '#warning' with '#pragma message'
* Fixing comparison between unsigned and signed type
* Ignoring error stemming from warning about deprecated functions
* Rectifying signed/unsigned comparison
* char * arrays should be compared via strcmp
* Commenting out unused parameters in order to prevent -Wunused-parameter
* Removing unused variable connection buffer
* Adding missing switch cases
* Correct initlisation of struct tm t
* Correct printf specifier for unsigned long it is %lu
* Adding missing initializer for tm_isdst
* Performing cast in order to guarantuee correct comparison
* Fixing formatting
* Disabling '-Wunused-variable' to prevent false positives
* Removing prefix 'WIFI_' and 'GSM_' because Arduino Create is looking for 'SECRET_SSID', 'SECRET_PASS', etc. when importing a example project into Arduino Create
* Correcting comment
* Removing prefix of parameter 'newState' wherever used, since prefixes usually indicate class members
* Consting parameter 'newState' - defensive programming
@per1234 per1234 reopened this Mar 30, 2021
per1234 added a commit that referenced this issue Aug 9, 2021
Suppress text output when in --format json mode
@cmaglie cmaglie linked a pull request Aug 20, 2021 that will close this issue
5 tasks
@rsora rsora added type: imperfection Perceived defect in any part of project topic: core labels Sep 22, 2021
@per1234 per1234 added conclusion: resolved Issue was resolved topic: code Related to content of the project itself labels Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants