These tools enable automatic firmware updates on devices that periodically send NB-IoT data messages to a server that sends an alert whenever it detects dropped or duplicate messages.
We use Raspberry Pis to run the end 2 end tests from different locations. The plan is that they will send nbiot-packets by connecting an EE-NBIOT-01 directly to the UART on the Raspberry Pi. Some of them might also have an Arduino attached to compile and test that the Arduino library is working.
- Install and configure the aws cli
- Raspberry Pi 3 B+
- Raspberry Pi power supply
- microSD card for the Raspberry Pi
- If attaching an Arduino UNO to the Pi
- Arduino UNO
- USB A to USB B cable (for the UNO)
- EE-NBIOT-01 board
- Adapter board with voltage divider (100Ω and 220Ω resistor) for TX (schematic)
-
Download latest Raspbian Stretch Lite and burn to the microSD card using Etcher
-
Mount the SD card and create an empty file called ssh to enable SSH access
-
If the Pi has to use WiFi (Ethernet preferred), add a file named wpa_supplicant.conf in the root of the SD card:
Update the file with SSID and password and remove the network definition that won't be used
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 country=no network={ ssid="no_password_SSID" key_mgmt=NONE } network={ ssid="password_protected_SSID" psk="password" }
-
Connect the Raspberry Pi using Ethernet and power up
-
cd _nbiot-e2e_/scripts
-
Run the setup script and follow the instructions. You will be prompted for a password when the script tries to SSH to the Pi; the password is raspberry.
./run_setup_rpi.sh
The script takes about 20 minutes, after which the Pi should be up and running the end to end test.
The Pis are connected to AWS Systems Manager, so we can use Systems Manager to remotely execute scripts on a Pi.
cd _nbiot-e2e_/scripts/remote
- List the managed instances:
aws ssm describe-instance-information
- Copy the instance ID of the Pi you want to connect to
./exec.sh nbiot-e2e-01 "echo This command will run on nbiot-e2e-01, wait for execution to finish and output the response"
exec-all.sh
executes the arguments on all the nbiot-e2e Pis and send the
responses to the SSM-RunCommand-Output log stream in Cloud Watch. It then
checks the Cloud Watch logs every second and prints the output.
cd _nbiot-e2e_/scripts/remote
./exec-all.sh command
- Wait for responses. Press CTRL + C to exit.
-
cd _nbiot-e2e_/scripts/remote
-
If it's the first time, you need to get the Pi's public ssh key and add it to the e2e server (replace XX with pi number):
`./getsshpubkey.sh nbiot-e2e-XX`
Copy the STDOUT value and add it to the end of
.ssh/authorized_keys
on the e2e server -
Open the tunnel from the Pi to the e2e server:
`./open-tunnel.sh nbiot-e2e-XX`
-
-
ssh to the Pi from the e2e server:
ssh -o StrictHostKeyChecking=no -p 2222 e2e@localhost
-
You should now be logged in as e2e on the pi
-
-
When you're done. Remember to close the tunnel:
`./close-tunnel.sh nbiot-e2e-XX`