General Setup, RPI, guiding

Adventures in PiFi Astronomy

Using a raspberry pi to control and guide a Celestron EdgeHD 8 AVX with a ZWOASI120CC and a Sony a6000

Although I prefer to use a manual mount and look at the stars through an eyepiece. There are some deep sky objects that I just can't see with my telescope through the eyepiece. For these objects I use astrophotography. I believe that I have everything that I need, and have set just about everything up so I can do guided long exposures. I now just need a clear night to try it out. Here's an overview of how I got to this point.  

General Setup
I've found that if you don't use a good, well charged power supply the AVX will misbehave, so I have it connected to either the Celestron wall wort, or the Celestron Lithium power tank.

Celestron WiFi: Don't use it. It is unreliable and will be the source of endless grief. The problem is that it can easily disconnect and when it does, your alignment is lost. You need to re-align. This can means that you spend the whole night aligning your telescope instead of looking at the stars.
I haven't tried this, so it may work, I don't know. The problem is that it cost's $200, just seems to be too much money. The alternative is to use a raspberry pi which will be more like $100 all-in, and will be able to do much more than just allow a wifi connection.

Sony a6000. It works OK, but I wish that I had done more research before purchasing it. Remote access is only through a mobile device and it has limitations. Update, I'm not connecting to it using the rpi over usb using gphoto2. This works so well that I'm now very happy with the camera. I can now just setup scripts to do a series of photos and leave it. Ultimately you'll probably want a b/w astro camera.

Guide Setup
I chose this because it does not cost too much, seems to have good Linux support. The first thing that you need to do though is reflash the firmware. I had to use the "compat" version of the firmware to get it working with Linux.
I had read that some cameras may not be able to achieve focus with thicker "Off Axis Guiders" OAG's. So I picked up this one for a good price and it seems to work great. I did need to fiddle with spacers for a while, and I heard that the early version of it were wobbly, but mine seems to work great. Note both the main camera and the guide camera need to be focused. That means that both need to be the same distance from the prism. This is why you need spacers.
"Orion Thin Off-Axis Guider for Astrophotography"
Guide Connections
Your guide computer, in this case a rpi needs to be connected to the AVX mount through the a USB connection to the handset, and a USB connection to the guide camera. I also needed to connect the guide camera to the AVX mount through the guide port. Update, don't use the guide port. You can do everything just using the connection to the handset over usb. This path is more robust and has more features.
Guide Software
I am using PHD2 along with indi astronomy drivers. This seems to be working great on intel, or raspberry pi Linux. More detail below.

Guide computer
I'm a linux guy, so it's linux all the way:) I also wanted a low power, and a small setup that could server as a wifi bridge so that I could use skysafari when not doing photography. The raspberry pi fit the bill, so that's what I'm using. Once setup as below, I can just plug in the pi then access it through either vnc to start guiding, or through skysafari to slew the scope to the object in question.
Raspberry PI 
I tried both a Raspberry PI 2b+? and a Raspberry PI 3. They both work, but I'm using the 3 as it seems to be snappier. Update. I'm now using a PI 3 b plus. It's even snappier.
You need to use a good power supply. If you don't everything will seem fine, but connected USB devices will fail mysteriously...
Ubuntu Mate seems to work great, so that's what I'm using. I think that I followed these instructions to install: I set it up to automatically log into my user account. I also added PHD2 to the startup apps for my user so that when it boots, it's ready to guide. I still need to vnc into the pi start the guiding session.
Hot Spot
So I wanted to set it up to work as either a hotspot, or to just connect to my wifi network. This way I can just connect directly to it when I'm away from my house. I first set up the hotspot manually by updating config files, and creating scripts, but in the end there's a much easier way. All you need to do is use the GUI and click your way through the network device setup to create a hotspot, or a normal wifi connection.
Local Connection
This is pretty straight forward. One extra step is to configure your wifi hub to give a static ip address by keying off of the raspberry pi's network MAC address. This way you can use a static address to connect to the pi.
I not a big fan of ppa's so I just downloaded the source and compiled it localy on the pi. The instructions are pretty straight forward. I also did it all as root under /usr/local because that's the way I roll:)
I needed this astronomy software stack to connect the AVX mount. Again I just downloaded and compiled the latest. Instructions here: There's a few options in there. I believe that number 3 should work pretty well. I also built as root under /usr/local. I run it like this: indiserver indi_celestron_gps.
After installing this I followed the instructions to make it a daemon. This way it loads indi up when it boots. Make sure to build the 3rdparty apps for the guide camera. Update, there is also a gphoto2 driver that can allow you to control the sony a6000 from indi. I haven't explored this yet, but I should be able to use the sony as a guide camera, or connect it to the indi subsystem maybe ekos/kstars to do more elaborate guiding.
I believe that I just installed the ser2net package using apt-get install ser2net. You'll want to modify the /etc/ser2net.conf according to the instructions here:
I added one more line to the end of ser2net.conf just in case something get's out of whack and the avx ends up on /dev/ttyUSB1:
4001:raw:0:/dev/ttyUSB1:9600 NONE 1STOPBIT 8DATABITS
If that happens, you'll have to update your skysafari connection to point to port 4001. Also make sure to set it up to start by default when it boots, so you can just plug in the pi without fiddling with it.
I like x11vnc vs the other vnc's because I'm old school. I found some instructions here. I can't remember what instructions I followed, or if I just winged it:
I also found that the x11vnc client works way better than the default on or ubuntu.

I found that the indi drivers didn't seem to work with the guide camera, I found that I didn't build the apps for the guide camera, so I built them:) I setup the mount driver to be through the guide camera, and the guide AUX data through the indi_celestron_gps driver. After fiddling with it for some time, it seems to be guiding fine, at least with the virtual camera since I don't have a clear sky to test with. Again, I can do all of this through vnc from either my desktop, laptop, or vnc on my mobile phone. The mobile works surprisingly well! Update, I've had a few successful guiding sessions, and it's working great. For some I've had pretty steady guiding under .5 degrees.

The first shot at guiding the performance of the PI seemed pretty bad. I was running PHD on the PI, and VNCing in. Clouds were coming and going, so it's pretty hard to say if the slow UI had a bad effect on the guiding though. Since then I've gotten the indi camera working, so I can use the pi as purely a indi server and run PHD on my laptop/Desktop. That seems to perform better when testing during the day. I also tried using the "sub image" feature of the indi camera running PHD on the PI, and that seems to improve performance. I'll have to try this all out when I get a clear night...

I plan on using this setup for a road trip this summer. I don't want to bring an HDMI and keyboard along in case something goes wrong with the pi and I can't vnc. So I'm planning on setting up the ethernet port eth0 to start up with a static ip address. This way I should be able to connect to it with a null ether cable connected to a laptop, just in case. I've also backed up the ssd so I can restore and reboot if something goes wrong. 


  1. So, I've had two nights to try this out. So far not so good. The first night I could not get it to even guide. It kept on drifting. The second night I had gotten a raspberry pi 3 b+ which performs a lot better. I started out having the same drift problem, but after plugging away at it for some time, I was able to get it to guide. It looked like it was staying mostly under 1 in the graph view, but the photo results of a 2 min exposure had trails. I'll try and use the guider assistant next time.

    1. OK, looking closer, it appears that I was able to get at least 1 30s shot that looks perfect. Clear round stars...

  2. I managed to get a few pretty good images of the needle galaxy, and I even stacked them. Details here:

  3. I've now had a pretty successful session taking photos of the needle galaxy. I've also tracked the progress in a google photo album here:


Post a Comment