@dotpi/tools 2.10.1 → 2.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,313 +11,12 @@ This utility prepares a Raspberry Pi for running in a `dotpi` distributed system
11
11
 
12
12
  ## Getting started
13
13
 
14
- In the `project` folder, select a project that is close to your needs: `example-dev` is quite complete.
15
-
16
- Do not forget to install the pair SSH keys from `projects/example-dev/secrets/ssh` to local you `${HOME}/.ssh` configuration.
17
-
18
- - Download and install the Raspberry Pi Imager.
19
- - Select OS (operating system)
20
- - Choose `Rapsberry Pi OS (other)`
21
- - Choose `Rapsberry Pi OS Lite (64-bit)`
22
- - For Raspberry Pi 3, you may need to select `No filtering` or separately download a non-legacy OS, and choose `Use custom`.
23
- - Insert a new SD card in your computer
24
- - Select it as the storage
25
-
26
- - You may change somme settings. In particular, you can choose *not* to eject media when done, to avoid pulling the SD card out, then inserting it again.
27
- - Write the SD card
28
- - You you choose to apply the settings, these will be the defaults before applying the `dotpi` settings
29
-
30
- In a terminal:
31
-
32
- ```sh
33
- # change path to the dotpi-install folder
34
- cd ~/src/dotpi-install
35
-
36
- # prepare the SD car with the chosen project
37
- ./dotpi_root/bin/dotpi_prepare_sd_card --project ./projects/example-dev
38
- ```
39
-
40
- Type the instance number, or accept the default. The first instance will be `1`
41
-
42
- - Put the SD card into a Raspberry
43
- - Power it on
44
- - Connect it to the internet, and to you computer
45
-
46
- You may then copy the last line to get info of the remote process.
47
-
48
- Any SSH operation will wait until the network on the Raspberry Pi is ready.
49
-
50
- ```sh
51
- # This will monitor the first instance of the `dev` project
52
- ssh pi@dotpi-dev-001.local 'tail -f /opt/dotpi/var/log/dotpi_prepare_system_*.log'
53
- ```
54
-
55
- When done, you can connect.
56
-
57
- ```sh
58
- ssh pi@dotpi-dev-001.local
59
- ```
60
-
61
- It should also appear in the `dotpi-manager`.
62
-
63
- ## Settings
64
-
65
- ### Raspberry Pi Imager
66
-
67
- The installer will first apply the settings of the Raspberry Pi Imager.
68
-
69
- In particular:
70
-
71
- - host-name
72
-
73
- - ssh access
74
- - you can allow for password authentication (in case the authentication via key fails)
75
-
76
- - user and password
77
- - user name: not recommended to change
78
- - user password, when ssh is not available
79
-
80
- - the wifi settings will be over-ridden
81
-
82
- - you can avoid the eject the SD car when done
83
-
84
- ### Environment defaults
85
-
86
- Then, `dotpi-install` will apply the default settings of the `dotpi` environment.
87
-
88
- `dotpi_root/etc/dotpi_environment_default.bash`
89
-
90
- You should not change anything here. Instead, you can over-ride any value in your projects.
91
-
92
- ### Project settings
93
-
94
- Then, `dotpi-install` will apply the default settings of your project.
95
-
96
- #### `configuration` folder
97
-
98
- This folder is for "public" settings, that you would share on a repository.
99
-
100
- In you project, there is a configuration file named `configuration/dotpi_project.bash`, where you can override any value.
101
-
102
- Note that you can also extend settings, by appendind to bash arrays:
103
-
104
- ```sh
105
- # this add `screen` to the list of packages to install
106
- dotpi_apt_install+=(
107
- screen
108
- )
109
- ```
110
- In particular, you can change the name of your project. (The default is the folder name.)
111
-
112
- ```sh
113
- dotpi_project_name='dev'
114
- ```
115
-
116
- The remote machine hosnames will be on the form `dotpi-dev-xxx` with `xxx` as the instance numbers.
117
-
118
-
119
- You can also choose your audio device.
120
-
121
- ```sh
122
- dotpi_audio_device='HiFiBerry DAC+ ADC Pro'
123
- ```
124
-
125
- ##### `jackd` folder
126
-
127
- You can add a `jackd` folder in you `<project>/configuration` folder, in order to over-ride jackd settings from `dotpi-root/share/jackd`.
128
-
129
- Note that there is a symbolic link to configuration for known sound-cads. If it does not suit your needs, you can use a `dotpi_jackd.bash` configuration file.
130
-
131
- ```bash
132
- # keep this
133
- DOTPI_JACKD_ENVIRONMENT=(
134
- JACK_NO_AUDIO_RESERVATION=1
135
- )
136
-
137
- # warning: long option for -d (--driver) seems broken
138
-
139
- DOTPI_JACKD_ARGUMENTS=(
140
- --realtime
141
- --realtime-priority 95
142
- -d alsa
143
- --device hw:0
144
- --playback
145
- --period 1024
146
- --nperiods 2
147
- --rate 48000
148
- )
149
- ```
150
-
151
- #### `secrets` folder
152
-
153
- This folder is for "private" settings, that you would *not* share on a repository.
154
-
155
- In you project, there is a configuration file named `secrets/dotpi_secrets.bash`, where you can chage the password.
156
-
157
- ```sh
158
- dotpi_password='!rapsberry'
159
- ```
160
-
161
- ##### `network` folder
162
-
163
- You can add any NetworkManager configuration file. Be sure *not* to quote values, including `ssid` and `psk`, as anything is part of the value, including quotes.
164
-
165
- To keep the automatic configuration for the ethernet interface, do not add it here.
166
-
167
- To keep `NetworkManager` functional, do *not* configure network in an other way (ie. no `wpa_supplicant.conf` file).
168
-
169
- ##### `ssh` folder
170
-
171
- Be sure to install the pair of SSH keys in you `${HOME}/.ssh` configuration.
172
-
173
- ### Instance settings, `tmp` folder
174
-
175
- The last step is to apply particular settings relative to the instance.
176
-
177
- After sucessfully preparing an SD card, a copy of the last settings will be in your pject, in a `tmp` folder.
178
-
179
- - `dotpi_prepare_sd_card_*.log` is a copy of the screen messages
180
- - `dotpi_tmp.bash` contains the instance number (to increment for the next time)
181
- - `file-system` is a full copy of what will be installed on the Raspberry Pi.
182
-
183
- ## On the Raspberry Pi
184
-
185
- Any system-wide installation will link to the `/opt/dotpi` directory. Except the following.
186
-
187
- The `/boot/firmware` folder (mounted as `/bootfs` as a local SD card) contains the `config.txt` file.
188
-
189
-
190
- ### Commands
191
-
192
- Use `dotpi` or `sudo dotpi` to run any `dotpi_function` function.
193
-
194
- ### `/boot/firmware` `/bootfs`
195
-
196
- - `config.txt` is the hardware configuration file.
197
- - `firstrun_*.log` is the log the the first run
198
- - Intentionnaly, the network does not start at this stage
199
- - the `dotpi` folder contains the initial version of the `dotpi` file-system, and a non-customised version of the `firstrun.sh` script from the imager.
200
-
201
- ### `/opt/dotpi`
202
-
203
- `/opt/dotpi/bin/dotpi` is the main executable, installed in `/usr/bin`
204
-
205
- #### `/opt/dotpi/etc`
206
-
207
- - `config.txt` is an *initial* copy of the hardware configuration. It may diverge after any mofdification.
208
- - `dotpi_environment_*.bash` contain the customisation of the environment
209
- - `network` contains the network configuration, that where copied to `/etc/NetworkManager/system-connections`. It may diverge after any mofdification.
210
- - `ssh` contains the public SSH keys that were copied to `${HOME}/.ssh/authorized_keys`
211
-
212
- #### `/opt/dotpi/share`
213
-
214
- - `dotpi-manager` contains the client and the service. Use `sudo dotpi manager_update` to update the client.
215
- - `jackd` contains the configuration and the service.
216
- - `limits` contains the limits that were copied to `/etc/security/limits.d`.
217
- - `n` contains the node version manager. `node.js` itself, is in `/home/pi/n/bin/node` and linked in `/usr/bin/node`.
218
-
219
- #### `/opt/dotpi/var/log`
220
-
221
- Log files.
222
-
223
- - `dotpi_prepare_system_*.log` contains the log of the system preparation
224
- - `dotpi_manager_update_*.log` contain the logs of the dotpi-manager updates
225
-
226
- #### `/usr/local/bin`
227
-
228
- This is an alias to `/usr/bin`.
229
-
230
- ### Other
231
-
232
- #### Local machine
233
-
234
- If you install `wpa_passphrase`, wifi passwords will be hashed.
235
-
236
- You should install the version 3 of `rsync` to get quicker transfer times with `dotpi-manager`.
237
-
238
- ```sh
239
- rsync --version | grep version
240
- ```
241
-
242
- #### Remote Raspberry Pi
243
-
244
-
245
- ##### Network
246
-
247
- Everything is managed via `NetworkManager`. You can use `nmtui` to use a user-interface.
248
-
249
- You also directly use `nmcli` with a command-line interface.
250
-
251
- ```sh
252
- nmcli device
253
- # DEVICE TYPE STATE CONNECTION
254
- # eth0 ethernet connected Wired connection 1
255
- # lo loopback connected (externally) lo
256
- # wlan0 wifi disconnected --
257
- # p2p-dev-wlan0 wifi-p2p disconnected --
258
-
259
- nmcli radio
260
- # WIFI-HW WIFI WWAN-HW WWAN
261
- # enabled enabled missing enabled
262
- ```
263
-
264
-
265
- ##### `jackd`
266
-
267
- In order to play soundfiles via `jackd`, you can install `mpv`
268
-
269
- ```sh
270
- mpv --ao=jack 'sound.mp3'
271
- ```
272
-
273
- You can monitor a jack connection in a terminal with. Warning, you need to install the `jackmeter` package but the command is `jack_meter`.
274
-
275
- ```sh
276
- # list jack connections
277
- jack_lsp
278
- # system:capture_1
279
- # system:capture_2
280
- # system:playback_1
281
- # system:playback_2
282
- # cpal_client_out:out_0
283
- # cpal_client_out:out_1
284
- # cpal_client_out-01:out_0
285
- # cpal_client_out-01:out_1
286
-
287
- # monitor the system output
288
- jack_meter system:playback_1
289
-
290
- # monitor a particular connection
291
- jack_meter mpv:out_0
292
- ```
293
-
294
- ##### Raspberry pi
295
-
296
- You can get various information about the hardware and software.
297
-
298
- ```sh
299
- cat /proc/device-tree/model
300
- # Raspberry Pi 4 Model B Rev 1.4pi
301
-
302
- # 64bit kernel (even for 32bit system)
303
- uname -a
304
- # Linux dotpi-dev-019 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
305
-
306
- # 64bit kernel (even for 32bit system)
307
- arch
308
- # aarch64
309
-
310
- # 32bit system
311
- file $(which file)
312
- # /usr/bin/file: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=f5f7f7c84dbb609f53ae3b9ac6b4437d927bde7d, for GNU/Linux 3.2.0, stripped
313
- ```
14
+ See the documentation [here](https://ircam-ismm.github.io/dotpi/)
314
15
 
315
16
  ## Known bugs
316
17
 
317
18
  Please do report them.
318
19
 
319
- - [ ] do not allow `.` character in project, it generates an invalid hostname.
320
-
321
20
  ## Todo
322
21
 
323
22
  - [ ] dotpi-manager: dependency to audio should be soft
@@ -6,6 +6,5 @@
6
6
  "postinstall": "./dotpi_install",
7
7
  "preuninstall": "./dotpi_uninstall"
8
8
  },
9
- "license": "BSD-3-clause",
10
- "gitHead": "0321bc097fea5755a4af8a2d59c9392d30bd452c"
9
+ "license": "BSD-3-clause"
11
10
  }
@@ -12,6 +12,5 @@
12
12
  "chalk": "^5.4.0",
13
13
  "execa": "^9.5.2",
14
14
  "template-literal": "^1.0.4"
15
- },
16
- "gitHead": "0321bc097fea5755a4af8a2d59c9392d30bd452c"
15
+ }
17
16
  }
@@ -11,6 +11,5 @@
11
11
  "@dotpi/javascript": "^1.6.3",
12
12
  "execa": "^9.5.2",
13
13
  "globby": "^14.0.2"
14
- },
15
- "gitHead": "0321bc097fea5755a4af8a2d59c9392d30bd452c"
14
+ }
16
15
  }
@@ -13,6 +13,5 @@
13
13
  "@dotpi/javascript": "^1.6.3",
14
14
  "@dotpi/module": "^1.8.3",
15
15
  "commander": "^12.1.0"
16
- },
17
- "gitHead": "0321bc097fea5755a4af8a2d59c9392d30bd452c"
16
+ }
18
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotpi/tools",
3
- "version": "2.10.1",
3
+ "version": "2.10.2",
4
4
  "description": "Set of scripts for managing dotpi fleets of Raspberry Pi",
