Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

Astroberry - Network issues!!


daz

Recommended Posts

So, I WAS able to connect my astroberry server to my WLAN and remote onto it via the browser.... (note, was!!)

I decided tonight to try and get the VAP working so I could connect in the field, and this is where it all went wrong!!  I was not able to connect to the RPi at all using the 'astroberry' VAP, although my Ubuntu client 'seemed' to connect and receive an IP address. No matter what I tried (browser, VNC) I could not connect.

So, I went back to my WLAN to try and figure things out, and now it won't connect to the WLAN at all... I've tried a static IP address, but that didn't work and now I get a "No DHCPOFFERS received" message when I restart the wlan0 interface! I can only access by plugging into the device with screen/keyboard/mouse, I can't remote to it at all...

The wpa_supplicant file shows the network correctly, and I have even deleted the entry and redone the wlanconf but still no joy!

Aaarrggh!!

 

Hopefully @RadekK spots this :) but anyone shed any light in the meantime? I'd like to get back to it working on the WLAN before I try the VAP again!!

Ta...

Link to comment
Share on other sites

Let's do a quick review of configuration ;)

1. Networking

Your /etc/network/interfaces should contain:

auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

2. WLAN

Your /etc/wpa_supplicant/wpa_supplicant.conf should contain at least:

network={
scan_ssid=1
ssid="$SSID"
psk="$PSK"
}

where $SSID is your wireless network name and $PSK is your wireless password

 

With only these two configuration files you should successfully connect to your home network. No other tricks are necessary. If you cannot connect despite proper configuration we have some major issue here and need to debug it with logs review i.e. /var/log/syslog

You can disable VAP autoconfiguration by editing /etc/rc.local file. Just comment out the line with check-wlanconn so it looks like:

#check-wlanconn > /dev/null 2>&1

This way artificial intelligence ;) embedded in Astroberry Server will not mess with standard networking configuration described in points 1 & 2 above.

After thius, you can run check-wlanconn and astroberry_vap scripts manually to play with VAP.

BTW. What is you RPi version (3B or 3B+)? Does your home AP support AC mode? Does your PC support AC mode?

BTW2. Take a look at the last but one question in FAQ

  • Like 1
Link to comment
Share on other sites

Hi Radek

Many thanks for your reply - it turns out I am an idiot!! Although I was spelling the name of my SSID correctly, I was ignoring capitalisation!

As soon as I corrected that and rebooted, I can now again connect to my AB Server! Yay!!!

 

So, onwards to retry the VAP!!

 

Thanks!!

Link to comment
Share on other sites

11 hours ago, daz said:

Hi Radek

Many thanks for your reply - it turns out I am an idiot!! Although I was spelling the name of my SSID correctly, I was ignoring capitalisation!

As soon as I corrected that and rebooted, I can now again connect to my AB Server! Yay!!!

 

So, onwards to retry the VAP!!

 

Thanks!!

I made this exact mistake as well got me stumped for 2 days.... reimaging and reimaging.

Link to comment
Share on other sites

  • 9 months later...
On 15/03/2019 at 17:33, RadekK said:

Don't worry ?

Anyway I need to review WLAN/VAP scripts because ppl have problems with them. I will keep you posted.

I've just loaded the image onto a Raspberry Pi4, things by and large seem to work, but I used NetworkManager to connect to my own Wireless Network.

Something interesting is that while I obtained an IP address from my DHCP server, my default gateway was set to 0.0.0.0 and not the IP address of the gateway (which the DHCP server serves to the clients on this subnet), so network connectivity seemed pretty patchy - I could connect to resources on same subnet from Astroberry, and remote systems on remote subnets can initiate connections to the Astroberry, but the Astroberry itself couldn't connect to the Internet, or other subnets on my network.

Turns out that in addition to NetworkManager, dhcpcd is also running as a standalone daemon. So I disabled that (sudo systemctl disable dhcpcd), I still get my IP address via DHCP (through Network Manager), but now the gateway is stable and correct in the configuration (confirmed with route -n).

So my advice is if you don't want to use the VAP, remove all that config, and either use the legacy /etc/network/interfaces config and disable NetworkManager, or disable dhcpcd and just use NetworkManager.

Link to comment
Share on other sites

4 hours ago, gilesco said:

I've just loaded the image onto a Raspberry Pi4, things by and large seem to work, but I used NetworkManager to connect to my own Wireless Network.

Something interesting is that while I obtained an IP address from my DHCP server, my default gateway was set to 0.0.0.0 and not the IP address of the gateway (which the DHCP server serves to the clients on this subnet), so network connectivity seemed pretty patchy - I could connect to resources on same subnet from Astroberry, and remote systems on remote subnets can initiate connections to the Astroberry, but the Astroberry itself couldn't connect to the Internet, or other subnets on my network.

