Jump to content

NLCbanner2024.jpg.2478be509670e60c2d6efd04834b8b47.jpg

Pi in the Sky (Raspberry flavour)


Paul M

Recommended Posts

So I have eventually started my Raspberry Pi  project.

My aim is to use the Pi to interface between my Android devices running SkySafari using WiFi and my EQ6Pro mount.

I received some help and pointers from SteveB72 of this parish. He offered this link: http://astroland.funxiun.com/remote-control-your-goto-telescope-mount-using-a-raspberry-pi-and-skysafari/ Which introduces ser2net into my vocabulary.

First off I finally got the Pi running. I wanted to use an old TV through Scart using a lead I already had. The Pi B+ has either HDMI or AV out via a 3.5 jack. My existing lead wasn't wired correctly although it had looked promising. 

So I had to wait my turn to get to the TV in the lounge!

After initial configuration it now boots into desktop. I have a WiFi dongle up and running and USB keyboard and mouse.

Now my problems begin...

I open a command line (or whatever they're called on this platform) and typed:

sudo apt-get install ser2net

Which returned some info about the ser2net latest version already installed.

So it's in there but, then the link above gives a line that needs adding to the /etc/ser2net.config file:

4000:raw:0:/dev/ttyUSB0:9600 NONE 1STOPBIT 8DATABITS

Where can I locate the /etc/ser2net.config file? 

Can I find it via the command line? Can I add the line via the command line?

My pi currently boots into Desktop but the terminal utility opens a command line window. What do I type in there to find the file I'm looking for?

I thought I might find it by putting the Micro SD card into my windoze lappy and edit it that way. No such luck. I think the thing I'm barking up isn't even a tree, let alone the right  tree!

All the Youtube stuff I've watched has assumed that the watcher has a vague idea what's going on.

I really have no idea about linux. At best I can only copy lines parrot fashion and hope something happens. My programming days began and ended with BBC Basic in the 80's (for the younger reader the 80's is a reference to a decade in the last century!). At least I could hold my own with the Beeb.

The Dummies Guide to RasPi is most likely an order of magnitude too advanced from my starting point.

Plans for world domination are slowly fading...

Link to comment
Share on other sites

/etc/ser2net.config is the path to the config file.  Perhaps the simplest thing to do to start with is at the prompt in the command line window enter:

cat /etc/ser2net.config

and see what happens.  The file may already exist and have some content in which case you'll see it, or it may not in which case you'll get an error.

James

Link to comment
Share on other sites

cat /etc/ser2net.config returns nothing so I guess I'll just have to create it?