5
5
  "author": "Jean-Philippe Lambert",
6
6
  "contributors": [
@@ -46,5 +46,5 @@
46
46
  "devDependencies": {
47
47
  "lerna": "^8.2.4"
48
48
  },
49
- "gitHead": "0321bc097fea5755a4af8a2d59c9392d30bd452c"
49
+ "gitHead": "01548da878a4515021a67428b4138b2b4af1c807"
50
50
  }
@@ -1,28 +0,0 @@
1
- Copyright (c) 2023-present IRCAM – Centre Pompidou (France, Paris)
2
-
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without modification,
6
- are permitted provided that the following conditions are met:
7
-
8
- * Redistributions of source code must retain the above copyright notice, this
9
- list of conditions and the following disclaimer.
10
-
11
- * Redistributions in binary form must reproduce the above copyright notice, this
12
- list of conditions and the following disclaimer in the documentation and/or
13
- other materials provided with the distribution.
14
-
15
- * Neither the name of the IRCAM nor the names of its
16
- contributors may be used to endorse or promote products derived from
17
- this software without specific prior written permission.
18
-
19
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,28 +0,0 @@
1
- Copyright (c) 2023-present IRCAM – Centre Pompidou (France, Paris)
2
-
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without modification,
6
- are permitted provided that the following conditions are met:
7
-
8
- * Redistributions of source code must retain the above copyright notice, this
9
- list of conditions and the following disclaimer.
10
-
11
- * Redistributions in binary form must reproduce the above copyright notice, this
12
- list of conditions and the following disclaimer in the documentation and/or
13
- other materials provided with the distribution.
14
-
15
- * Neither the name of the IRCAM nor the names of its
16
- contributors may be used to endorse or promote products derived from
17
- this software without specific prior written permission.
18
-
19
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,28 +0,0 @@
1
- Copyright (c) 2023-present IRCAM – Centre Pompidou (France, Paris)
2
-
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without modification,
6
- are permitted provided that the following conditions are met:
7
-
8
- * Redistributions of source code must retain the above copyright notice, this
9
- list of conditions and the following disclaimer.
10
-
11
- * Redistributions in binary form must reproduce the above copyright notice, this
12
- list of conditions and the following disclaimer in the documentation and/or
13
- other materials provided with the distribution.
14
-
15
- * Neither the name of the IRCAM nor the names of its
16
- contributors may be used to endorse or promote products derived from
17
- this software without specific prior written permission.
18
-
19
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,28 +0,0 @@
1
- Copyright (c) 2023-present IRCAM – Centre Pompidou (France, Paris)
2
-
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without modification,
6
- are permitted provided that the following conditions are met:
7
-
8
- * Redistributions of source code must retain the above copyright notice, this
9
- list of conditions and the following disclaimer.
10
-
11
- * Redistributions in binary form must reproduce the above copyright notice, this
12
- list of conditions and the following disclaimer in the documentation and/or
13
- other materials provided with the distribution.
14
-
15
- * Neither the name of the IRCAM nor the names of its
16
- contributors may be used to endorse or promote products derived from
17
- this software without specific prior written permission.
18
-
19
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,4 +0,0 @@
1
- #!/bin/bash
2
-
3
- /usr/bin/env node /opt/dotpi/share/n/bin/corepack "${@}"
4
-
@@ -1,4 +0,0 @@
1
- #!/bin/bash
2
-
3
- /opt/dotpi/share/n/bin/node --lite_mode --optimize_for_size "${@}"
4
-
@@ -1,4 +0,0 @@
1
- #!/bin/bash
2
-
3
- /usr/bin/env node /opt/dotpi/share/n/bin/npm "${@}"
4
-
@@ -1,4 +0,0 @@
1
- #!/bin/bash
2
-
3
- /usr/bin/env node /opt/dotpi/share/n/bin/npx "${@}"
4
-