Table of Contents

Building MESHdesk firmware using the LEDE Project

What is the LEDE Project?

The LEDE project is founded as a spin-off of the OpenWrt project and shares many of the same goals. We are building an embedded Linux distribution that makes it easy for developers, system administrators or other Linux enthusiasts to build and customize software for embedded devices, especially wireless routers. The name LEDE stands for Linux Embedded Development Environment.

Why are you advocating LEDE Project instead of OpenWrt?

Preparing the environment

sudo apt-get update
sudo apt-get install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl unzip mercurial

Check out the code

cd ~
mkdir lede
cd lede
git clone https://git.lede-project.org/source.git
#To see the tags (releases)
git fetch --tags
git tag -l
#Checkout the 17.0.1 release
git checkout v17.01.0

Please refrain from using the current development branch or even the lede-17.01 branch since something in that code breaks the Batman-adv mesh in the MESHdesk firmware making it useless.


Installing the packages

./scripts/feeds update
./scripts/feeds install coova-chilli
./scripts/feeds install luasocket
./scripts/feeds install libuci-lua
./scripts/feeds install curl
./scripts/feeds install -a -p routing 
./scripts/feeds install iwinfo
./scripts/feeds install alfred
Installing package 'coova-chilli' from packages
WARNING: No feed for package 'libmatrixssl' found, maybe it's already part of the standard packages?
 
Installing package 'alfred' from routing
WARNING: No feed for package 'libgps' found, maybe it's already part of the standard packages?

Adding the MESHdesk package

svn checkout svn://dvdwalt@svn.code.sf.net/p/radiusdesk/code/trunk/meshdesk/MESHdesk ./MESHdesk
tar -czvf MESHdesk.tar.gz ./MESHdesk
cd ./source
mkdir -p ./package/zzz-MESHdesk/files
cp [where ever you file is]/MESHdesk.tar.gz ./package/zzz-MESHdesk/files
cd ./package/zzz-MESHdesk/files
tar -xzvf MESHdesk.tar.gz
mv ./MESHdesk/Makefile ../
cd ./source
mkdir -p files/etc
cp ./package/zzz-MESHdesk/files/MESHdesk/files/common/passwd ./files/etc
cp ./package/zzz-MESHdesk/files/MESHdesk/files/common/shadow ./files/etc
  • Should you wish to get an existing build environment's MESHdesk package updated to the latest SVN:
cd ./source
cd ./package/zzz-MESHdesk/files/MESHdesk
svn update
#It will mention that it restored the Makefile
#Restored 'Makefile'
cd ../
mv ./MESHdesk/Makefile ../

Tweaking MESHdesk package

MediaTek or Atheros

#Compiling MediaTek
cd ./source
cp ./package/zzz-MESHdesk/files/MESHdesk/configs/dhcp_network_one_eth_mediatek ./package/zzz-MESHdesk/files/MESHdesk/configs/dhcp_network_one_eth
cp ./package/zzz-MESHdesk/files/MESHdesk/configs/frmwr_network_one_eth_mediatek ./package/zzz-MESHdesk/files/MESHdesk/configs/frmwr_network_one_eth
 
#Compiling Atheros
cd ./source
cp ./package/zzz-MESHdesk/files/MESHdesk/configs/dhcp_network_one_eth_atheros ./package/zzz-MESHdesk/files/MESHdesk/configs/dhcp_network_one_eth
cp ./package/zzz-MESHdesk/files/MESHdesk/configs/frmwr_network_one_eth_atheros ./package/zzz-MESHdesk/files/MESHdesk/configs/frmwr_network_one_eth
  • Pleas take care to do the steps above or else you could render your firmware useless if it is using the wrong file!

HTTP or HTTPS

 vi ./package/zzz-MESHdesk/files/MESHdesk/meshdesk
