Skip to content

Instantly share code, notes, and snippets.

@wvreeven
Last active September 10, 2021 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wvreeven/2ba0d935d46c2068ad9c85ce17e12478 to your computer and use it in GitHub Desktop.
Save wvreeven/2ba0d935d46c2068ad9c85ce17e12478 to your computer and use it in GitHub Desktop.
Set up a fixed ethernet IP address on ASIAir
Many ASIAir users complain about the poor WIFI signal. In order to fix that, ZWO announced in September 2021 that they
were going to release a new product: the ASIAir Plus. However, that doesn't solve the WIFI issue on existing ASIAir and
ASIAir Pro. It is possible to use a portable WIFI router to ASIAir however that introduces a few challenges. First of
all, there is yet another device that needs power. If you have an ASIAir Pro then of course can power the router from
one of the power ports but still more power is consumed which requires bigger batteries. Secondly, the WIFI router needs
to be connected to the ASIAir somehow which either requires an additional cable or introduces more weight for the mount
to carry.
I am not a big fan of WIFI myself and I prefer an ethernet connection. Especially with my ASI6200MM full frame camera,
downloading the images is MUCH faster via a cable than via WIFI. Connecting to the ASIAir will introduce another cable
but to me that is a small price to pay.
One challenge is to be able to connect to ASIAir via the ethernet cable no matter where you are. The simplest solution
to that challenge is to make sure that the ASIAir always has the same fixed IP address. If you make sure that this IP
address is in the range of your home network (in such a way of course that it doesn't clash with the DHCP range of your
home network router) then you only need to remember (or write down) one IP address which can be used everywhere. I made
sure that my iPad takes a fixed IP address in the same range when I use the lightning to ethernet adapter so the ASIAir
app can always connect to the same IP addres wherever I am. The only downside to this for the iPad is that it cannot
use the ethernet cable connection while also connected to the WIFI network because both networks will have an IP address
in the same range and the ethernet connection will not have a gateway configured. Again this is a small price I am
willing to pay.
The question now is: how to give the ASIAir a fixed ethernet IP address? One way to do so is to configure a fixed DHCP
lease for your ASIAir's MAC address. This is particularly useful if your ASIAir is at a fixed location, for instance
your observatory in the backyard.
I am not so lucky to have that yet and I drag my ASIAir (and telescope and mount) in and out of the backyard every
time I go imaging. And occasionally I go to a dark and remote location too. So I have opted for giving the ASIAir
a hardcoded fixed IP address on the ethernet port as described above.
In order to set this up, you need to know the IP range of your home WIFI network. In many cases this is 192.168.0.XXX
or 192.168.1.XXX but make sure to check! Also make sure to check the DHCP range of your router. In my case it is
192.168.1.25 to 192.168.1.127 and again this will vary so, again, make sure to check.
Once you know both the WIFI IP range and DHCP range, you can choose an IP address, preferrably one that is not taken
yet and most home network routers can show you the allocated IP addresses. I chose 192.168.1.11 for one and 192.168.12
for another ASIAir Pro.
The fixed IP address needs to be configured in the `/etc/dhcpcd.conf` file on the ASIAir. To modify it you need to
make an ssh connection to the ASIAir. See my gist
https://gist.github.com/wvreeven/05bac7b5682a946cd7b9c3192db70746
on how to enable ssh access on the ASIAir. Once the ssh connection is created, you need to edit the `/etc/dhcpcd.conf`
file. Popular console text editors on Linux are nano, emacs and vi. I use vi myself. You need to remount the root
partition with write permissions to edit the file because the root partition gets mounted read only as soon as ASIAir
has booted! To do so, issue
sudo mount -o remount,rw /
Then edit the file using sudo. When using vi, for example, the command is:
sudo vi /etc/dhcpcd.conf
The lines to add are the following:
interface eth0
static ip_address=192.168.1.11/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8
And make sure of course to replace the static ip address with the one you chose and make sure to keep the trailing
`/24` part! Also edit the routers ip address with the one from your home network router. When out in the field and
with only your mobile device connected, the routers value is meaningless so it is OK to hard code it. The domain
name servers IP address given here is one of the DNS servers of Google and you are free to replace it with any DNS
server IP address that you prefer.
Once these lines have been added you can save the file and reboot the ASIAir. Then you can connect with the wired
cable. This can be done either directly using your mobile device (remember to disconnect it from your home WIFI
network!!!) or plug the cable into your home network router and connect via your home WIFI.
One last remark: connecting the ASIAir to your mobile device will NOT make internet available to the ASIAir via the
3G/4G/5G mobile connection. Your mobile device very, very likely is not configured to act as a router for devices
connected to it via the ethernet cable.
In any case, enjoy the wired connection to the ASIAir!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment