Introduction: Intel Edison Sharing a File Over and Ad-hoc Network
Hello, learn how to configure a internet-less wireless Edison network through the use of an ad-hoc network.
2-Intel edison boards.
Step 1: Configuring Your Edison Board to Connect to the Ad-hoc Network.
In this step we will create an ad-hoc network.
The first step to do this is to create a bash script to aid in this process.
For the first edison:
When logged in to the Intel Edison via ssh create a bash file called adhoc.sh by entering the following command into the PuTTy command window:
Inside the file paste the following code within the document:
if [ $# != 1 ] ; then
echo "$0 " exit fi $rmt wpa_cli -iwlan0 disconnect $rmt wpa_cli -iwlan0 remove_network all $rmt wpa_cli -iwlan0 add_network $rmt wpa_cli -iwlan0 set_network 0 frequency 2412 $rmt wpa_cli -iwlan0 set_network 0 mode 1 if [ ! -n "$rmt" ] ; then $rmt wpa_cli -iwlan0 set_network 0 ssid \"$1\" else $rmt wpa_cli -iwlan0 set_network 0 ssid '\"'$1'\"' fi $rmt wpa_cli -iwlan0 set_network 0 auth_alg OPEN $rmt wpa_cli -iwlan0 set_network 0 key_mgmt NONE $rmt wpa_cli -iwlan0 set_network 0 scan_ssid 1 $rmt wpa_cli -iwlan0 select_network 0 $rmt wpa_cli -iwlan0 enable_network 0 $rmt wpa_cli -iwlan0 status
Save the document by pressing the escape button then entering ":wq" and pressing the enter key.
The bash file has now been created.
The next step is to initialize the connection.
Launch the bash file through the following command.
Where is replaced with the name of the network to be created.
Change the ip address of the intel board using the following command:
ifconfig wlan0 192.168.0.10
The edison is now ready to connect to an adhoc network.
Repeat the previous steps with your second Intel Edison but replacing the ip with a different one, ie: 18.104.22.168.20.
Step 2: Reading a File Across the Connection
Now that we have connected each Edison, we are now ready to read a file between them.
In the first edison board create a text file called atext.txt in the root folder by typing in the following command into the PuTTy command line.
(Check what your directory is by entering the following command: pwd)
Once the file has been opened enter anything within it ie:"2015" and then save the file by pressing the escape button and entering the following keys.
Press the enter key to save.
On the second Edison board read the contents of the file by entering the following command into the PuTTy window.
ssh 192.268.0.10 tail -f /home/root/file.txt
The ip address in the previous command can be replaced with whatever the ip address of the first Edison is set to.
If all goes well the PuTTy window should display the words "2015".
You have now transferred a file across an adhoc connection.