Giter VIP home page Giter VIP logo

meshandroid's Introduction

Mesh

Quick start

  • Use Samsung Galaxy S4
  • Flash LineageOS 14.1
  • Install su (addonsu-14.1-arm-signed.zip)
  • Disable WiFi in Android settings
  • Install this app
  • Choose an IP address and network name. Note: The IP address must be unique on the network, and the network name should be the same for all phones.
  • Click "Start Mesh network" to connect to the network
  • Click "Run OLSRD" to build the mesh

Details

This is a small app to build a Mesh network using OLSR. It is very similar to MANET Manager.

This app was built to run exclusively on the Samsung Galaxy S4 (i9505)

The app requires WiFi Ad-Hoc mode, which is generally not support by Android (see here).
In order to enable it, the app requires root access to load a different network driver, and it expects to find these files on the phone:

  • /system/etc/wifi/bcmdhd_ibss.bin
  • /system/etc/wifi/nvram_net.txt

They are available in LineageOS 14.1 for jftlexx.

So if you own a S4, flash LineageOS, install su and you should be ready to run this app.

If you own a similar phone (I've tested the i9506 and the Samsung Note 3 (SM-N9005) successfully) or a phone with the same bcmdhd driver it might also work.

WiFi Ad-Hoc

First step is to enable WiFi Ad-Hoc mode on your phone.

Please note that it was necessary to set a fixed BSSID in order to connect properly to the network. This is hard-coded and set to 02:11:22:33:44:55.
If this wouldn't be hard-coded, you might end up with two networks with the name SSID, but different BSSIDs which aren't able to communicate between each other.

Second note: Subnet mask is also hard-coded to 255.0.0.0

OLSR

The app uses OLSR as the routing protocol. It comes with a precompiled binary for olsrd and the jsoninfo plugin.

After you've set up the Ad-Hoc network, press "Start OLSR" to get the daemon running in the background. It will begin to automatically detect other OLSR clients in the network.

All detected neighbors are shown in the app.

If olsrd is running and you connect to the device via adb, you can access the jsoninfo data by:

curl http://localhost:9090/all

How to build from source

Quote from Andrew Hunter [email protected]:

For olsrd (git clone https://github.com/OLSR/olsrd.git), I had to change a couple of things:

  1. in make/Makefile.android add -pie to LDFLAGS (line 124 I think)
  2. in make/Makefile.android remove the option -mthumb-interwork from the CPPFLAGS (around line 100)
  3. rewrite the end of make/Makefile.android.compiler like this:
NDK_ABIDIR = linux-androideabi
NDK_SYSROOT = $(NDK_BASE)/sysroot
NDK_UNAME = $(shell uname -s | tr '[A-Z]' '[a-z]')
NDK_TOOLCHAIN = $(NDK_BASE)/
CROSS_COMPILE = $(NDK_BASE)/bin/
 
CC = $(CROSS_COMPILE)clang --sysroot="$(NDK_SYSROOT)"
LD = $(CROSS_COMPILE)arm-linux-androideabi-ld
AR = $(CROSS_COMPILE)llvm-ar

Then I compiled it with:

$ make OS=android NDK_BASE=/path/to/my/ndk/standalone/toolchain/ build_all

And then I ran it as root on the devices from /data/local/tmp:

$ ./olsrd -i wlan0 > olsr.log &

This worked and began installing routes once multiple devices could see each other.

Driver details

Andrew Hunter [email protected] found a way to enable the IBSS driver on the S4. He has insane knowledge about mesh routing and showed me step-by-step how to set up Ad-Hoc mode and OLSR on Android.

Blog posts:

bcmdhd vs brcmfmac

bcmdhd is what broadcom open-sourced for android. Separately, we started working on brcmfmac for the mainline linux kernel. Both drivers come from the same proprietary driver. The goal is to have brcmfmac work on Android as well and we have most features on board for that.

Source: gmane.org

Known issues

Not tested at all.
No power management, I got no idea what happens after the phone goes into standby mode.

Sometimes the olsrd daemon hangs and you need to force kill it. I should add the watchdog plugin to avoid this.

meshandroid's People

Contributors

andreas-mausch avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.