Build steps for compilation on Raspberry Pi with Raspbian OS

Prerequisites

      1. Install the Raspian Pi OS from the “Raspberry Pi Imager” software. Select the Raspberry Pi Os (64-bit) image. 
      2. After installation below are additional packages to be installed for build, db and execution.

sudo apt-get update;
sudo apt-get upgrade;
sudo apt-get install vim;
sudo apt-get install libev-dev;
sudo apt-get install libjansson-dev;
sudo apt-get install zlib1g-dev;
sudo apt-get install libnl-3-dev;
sudo apt-get install libnl-genl-3-dev;
sudo apt-get install libnl-route-3-dev;
sudo apt-get install libavro-dev;
sudo apt-get install libcjson1 libcjson-dev;
sudo apt-get install libssl-dev;
sudo apt-get install uuid-dev;
sudo apt-get install libmysqlcppconn-dev; 
sudo apt-get install libreadline-dev;
sudo apt-get install iptables;
sudo apt install mariadb-server;

sudo apt-get install golang;

Build Instructions

    1.  In a working directory git clone the OneWifi in generic folder and unified-wifi-mesh repository

mkdir easymesh_project
cd easymesh_project
git clone https://github.com/rdkcentral/OneWifi.git
git clone https://github.com/rdkcentral/unified-wifi-mesh.git

    2.  Run the makefile of OneWifi with setup option to pull in other dependent repository. This is a one time operation.

cd OneWifi
make -f build/linux/makefile setup

    3.  Build the Onewifi with make command

make -f build/linux/makefile all

    4.   Build easymesh components in the unified-wifi-mesh folder

        • Controller

cd unified-wifi-mesh/build/ctrl
make clean; make all

        • Cli

cd unified-wifi-mesh/build/cli
make clean; make all

Note: For the latest Cli package "golang" should be installed. Instructions specified in the prerequisite section above.


        • Agent

cd unified-wifi-mesh/build/agent
make clean; make all


Execution Steps

Prerequisites

OneWifi Related

        • Install bridge utils 

sudo apt-get install bridge-utils

        • Mask running of wpa_supplicant with below commands and ensure that wpa_supplicant is not running after these steps using ps command.

sudo systemctl stop wpa_supplicant
sudo systemctl disable wpa_supplicant
sudo systemctl mask wpa_supplicant
sudo systemctl status wpa_supplicant 

        • Configure brlan0 interface, IP Tables, DHCP 

#Enable brlan0 interface and configure ip address
sudo brctl addbr brlan0
sudo ip link set dev brlan0 up
sudo ip addr add 192.168.100.1/24 broadcast 192.168.100.255 dev brlan0

#IP tables command
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o brlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i eth0 -o brlan0 -j ACCEPT

#dnsmasq for DHCP in background or in a different terminal
sudo dnsmasq -i brlan0 -d --dhcp-range=192.168.100.2,192.168.100.200 &


DB Setup commands (On controller)

        • Setup mysql database one time running below command. Choose "n" for Remove anonymous users and Remove test database.

sudo mysql_secure_installation

        • Setup "OneWifiMesh" database with the below commands

#Login to MariaDB monitor
sudo mysql -u root -p

#In MariaDB console
create database OneWifiMesh;
use OneWifiMesh;
show tables;                        ==> should show no tables

        • Reset database and check tables are created

#In a separate window run easy mesh ctrl with <username of db>@<password> to connect to DB.
sudo ./onewifi_em_ctrl root@root

#In a separate window run easy mesh cli using the below command to open the updated go based cli
sudo ./onewifi_em_cli rpi

            • In the cli use keys "j" to scroll down and "k" to scroll up the menu.
            • Select "Wifi Reset" and then select Update to update the window.
            • Select Apply to reset the database.

Sample screenshot of the cli below:


#After this in MariaDB Console you if you run "show tables;" you will see 9 tables created with NetworkSSIDList and NetworkList tables Initialized.
# All other tables will be empty
MariaDB [OneWifiMesh]> show tables;

+------------------------+
| Tables_in_OneWifiMesh |
+------------------------+
| BSSList                             |
| DeviceList                        |
| NetworkList                     |
| NetworkSSIDList             |
| OperatingClassList         |
| PolicyList                         |
| RadioList                          |
| STAList                            |
| ScanResultList                |
+-----------------------+


Running instructions
        • Device 1  - Run Easy mesh Controller and cli in separate windows. 

sudo ./onewifi_em_ctrl root@root

sudo ./onewifi_em_cli

        • Device 2 - Run OneWifi first in a separate window and then run easy mesh agent

sudo ./OneWifi -c

sudo ./onewifi_em_agent

        • In cli you can select various options to see that it is populated with the updated information. 
        • To change SSID do the following 
          • Select "SSID List" from the menu
          • Select "Update" button to enter into edit mode
          • Change the SSID to desired value
          • Select "Apply" button to save the edited setting.

Note:

 1. Use "Tab" to move between Update, Apply and Cancel button in the cli

2. Use keys "j" and "k" to scroll up and down. 



  • No labels

6 Comments

  1. Unknown User (cpokuru) , Thanks for providing a building guide. Do we have any pages for a running guide?

  2. Hello Unknown User (mseo) and Unknown User (b.carlson) ,We will walk through the runtime in our coming working group calls


    1. Hello Unknown User (mseo) Unknown User (b.carlson) et al,

           I have updated Execution steps in this page and will go over this in the working group call as a demo on Nov-7th. 

      1. Unknown User (amarnath_hullursubramanyam) , Thanks for providing the demo and guide for the execution steps today. I will try it and provide feedback. 

        1. Unknown User (mseo) , Most welcome. I did some minor edits with regards to the command. Please check that when you are executing.