config internet 'internet1'
        option dns 'rd01.wificity.asia'
        option url 'cake2/rd_cake/nodes/get_config_for_node.json'
        option status_url 'cake2/rd_cake/mesh_reports/submit_report.json'
        option actions_url 'cake2/rd_cake/node_actions/get_actions_for.json'
        option ap_url 'cake2/rd_cake/aps/get_config_for_ap.json'
        option ap_status_url 'cake2/rd_cake/ap_reports/submit_report.json'
        option ap_actions_url 'cake2/rd_cake/ap_actions/get_actions_for.json'
        option protocol 'https'
        option ip '192.168.99.1'

Identity interface

 vi ./package/zzz-MESHdesk/files/MESHdesk/meshdesk
option id_if 'eth0'
option id_if 'eth1'

Default mode

 vi ./package/zzz-MESHdesk/files/MESHdesk/meshdesk
option gw_auto_reboot_time '600'
option mode 'mesh'
option id_if 'eth0'

Preset for a certain model and server

 vi ./package/zzz-MESHdesk/files/MESHdesk/meshdesk
 vi ./files/etc/config/system
config system
        option ttylogin '0'
        option log_size '64'
        option urandom_seed '0'
        option timezone 'SAST-2'
        option hostname '505'
 
config timeserver 'ntp'
        option enabled '1'
        option enable_server '0'
        list server '0.lede.pool.ntp.org'
        list server '1.lede.pool.ntp.org'
        list server '2.lede.pool.ntp.org'
        list server '3.lede.pool.ntp.org'
 
config led 'wifi_led'
        option name 'wifi'
        option trigger 'netdev'
        option dev 'bat0'
        option mode 'link tx rx'
        option sysfs 'zbt-wa05:blue:air'

Selecting the packages

make menuconfig

We recommend that you include all of the packages in the list where possible. 8-)

Package Detail
Languages → lua Embedded lightweight scripting language
Languages → luasocket We neet this library for precision timing
libraries → libuci-lua Interface library for lua scripting language to UCI system
Kernel modules → Network support → batman-adv used for the mesh
Network → alfred used to communicate over the mesh
Network → batctl User space configuration tool
Network → Captive Portals → coova-chilli Captive portal for the breakout points
Network → File Transfer → Curl A Client side URL Transfer utility
Network → VPN → OpenVPN PolarsSSL OpenVPN package for OpenVPN brige exit point - You can also use OpenVPN OpenSSL
Network → wpad use this instead of wpad-mini to allow WPA Enterprise suport
Utilities → iwinfo Handy utility to get Wifi info instead of iw
Base system → zzz-MESHdesk The package we checked out and added manually from SVN

Support for 3G/4G dongles

  • We are once again taking the lead with new features.
  • Lets see when and if the commercial guys will follow with 3G/4G support since it requires additional hardware.
Package Detail
Utilities → comgt Used to create chat scripts to connect to mobile network
Kernel modules → USB support → kmod-usb-serial Required for USB data transfer
Kernel modules → USB support → kmod-usb-serial-option Required for USB data transfer
Kernel modules → USB support → kmod-usb-serial-wwan Required for USB data transfer
Kernel modules → USB support → kmod-usb2 Required for USB support in device
Utilities → usb-modeswitch Required to switch the mode of the USB stick from storage to modem

Atheros based 802.11AC

Hardware Firmware Package
Yuncore XD3200 ath10k-firmware-qca988x

Support for WiFi Client Internet connection

  • We are once again taking the lead with new features.
  • This might take the others a bit quicker to catch up with us since it does not require additional hardware.
Package Detail
Network → Routing and Redirection → relayd Used to bridge the WiFi Station interface with the LAN

Removing unused packages

Package Detail
Network → odhcp6c No need for DHCP client v6
Network → odhcpd No need for DHCP server v6
Network → ppp No need for PPP
Kernel modules → Network Support → kmod-ppp No need for PPP
Network → wpad Use wpad-mini instead (This forfeit WPA Enterprise suport)

The only way we could manage to fit everything on a 4M device was to replace wpad again with wpad-mini (This on Chaos Calmer)


Building the firmware

make V=99

What next?