Go Down

Topic: Bridge between eth1 and wifi (Read 6541 times) previous topic - next topic

dattasaurabh82

You are probably running into trouble because most of the documentation out there, which talks about bridging networks, is talking about going from Ethernet to WiFi, with the WiFi acting as client OR AP, but not both.
Okay so let's say we set up two wifi ports.
  • One is the default wifi chip on board of Yun
  • Another is: say I setup an usb wifi on Yun(like these down below I found)

configuring a 2nd usb wifi
http://www.lucadentella.it/en/2014/11/08/yun-adattatore-wifi-usb/
making it, as well, as an access point.
http://andrea-toscano.com/arduino-yun-usb-wifi-dongle-acting-as-access-point/

Now Yun say has two WANs(radio0 and radio1) and one LAN(ethernet).

Now Should it be following according to https://wiki.openwrt.org/doc/recipes/bridgedap
and then make changes in network and wireless files  accordingly ?

I mean Say radio0 is for WAN0 to home router and and radio1 - WAN1 as access point for other clients/hosts.


 

sonnyyu

#16
Dec 29, 2015, 03:17 pm Last Edit: Dec 29, 2015, 03:29 pm by sonnyyu
A wireless mesh network (WMN) is a communications network made up of radio nodes organized in a mesh topology. The coverage area of the radio nodes working as a single network is sometimes called a mesh cloud. Access to this mesh cloud is dependent on the radio nodes working in harmony with each other to create a radio network. A mesh network is reliable and offers redundancy. When one node can no longer operate, the rest of the nodes can still communicate with each other, directly or through one or more intermediate nodes. The picture below illustrates how wireless mesh networks can self form and self heal. Openwrt suport WMN well. Plus WMN will extend communication distance.  Node 1 to node 9 could be 4*maximum communication distance.



http://wiki.openwrt.org/inbox/mesh.olsr

I have only one Yun, can not start test WMN, anyone could show us  light?




The mesh wifi network (B.A.T.M.A.N, OLSR, 802.11s ) is only requirement of single radio.


The benefit of mesh network:

  • redundancy
  • bandwidth auto scalable
  • self form
  • self heal
  • extended communications distance



sonnyyu



A mesh architectures allowing otherwise out-of-range nodes 1-4 to still connect to the Internet.



sonnyyu

#18
Dec 29, 2015, 03:45 pm Last Edit: Dec 30, 2015, 03:28 am by sonnyyu
Shea Stadium, NYC.

60,372 seats, to support Wifi of them plus size of Stadium.

The mesh network is only way to go?

P.S.

Largest stadiums by capacity:

Rungnado May Day Stadium, 150,000 seats, Pyongyang, North Korea

I am not sure get Wifi connected there is the highest priority.





Mrricca92

The output of ifconfig:

Code: [Select]
root@Arduino:~# ifconfig
br-br1    Link encap:Ethernet  HWaddr 90:A2:DA:F8:06:76
          inet addr:192.168.0.200  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3570 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1757 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:507932 (496.0 KiB)  TX bytes:725845 (708.8 KiB)

eth1      Link encap:Ethernet  HWaddr 90:A2:DA:F8:06:76
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11490 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6368 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10938789 (10.4 MiB)  TX bytes:1423788 (1.3 MiB)
          Interrupt:4

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 90:A2:DA:F0:06:76
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3158 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7383 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:418323 (408.5 KiB)  TX bytes:8066749 (7.6 MiB)






I followed your guide and seems to work something. So I tried to ping from my computer to the device with IP 192.168.1.9 and it works, but when I try to connect to the webserver (http://192.168.1.9:8080/index.htm) with the browser don't works.

Below is my code in setbridge.sh

uci set network.lan.proto=none
uci delete network.lan.ipaddr
uci delete network.lan.netmask
uci set network.wan.proto=none
uci delete network.wan.metric
uci set network.br1=interface
uci set network.br1.type=bridge
uci set network.br1.proto=static
uci set network.br1.ifname=eth1
uci set network.br1.ipaddr=192.168.1.10
uci set network.br1.netmask=255.255.0.0
uci set network.br1.gateway=192.168.1.1
uci set network.br1.broadcast=192.168.1.128
uci set network.br1.dns=8.8.8.8
uci set wireless.@wifi-iface[0].network='br1 lan'
uci commit


Then I have two questions:
1) What do you mean "Power cycling Yun"?
2) In my case I do not need DNS right ?, because I work locally

sonnyyu

#20
Jan 03, 2016, 08:24 pm Last Edit: Jan 03, 2016, 08:27 pm by sonnyyu
I followed your guide and seems to work something. So I tried to ping from my computer to the device with IP 192.168.1.9 and it works, but when I try to connect to the webserver (http://192.168.1.9:8080/index.htm) with the browser don't works.
...
Test with firewall off:

Code: [Select]
/etc/init.d/firewall disable
/etc/init.d/firewall stop


1) What do you mean "Power cycling Yun"?
A: turn off the power then turn it back on.

2) In my case I do not need DNS right ?, because I work locally
A: Never hurt.




sonnyyu

#21
Jan 03, 2016, 08:27 pm Last Edit: Jan 03, 2016, 08:40 pm by sonnyyu
Code: [Select]
uci set network.br1.netmask=255.255.0.0
uci set network.br1.gateway=192.168.1.1
uci set network.br1.broadcast=192.168.1.128


Should be:

Code: [Select]
uci set network.br1.netmask=255.255.0.0
uci set network.br1.gateway=192.168.0.1
uci set network.br1.broadcast=192.168.255.255


It is Class B subnet. IP arrange is 192.168.0.2~192.168.255.254.



Mrricca92

Thanks for the answers. I have another problem, when I turn off and relight Arduino can not longer connect him with wifi.

sonnyyu


Mrricca92

I can not connect to the WiFi network.

Code: [Select]

root@Arduino:~# uci set wireless.@wifi-iface[0].encryption=psk
root@Arduino:~# uci set wireless.@wifi-iface[0].key=arduino
root@Arduino:~# uci commit
root@Arduino:~# wifi down; wifi up
Configuration file: /var/run/hostapd-phy0.conf
Line 56: invalid WPA passphrase length 7 (expected 8..63)
WPA-PSK enabled, but PSK or passphrase is not configured.
2 errors found in configuration file '/var/run/hostapd-phy0.conf'
Failed to set up interface with /var/run/hostapd-phy0.conf
Failed to initialize interface
Failed to start hostapd for phy0
root@Arduino:~#



sonnyyu

#25
Jan 04, 2016, 12:09 pm Last Edit: Jan 04, 2016, 12:11 pm by sonnyyu
Code: [Select]
Line 56: invalid WPA passphrase length 7 (expected 8..63)

The password is too short, use "arduino1" instead of.

Use WPA passphrase is optional, test it with out passphrase first.





Mrricca92


Mrricca92


I followed your advice. But when I get to the point "Power cycling Yun" I can no longer connect to the wifi only with the ethernet cable.

From this point I can no longer have to connect to wifi.
Code: [Select]

root@Arduino:~# uci set wireless.@wifi-iface[0].encryption=psk
root@Arduino:~# uci set wireless.@wifi-iface[0].key=arduino1
root@Arduino:~# uci commit
root@Arduino:~# wifi down; wifi up
Configuration file: /var/run/hostapd-phy0.conf
Using interface wlan0 with hwaddr 90:a2:da:f3:1f:1d and ssid "Arduino Yun-90A2DA        F31F1D"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
root@Arduino:~#
[code]


Comparing ifconfig with your seem right. I can not figure out what it might be.

[code]
br-br1    Link encap:Ethernet  HWaddr 90:A2:DA:FB:1F:1D
          inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11199 errors:0 dropped:3159 overruns:0 frame:0
          TX packets:499 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:896680 (875.6 KiB)  TX bytes:33088 (32.3 KiB)

eth1      Link encap:Ethernet  HWaddr 90:A2:DA:FB:1F:1D
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3405 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6286 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:336292 (328.4 KiB)  TX bytes:554211 (541.2 KiB)
          Interrupt:4

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:249 errors:0 dropped:0 overruns:0 frame:0
          TX packets:249 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:20404 (19.9 KiB)  TX bytes:20404 (19.9 KiB)

wlan0     Link encap:Ethernet  HWaddr 90:A2:DA:F3:1F:1D
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5141 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7719 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:465172 (454.2 KiB)  TX bytes:848960 (829.0 KiB)
[code]

sonnyyu

#28
Jan 05, 2016, 09:02 am Last Edit: Jan 05, 2016, 09:03 am by sonnyyu
The output of:

Code: [Select]
uci show network
uci show wireless


before and after Power cycling Yun.




Mrricca92

This is before Power cycling Yun.
Code: [Select]

