Skip to content

Commit

Permalink
Merge pull request #784 from particle-iot/feature/kigen-esim-prov-tac…
Browse files Browse the repository at this point in the history
…hyon

Feature/kigen esim prov tachyon
  • Loading branch information
keeramis authored Jan 16, 2025
2 parents c376c65 + 9b1d1df commit 43b37b0
Show file tree
Hide file tree
Showing 17 changed files with 1,226 additions and 27 deletions.
39 changes: 39 additions & 0 deletions ESIM_PROVISION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Provision a blank eSIM

### Pre-req

1. Input JSON (A JSON file that has a list of EIDs and their respective RSP URLs)
2. Output (Folder where output logs will be stored. Defaults to `esim_loading_logs` if not set)
3. lpa tool (lpa tool binary - differently built for mac and windows)
4. binaries (Folder with the user binaries)

## Setup

### Local folder setup on computer

Put your files in this structure (for example)

```
/kigen-resources
├── /binaries
│ ├── esim-firmware-b5som.bin
│ ├── esim-firmware-msom.bin
├── input.json
├── custom_output_folder/
├── lpa
│ ├── mac
│ ├── ├── lpa
│ ├── windows
│ ├── ├── lpa.exe
```

### Device Setup

1. Connect your device(s) to the computer
2. Run this command
```
particle.js esim provision --input /path/to/input.json --lpa /path/to/lpa-tool --binary /path/to/binaries --bulk true
```

### Expected Outcome
First, the device(s) are flashed. Once the download process starts on a given device, device will turn its LED into yellow. If the download worked, LED turns green. If the download failed, LED turns red.
28 changes: 14 additions & 14 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
}
],
"dependencies": {
"@particle/device-constants": "^3.5.0",
"@particle/device-constants": "^3.7.0",
"binary-version-reader": "^2.5.1",
"chalk": "^2.4.2",
"cli-progress": "^3.12.0",
Expand All @@ -70,7 +70,7 @@
"particle-api-js": "^11.1.0",
"particle-commands": "^1.0.1",
"particle-library-manager": "^0.1.15",
"particle-usb": "^3.6.0",
"particle-usb": "^3.7.0",
"request": "https://github.com/particle-iot/request/releases/download/v2.75.1-relativepath.1/request-2.75.1-relativepath.1.tgz",
"safe-buffer": "^5.2.0",
"semver": "^7.5.2",
Expand Down
4 changes: 2 additions & 2 deletions src/cli/cloud.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Cloud Command-Line Interface', () => {
'Display a list of your devices, as well as their variables and functions',
'Usage: particle cloud list [options] [filter]',
'',
'Param filter can be: online, offline, a platform name (core, photon, p1, electron, argon, boron, xenon, esomx, bsom, b5som, tracker, trackerm, p2, msom), a device ID or name',
'Param filter can be: online, offline, a platform name (core, photon, p1, electron, argon, boron, xenon, esomx, bsom, b5som, tracker, trackerm, p2, msom, electron2), a device ID or name',
''
].join('\n'));
});
Expand Down Expand Up @@ -308,7 +308,7 @@ describe('Cloud Command-Line Interface', () => {
' particle cloud compile photon Compile the source code in the current directory in the cloud for a `photon`',
' particle cloud compile electron project --saveTo electron.bin Compile the source code in the project directory in the cloud for an `electron` and save it to a file named `electron.bin`',
'',
'Param deviceType can be: core, c, photon, p, p1, electron, e, argon, a, boron, b, xenon, x, esomx, bsom, b5som, tracker, assettracker, trackerm, p2, photon2, msom, muon',
'Param deviceType can be: core, c, photon, p, p1, electron, e, argon, a, boron, b, xenon, x, esomx, bsom, b5som, tracker, assettracker, trackerm, p2, photon2, msom, muon, electron2',
''
].join('\n'));
});
Expand Down
46 changes: 46 additions & 0 deletions src/cli/esim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const unindent = require('../lib/unindent');

module.exports = ({ commandProcessor, root }) => {
const esim = commandProcessor.createCategory(root, 'esim', 'Download eSIM profiles (INTERNAL ONLY)');

commandProcessor.createCommand(esim, 'provision', 'Provisions eSIM profiles on a device', {
options: Object.assign({
'lpa': {
description: 'Provide the LPA tool path'
},
'input': {
description: 'Provide the input json file path'
},
'output': {
description: 'Provide the output folder path'
},
'binary': {
description: 'Provide the path to the binaries'
},
'bulk': {
description: 'Provision multiple devices'
}
}),
handler: (args) => {
const ESimCommands = require('../cmd/esim');
if (args.bulk) {
return new ESimCommands().bulkProvisionCommand(args);
} else {
return new ESimCommands().provisionCommand(args);
}
},
examples: {
'$0 $command': 'TBD'
},
epilogue: unindent(`
The JSON file should look like this:
{
"TBD": "TBD"
}
TBD TBD
`)
});
return esim;
};

2 changes: 2 additions & 0 deletions src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const bundle = require('./bundle');
const cloud = require('./cloud');
const config = require('./config');
const doctor = require('./doctor');
const esim = require('./esim');
const protection = require('./device-protection');
const flash = require('./flash');
const func = require('./function');
Expand Down Expand Up @@ -50,6 +51,7 @@ module.exports = function registerAllCommands(context) {
cloud(context);
config(context);
doctor(context);
esim(context);
protection(context);
flash(context);
func(context);
Expand Down
2 changes: 1 addition & 1 deletion src/cli/usb.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('USB Command-Line Interface', () => {
' --exclude-dfu Do not list devices which are in DFU mode [boolean]',
' --ids-only Print only device IDs [boolean]',
'',
'Param filter can be: online, offline, a platform name (core, photon, p1, electron, argon, boron, xenon, esomx, bsom, b5som, tracker, trackerm, p2, msom), a device ID or name',
'Param filter can be: online, offline, a platform name (core, photon, p1, electron, argon, boron, xenon, esomx, bsom, b5som, tracker, trackerm, p2, msom, electron2), a device ID or name',
''
].join('\n'));
});
Expand Down
Loading

0 comments on commit 43b37b0

Please sign in to comment.