Configuring a Tower Controller - TylerSteane/Three-Tier-ESP-Testbed-Tower GitHub Wiki
Configuring a Tower Controller
Each tower requires a controller, this controller is responsible for communicating with and programming the attached ESP-01 modules. Our design is suited for and tested with a Raspberry Pi 3 Model B+.
Step 1: Install Raspbian to a micro SD card as per the Raspberry Pi documentation (here)
When you start your Raspberry Pi for the first time, the Welcome to Raspberry Pi application will pop up and guide you through the initial setup.
- Click Next to start the setup.
- Set your Country, Language, and Timezone, then click Next again.
- Enter a new password for your Raspberry Pi and click Next.
- Skip the connect to WiFi network stage, we will be hard wiring the Towers to the network.
- Skip the Raspbian update stage
- Select Reboot
Step 2: It's vital to configure the correct System and Interface settings if this step isn't followed correctly the Pi script won't function correctly. Under Menu -> Preferences select the Raspberry Pi Configuration settings.
In System, change the following settings:
- Change the Hostname to something unique. In our prototype environment, we used the relevant tower number ie. "Tower1", "Tower2"
- Resolution: 1920 x 1080 (Helpful for VNC Debugging)
In Interfaces, change the following settings:
- SSH: Enable (For Debugging)
- VNC: Enable (For Debugging)
- Serial Port: Enable (IMPORTANT)
- Serial Console: Disable (IMPORTANT)
Reboot the Raspberry Pi
Step 3: Configure Network Settings. As the ESP-01 modules can be used for Wifi testing it is recommended that the Towers are hardwired to the Managment network. In our prototype system, each device in the network is set with a static IP, this helps with debugging. Because the towers are configured to connect to a static IP it's important to configure the management pc with a static IP address. The default configuration of the Pis is to connect to 192.168.0.100.
- Network Address: 192.168.0.0/24
- Management PC IP: 192.168.0.100
- Tower1: 192.168.0.101
- Tower2: 192.168.0.102
- Tower3: 192.168.0.103
- Tower4: 192.168.0.104
- Tower5: 192.168.0.105
The following steps will be run from a command line terminal or a SSH session
Step 4: Install Python dependencies. Required for the Tower script to run correctly.
- Run:
pip install pyserial
- PySerial is required to read and write serial data to the ESPs
- Run:
sudo apt-get install xterm
- Xterm is required to start the application at bootup
- Run:
git clone https://github.com/espressif/esptool.git
- esptool is required to flash the ESPs
Step 5: Git Clone the ESP-Testbed repository
- Run:
git clone https://github.com/Wingman3434/ESP-Testbed.git
- This clones the latest tower and MGMT scripts
Step 6: Set Pi_Client.py to run at startup
- Run:
sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart
- Above the line starting with @xscreensaver
- Add
@xterm -e /usr/bin/python /home/pi/ESP-Testbed/Tower/Pi_Client.py 192.168.0.100
Step 7: Reboot the Raspberry Pi
- If in SSH run:
sudo reboot now