Automated deployment for batch of 100 BR1 mini's

I have create a set of scripts to automated the deployment for batch of BR1 mini’s.
Next week I have a batch of 100 units to deploy and I wanted to automate the process.
The scripts are 100% hands off, no chrome browser, or manual login required.
I wrote it in batch scripts as I wanted to be able to use a lot of windows laptops without having to set up the correct environment for it to run. If any one would like to contact me to rewrite in another language we can do so. I was think about redoing it later in perl.

Why I created this script:
The BR1 mini is an excellent priced router, however it lacks out of box capability to connect to ic2 via wan or wwan (wifi as wan). You may not have pre-activated sims, or you may be deploying them in one region and shipping it to another. You may also not want to use cellular data just for the deployment.
I also wanted to be able to change variables during different deployments which makes it impractical to use a config file or the bulk config tool.

Features it provides:
Ping check as it waits for the router.
Looping trying to login to the router.
Automates changing the password as required in new builds.
Activation of the wan trial.
Change priorities of the wan in the dashboard.
(WAN P1, Wifi as Wan P2, Cellular P3)
Set the apns on both sim cards.
Set cellular usage limit with management restriction at 20GB
Set a profile on the Wifi As Wan connection.
I enabled wifi as wan so I didn’t have to plug in a second cable to get it online in incontrol2.
The mini’s ports out of box both the lan and the wan act as lan.
pre-caches firmware files needed from peplink site.
Optionally upgrade the firmware from a local file, assumes you don’t want to send the firmware down 100 times for deployment.
Manages reboot of firmware, and confirm the device comes back up with the new firmware.
I wanted to be able to configure the entire deployment with no internet, or access to incontrol.
Most of my steps are actually pre-configuration which is required to connect to incontrol , however I also added the automation of the firmware upgrade as well.
Optionally confirm Cellullar sim A has connection to the cellular network, and get it’s state and IP address.
Attempts to get the iccid of both cards.
Notifies user when the current router is complete and it’s ready for the next one.
Continues to loop waiting for the next router.
Records serial number, firmware version, Cellular state, Cellular IP, time/date to a csv file for later retrieving.
You can also reset to factory default, and revert firmware:

Log file attached: deployment.txt (2.1 KB)
script attached. remove .pdf it is a zip archive.deploy-mini-scripts.zip.PDF (1.9 MB)
script zip password is pepwave
Extract to a folder, and run the script from the folder.

Script will expect the router to be at the following address https://192.168.50.1:443 with login admin/admin. This is can all be changed at the top of the script.
To speed up the process hard code your ethernet to 192.168.50.x or something other then 192.168.50.1 so you don’t have to wait for the pepwave to give you a dhcp address.

usage:
deploymini STANDARD (Standard deployment include firmware upgrade)
deploymini NOFW (Standard install exiting early without FW upgrade)
deploymini GETSN (Just gets serial number and exits)
deploymini GETFW (Gets FW version and exits)
deploymini GETCELLULAR (Just gets cellular checks status and exits)
deploymini GETCELLULARICCIDONLY (Just gets cellular iccid and exits)
deploymini RESET (This would factory reset leaving current fw)
deploymini RESET-REVERT (This would factory reset and downgrade fw)
deploymini CELLRESET (Reboots only cellular module.)

The scripts were create by using a live deployment in chrome and watching the web posts, then building logic around it.
The scripts do not prevent you from trying to send invalid data so keep in mind if you modify anything that is not pre-defined.
Script will change admin/admin to admin/Script2021!
I’m hoping that this will help others with mass deployments.
These scripts worked well for my deployment however your mileage may very.

I’ll work on creating and uploading a video later, it’s awesome to watch the wan priorities changes from running a script.

Jonathan
Jonathan@1simplephone.com

15 Likes

This is fantastically useful Jonathan - thanks very much for sharing!

2 Likes

Thanks, I think in a couple of weeks I’ll rewrite it to also run on raspberry pi’s.

1 Like

I’d recommend making sure the cellular routers are spaced at least 12-24 inches apart.
Rarely I restarted the script and or used the RESET-REVERT, to factory reset and revert to 8.0.2 fw.
The batch of units I received had really old firmware are 8.0.0 and I think that also sometime gave a little trouble.
I likely should have stepped the firmware up from 8.0.0 to 8.0.2 to 8.1.1
The mass deploy is going well, but sometime I have trouble with a device getting an ip, and/or reading the sim. I have 21 left to go out of 100.

1 Like

I’m pleased to say that I was able to deploy all 100 units with these scripts.
The only time I have to restart it was a few that didn’t take, but once they were on 8.0.2 firmware instead of 8.0.0 it worked fine.

1 Like

Pictures

Video link

5 Likes

Here is a video showing the full script in action!

4 Likes

nice! thanks for the follow up!

Hello @Jonathan_Pitts,
I think there is a new feature in the beta release 8.1.2 known as “SP Default Configuration via LAN” that appears to be for streamlining this process. Have you had a look at this? Would it have improved the process with these?
I’m considering ways & methods similar for some mass ongoing deployments and how we will streamline the processes.
Happy to Help,
Marcus :slight_smile:

@mldowling

I have tested this, I’m working with the engineers so that I fully understand the expected behavior.
This is how it works in the beta:
Connected to ic2 via parent dhcp in SP (Service Provider) mode and connects to incontrol.
After the first time it switches modes.
This means that the first time would likely need to get a bulk config, set apn values, preferred sim card or sync the failover license.
There isn’t currently a way for it to connect to ic2 and activate the wan trial license like my script does.
I think there may be a combination required here as the new mode also doesn’t account for the lag in equipment that is sitting at distributors with firmware’s lower then 8.1.2.

1 Like