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.

Welcome to Stargazers Lounge

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customise your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • Announcements

    sgl_imaging_challenge_banner_satellites_v2.jpg

rkc

SkyFi with a Pi

17 posts in this topic

In case anyone (like me) is a fan of SkySafari but feels that the SkyFi unit is a little overpriced, I thought I would share some results I had using a Raspberry Pi to build a proxy that allows SkySafari to wirelessly control (and display direction info from) my AZ EQ6 GT mount.

Basically, all you need is to echo all data coming in on a network connection to a serial port, and vice versa.

First, the hardware:

1 Raspberry Pi

1 WiFi dongle

1 USB to serial adapter

1 Power supply for the Raspberry Pi

The serial cable that comes with the SynScan handset

I already had most of the above from other projects...

Second, the software:

I set up the wRaspberry Pi and the WiFi adaptor for it using standard guides found on the web. Since my observing is done from home, I set up the Pi to simply join my wifi network, but it should be possible to set it up as an access point if you need to. The tricky bit was the network to serial program - I spent a long time trying to get socat to work, but eventually switched to ser2net which was MUCH easier:

Install ser2net:

sudo apt-get install ser2net

Configure ser2net:

At the bottom of /etc/ser2net.conf, add the following line:

4030:raw:10:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT

then start ser2net using

sudo service ser2net start

Configure SynScan:

Nothing to do really - just start up in the usual way. Do NOT select PC-direct mode.

Configure SkySafari

In settings, telescope setup, select Scope Type = SkyWatcher SynScan, Mount Type = Alt-Az (if you are using the mount in AZ mode as I am), or EQ if you are using it in EQ mode. Enter the Pi's IP address, and port number 4030. I have disabled Set Time & Location, and set Readout Rate to 1, but other settings may work.

That's it...

Hope someone finds this useful.

Richard

7 people like this

Share this post


Link to post
Share on other sites

Keeping in with tradition you'll have to call it PiFi :)

I had been hoping to use my RPi as a complete imaging system but the older chipset, lack of drivers and lack of guts made it unsuitable. I've since got a Pandaboard which works well but is a real power glutton.

Share this post


Link to post
Share on other sites

So that no one else makes the same mistake or in case I am mistaken and someone can correct me ...

Spent a day trying to get this mod/hack to work with my HEQ5 connected directly to a Raspberry Pi vi an EQDirect usb to serial adapter.

Couldn't work out why SkySafari couldn't see the mount - I set it as an Orion Sirius as I believe this mount is identical to the HEQ5.

Anyway, it looks like the SynScan handset is essential for this to work - SkySafari won't talk to the mount directly. See also:

Cheers,

Ed

Share this post


Link to post
Share on other sites

Hi Richard

Thanks for your excellent post, followed your instructions to the letter and unbelievably it all worked first time!!

Many Thanks for the PiFi tips

Matt

In case anyone (like me) is a fan of SkySafari but feels that the SkyFi unit is a little overpriced, I thought I would share some results I had using a Raspberry Pi to build a proxy that allows SkySafari to wirelessly control (and display direction info from) my AZ EQ6 GT mount.

Basically, all you need is to echo all data coming in on a network connection to a serial port, and vice versa.

First, the hardware:

1 Raspberry Pi

1 WiFi dongle

1 USB to serial adapter

1 Power supply for the Raspberry Pi

The serial cable that comes with the SynScan handset

I already had most of the above from other projects...

Second, the software:

I set up the wRaspberry Pi and the WiFi adaptor for it using standard guides found on the web. Since my observing is done from home, I set up the Pi to simply join my wifi network, but it should be possible to set it up as an access point if you need to. The tricky bit was the network to serial program - I spent a long time trying to get socat to work, but eventually switched to ser2net which was MUCH easier:

Install ser2net:

sudo apt-get install ser2net

Configure ser2net:

At the bottom of /etc/ser2net.conf, add the following line:

4030:raw:10:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT

then start ser2net using

sudo service ser2net start

Configure SynScan:

Nothing to do really - just start up in the usual way. Do NOT select PC-direct mode.

Configure SkySafari

In settings, telescope setup, select Scope Type = SkyWatcher SynScan, Mount Type = Alt-Az (if you are using the mount in AZ mode as I am), or EQ if you are using it in EQ mode. Enter the Pi's IP address, and port number 4030. I have disabled Set Time & Location, and set Readout Rate to 1, but other settings may work.

That's it...

Hope someone finds this useful.

Richard

Share this post


Link to post
Share on other sites

Hi RKC, great post - can I pick your brains on this please?

1) You said "I set up the wRaspberry Pi and the WiFi adaptor for it using standard guides found on the web. Since my observing is done from home, I set up the Pi to simply join my wifi network".

