This PR will allow the use of flashing device os offline.
When the user downloads an specific device os version it will be cached in a file, then if the user tries to download it again without internet access, then the cli will looks into the cached file to try to flash the device.
How to Test
Pull down the branch: git pull && git checkout feature/sc-121837/support-local-flash-without-internet-access
Install dependencies: npm i
Run tests: npm test
Attempt to run steps with internet access
Attempt to run steps without internet access
Remove the device-os-version-cached.json from ~/.particle/device-os-flash/binaries
Attempt to run steps without internet access
Re-run step 4
Delete the binaries from ~/.particle/device-os-flash/binaries/${version}/${platform}
Attempt to run steps without internet access
Steps with internet access:
Update your device to:
latest: npm start -- update
specific target: npm start -- update --target 5.0.0
Steps Without internet access
Disconnect the client from internet
Update your device to:
latest: npm start -- update
specific target: npm start -- update --target 5.0.0
outcome
Tests should pass
Steps 4 and 5 should flash the device without issues and should create a new file in ~/.particle/device-os-flash/binaries named device-os-version-cached.json
Step 7 and 10 should show a message indicating: Device OS version not found in cache for platform: ${platformId} version: ${version} and there was an internet connection error
Description
This PR will allow the use of flashing device os offline. When the user downloads an specific device os version it will be cached in a file, then if the user tries to download it again without internet access, then the
cli
will looks into the cached file to try to flash the device.How to Test
git pull && git checkout feature/sc-121837/support-local-flash-without-internet-access
npm i
npm test
steps with internet access
steps without internet access
device-os-version-cached.json
from~/.particle/device-os-flash/binaries
steps without internet access
~/.particle/device-os-flash/binaries/${version}/${platform}
steps without internet access
Steps with internet access:
npm start -- update
npm start -- update --target 5.0.0
Steps Without internet access
npm start -- update
npm start -- update --target 5.0.0
outcome
~/.particle/device-os-flash/binaries
nameddevice-os-version-cached.json
Device OS version not found in cache for platform: ${platformId} version: ${version} and there was an internet connection error
Related Issues / Discussions
Story details 👉 https://app.shortcut.com/particle/story/121837/support-local-flash-without-internet-access
Completeness