Skip to content

Commit 9fcb3cf

Browse files
committed
README - Installation
1 parent ac25f79 commit 9fcb3cf

File tree

3 files changed

+43
-27
lines changed

3 files changed

+43
-27
lines changed

ArduinoOTA.png

16.8 KB
Loading

README.md

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33

44
This library allows you to update sketches on your board over WiFi or Ethernet.
55

6-
The library is a modification of the Arduino WiFi101OTA library. For more information about how to use this library please visit
7-
https://www.arduino.cc/en/Reference/WiFi101OTA
6+
The library is a modification of the Arduino WiFi101OTA library.
87

9-
## Supported microcontrollers
8+
![network port in IDE](ArduinoOTA.png)
9+
10+
## Supported micro-controllers
1011

1112
* ATmega AVR with at least 64 kB of flash (Arduino Mega, [MegaCore](https://github.com/MCUdude/MegaCore) MCUs, MightyCore 1284p and 644)
1213
* Arduino SAMD boards like Zero, M0 or MKR
1314
* nRF5 board supported by [nRF5 core](https://github.com/sandeepmistry/arduino-nRF5).
1415

15-
## Supported libraries
16+
## Supported networking libraries
1617

1718
* Ethernet library - shields and modules with Wiznet 5100, 5200 and 5500 chips
1819
* WiFi101 - WiFi101 shield and MKR 1000
@@ -26,31 +27,29 @@ UIPEthernet, WiFiSpi and WiFi library don't support UDP multicast for MDNS, so A
2627

2728
WiFiEsp library for esp8266 with AT firmware failed tests and there is no easy fix.
2829

29-
## ATmega support
30+
## Installation
3031

31-
The size of networking library and SD library limit the use of ArduinoOTA library to ATmega MCUs with at least 64 kB flash memory. There are other network upload options for here excluded ATmega328p ([Ariadne bootloader](https://github.com/loathingKernel/ariadne-bootloader) for Wiznet chips, [WiFiLink firmware](https://github.com/jandrassy/arduino-firmware-wifilink) for the esp8266).
32+
The library is in Library Manager of the Arduino IDE.
3233

33-
For upload over InternalStorage Optiboot bootloader with [`copy_flash_pages` function](https://github.com/Optiboot/optiboot/pull/269) is required. Arduino AVR package doesn't use Optiboot for Arduino Mega. For Arduino Mega you can download [my boards definitions](https://github.com/jandrassy/my_boards) and use it [to burn](https://arduino.stackexchange.com/questions/473/how-do-i-burn-the-bootloader) the modified Optiboot and to upload sketches to your Mega over USB and over network.
34+
Arduino SAMD boards (Zero, M0, MKR) are supported 'out of the box'.
3435

35-
For SDStorage a 'SD bootloader' is required to load the uploaded file from the SD card. There is no good SD bootloader. 2boots works only with not available old types of SD cards and zevero/avr_boot doesn't yet support USB upload of sketch. The SDStorage was tested with zevero/avr_boot. The ATmega_SD example shows how to use this ArduinoOTA library with SD bootloader.
36+
For nRF5 boards two lines need to be added to platform.txt file of the nRF5 Arduino package (until the PR that adds them is accepted and included in a release). Only nRF51 was tested until now. For details scroll down.
3637

37-
To use remote upload from IDE with SDStorage or InternalStorage, you must add some lines to platform.txt file of the boards package. Packages are located in ~/.arduino15/packages/ on Linux and %userprofile%\AppData\Local\Arduino15\packages\ on Windows (AppData is a hidden folder).
38+
ATmega boards require to flash a modified Optiboot bootloader for flash write operations. Details are below.
3839

39-
The upload over ArduinoOTA library requires upload of .bin file. To set Arduino IDE to create a .bin file add following lines after existing similar lines:
40+
## ATmega support
4041

41-
```
42-
## Create output (bin file)
43-
recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" -O binary {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
44-
```
42+
The size of networking library and SD library limit the use of ArduinoOTA library to ATmega MCUs with at least 64 kB flash memory.
4543

46-
To configure the network upload tool in IDE add following lines to platform.txt file at the end of section "AVR Uploader/Programmers tools".
44+
*There are other network upload options for here excluded ATmega328p ([Ariadne bootloader](https://github.com/loathingKernel/ariadne-bootloader) for Wiznet chips, [WiFiLink firmware](https://github.com/jandrassy/arduino-firmware-wifilink) for the esp8266).*
4745

48-
```
49-
tools.avrdude.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
50-
tools.avrdude.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
51-
```
46+
For upload over InternalStorage, Optiboot bootloader with [`copy_flash_pages` function](https://github.com/Optiboot/optiboot/pull/269) is required. Arduino AVR package doesn't use Optiboot for Arduino Mega. For Arduino Mega you can download [my boards definitions](https://github.com/jandrassy/my_boards) and use it [to burn](https://arduino.stackexchange.com/questions/473/how-do-i-burn-the-bootloader) the modified Optiboot and to upload sketches to your Mega over USB and over network.
5247

53-
The Arduino AVR core has this lines but the tools.avrdude.upload.network_pattern is different (for Yun). Change it to this version. The upload tool is installed with Arduino AVR core package. At least version 1.2 of the arduinoOTA tool is required.
48+
For SDStorage a 'SD bootloader' is required to load the uploaded file from the SD card. There is no good SD bootloader. 2boots works only with not available old types of SD cards and zevero/avr_boot doesn't yet support USB upload of sketch. The SDStorage was tested with zevero/avr_boot. The ATmega_SD example shows how to use this ArduinoOTA library with SD bootloader.
49+
50+
To use remote upload from IDE with SDStorage or InternalStorage, copy platform.local.txt from extras/avr folder, next to platform.txt in the boards package used (Arduino-avr or MCUdude packages). Packages are located in ~/.arduino15/packages/ on Linux and %userprofile%\AppData\Local\Arduino15\packages\ on Windows (AppData is a hidden folder). The platform.local.txt contains a line to create a .bin file and a line to override tools.avrdude.upload.network_pattern, because in platform.txt it is defined for Yun.
51+
52+
The IDE upload tool is installed with Arduino AVR core package. At least version 1.2 of the arduinoOTA tool is required. For upload from command line without IDE see the command template in extras/avr/platform.local.txt.
5453

5554
## nRF5 support
5655

@@ -60,18 +59,28 @@ If SoftDevice is not used, the sketch is written from address 0. For write to ad
6059

6160
For SD card update use [SDUnRF5 library](https://github.com/jandrassy/SDUnRF5).
6261

63-
To use remote upload from IDE, add following lines to sandeepmistry/hardware/nRF5/0.6.0/platform.txt at the end of section "OpenOCD sketch upload":
64-
65-
```
66-
tools.openocd.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
67-
tools.openocd.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
68-
```
62+
To use remote upload from IDE, add lines from [this PR](https://github.com/sandeepmistry/arduino-nRF5/pull/327/commits/4b70ae7207124bd92afa14e562e4f0c4d931220d) to sandeepmistry/hardware/nRF5/0.6.0/platform.txt at the end of section "OpenOCD sketch upload":
6963

70-
If you use SoftDevice, stop BLE before applying update. Use `OTEthernet.beforeApply` to register a callback function. For example in setup `ArduinoOTA.beforeApply(shutdown);` and add the function to to sketch:
64+
If you use SoftDevice, stop BLE before applying update. Use `ArduinoOTA.beforeApply` to register a callback function. For example in setup `ArduinoOTA.beforeApply(shutdown);` and add the function to to sketch:
7165

7266
```
7367
void shutdown() {
7468
blePeripheral.end();
7569
}
7670
```
71+
## Boards tested
72+
73+
* SAMD
74+
- Arduino MKR Zero
75+
- Crowduino M0 SD
76+
* nRF5
77+
- Seeed Arch Link
78+
* ATmega
79+
- Arduino Mega
80+
- Badio 1284p
81+
82+
## Contribution
83+
84+
Please report tested boards.
7785

86+
Other ARM based MCUs could be added with code similar to SAMD and nRF5.

extras/avr/platform.local.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
## Create output (bin file)
3+
recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" -O binary {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
4+
5+
tools.avrdude.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
6+
7+

0 commit comments

Comments
 (0)