It appears that Rasbian is a flavour of Debian. I just looked through the provided guide :(

Going to bed to sleep it off!

Link to comment
Share on other sites

Rather than the TV you could use Putty from your Windows computer. Just plug the Pi into your Lan and power it up. You can then login through Putty.

From reading your post you might be better off trying out a few more well documented PI projects first, just to get your bearings around command line and text editors.

Link to comment
Share on other sites

Rather than the TV you could use Putty from your Windows computer. Just plug the Pi into your Lan and power it up. You can then login through Putty.

From reading your post you might be better off trying out a few more well documented PI projects first, just to get your bearings around command line and text editors.

I might try PuTTY later. Never heard of it before so who knows where that'll take me (maybe some questions on how to make it work! :) ).

The thing is with this here Ras Pi is that my son got it me or Christmas and I couldn't really think of a use for it. 20 years ago I would have been all over it but now I don't seem to have the patience to learn a whole new way of doing things :(

This particular project did light a spark of enthusiasm and got me to the un-boxing stage. I really didn't expect it to be such a deal to run a script and edit a config file. But my lack of experience with this Linux stuff is taking its toll.

I'll play a while longer but I can see I'm going to need a book or two to get this thing to fly.

Link to comment
Share on other sites

cat /etc/ser2net.config returns nothing so I guess I'll just have to create it?

It appears that Rasbian is a flavour of Debian. I just looked through the provided guide :(

Going to bed to sleep it off!

If it returns nothing and no error then the file exists but is empty, so you'll need to add the required information.  You'll need to use "sudo" to become the root user to change that file.  Then, if you wish to avoid getting your head around editors just yet, you could do:

echo "4000:raw:0:/dev/ttyUSB0:9600 NONE 1STOPBIT 8DATABITS" > /etc/ser2net.config

You are throwing yourself in at the deep end a bit here though.  One of the RPi introduction books would probably be quite helpful.  Or perhaps have a look through some of the back issues of The MagPi: http://www.raspberrypi.org/magpi/

James

Link to comment
Share on other sites

Thanks James, MagPi looks like it could be useful.

I'll try adding the line in the way you suggest. When I set out I thought it would be very simple, only needing to add a line to the config file. 

I think the rood of my problem is lack of understanding of the file system. No idea where or how files are stored or accessed.

Link to comment
Share on other sites

It's a tree-based filesystem just like Windows, but there's no concept of drives because UNIX makes all your disks look like one.  Whereas Windows uses "\" for a directory name separator however, UNIX uses "/".  /etc is a directory at the top of the tree, and ser2net.config is a file within it.

The rules aren't hard and fast, but generally system configuration files go in /etc (or a subdirectory of it) whilst user-specific configuration files will be in the user's home directory (or a subdirectory of it), which for "real" users is usually /home/<username>.

The RPI must have a file-manager style interface somewhere on the menus, similar to Windows Explorer, but to be honest I use the command line pretty much all the time and I can't recall where it is.

James

Link to comment
Share on other sites

I've just been reading some of the tutorials in MagPi (why do I keep getting a theme tune from my school days in my head :) ) and I think there may be a glimmer of hope.

Some things are slipping into place and beginning to make sense.

Next job is to get free of the big HDMI TV so I can spend more time playing this evening.

Link to comment
Share on other sites

The musical interlude must have settled my nerve..

I followed James' directions to write the config file directly.

Right after I did it I discovered the file management tool. After a bit of tinkering I remembered that /etc is a directory so set that as my search destination and up it popped. Easy this Linux, innit? :)

Strangely on searching said folder I found my ser2net.config file but also found one called ser2net.conf. 

Hmm..

So there we have syntax error #1 . My target file existed all along but I was looking for something else.

So clicking on the correct file it opened up and contained mostly usage instructions and just 3 lines of instruction at the end. I added my line at the end but it wouldn't save saying it was accessible.

Back to James' "echo" command. I just zapped the whole file with my required single line of instruction. That got the job done!

Then I set up SkySafari. All it needs is the mount type, the IP address of the RasPi and the designated port (4000 in my case)

Time for some plugging in of stuff. So in came the EQ6Pro head and the leads.

Not a lot happened, SkySafari reported that it could not connect to the specified device.

Some more looking at my ser2net.conf file showed more dyslexic errors. Sorted that with some more of my old mate "echo" .

Tried to connect again and this time SkySafari reported that it can see the mount but it isn't responding. 

Now, I had been wondering whether this set up was going to connect via the handset or direct.

I'd initially set up without the handset using the special USB to serial cable used for connecting EQMOD direct to the mount. 

So I tried using the USB to serial adapter used to update the Synscan firmware and connected through the handset.

A quick check of everything else and I was ready to try again.

Pressing "connect" on SkySafari then brought up the scope control tools and cross hairs.

I just had the mount laid on its side with the clutches loose. On selecting Jupiter and clicking "GoTo"  the motors chuckled away merrily as the cross hairs zeroed in on Jupiter!

I played some more. Both my HTC Android phone and cheap Android tablets worked.

Some sky testing is required to verify total success but it looks very promising.

The down side is that I'm tied to a WiFi network and Android won't connect to Ad Hoc networks without Rooting it.

I already had an idea for using a portable WiFi router type thing : http://www.ebuyer.com/644057-zoom-3g-4g-travel-router-with-wireless-n-mobile-hotspot-4506-72-00bg?utm_source=google&utm_medium=products&gclid=CjwKEAjw56moBRD8_4-AgoOqhV4SJADWWVCcSKXECnR99u6nRv2vkkuUcnQQUyfzcG2YvHimipaNqxoCKNfw_wcB

which I used with a 3g mobile network dongle for out of town connectivity (before I had tons of mobile data on my phone).

Quite simply I turned it on without the 3g dongle and connected both my tablet and RasPi to it via WiFi, amended the IP address in SkySafari and it just worked.

Wow! I can't stop this stuff from working :D

It all needs tiding up and field testing (garden testing actually!) and I'm off!

Next job is to configure the Pi as a WiFi router or whatever they call it for Android to connect to.

I'd like to thank the respondents to my cries for help, particularly James who gave me just enough to keep me inspired. :)

Oh, funnily enough, I went out and bought the Raspberry Pi User Guide this afternoon.

Not opened it yet!

Link to comment
Share on other sites

You might find this guide useful for setting up the Pi as a WiFi hotspot: http://elinux.org/RPI-Wireless-Hotspot. It worked for me, in the end, but it took an age to track down all my typos  :rolleyes2: .

I would suggest familiarising yourself with Nano (the default Raspbian text editor) at the command line first. I'd also repeat the suggestion of connecting to the Pi via SSH. I'm sure they'll be an Android app or two for this, or you could use Putty from your Windows desktop.

Good luck!

Link to comment
Share on other sites

It was a lovely clear day here all day yesterday so I had big plans to sky test my Pi in the Sky when I got home from work.

Didn't finish until 19:00 then had to get home and get fed, by which time the sky didn't seem as clear as I'd expected from its day time quality. No sign of clouds but the sky brightness was such that averted vision was needed to see all three members of the cute triangle asterism in Auriga (the kids?), so pretty poor. 

My enthusiasm to set up was diminishing even though Jupiter was well placed. I decided not to.

Instead I spent time reading up on this here PuTTY and today I installed and configured it along with Xming. So now I can even use the Pi's GUI/desktop from my windoze lappy. Just a very slight response lag but i'm going to be learning more about the command line anyway.

I've also read up on using the Pi as a WiFi hotspot (thanks for the link Incredible-Hulk!) but that seems like a lot of configuring to get right. Maybe a bit too much for me just now.

Wow!, I'm feeling like a proper geek...again :)

Link to comment
Share on other sites

We had a descent sky here this evening so I set up the scope to see how this lot works in practice.

After a typically rough polar alignment I carried out a two star alignment with the SynScan handset. Then connected the RPi  to the handset using the USB to serial adapter cable.

Next I switched on the Zoom WiFi hot spot router and powered the RPi via one of the USB power outlets on my SkyWatcher power tank.

I've noticed that since I configured some of these utilities on the Pi the Netgear WiFi dongle doesn't activate every time on power up. I have to wait for the RPi to boot then unplug and plug back in the dongle. I'me sure I'll trace that fault eventually.

Then I opened SkySafari on my ZTPad android tablet and clicked "connect" on the telescope tool bar. It failed.

Now here's the problem with the RPi out in the field. No monitor or mouse or keyboard. So checking it's IP address can be difficult if you can't talk to it via PuTTY because you don'y know it's IP address....

So I looked at the Zoom's client list and found that since last use the RPi had been allocated a different IP address. 

As soon as I corrected the RPi's IP in the Sky Safari configuration it started working.

I've since locked the IP address for the Pi in the Zoom's configuration. So that should be the same on each boot.

Another issue when running the RPi "headless" is shutting it down. It has no physical shutdown button (one can be fitted utilising the  GPIO interface and a bit of code) and to avoid corrupting the system and user files it should be shut down via the button on the desktop or via the command line (I've been using "sudo shutdown -h now").

Easier said than done in the field. The solution I've adopted for now is to install a PuTTY type utility on the tablet so I can talk to the RPi via the command line.

I've also got a short cut to the Zoom's configuration utility on the tablet to help with problem diagnosis.

Some of these complications could be simplified by setting up the RPi as a hot spot as mentioned earlier. I'm just nervous of making a mess of the stuff I already have working. 

Right, anyway, so it works. 

First target was Jupiter. The first SkySafari driven GoTo was a bit off but I wasn't worried too much. I centered it using the slew buttons provided in the scope control on SkySafari and the pressed "align" which seems to be the same as "sync" with EQMOD.

The seeing was quite good and Jupiter stood up to all the magnification I could throw at it. No exciting events taking place though.

Even though the Moon was still casting shadows I selected Comet Lovejoy as my next target. Two key presses and the scope was on its way. So much easier than manually entering RA and Dec coords into the handset.

This time the target was within the field of view. I centered it and hit "align" again. An easy target but spoiled by my bright sky.

I tried a good few GoTo's and they were all there about. I did notice that the mount took an unusual route a couple of times. Sky Safari does thing differently to SynScan.

My last target was the Moon. Even though it was getting low over the houses it still looked good.

I even took a picture through the eyepiece with my phone to prove it :)

post-28650-0-42402800-1427243267_thumb.j

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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