According to a white paper on APP network performance testing, the current APP network environment is relatively complex, including 2G, 3G, 4G networks and more and more public Wi-Fi networks. Different network environments and differences in network standards will have a certain impact on users’ use of APP. In addition, the current application scenarios of APP are changeable, such as entering the subway, boarding the bus, entering the elevator, watching concerts, etc., which makes weak network testing particularly important. Today, we will talk about how to build a weak network testing environment with Raspberry PI.

Facebook’s ATC is well known for its scalable architecture, which allows multiple phones to be used simultaneously and different network control policies to be applied. In addition, RPC interface is also provided, on which the secondary development can be more convenient to achieve automatic weak network testing.

Hardware preparation

  • Raspberry PI 3B+ (preferably with fan, radiator, etc.)

  • 16G TF card (remember to have your card reader ready)

  • 5 v / 3 a charger

  • Micro USB cable

  • Ethernet cable

  • HDMI cable

  • display

  • The keyboard

In fact, the HDMI cable, monitor, keyboard, USB cable mentioned above can also be not prepared, that is, through the MacBook to configure the system remotely, in addition, if you want to use the raspberry PI specific purchase link in this article, after following the public account in the background reply: “Raspberry PI” three words.

Let’s take a look at the unpacking process:

I bought this package is a heat sink and fan, so let’s look at how fin is stuck, here are posted on the main CPU, LAN CARDS and memory on the other new raspberry pie 3 b + main factory built-in CPU heat sink, can not paste, paste way: only need to tear off heat sink back glue, paste directly in the corresponding location, the following figure:

Next, install the box and fan. This one is easier. Here’s how it looks:

Burning system

First, insert the TF card into the computer through the card reader, and then check the volume currently attached by the following command to determine whether the TF card is read:

We can judge the current disk2S1 is our TF card partition in the system corresponding file, if your TF card has multiple partitions, then there may be disk2S2, DISK2S3…

/dev/disk2 is a TF card. /dev/disk2 is a TF card.

Next, prepare to burn the system, first enter the official website to download the system image, download page:

https://www.raspberrypi.org/downloads/

We downloaded the first full desktop version, went to the directory where the system image was, unmounted these partitions using diskutil unmount, and then burned the system to the TF card using the following command:

After a few minutes, the above message is displayed, indicating that the system is successfully swiping. Run the diskutil unmountDisk /dev/disk2 command to uninstall the TF card, and then insert the card into the raspberry PI.

Configure raspberry pie

Because there is no monitor or keyboard, I use network cables to set up WiFi for raspberry PI.

Connect the Mac to WiFi, connect the Raspberry PI to the Mac with the cable (the Mac needs a converter here), and set the Mac here: System Preferences – Sharing – Internet Sharing -USB 10/100/1000 LAN (tick) :

USB 10/100/1000 LAN is connected (if not, you can temporarily assign an IP address to the USB 10/100/1000 LAN based on your IP address in the IPv4 configuration option) :

Then open the Mac terminal, type arp-a, find the line that says “Bridge100”, and write down the IP address as raspberry PI’s IP address. You may notice that the command line window has changed because I moved to another computer.

Next, you need to enable SSH for PI, as Raspberry has disabled SSH connections by default since September 2016. It’s easy to create an empty file called ‘SSH’ in the TF card partition (no TXT suffix!). After that, we plugged the TF card into the raspberry pie and powered it up.

At this point, you can SSH PI @ to the IP address you just recorded. The default password is Raspberry

Finally, set raspberry PI to automatically connect to wifi. After SSH Raspberry PI, run sudo iwlist wlan0 scan command to check the recognized wifi:

ESSID is the name of wifi, use the following command to add wifi information to raspberry PI:

Press Control + O to save and Control + X to exit.

Sudo reboot Reboot the Raspberry PI. Remove the network cable and the Raspberry PI automatically connects to the saved wifi.

Recommended reading:

APP power consumption test white paper

APP network performance test whitepaper

Want to understand some sense, meet some interesting things — off the island