root@Arduino:~# uci show network
network.loopback=interface
network.loopback.ifname=lo
network.loopback.proto=static
network.loopback.ipaddr=127.0.0.1
network.loopback.netmask=255.0.0.0
network.lan=interface
network.lan.proto=none
network.wan=interface
network.wan.ifname=eth1
network.wan.proto=none
network.br1=interface
network.br1.type=bridge
network.br1.proto=static
network.br1.ifname=eth1
network.br1.ipaddr=192.168.1.10
network.br1.netmask=255.255.255.0
network.br1.gateway=192.168.1.1
network.br1.broadcast=192.168.1.255
network.br1.dns=8.8.8.8
root@Arduino:~# uci show wireless
wireless.radio0=wifi-device
wireless.radio0.type=mac80211
wireless.radio0.channel=11
wireless.radio0.hwmode=11ng
wireless.radio0.path=platform/ar933x_wmac
wireless.radio0.htmode=HT20
wireless.radio0.ht_capab=SHORT-GI-20 SHORT-GI-40 RX-STBC1 DSSS_CCK-40
wireless.radio0.disabled=0
wireless.@wifi-iface[0]=wifi-iface
wireless.@wifi-iface[0].device=radio0
wireless.@wifi-iface[0].mode=ap
wireless.@wifi-iface[0].encryption=none
wireless.@wifi-iface[0].ssid=Arduino Yun-90A2DAF31F1D
wireless.@wifi-iface[0].network=br1 lan


This is right after Power cycling Yun.
Code: [Select]

root@Arduino:~# uci show network
network.loopback=interface
network.loopback.ifname=lo
network.loopback.proto=static
network.loopback.ipaddr=127.0.0.1
network.loopback.netmask=255.0.0.0
network.lan=interface
network.lan.proto=none
network.wan=interface
network.wan.ifname=eth1
network.wan.proto=none
network.br1=interface
network.br1.type=bridge
network.br1.proto=static
network.br1.ifname=eth1
network.br1.ipaddr=192.168.1.10
network.br1.netmask=255.255.255.0
network.br1.gateway=192.168.1.1
network.br1.broadcast=192.168.1.255
network.br1.dns=8.8.8.8
root@Arduino:~# uci show wireless
wireless.radio0=wifi-device
wireless.radio0.type=mac80211
wireless.radio0.channel=11
wireless.radio0.hwmode=11ng
wireless.radio0.path=platform/ar933x_wmac
wireless.radio0.htmode=HT20
wireless.radio0.ht_capab=SHORT-GI-20 SHORT-GI-40 RX-STBC1 DSSS_CCK-40
wireless.radio0.disabled=0
wireless.@wifi-iface[0]=wifi-iface
wireless.@wifi-iface[0].device=radio0
wireless.@wifi-iface[0].mode=ap
wireless.@wifi-iface[0].encryption=none
wireless.@wifi-iface[0].ssid=Arduino Yun-90A2DAF31F1D
wireless.@wifi-iface[0].network=br1 lan


And this is after finishing the procedure.
Code: [Select]
root@Arduino:~# uci show network
network.loopback=interface
network.loopback.ifname=lo
network.loopback.proto=static
network.loopback.ipaddr=127.0.0.1
network.loopback.netmask=255.0.0.0
network.lan=interface
network.lan.proto=none
network.wan=interface
network.wan.ifname=eth1
network.wan.proto=none
network.br1=interface
network.br1.type=bridge
network.br1.proto=static
network.br1.ifname=eth1
network.br1.ipaddr=192.168.1.10
network.br1.netmask=255.255.255.0
network.br1.gateway=192.168.1.1
network.br1.broadcast=192.168.1.255
network.br1.dns=8.8.8.8
root@Arduino:~# uci show wireless
wireless.radio0=wifi-device
wireless.radio0.type=mac80211
wireless.radio0.channel=11
wireless.radio0.hwmode=11ng
wireless.radio0.path=platform/ar933x_wmac
wireless.radio0.htmode=HT20
wireless.radio0.ht_capab=SHORT-GI-20 SHORT-GI-40 RX-STBC1 DSSS_CCK-40
wireless.radio0.disabled=0
wireless.@wifi-iface[0]=wifi-iface
wireless.@wifi-iface[0].device=radio0
wireless.@wifi-iface[0].mode=ap
wireless.@wifi-iface[0].ssid=Arduino Yun-90A2DAF31F1D
wireless.@wifi-iface[0].network=br1 lan
wireless.@wifi-iface[0].encryption=psk
wireless.@wifi-iface[0].key=arduino1111

Go Up