When getting started with an AWS DeepLens camera it can be helpful to restore the camera to its factory settings, especially if you get a second hand one. Luckily, this is a pretty easy thing to do. The instructions are documented by AWS at Restoring Your AWS DeepLens Device to Factory Settings. I will walk you through the steps here, too.
Factory Restore
The first thing to do is to find a USB flash drive that’s 16 GB or larger. We’ll use this flash drive to restore the DeepLens’ original operating system. Format the flash drive to have two partitions. The first partition should be a FAT32 partition of at least 2 GB. The second partition should be an NTFS partition at least 9 GB. GParted works well for this or you can use some other partition tool.
If you ran into the problem I did I was not able to delete the existing partitions on the flash drive. Simply writing some zeros to the flash drive fixed that problem:
sudo dd if=/dev/zero of=/dev/sdXY bs=2048 count=32
Once the partitions are created, next download the AWS custom Ubuntu ISO image. (The DeepLens operating system is Ubuntu 16 so it’s very user-friendly in itself.) Write the ISO to the first partition of the flash drive and make sure the partition is bootable. You can use UNetbootn or dd
or another tool to write the image to the first partition.
Download the factory package for your camera. There are currently two versions, v1.0 and v1.1. Be sure to download the version for your DeepLens. You can find the version on the sticker on the bottom. After downloading the appropriate file, extract the files to the flash drive’s second partition. Make sure the usb_flash
script is executable. In case you need to make the NTFS partition mountable you can use the command:
sudo ntfxfix /dev/sdXY
Insert the USB drive into the DeepLens and power it on. As it powers on keep pressing the escape key to get into the BIOS. Once in the BIOS, select Boot From File, choose USB VOLUME, choose EFI, choose BOOT, and then choose BOOTx64.EFI. This will cause the DeepLens to boot from the flash drive and begin the flashing process.
Stuck in Reboot Loop
If you’re unlucky like me the DeepLens will go through the flashing process fine and reboot but then get stuck with an error message. The problem for me was I was using Ubuntu to make the USB drive. I changed to using Windows to make it and reflashed and it worked fine. I don’t actually know what the exact problem was but changing to a Windows desktop fixed it. I don’t think I did anything differently because I tried it multiple times. Since the DeepLens was now successfully factory restored I didn’t feel like spending time to figure it out! For reference, the error below is the error I was getting:
mount: mounting /run on /root/run failed: No such file or directory
Target filesystem doesn't have requested /sbin/init
run-init: opening console: No such file or directory
No init found. Try passing init= bootarg.
Rebooting automatically doe to panic= boot argument
Finished!
The DeepLens will boot into the Ubuntu installation and you are now ready to register your DeepLens in your AWS account and get started with some fun image recognition projects. Check out the AWS forums for DeepLens for assistance.
And before you ask, the default DeepLens password is aws_cam
. 🙂
Im stuck in that same boot loop. Flashing from Ubuntu VM using Gparted and unetbooting. Guess I will try windows and see how it goes
It’s worth a shot! I feel like everything should have worked when I did it using Ubuntu but for some reason making it on Windows must have done something different.