chootka / subnodes

Subnodes is an open source project that configures your Raspberry Pi as a wireless AP, Node.js server, and BATMAN ADV mesh point.
Other
205 stars 39 forks source link

Meshing with LibreMesh #19

Closed luandro closed 5 years ago

luandro commented 6 years ago

Hey, I'm trying to use subnodes to mesh a Raspberry 3 using a TL-WN722N dongle to a router with a Libre Mesh firmware installed.

I'm not so familiar with how to get the information for the config file to setup subnodes.

# To-Do: Specify exact device you would like to use for mesh point
#MESH_PHY="phy2"

By using the lsusb command I get the usb devices, but none of the information looks like phy2. And since it has a To-Do, is this implemented?

MaStr commented 6 years ago

Hi, which TLWN722N version do you have? Is it a v1 or a different version? V2 and later have very poor native linux support and my last tests ended up with no possible AdHoc networks. I am open to any other experiences, maybe @chootka has some.

In addition: If you want to mesh between an 2nd device other then subnodes via BATMAN, you need to make sure that

To find out the "phyX" number, you need to run:

iw phy  | grep phy

To get more information, you can also run:

iw phy phyX info

If you can't finde two active phy devices with the "grep" output, IMHO you should get a different USB WiFi dongle.

best regards Matthias

luandro commented 6 years ago

Thanks a lot @MaStr.

It took me a while, but I was able to get an Atheros chipset. Just tried running the subnodes install with the right phy, but I think I got some of the other info wrong. I'll try to dig a little deeper into Libre Mesh to get everything right.

I'll close this issue once I succeed/fail, in order to document the process.

Cheers!

MaStr commented 6 years ago

An additional comment about the configuration: The points described above are only to make both nodes mesh with each other, which means a Layer2 mesh. Layer2 is like patching an ethernet cable between both devices.

Additional configuration of IP addresses will be necessary after you ensures layer2 connectivity. Which steps are needed to be done is depending on the network configuration subnodes assumes and which LibreMesh provides/needs.

luandro commented 6 years ago

My main objective is to get a Layer 2 mesh in order to run protocols such as scuttlebot freely. But I still haven't been able to get it to work. Here are the config files for the LibreMesh router, maybe you can help me spot something I'm missing.

config lime 'system'
        option domain 'lan'
        option hostname 'teste'

config lime 'network'
        list protocols 'ieee80211s'
        list protocols 'lan'
        list protocols 'anygw'
        list protocols 'batadv:%N1'
        list protocols 'bmx6:13'
        list protocols 'olsr:14'
        list protocols 'olsr6:15'
        list protocols 'olsr2:16'
        option primary_interface 'eth0'
        list resolvers '4.2.2.2'
        list resolvers '141.1.1.1'
        list resolvers '2001:470:20::2'
        option main_ipv4_address '10.%N1.0.0/16'
        option main_ipv6_address '2a00:1508:0a%N1:%N200::/64'
        option anygw_mac 'aa:aa:aa:%N1:%N2:aa'
        option anygw_dhcp_start '2'
        option anygw_dhcp_limit '0'
        option bmx6_over_batman 'false'
        option bmx6_mtu '1500'
        option bmx6_pref_gw 'none'

config lime 'wifi'
        list modes 'ap'
        list modes 'apname'
        list modes 'ieee80211s'
        option ieee80211s_mesh_id 'LiMe'
        option adhoc_mcast_rate_5ghz '6000'
        option distance '1000'
        option ieee80211s_mesh_fwding '0'
        option apname_ssid 'Moinho/%H'
        option adhoc_bssid 'ca:fe:00:c0:ff:ee'
        option htmode_5ghz 'HT40'
        option channel_2ghz '11'
        option adhoc_mcast_rate_2ghz '24000'
        option channel_5ghz '48'
        option adhoc_ssid 'LiMe'
        option ap_ssid 'Moinho'

config net 'lm_hwd_openwrt_wan'
        option autogenerated 'true'
        list protocols 'ieee80211s'
        list protocols 'anygw'
        list protocols 'batadv:%N1'
        list protocols 'bmx6:0'
        list protocols 'olsr:14'
        list protocols 'olsr6:15'
        list protocols 'olsr2:16'
        list protocols 'wan'
        option linux_name 'eth0.2'

And this is the config file I'm trying to run subnodes with.

MaStr commented 6 years ago

Hi Luandro, first of all, and this is very important: scuttlebot is not a layer2 protocol for gossip etc. It uses IPv4 broadcasts to 255.255.255.255 to announce the appearance, but the message contains a hostname or an IPv4 to be connected to.
You need to get the batman-adv network up and running AND a compatible ipv4 setup. (btw: I saw your post in ssb as well ;-) )

The next topic is your mesh configuration: I posted in my first post, you need to match SSID, and the bssid between both configurations:

'wifi'.adhoc_bssid == CELL_ID 'wifi'.adhoc_ssid == MESH_SSID

channek etc. seems to match.

I do not have practical experience with such a setup, but the comment is based on my experience with the protocol.

best regards Matthias

luandro commented 6 years ago

It's awesome that you know about ssb and what I'm trying to achieve, that makes it easier. Who are you in ssb?

I've changed the config to match CELL_ID and MESH_SSID, but still can't get it to work. A batctl if on the Pi gives me only wlan1: active, shouldn't there be more interfaces configured?

I've moved all the install scripts from subnodes to PiBakery, would you mind helping me out in the meshpi repo? So I can close this issue here and move it to somewhere more specific.

MaStr commented 6 years ago

Ok, we can move the discussion over. BTW: If you want to checkout if batman-adv found another node, you need to run

batctl o 
chootka commented 5 years ago

I will close this issue since it moved over to a diff thread.