Turns out that in addition to NetworkManager, dhcpcd is also running as a standalone daemon. So I disabled that (sudo systemctl disable dhcpcd), I still get my IP address via DHCP (through Network Manager), but now the gateway is stable and correct in the configuration (confirmed with route -n).

So my advice is if you don't want to use the VAP, remove all that config, and either use the legacy /etc/network/interfaces config and disable NetworkManager, or disable dhcpcd and just use NetworkManager.

 IMHO I would disagree - Dont change anything initially as it works by default 99.99% of the time.  I use wired ,local wlan and a hotspot(with static address for laptop/tablet) works every time (ok as I say 99% of the time - rest is normally me and typing 🙂 ).

Check all your settings first as there are many working "box's" with no problems so messing up files /suspending programs will cause more issues IMHO.

Also use the network priority value to allow Astroberry to connect in the order you require - mine is Wired, Local Wireless and then if all else fails Hotspot server - as the latter will only be used ,in my case, when in the field.

Not saying there couldn't be a problem but 1 against the many would suggest a "local" problem.

To be honest I now just use a 5/2.4 Wifi Router (12v) in the field - doesn't weigh much and i just plug the RPI (any) wired connection. Better Wlan strength ,spread  and less work load on RPI as its in Wifi client not server mode. Then just use the Hotspot in the field if I have problems. 🙂

As I say IMO.

Link to comment
Share on other sites

Hot Spot uses standard functionality of Network Manager and the only thing that Astroberry does is... adding predefined hot spot connection. If it does not work it must be Network Manager issue or (as stash suggests) local issue.

Link to comment
Share on other sites

On 10/01/2020 at 17:43, stash_old said:

 IMHO I would disagree - Dont change anything initially as it works by default 99.99% of the time.  I use wired ,local wlan and a hotspot(with static address for laptop/tablet) works every time (ok as I say 99% of the time - rest is normally me and typing 🙂 ).

Check all your settings first as there are many working "box's" with no problems so messing up files /suspending programs will cause more issues IMHO.

Also use the network priority value to allow Astroberry to connect in the order you require - mine is Wired, Local Wireless and then if all else fails Hotspot server - as the latter will only be used ,in my case, when in the field.

Not saying there couldn't be a problem but 1 against the many would suggest a "local" problem.

To be honest I now just use a 5/2.4 Wifi Router (12v) in the field - doesn't weigh much and i just plug the RPI (any) wired connection. Better Wlan strength ,spread  and less work load on RPI as its in Wifi client not server mode. Then just use the Hotspot in the field if I have problems. 🙂

As I say IMO.

I know it is a different Linux distro, and not Raspbian, but this link explains the problem better than I can with respect to Network Manager and dhcpcd: https://bbs.archlinux.org/viewtopic.php?id=170813

Astroberry is running both dhcpcd as a service in addition to Network Manager (which spawns its own dhcpcd when you decide to set up a connection as "Automatic")

This causes a conflict, you may not notice it because you are on a single subnet network, whereas I have multiple subnets on my network and need the default gateway to operate.

Link to comment
Share on other sites

46 minutes ago, gilesco said:

I know it is a different Linux distro, and not Raspbian, but this link explains the problem better than I can with respect to Network Manager and dhcpcd: https://bbs.archlinux.org/viewtopic.php?id=170813

Astroberry is running both dhcpcd as a service in addition to Network Manager (which spawns its own dhcpcd when you decide to set up a connection as "Automatic")

This causes a conflict, you may not notice it because you are on a single subnet network, whereas I have multiple subnets on my network and need the default gateway to operate.

I have used and set up a lot more complicated set ups! 

You will have to provide a network map and connection requirements to get any further help 🙂

 

Link to comment
Share on other sites

21 hours ago, stash_old said:

I have used and set up a lot more complicated set ups! 

You will have to provide a network map and connection requirements to get any further help 🙂

 

My problem is resolved, I disabled the dhcpcd daemon, and leave Network Manager to spawn it's own instance of dhcpcd.

Giles (CCNP, CCNA Security, CCNA, CCENT)

  • Thanks 1
Link to comment
Share on other sites

5 hours ago, RadekK said:

Can you share the solution providing specific details here? https://github.com/rkaczorek/astroberry-server/issues

I don't have a github account, wish there was a way to do this anonymously, I'd rather not subscribe to yet another online account, with yet another password, but all I've done from the 2.0.0 image build is the following:

sudo systemctl disable dhcpcd

Let me show you the issue I had with these command excerpts:

#First let's look at the routing table with the default astroberry setup:

