Jump to content

Stargazers Lounge Uses Cookies

Like most websites, SGL uses cookies in order to deliver a secure, personalised service, to provide social media functions and to analyse our traffic. Continued use of SGL indicates your acceptance of our cookie policy.

daz

Astroberry - Network issues!!

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...

Share this post


Link to post
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

Share this post


Link to post
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!!

Share this post


Link to post
Share on other sites

Don't worry ?

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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 🙂

 

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.