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
[email protected]

20 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!

5 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

Just deployed another 25 units to go to NYC.
I’ll be working to release a new script update soon.

3 Likes

Ok new year, v2 of the script.
This one is geared to do 100 routers per hour!

New deployment can do 100-150 units per hour, each units averages 7-10 mins to complete.
3d printed docking stations with poe injector/spliter to do cable management and antenna placement.
Push-on sma adapters for quick setup.
Peplink managed poe switch with raspberry pi controlling the scripts.
Peplink device apis to control port status, port poe enable/disable, and router configs.
Each port runs in it’s own process with a management dashboard of the overall procerss.
Each port is on a seperate vlan so we can talk to 24 devices all with the same default ip 192.168.50.1 at the same time.
Laptops are now only used to check the management dashboard status.
Process:
Logins to each unit
Updated firmware from local cached firmware
Activated the trial license for the minis to enable wifi-as-wan and wired wan.
Loads local config file, (changes apns ,plmn order, setup wan order, firewalls, etc)
Checks to make sure that unit has read both iccid numbers in sim slots.
Checks sim pririoty.
Confirms sim A comes online.
Records carrier, cell signal measurements, ip address.
Confirms checked into ic2
Adds deployment notes to device in ic2.
Locks config
Records entire process from start, config, testing, in a local sqlite database.
Troubleshoot controls from management interface, restart poe power, change sim priority, restart cellular module
reboot unit, restore factory default.

A huge shout out to my friend John Scully @jmpfas from Pizza Cloud, that helped write the management scripts and spent countless hours helping test to perfection.
v2 of this script has been designed in house with a peplink poe switch, and the docking ports.
If you would like any consultation or deployment services please contact me [email protected]
In the coming weeks I plan on releasing a community edition of this script, a single version to run on a raspberry pi.
Thank you peplink and frontier Us for your support!

Video, docking peplinks https://youtu.be/0Fm7ftAfq08
Video, undocking peplinks https://youtu.be/7xAfLBf9CNc
Video, screen recording pi peplink deployment management start https://youtu.be/N__XHp7gvFE
Video, screen recording pi peplink deployment management finish (see cellular state) https://youtu.be/0CcIwTxbqFg











8 Likes

In case anyone is wondering WHY go through all this instead of just using IC2 - there were several reasons.

  1. without the WAN license you cannot reach IC2 until cellular comes up, and we really needed to configure BEFORE cellular was active, plus as you will see below some would not have cellular come up until “thumped”.
  2. Jonathan’s DSL sucks. Would have taken forever to remote upgrade firmware on hundreds of units. This did it from local cached copy.
  3. We were checking for a LOT of very subtle errors that you cannot see via IC2, or even via the GUI. Such as:
    Two Sims inserted - sim1 is Peplink sim and is preferred. Sim2 is a verizon sim and is not activated (it is there for “just in case”. Both are marked ENABLED in PW. Sim 1 preferred.
    About one out of 10 units would come up fixated on sim2. i.e. sim1 enabled and not in use. Sim2 enabled, in use but of course failing. Device would NEVER retry sim1. reboot. reset cell module. cycle power - just sits on sim2. (We are working with Peplink to figure this one out).
    So program sees this state and disables sim2 totally, resets cellular module, waits for sim1 to connect, then re-enables sim2.

There are four or five other very specific details like that we wanted to confirm.

5 Likes

What an epic iteration of this automation process!
Well done Jonathan and John - really very clever and so neat to watch on the workbench!

The 3d printed docks with the push on adapters are wonderful. Bravo!

3 Likes

Thanks Martin!

1 Like

Hey, this case study goes live at Peplink main site now~

1 Like

Hi, is the new version v2 available for the community?

1 Like

V2 is a complete rewrite and tied to internal source code/processes along with the raspberry pi.
I might be able to write something custom for you, but internally we spent about 80 hours on the project and it’s not something that is ready for public release.

2 Likes

I know this is a bit old, but are you willing to release this via github or zip file how you did before? We are going through a similar situation and have about 90 units we need to update.

1 Like

See post 1 Automated deployment for batch of 100 BR1 mini's

You can right click the link , download and change the ext name.

v2 was never publicly released.
It required a raspberrypi, peplink 24 port POE switch and a few backend services for logging results, and locking the config. It wasn’t practical to do a public release.

If you need any BR1 HW2 LTE or LTE-A models I have some available for sale.

3 Likes