You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/firmware_update.md
+53-10Lines changed: 53 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,7 +114,7 @@ In the rare event that a unit is not staying on long enough for new firmware to
114
114
115
115
## Updating Firmware From WiFi
116
116
117
-

117
+

118
118
119
119
**Note:** Firmware versions 1.1 to 1.9 have an issue that severely limits firmware upload over WiFi and is not recommended; use the [GUI](firmware_update.md#updating-firmware-using-the-uploader-gui) method instead. Firmware versions v1.10 and beyond support direct firmware updates via WiFi.
120
120
@@ -158,7 +158,9 @@ Get [esptool.py](https://github.com/espressif/esptool). Connect a USB A to C cab
158
158
159
159
If the COM port is not showing be sure the unit is turned **On**. If an unknown device is appearing, you’ll need to [install drivers for the CH340](https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all). Once you know the COM port, run the following command:
Where */dev/ttyUSB0* is replaced with the port that the RTK product enumerated at and *RTK_Surveyor_Firmware_vxx.bin* is the firmware you would like to load.
164
166
@@ -288,12 +290,14 @@ You are welcome to clone or fork this repo and do the exact same thing yourself.
288
290
289
291
If you run the [compilation workflow](https://github.com/sparkfun/SparkFun_RTK_Firmware/blob/main/.github/workflows/compile-rtk-firmware.yml), it will compile the firmware and attempt to push the binary to the Binaries repo. This will fail as your account won't have the right permissions. The [non-release-build](https://github.com/sparkfun/SparkFun_RTK_Firmware/blob/main/.github/workflows/non-release-build.yml) is the one for you. The firmware binary will be attached as an Artifact to the workflow run. Navigate to Actions \ Non-Release Build, select the latest run of Non-Release Build, the binary is in the Artifacts.
290
292
291
-
You can then use the [SparkFun RTK Firmware Uploader](https://github.com/sparkfun/SparkFun_RTK_Firmware_Uploader) to upload the binary onto the ESP32.
293
+
You can then use (e.g.) the [SparkFun RTK Firmware Uploader](https://github.com/sparkfun/SparkFun_RTK_Firmware_Uploader) to upload the binary onto the ESP32.
292
294
293
295
## Using Docker
294
296
295
297
Installing the correct version of the ESP32 core and of each required Arduino library, is tedious and error-prone. Especially on Windows. We've lost count of the number of times code compilation fails on our local machines, because we had the wrong ESP32 core installed, or forgot to patch Server.h... It is much easier to sandbox the firmware compilation using an environment like [Docker](https://www.docker.com/).
296
298
299
+
Docker is open-source. It is our new favourite thing!
300
+
297
301
Here is a step-by-step guide for how to install Docker and compile the firmware from scratch:
298
302
299
303
### Clone, fork or download the RTK Firmware repo
@@ -330,20 +334,20 @@ For the real Wild West experience, you can also download a copy of the `release_
330
334
331
335
### Install Docker Desktop
332
336
333
-
* Head to [Docker](https://www.docker.com/) and create an account. A free "Personal" account will cover occasional compilations of the firmware
337
+
***(Optional)**Head to [Docker](https://www.docker.com/) and create an account. A free "Personal" account will cover occasional compilations of the firmware
334
338
* Download and install [Docker Desktop](https://docs.docker.com/get-started/get-docker/) - there are versions for Mac, Windows and Linux. You may need to restart to complete the installation.
335
-
* Run the Desktop and sign in
339
+
* Run the Desktop. If you don't sign in, it will run in Personal mode - which will cover occasional compilations of the firmware
336
340
* On Windows, you may see an error saying "**WSL needs updating** Your version of Windows Subsystem for Linux (WSL) is too old". If you do:
337
341
* Open a command prompt
338
342
* Type `wsl --update` to update WSL. At the time of writing, this installs Windows Subsystem for Linux 2.6.1
339
343
* Restart the Docker Desktop
340
-
* If you are using Docker for the first time, the "What is a container?" and "How do I run a container?" demos are useful
344
+
* If you are using Docker for the first time, the "What is a container?" and "How do I run a container?" demos are useful - _but not essential_
341
345
* On Windows, you may want to give Docker Desktop permission to access to your Network, so it can access (e.g.) HTML ports
342
346
* You can Stop the container and Delete it when you are done
343
347
* You may want to prevent Docker from running when your machine starts up
344
348
* Uncheck "Start Docker Desktop when you sign in to your computer" in the Desktop settings
345
349
346
-
### Running the Dockerfile to create an Image
350
+
### Using Docker to create the firmware binary
347
351
348
352
***Make sure you have Docker Desktop running.** You don't need to be logged in, but it needs to be running.
349
353
* Open a Command Prompt and `cd` into the SparkFun_RTK_Firmware folder
@@ -365,19 +369,35 @@ For the real Wild West experience, you can also download a copy of the `release_
365
369
366
370
```
367
371
app3M_fat9M_16MB.csv
372
+
compile_with_docker.bat
368
373
Dockerfile
369
374
readme.md
370
375
RTKFirmware.csv
371
376
RTK_Surveyor
372
377
```
373
378
374
-
* The file we will be using is the `Dockerfile`.
375
-
* Type:
379
+
* The file that does most of the work is the `Dockerfile`
380
+
381
+
* But, if you're short on time, run `compile_with_docker.bat`. It does everything for you:
382
+
383
+

384
+
385
+
* Hey presto! You have your newly compiled firmware binary!
386
+
387
+
### Running the Dockerfile manually
388
+
389
+
If you want to see and understand what's going on under the hood with the Dockerfile, Image and Container:
Building the full Image from scratch is slow, taking several minutes. You should only need to do it once - unless you make any changes to the Dockerfile.
398
418
399
-
* When you make changes to the source code and want to recompile, use:
419
+
***When you make changes to the source code and want to recompile, use:**
This uses the cache for the `upstream` stage and avoids recreating the full ubuntu machine. But it ignores the cache for the `deployment` stage, ensuring the code is recompiled.
406
426
407
-
### Access the firmware by running the Image
427
+
####Access the firmware binary by running the Image
408
428
409
429
In Docker Desktop, in the Images tab, you should now be able to see an Image named `rtk_firmware`. We now need to Run that Image to access the firmware binary. Click the triangular Run icon under Actions:
410
430
@@ -436,12 +456,35 @@ If you need the `.elf` file so you can debug code crashes with me-no-dev's [ESP
436
456
docker cp rtk_container:/RTK_Surveyor.ino.elf .
437
457
```
438
458
459
+
If you need the `.bootloader.bin` file so you can upload it with esptool:
If you want the files to appear in a more convenient directory, replace the single `.` with a folder path.
440
466
441
467
Delete the `rtk_container` container afterwards, to save disk space and so you can reuse the same container name next time. If you forget, you will see an error:
442
468
443
469
```Conflict. The container name "/rtk_container" is already in use by container. You have to remove (or rename) that container to be able to reuse that name.```
444
470
471
+
***Remember:** when you make changes to the source code and want to recompile, use:
0 commit comments