That's exactly what I want to do - can you point me at the link that provides the standard guides you mention - I can't locate it ...?

Many thanks

David

Share this post


Link to post
Share on other sites

Hi RKC, great post - can I pick your brains on this please?

1) You said "I set up the wRaspberry Pi and the WiFi adaptor for it using standard guides found on the web. Since my observing is done from home, I set up the Pi to simply join my wifi network".

That's exactly what I want to do - can you point me at the link that provides the standard guides you mention - I can't locate it ...?

Many thanks

David

I don't recall exactly which site I used - I just googled "Raspberry Pi wifi" and picked one that matched the distro and wifi card I had. May have been this one : http://pingbin.com/2...i-raspberry-pi/

Incidentally I've since stopped using ser2net, as I am using a bluetooth link from the pi to my scope now, and ser2net would close the bluetooth connection every time the network connection was closed (which is multiple times a second when used from SkySafari). I wrote a bit of python code to achieve the same thing, but keep the serial port open.

The python code is at https://github.com/richardkchapman/serproxy

Share this post


Link to post
Share on other sites

Ok that's great thanks. You say you have now switched to Bluetooth for Pi /scope communication . I thought Bluetooth was slower than wifi - what made you change to Bluetooth?

Share this post


Link to post
Share on other sites

Ok that's great thanks. You say you have now switched to Bluetooth for Pi /scope communication . I thought Bluetooth was slower than wifi - what made you change to Bluetooth?

