User avatar
By RichardS
#43124 User
Shubham Jain

Description
Using its cheap Wi-Fi capability, we have successfully implemented a source routing protocol on an ad-
hoc ESP8266-12 network from a root node as the source using Arduino IDE for development. The
reasons we went for ESP8266-12 were that it was locally available in Ahmedabad (Gujarat, India) here
and we wanted to use RPSMA antenna for our application.
First we implemented a client-server demo, and then proceeded to multi-hop communication with fixed
topology. And this led us to the implementation of source routing on application layer as our next step.
For this, initially, we used a combination of breadth-first and depth-first traversal (of the tree formed by
the nodes in the network) to search the network for routes from a designated root node. It worked for a
3 node network. That is, we got routes from all nodes in the network from the designated root node.
Using the routes, the root node can enable access to any node in the network for the user.
But on increasing the number of nodes to 6, it failed to give routes of all nodes. This happened because
of the combination of the two traversal techniques. We did not take care of multiple nodes wanting to
connect the same node at the same time leading to high traffic, which led to not being able to connect
to some nodes or reset of some nodes with garbage output on serial terminal.
Then, we relooked at the problem and used only depth-first traversal to search the network for routes
from our root node. That worked well and now we had the routes to all nodes in the network from the
root node. Now we can connect to any node with our packets in form of URL strings which we inherited
from the client-server demo.
This can be easily extended to implement a mesh by directing all messages via root node.
As few of our nodes run on battery in our application, we implemented deep sleep mode for them for a
fixed duration decided by the root node. Again, using depth-first traversal, the farthest node on the
route from the root node sleeps first, followed by the previous node in the route if all the nodes for
which that previous node is a previous node have slept. All nodes store its important information in
EEPROM which they access after wake-up after the sleep duration which is same for all nodes that slept.
And by using depth first traversal, we ensured that first the node farthest from the root node wakes up
as it slept first, thus ensuring no need of time-synchronization for communication when the root node
wants to communicate with all nodes after they wake up.
Description of images attached:
1. Node1.jpg: This node consists of an Arduino Mega 2560 board for initiating the routing
connected serially to the ESP8266 which acts like a master node for collecting paths from all
nodes in the network.
2. One of other nodes.jpg: This is an example of all other nodes. In this, Arduino board is used just
for giving power and viewing the serial output. This was done to take care of current
requirement of ESP8266 in case of direct serial output.
3. The other two images show the serial output showing how the neighbors are collected and
paths are formed. For example, node1_screenshot2.png shows all routing paths received: 1,3-
1,3,2-1,4-1,6. Here, the node separator is ‘,’ and the path separator is ‘-‘. That means, we got 4
paths for the four nodes we used, we did not use node ID 5. So 3 is directly reachable from 1, 2
is two-hop away reachable through 3 and both 4 and 6 are directly reachable from 1.

Parts

Links
Homepage

Video

Images
Attachments
Node1.JPG
One of other nodes.JPG
node1_screenshot2.png
node1_screenshot1.png