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_compile.md
+39-25Lines changed: 39 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,19 +22,6 @@ Installing the correct version of the ESP32 core and of each required Arduino li
22
22
23
23
Here is a step-by-step guide for how to install Docker and compile the firmware from scratch:
24
24
25
-
### Install Docker Desktop
26
-
27
-
* Head to [Docker](https://www.docker.com/) and create an account. A free "Personal" account will cover occasional compilations of the firmware
28
-
* 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.
29
-
* Run the Desktop and sign in
30
-
* 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:
31
-
* Open a command prompt
32
-
* Type `wsl --update` to update WSL. At the time of writing, this installs Windows Subsystem for Linux 2.6.1
33
-
* Restart the Docker Desktop
34
-
* If you are using Docker for the first time, the "What is a container?" and "How do I run a container?" demos are useful
35
-
* On Windows, you may need to give Docker Desktop permission to access to your Network
36
-
* You can Stop the container and Delete it when you are done
37
-
38
25
### Clone, fork or download the RTK Everywhere Firmware repo
39
26
40
27
To build the RTK Everywhere Firmware, you obviously need a copy of the source code.
@@ -67,9 +54,24 @@ For the real Wild West experience, you can also download a copy of the `release_
67
54
68
55
[](https://github.com/sparkfun/SparkFun_RTK_Everywhere_Firmware/archive/refs/heads/release_candidate.zip"Download ZIP (release_candidate branch)")
69
56
57
+
### Install Docker Desktop
58
+
59
+
* Head to [Docker](https://www.docker.com/) and create an account. A free "Personal" account will cover occasional compilations of the firmware
60
+
* 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.
61
+
* Run the Desktop and sign in
62
+
* 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:
63
+
* Open a command prompt
64
+
* Type `wsl --update` to update WSL. At the time of writing, this installs Windows Subsystem for Linux 2.6.1
65
+
* Restart the Docker Desktop
66
+
* If you are using Docker for the first time, the "What is a container?" and "How do I run a container?" demos are useful
67
+
* On Windows, you may want to give Docker Desktop permission to access to your Network, so it can access (e.g.) HTML ports
68
+
* You can Stop the container and Delete it when you are done
69
+
* You may want to prevent Docker from running when your machine starts up
70
+
* Uncheck "Start Docker Desktop when you sign in to your computer" in the Desktop settings
71
+
70
72
### Running the Dockerfile to create an Image
71
73
72
-
* Make sure you have Docker Desktop running
74
+
***Make sure you have Docker Desktop running.** You don't need to be logged in, but it needs to be running.
73
75
* Open a Command Prompt and `cd` into the SparkFun_RTK_Everywhere_Firmware folder
74
76
* Check you are in the right place. Type `dir` and hit enter. You should see the following files and folders:
Building the Image is slow, taking several minutes. But you should only need to do it once - unless you make any changes to the Dockerfile.
122
+
Building the full Image from scratch is slow, taking several minutes. But you should only need to do it once - unless you make any changes to the Dockerfile.
121
123
122
-
### Compile the firmware by running the Image
124
+
* When you make changes to the source code and want to recompile, use:
123
125
124
-
In Docker Desktop, in the Images tab, you should now be able to see an Image named `rtk_everywhere_firmware`. We now need to Run that image to compile the firmware. Click the triangular Run icon under Actions:
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.
131
+
132
+
### Access the firmware by running the Image
133
+
134
+
In Docker Desktop, in the Images tab, you should now be able to see an Image named `rtk_everywhere_firmware`. We now need to Run that Image to access the firmware binary. Click the triangular Run icon under Actions:
125
135
126
136

127
137
128
-
Running the Image will create a Container for the arduino-cli code compilation. The Container name is random, because we didn't define one in the **Optional settings**. It is running the final line of the Dockerfile `CMD arduino-cli compile ...`. Let it run. As the compilation progresses, you will see messages appear in the Logs tab. When the compilation is complete, the Container will stop and you should see:
138
+
Running the Image will create a Container, through which we can access the output of the arduino-cli code compilation.
139
+
140
+
By default, the Container name is random. To avoid this, we define one in the **Optional settings** :
129
141
130
-

142
+

131
143
132
-
You can recompile your code at any time by running the image again. (You don't need to recreate the image each time - unless you've changed the Dockerfile.)
144
+
Run the Container and you should see:
133
145
134
-
Make a note of the container name. We will need it to extract the firmware binary from the container. In the above screenshot, the container is called **reverent_jackson**
146
+

135
147
136
-
In the Command Prompt, type the following (replace **reverent_jackson** with your container name):
If you want the files to appear in a more convenient directory, replace the single `.` with a folder path.
151
165
152
-
The Container compilation is fast, taking around 2 minutes 20 seconds for a full compile. Running the same `arduino-cli compile` command directly in a Command Prompt takes around 3 minutes.
166
+
Delete the `rtk_everywhere` container afterwardds, to save disk space, and so you can reuse the same container name next time.
0 commit comments