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

Unable to load Node.js chat client after installing Subnodes on Raspberry Pi 3B #17

Open Chulabhaya opened 6 years ago

Chulabhaya commented 6 years ago

Hi there. Not sure where I'm going wrong in my installation setup here, but I've been attempting to set up Subnodes on a Raspberry Pi 3B running Raspbian Stretch (not Lite), where I'm using the Pi's built in wifi-adapter (which I believe is wlan0), and an Adafruit wifi adapter (https://www.adafruit.com/product/814) as wlan1 (I believe this also has the correct driver). In the subnodes.config file, I commented out the last four lines under "# SET THE DHCP RANGE IF WE ARE ONLY SETTING UP AN AP", since I was trying to setup both an access point and a mesh.

Afterwards I ran the install script, and a network called submesh showed up on my laptop (but not on my Android phone, any idea why that might be?). I connected and tried to browse to http://www.subnodes.org and it would not load. Any ideas as to what I'm doing incorrectly? Thank you!

breqdev commented 6 years ago

I'm having a similar issue. My Ubuntu laptop detects the network but will not connect to it.

chootka commented 6 years ago

Hello - @Yuerno @wesleycha do either of you need to be running a node server? If not, I would recommend using the https://github.com/chootka/subnodes-lighttpd repository, which sets up a lighttpd (apache-like) web server running php7.

Either way, I will look at this issue as soon as possible this week.

chootka commented 6 years ago

Another note - you shouldn't comment anything out in the subnodes.config file. The comment "# SET THE DHCP RANGE IF WE ARE ONLY SETTING UP AN AP" was there as a note to myself that I realize is very confusing, and I will remove it from the config file.

Finally, when you see the 'submesh' network come up, you won't be able to join this - it's used solely by batman adv. You need to configure and connect to your access point (which will have whatever name you set for the AP_SSID param in the config file). This is your entry point into the web server on your RPi.

If either of you want to talk about this more in real time, find me in the #subnodes room on chat.freenode.net.

Chulabhaya commented 6 years ago

@chootka Thanks for the reply! It's not really important for me to be running necessarily a nodejs server; the important aspect for me is being able to do the chat client functionality across people connected to a BATMAN mesh network. Would the same sort of thing be possible through lighttpd as well?

I'll give the nodejs version of subnodes another shot with the updated changes and see how it goes. Thanks for your work on this!

chootka commented 6 years ago

@Yuerno Yeah, so they would join your access point, open up a web browser which would load your chat client and then be able to communicate via the mesh network from there.

With that said, I don't have a boilerplate mesh-connected chat application available to show as an example unfortunately. The important thing is to know that the access point is bridged with the mesh point, meaning that traffic from the access point can cross over to the mesh network - but it will take additional configuration and development to take advantage of this on your part.

If you did end up developing something like that, i'd be happy to have a pull request from you :)

And like i mentioned, if you wanted to chat more in real time about how to reach other devices over the mesh network, i am happy to explain in the #subnodes IRC room on freenode. It's a little more advanced than what's available in the subnodes repo at this time (subnodes was intended to be a very simple starter shell...)

~sarah

breqdev commented 6 years ago

Sorry for not getting back to you for a while; I just finished midterms so I hadn't had time to work on this for while. I've gotten two nodes running subnodes-lighttpd, one is a Pi 3 and the other is a Pi 2. The access points are working fine, but the mesh network is not working. I am unable to ping one node from the other, and running sudo batctl neighbors returns an empty list, so the nodes can't see each other. I have changed the IP address ranges of the second node to be distinct from the IP addresses of the first, but otherwise I have not made any changes to the configuration files. Both mesh networks have the essid of "submesh". Is there another setting that needs to be changed?

Chulabhaya commented 6 years ago

@chootka So I gave the Node.js version of Subnodes another shot, using a Raspberry Pi 3B with the November version of Raspbian Stretch, and the kernel updated to 4.14 (to get an updated version of Batman-adv). Since I just wanted to test out a single node, I didn't change anything in the install script, and simply ran it. After restarting however, I don't see the access point on any devices, and the Pi says 'no wireless interfaces found', and if you mouse over it, it says 'connection to dhcpcd lost'.

Do you think it's possible that not using the Lite version of Raspbian or updating the kernel could make this not work? I'll also give subnodes-lighttpd a shot later to see if I get the same issue as @wesleycha

EDIT: So when I ran the installation for subnodes-lighttpd (this time with the same version of Stretch, but with no kernel update, and making only 1 change in the config file, which was to change the AP_SSID to a name of my choosing), everything seems to work. I'm able to see the access point and connect to it from my Android phone (however, not from my Windows 10 laptop, but I think that might be a Windows issue). I haven't been able to test to see if the Batman mesh network is fully functional and will see other nodes, but I will try that tomorrow and see if I get the pinging issues.

breqdev commented 6 years ago

All right, I'm done with classes for the week so I've had time to try a few more things. I re-flashed Raspbian Lite and did a full reinstall on both nodes to ensure the kernel versions and BATMAN versions matched up. However, running batctl n still does not show any neighbors, even though the network SSIDs match up. Both nodes are using WiFi dongles form Edimax (which run the access point just fine, so I doubt they would cause issues when running the mesh). The only difference between the nodes is that one is a Pi 3 with a single USB adapter and the other is a Pi 2 with two USB WiFi adapters. Unfortunately, I forgot to bring another Pi back to school with me, so I won't have access to two identical Pis until February break.

@Yuerno, have you been able to see if the BATMAN mesh works on your setup?

EDIT: About the windows issue: I've had similar issues before. Windows doesn't let you join networks without Internet access. This is actually one of the reasons I switched to Ubuntu.

Chulabhaya commented 6 years ago

@wesleycha Can confirm, the mesh doesn't work for me either.

As a matter of fact, I can't get BATMAN running by itself anymore (this is outside of Subnodes). The issue seems to be that BATMAN requires the Cell IDs of the network interfaces you're using for it (wlan0, wlan1, etc.) across multiple Pis to all match, which happened fine a couple of weeks ago, but apparently no longer works. Not sure what caused it, although it's pretty frustrating to say the least, since I've been making a project with the mesh as the backbone, and it was perfectly functioning a couple of weeks ago, and then without any changes, the Cell ID issue pops up.