root@indi:/home/astroberry# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     303    0        0 wlan0
169.254.0.0     0.0.0.0         255.255.0.0     U     303    0        0 wlan0
172.21.1.0      0.0.0.0         255.255.255.0   U     600    0        0 wlan0

#For some reason the gateway has been set to 0.0.0.0

#Checking the IP address for wlan0, shows it got the IP from DHCP
root@indi:/home/astroberry# ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.21.1.71  netmask 255.255.255.0  broadcast 172.21.1.255
...

So disable the DHCPCD daemon:

root@indi:/home/astroberry# systemctl disable dhcpcd
Synchronizing state of dhcpcd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable dhcpcd
Removed /etc/systemd/system/multi-user.target.wants/dhcpcd.service.
Removed /etc/systemd/system/dhcpcd5.service.

It is still running (but won't be after a reboot), note the highlighted debug in the status:


root@indi:/home/astroberry# systemctl status dhcpcd
* dhcpcd.service - dhcpcd on all interfaces
   Loaded: loaded (/lib/systemd/system/dhcpcd.service; disabled; vendor preset: enabled)
   Active: active (running) since Sat 2020-01-18 15:49:01 GMT; 1min 47s ago
 Main PID: 419 (dhcpcd)
    Tasks: 1 (limit: 4915)
   Memory: 2.3M
   CGroup: /system.slice/dhcpcd.service
           `-419 /sbin/dhcpcd -q -b

Jan 18 15:49:11 indi dhcpcd[419]: wlan0: soliciting an IPv6 router
Jan 18 15:49:12 indi dhcpcd[419]: wlan0: soliciting a DHCP lease
Jan 18 15:49:12 indi dhcpcd[419]: wlan0: offered 172.21.1.71 from 172.21.2.253
Jan 18 15:49:12 indi dhcpcd[419]: wlan0: ignoring offer of 172.21.1.71 from 172.21.2.253
Jan 18 15:49:17 indi dhcpcd[419]: wlan0: probing for an IPv4LL address
Jan 18 15:49:23 indi dhcpcd[419]: wlan0: using IPv4LL address 169.254.46.130
Jan 18 15:49:23 indi dhcpcd[419]: wlan0: adding route to 169.254.0.0/16
Jan 18 15:49:23 indi dhcpcd[419]: wlan0: adding default route
Jan 18 15:49:23 indi dhcpcd[419]: wlan0: pid 419 deleted default route
Jan 18 15:49:25 indi dhcpcd[419]: wlan0: no IPv6 Routers available

So, let's stop dhcpcd:


root@indi:/home/astroberry# systemctl stop dhcpcd
 

Now restart network manager:

root@indi:/home/astroberry# systemctl restart NetworkManager
root@indi:/home/astroberry# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.21.1.1      0.0.0.0         UG    600    0        0 wlan0
172.21.1.0      0.0.0.0         255.255.255.0   U     600    0        0 wlan0
 

I get the correct gateway from DHCP which is managed by NetworkManager.

Link to comment
Share on other sites

Thanks for sharing.

Default gateway set to 0.0.0.0 is strange indeed. This must be an isolated case. I have reviewed and retested configuration on fresh system and I always get proper gateway from local dhcp servers. I will keep the configuration in the image as it is now unless this issue is reported by other users.

Clear skies!

Link to comment
Share on other sites

  • 9 months later...

I'm getting network issues and am not very Linux syntax savvy.   

I'll connect it to my phone's hotspot, and also connect a tablet to that same hotspot, run Fing on the tablet (to see devices connected to that network) and can see that Astroberry almost always has 2 IP addresses.  Anyway, I normally can VNC to one of them so this isn't a problem but last night in the field I could not VNC to at all.  I rebooted all devices several times in different orders, I also deleted Astroberry's own Wi-Fi connection configured in the network manager leaving only my phone hotspot Wi-Fi connection configured with a priority of 1 or 2 and VNC just would not connect.  

I would really like to use astroberry and have spent many days and nights trying to work with , understand and learn a bit about linux, but after another night lost I am at that point right now where I feel like we are not destined to get along.

It's there anything I should try from here? 

 

Link to comment
Share on other sites

38 minutes ago, EmuHead said:

I'm getting network issues and am not very Linux syntax savvy.   

I'll connect it to my phone's hotspot, and also connect a tablet to that same hotspot, run Fing on the tablet (to see devices connected to that network) and can see that Astroberry almost always has 2 IP addresses.  Anyway, I normally can VNC to one of them so this isn't a problem but last night in the field I could not VNC to at all.  I rebooted all devices several times in different orders, I also deleted Astroberry's own Wi-Fi connection configured in the network manager leaving only my phone hotspot Wi-Fi connection configured with a priority of 1 or 2 and VNC just would not connect.  

I would really like to use astroberry and have spent many days and nights trying to work with , understand and learn a bit about linux, but after another night lost I am at that point right now where I feel like we are not destined to get along.

It's there anything I should try from here? 

 

I assume you're using a stock Pi without any extra WiFi adapters?

You should be able to connect via https://astroberry.local/ from the local network. I ran in to issues because I was trying to use a separate WiFi dongle to get a better range. The best solution I found was to get everything working in the house, and then rebooted a few times to make sure the same behavior happened each time. You can also try booting without the hotspot active to see what happens in that scenario.

Link to comment
Share on other sites

7 hours ago, rnobleeddy said:

I assume you're using a stock Pi without any extra WiFi adapters?

You should be able to connect via https://astroberry.local/ from the local network. I ran in to issues because I was trying to use a separate WiFi dongle to get a better range. The best solution I found was to get everything working in the house, and then rebooted a few times to make sure the same behavior happened each time. You can also try booting without the hotspot active to see what happens in that scenario.

Yes its a stock Pi without adapter.  I have deleted all the wifi connections within Astroberry though (including the one with -999 priority also), and only left the one i created to connect to my Phone's hotspot.  I dont think it liked that. 

Does there need to be 'Astroberry Hotspot' (with the -999 priority) or 'Astroberry' wifi connections configured for it to work even at a base level.

How can I add the Astroberry VAP again, because I'm pretty sure I deleted it.

I also checked for the lines in etc/network/interfaces and they weren't there.

I then checked etc/wpa_supplicant/wpa_supplicant.conf and it didn't exist, only the .bak version of that file existed.

Edited by EmuHead
Link to comment
Share on other sites

All good questions - afraid a couple of them I had myself! I got in a bit of a mess with 2 wifi adapters but I never worked out all the quirks.

Quote

Does there need to be 'Astroberry Hotspot' (with the -999 priority) or 'Astroberry' wifi connections configured for it to work even at a base level.

Almost certainly not. So unless you need it back, I wouldn't worry about the fact you deleted it.

 

Is it the case that you know the Pi is connected to the hotspot and you just can't VNC to it, or are you unsure whether it's connected to your WiFi hot spot?

If it's the WiFi connection, I'd suggest booting it up attached to a monitor to see what it's connecting to. It will remember settings from boot to boot, so if you only have the hotspot setup then it that should be fine. If you have >1 connection configured the behavior appears to be that it sticks with whatever it finds first. This could be the culprit if you've also setup a 2nd WiFi connection on the astroberry and it's connect to that (e.g. your house WiFi is on the edge of range in your garden) - then your tablet is no longer on the same network.

If it's VNC then you should able to get there via  https://astroberry.local/  in a browser from a device on the same network. Not sure why astroberry has 2 ip addresses - where are you seeing this? You should always be able to SSH in to one of them (e.g. via https://www.chiark.greenend.org.uk/~sgtatham/putty/).  

 

You can always just start from a blank image if you're worried that something has been messed up.

 

 

 

 

 

Link to comment
Share on other sites

On 09/11/2020 at 20:13, rnobleeddy said:

All good questions - afraid a couple of them I had myself! I got in a bit of a mess with 2 wifi adapters but I never worked out all the quirks.

Almost certainly not. So unless you need it back, I wouldn't worry about the fact you deleted it.

 

Is it the case that you know the Pi is connected to the hotspot and you just can't VNC to it, or are you unsure whether it's connected to your WiFi hot spot?

If it's the WiFi connection, I'd suggest booting it up attached to a monitor to see what it's connecting to. It will remember settings from boot to boot, so if you only have the hotspot setup then it that should be fine. If you have >1 connection configured the behavior appears to be that it sticks with whatever it finds first. This could be the culprit if you've also setup a 2nd WiFi connection on the astroberry and it's connect to that (e.g. your house WiFi is on the edge of range in your garden) - then your tablet is no longer on the same network.

If it's VNC then you should able to get there via  https://astroberry.local/  in a browser from a device on the same network. Not sure why astroberry has 2 ip addresses - where are you seeing this? You should always be able to SSH in to one of them (e.g. via https://www.chiark.greenend.org.uk/~sgtatham/putty/).  

 

You can always just start from a blank image if you're worried that something has been messed up.

 

 

 

 

 

Ok phew.  

I've retested a few more times and it seems to connect consistently now to my phone's hotspot.  Now to not change anything.

The 2 IP addresses is what's shown in the network identification app, Fing.  It shows the Astroberry has 2 IP addresses, usually 1 number apart.  If i can't connect to the first one, can usually connect to the second one.  Not sure why it has two as I know this is unusual.

I still would like to re-add the default connection (the -999 one) back in case I need it one day.  Any chance someone could post a screen shot of those settings?

At any rate, appreciate the help thus far.

Cheers!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.