One less wire to get tangled up in the scope - and since I mounted my bluetooth receiver inside my SynScan controller (see ), I can use the handset normally, then control (or simply follow) where the scope is pointing on the iPad without needing to rewire anything. The Pi then just needs to be somewhere in the general vicinity (if I am using the iPad - it's just acting as a WiFi to Bluetooth bridge). Or if using SkySafari on Android, I can connect the bluetooth direct without needing the Pi at all.

The iPad is a little too large (and a little too cold) to use comfortably at night, I find. An Android 7" tablet like the Nexus7 is easier to handle.

Share this post


Link to post
Share on other sites

One less wire to get tangled up in the scope -

[...snip...]

Just to give a heads up, and thanks RCK for this 'drop dead simple' solution to getting a 'SkyFi' going.

It inspired me into documenting my first 'SkyPi' setup (here:  http://wiki.neuralbs.com/index.php/SkyPi) and it seems to work quite fine with SkySafari Pro 4 (I have a youtube video demonstrating it but I won't post it publicly unless requested ...forcing me to actually remove audio and my stupid comments + add annotations).

So, now that I have :

[skySafari]:iPad -> (AP mode WiFi) -> RPI -> USB2Serial -> SynScan -> EQ6

I would love to see if it would be possible to do this:

[skySafari]:iPad -> (AP mode WiFi) -> RPI -> [indilib in some sort of mode] -> USB2Serial -> MAX323 -> EQ6

OR (even better?)

[skySafari]:iPad -> (AP mode WiFi) -> RPI -> [indilib in some sort of mode] -> [Direct TTL control from RPI's I/O ports] -> EQ6

I am quite sure I am not the only trying to dream up this setup (while keeping SkySafari in the loop).

The next setup I might try is kStars running up directly from an RPI2 + remote desktop on an iPad.

The end goal is quite 'simple':

- have an iPad app to control the scope (important for buy-in of kids and GF)

- have less wires (moahr simpler)

- do cool techno stuff :D

Share this post


Link to post
Share on other sites

Kinda funny this popping up, I set mine up with ser2net too

Difference being, I used socat on my main rig(Use Linux mainly) to map it as a ordinary device port. So Stellerium can use it as a local device/port.  Also used the on board serial for telescope control. You need a UART to 3.3v level adapter but thaey are under £2 . 

Been messing with the CSI camera module to see what I can do, Takes good pics(Not tried astro though)  but the PI is not quick enough to stream with any usable quality . 

They released a new one earlier in the week, the PI 2 . it a quad core @ 900 mhz. + a 1gb of ram. Should help with streaming. Also help those that wish to run libindi as an all in one solution.

Been trying the new Pi 2 and its substantially quicker than the original.

1 person likes this

Share this post


Link to post
Share on other sites

Kinda funny this popping up, I set mine up with ser2net too

Difference being, I used socat on my main rig(Use Linux mainly) to map it as a ordinary device port. So Stellerium can use it as a local device/port.  Also used the on board serial for telescope control. You need a UART to 3.3v level adapter but thaey are under £2 . 

Been messing with the CSI camera module to see what I can do, Takes good pics(Not tried astro though)  but the PI is not quick enough to stream with any usable quality . 

They released a new one earlier in the week, the PI 2 . it a quad core @ 900 mhz. + a 1gb of ram. Should help with streaming. Also help those that wish to run libindi as an all in one solution.

Been trying the new Pi 2 and its substantially quicker than the original.

So, are you saying libindi requires a lot of CPU power to a point of overcoming a regular RPI? Otherwise, I'd love to have more details about the 'UART to 3.3v' part, are you implying that the EQ6 expects 3.3v level 'TTL'? /me keeps digging around ;)

Share this post


Link to post
Share on other sites

So, are you saying libindi requires a lot of CPU power to a point of overcoming a regular RPI? Otherwise, I'd love to have more details about the 'UART to 3.3v' part, are you implying that the EQ6 expects 3.3v level 'TTL'? /me keeps digging around ;)

Personally not used indi, but read a few have said its slow on the pi. whether that meant the program in general I'm not sure. Might give it a go and see.

Regards the serial , There's two ways to enable it . Easiest been through raspi-config if you use rasbian that is the other is here http://www.hobbytronics.co.uk/raspberry-pi-serial-port

As for the level shifting as rs232/uart is 12v, I used one of theses http://www.ebay.co.uk/itm/MAX3232-RS232-Serial-Port-To-TTL-Converter-Module-DB9-Connector-W-4-Jump-Cables-/370920380741?pt=LH_DefaultDomain_3&hash=item565c93d945

The only reason for that was due to the voltage been too much for the module type level shifters .

Then its the same as what rkc has posted with regards ser2net but changed the line to 

4030:raw:10:/dev/ttyAMA0:9600 8DATABITS NONE 1STOPBIT

I can do a pic if you wish.

Sorry for hijacking your rkc :icon_redface:

Share this post


Link to post
Share on other sites

Personally not used indi, but read a few have said its slow on the pi. whether that meant the program in general I'm not sure. Might give it a go and see.

Does slow mean 'slow response time'? I would be sort of baffled if the RPI couldn't handle the code in proper realtime...have to try this (which is the point of my setup).

Regards the serial , There's two ways to enable it . Easiest been through raspi-config if you use rasbian that is the other is here http://www.hobbytronics.co.uk/raspberry-pi-serial-port

As for the level shifting as rs232/uart is 12v, I used one of theses http://www.ebay.co.uk/itm/MAX3232-RS232-Serial-Port-To-TTL-Converter-Module-DB9-Connector-W-4-Jump-Cables-/370920380741?pt=LH_DefaultDomain_3&hash=item565c93d945

Ok, I looked around a little and it seems that, what ever way I do this, I would still need a "proper" conversion from 3.3v to TTL (for direct connection to the mount) or 3.3v to RS232 +/-12V (for serial connection to the SynScan controller). I am already accomplishing the latter with a USB2Serial converter, which I would like to do without since I find it's useless extra wiring compared to having a small RS2323 converter directly fed by the RPi.

The only reason for that was due to the voltage been too much for the module type level shifters .

Then its the same as what rkc has posted with regards ser2net but changed the line to 

4030:raw:10:/dev/ttyAMA0:9600 8DATABITS NONE 1STOPBIT
I can do a pic if you wish.

Sorry for hijacking your rkc :icon_redface:

A pic would give me an idea of the hookup you have going. As far as hijacking this thread, I would rather call it "we honour RKC's post" :D

So, I am still puzzled by how I could reduce the steps between SkySafari -> Mount. I saw that indilib seems to have a "SynScan" emulator but it stil remains unclear wether that is what I would eventually want to be using Vs using EQMOD (or does the SynScan live atop EQMOD...?). To, I think that my (more refined) connection "diagram" would look something like this:

SkySafari --> WiFi --> RPi --> [what part of indilib?] --> "EQDirect" (TTL from RPi to RS232 adaptor) -> EQ6 DB9 connector.

With this diagram, I would have very little wiring and the RPi would be velcroed to the mount, next to the power cord.

PS: Ok, so, clearly my phpBB-fu has gone really bad and I am failing at proper quoting (even if tried the direct codes).

Share this post


Link to post
Share on other sites

So, I am still puzzled by how I could reduce the steps between SkySafari -> Mount. I saw that indilib seems to have a "SynScan" emulator but it stil remains unclear wether that is what I would eventually want to be using Vs using EQMOD (or does the SynScan live atop EQMOD...?). To, I think that my (more refined) connection "diagram" would look something like this:

SkySafari --> WiFi --> RPi --> [what part of indilib?] --> "EQDirect" (TTL from RPi to RS232 adaptor) -> EQ6 DB9 connector.

With this diagram, I would have very little wiring and the RPi would be velcroed to the mount, next to the power cord.

PS: Ok, so, clearly my phpBB-fu has gone really bad and I am failing at proper quoting (even if tried the direct codes).

Trouble is a new to most of the astro stuff so can't really help much in that  regard but I see what you are saying.

To me the best way is to use the RPI to talk directly to the mount in your case via TTL and do away with the serial conversion all together.

I did mine this way as to have both usb ports free mainly . Though with the PI 2 that's mute I suppose.

I was wondering about doing away with the RPI and getting a bluetooth module and just wire it inside the HC in my case but still need a conversion as most serial adapters are 5v instead the standard 12v. :sad:  

rpi-rs232.jpg
rpi-rs232-1.jpg

Put the pics in spoiler tags as there a bit big. 

Share this post


Link to post
Share on other sites

Hi I too have been playing with TTL on the Raspberry Pi to connect Stell to my Synscan handset but I have had no luck getting any response from the Synscan handset.

I have used a USB to Serial(FDTI) from the PI to the hand set and this works with Stellarium on Win7 using a Virtual USB/Com port software  from www.HW-group.com - So Stellarium talks to Com10  which is set up by the Virtual Serial Software which in turn talks to the PI over TCP/IP on port 2000(or whatever). On the PI I run Ser2net which then uses the TTYUSB0 which has the USB to Serial cable which then connects to the handset via a RJ11 cable. This works no problem.

However I then ,like you , got a TTL to serial adapter (same one as you funny that) , did the changes to remove TTYAMA0 from start up commend line/ Inittab /Ser2net but I get zero - On Stellarium using the TTL I use the same Virtual Com port to redirect over TCP/IP to Ser2net (diff port so to connect to TTYAMA0) but zero. I even tried looping the output from the TTL/232 back to Windows ,connected 2 Telnet connections and typed away - this passed the data up and down ok.

Tried swapping the Tx/Rx pins - still zero My wiring looks like yours TX,RX,GND,3.3v

Any ideas ?

What is your wiring from the DB9 (o/p TTL) to your Mount or Handset - I use just RX,TX and GND !

Share this post


Link to post
Share on other sites

However I then ,like you , got a TTL to serial adapter (same one as you funny that) , did the changes to remove TTYAMA0 from start up commend line/ Inittab /Ser2net but I get zero - On Stellarium using the TTL I use the same Virtual Com port to redirect over TCP/IP to Ser2net (diff port so to connect to TTYAMA0) but zero. I even tried looping the output from the TTL/232 back to Windows ,connected 2 Telnet connections and typed away - this passed the data up and down ok.

Tried swapping the Tx/Rx pins - still zero My wiring looks like yours TX,RX,GND,3.3v

Any ideas ?

What is your wiring from the DB9 (o/p TTL) to your Mount or Handset - I use just RX,TX and GND !

On the adapter when you wire it , make sure you do TX>TX  not TX>RX like you think. Also don't forget the 3.3v feed. That's needed as to set the correct conversion voltage.

Regards the DB9 wiring, I changed the Male to a female on the HC cable so to fit without a gender changer, I did hunt for a Female but be damned if I could find one.

Share this post


Link to post
Share on other sites

On the adapter when you wire it , make sure you do TX>TX  not TX>RX like you think. Also don't forget the 3.3v feed. That's needed as to set the correct conversion voltage.

Regards the DB9 wiring, I changed the Male to a female on the HC cable so to fit without a gender changer, I did hunt for a Female but be damned if I could find one.

Thanks for the reply - Turns out that my PI just doesn't have the power to drive the ttl at 3.3v (amps problem) - Using a USB to serial to TTL converter with its own 5v supply (GND is shared anyway via GND Pin) I am now able to drive my SW AZ mount directly (No handset).  I could have used the 12v supply from the mount and dropped the voltage but using only three wires(RX,TX and gnd) with no power(12v) is safer for me as my soldering is Rubbish.

Have been using Ascom via Brazilian AZ/EQ GoTo Driver and this works in AZ mode but doesn't have any manual slewing keys as per hand set(bummer) so as I use video (Sammy 2000) with 200mm lens I cannot easily set up alignment. Plus when using the EQ version of the same software via a home made EQ platform it insists on going round 360 degree's a number of times - Not very helpful when wires attached to camera. They do an APP which has the directional keys but ,sods law, it does like my Tablet even though you have to use Skysafari as a companion sky map.

I also have another  "Standard" PI set up with USB to Serial connected to SYnScan handset which I can drive using SkySafari and Skysafari 4 plus but they don't want to work when using the PI using TTL (even though C2a,CDC and Stellarium Scope do work ok) - If I can get the latter working I will be a happy man.

So still work in progress

I use an old Linksys router for field use which provides wired and wireless networking and can be driven via 12v DC. 

Share this post


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