Skip to content

Instantly share code, notes, and snippets.

@bbaaxx
Forked from willh/deeplens_reset.txt
Created July 16, 2023 05:52
Show Gist options
  • Save bbaaxx/26185bc63c13ae03e8d8d6567a1bd6ab to your computer and use it in GitHub Desktop.
Save bbaaxx/26185bc63c13ae03e8d8d6567a1bd6ab to your computer and use it in GitHub Desktop.
AWS DeepLens factory reset and fix updated dependencies issues
AWS DeepLens factory reset steps followed:
Get Ubuntu and microSD card set up using AWS forum supplied instructions
https://s3.amazonaws.com/deeplens-public/factory-restore/DeepLens_System_Restore_Instruction.pdf
Pre-requisites: borked DeepLens in need of restore
keyboard
micro HDMI cable
monitor
bootable Ubuntu live USB
microSD card with image for flashing
plenty of patience
0. Micro HDMI, keyboard and power cable attached to deeplens, power on while pressing Esc to access Boot Manager
1. Boot from Ubuntu live USB "Try Ubuntu without installing"
2. Flash with image downloaded from factory reset PDF
cd /media/ubuntu/Storage
python flashing.py
3. Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
parted: invalid token: 2
OK/Cancel? [OK]
4. Warning: not all of the space available to /dev/mmcblk1 appears to be used, you can fix the GPT to use all of the space (an extra 8192 blocks) or continue with the current setting?
Fix/Ignore? [Fix]
Partition number? [1]
End? [99.6MB]? [<enter>]
5. Manually resize partition
sudo parted /dev/mmcblk1 resizepart 2 15758
sudo fsck -fy /dev/mmcblk1p2
sudo resize2fs /dev/mmcblk1p2
6. Remove power cable and live USB
7. On AWS DeepLens console, register device with *different name as previous attempts*, select correct previously created (and working) IAM roles, download certificates
8. Reattach power cable, power on deeplens
9. Wifi light flashes, log in to softAP
10. Connect via soft AP wifi to http://192.168.0.1/
11. Set up wireless connection details, double-check credentials are correct
12. "The updates are in progress now. The process will take up to 5 minutes to complete." [Install and reboot]
13. Disconnected from soft AP, deeplens wifi light solid on
<wifi light remains solidly on, deeplens never appears to reboot, remains like this longer than 1 hour>
<this is the point at which you will stay in 'Install and reboot'/reset soft AP/connect/'Install and reboot' loop>
14. Log in to deeplens directly with 'aws_cam' as password
15. "System program problem detected" dialog appears [Cancel]
16. Install software updates as prompted by Software Updater GUI program
17. Get most updates installed, then "Package operation failed" dialog when some dependencies are broken
18. Try and fix software updates
sudo apt-get update
sudo apt-get upgrade
sudo apt-get -f install
The following packages will be upgraded:
pulseaudio
Disk space prompt, do you want to continue [Y]
19. Error processing archive /var/cache/apt/archives/pulseaudio_1%3a8.0-0ubuntu3.7_amd64.deb (--unpack): trying to overwrite '/etc/pulse/default.pa' which is also in package audio-setup 1.0-1
20. Force install of pulseaudio
sudo dpkg --configure -a
sudo dpkg -i --force-overwrite /var/cache/apt/archives/pulseaudio_1%3a8.0-0ubuntu3.7_amd64.deb
sudo apt-get upgrade
Disk space prompt again [Y]
21. "Errors were encountered while processing: /var/cache/apt/archives/linux-firmware_1.157.14_all.deb"
22. Force install of linux firmware update package
sudo dpkg -i --force-overwrite /var/cache/apt/archives/linux-firmware_1.157.14_all.deb
23. Reinstall awscam package
sudo systemctl stop greengrassd.service
sudo rm -rf /opt/awscam
sudo apt-get update
sudo apt-get install --reinstall awscam
sudo reboot
24. Reboot doesn't fully bounce, shutdown messages occur 'systemd-shutdown' etc, 'kvm: exiting hardware virtualization', 'info: shutdown mwifiex...', 'PREP_CMD: card is removed' then loops USB disconnect messages over and over
25. Remove power cable from deeplens, reinsert, power on
26. Bootup appears normal, leave login screen up, 'You are now connected to wifi network AMXXXXX' soft AP, middle light flashes
27. Connect to soft AP from laptop, load up http://192.168.0.1
28. Device setup page 1: provide correct wifi credentials, notification on login screen showing connected to home wireless network
29. "The updates are in progress now. The process will take up to 5 minutes to complete." [Install and reboot]
30. Disconnected from soft AP, deeplens wifi light solid on
31. 1 minute later, deeplens starts to reboot
32. Reboot doesn't fully bounce, shutdown messages occur 'systemd-shutdown' etc, 'kvm: exiting hardware virtualization', 'info: shutdown mwifiex...', 'PREP_CMD: card is removed' then loops USB disconnect messages over and over
33. Remove power cable from deeplens, reinsert, power on
34. Bootup appears normal, leave login screen up
35. Wifi light flashes, connect to soft AP from laptop, load up http://192.168.0.1
36. Device setup page 2: certificates upload page. Upload certs downloaded from AWS deeplens console. Set password, enable SSH, disable automatic updates (updates are now to be applied skeptically and manually).
37. Device setup page 3: Review settings, finish
38. Disconnected from soft AP
39. Login screen on deeplens notification shows now connected to home wireless network
40. Load AWS console deeplens devices page
41. Device registration status 'in progress'
42. After a few minutes, device registration status is 'Completed'
FINISH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment