Welcome, Guest. Please login or register.

Username: Password:

Author Topic: Remote Access  (Read 7445 times)

cmosfreak

  • Full Member
  • ***
  • Posts: 11
    • View Profile
Remote Access
« on: June 18, 2015, 21:54:38 »

Hi there,

I'd like to control my garden observatory remotely from indoor using my home network. My first attempt using a tiny PC integrated into the mount running XP was quite annoying due to some limitations.
So I came to the question: Why not use a ethernet shield on my mega 2560 arduino to create a virtual, ethernet based COM port (using com0com on the Windows side)? My first tests were quite promising, but I ended up at the integration into AstroEQ. Unfortunately I couldn't a way to include some arduino libs into the AstroEQ project.
Any ideas?
Thank you
Andreas
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: Remote Access
« Reply #1 on: June 18, 2015, 22:54:03 »

You will need to make sure the code you use is as efficient as possible - the AstroEQ firmware is already pushing the capabilities of an ATMega. But, by all means try it out and see how you get on.

There are a few key parts that you will need to change to get your firmware working.

Line 345 is the following:
Code: [Select]
if ((decoded == -2) || Serial_available()) { //is there a byte in bufferYou will need to add a flag that indicates when your Ethernet code has a character available.

Line 348 is the following:
Code: [Select]
recievedChar = Serial_read(); //get the next character in bufferThis is where the next character is read. So your Ethernet code will need to have some function which will return the next character in its buffer.

Line 354 is:
Code: [Select]
Serial_writeStr(decodedPacket); //send the error packet (recieveCommand() already generated the error packet, so just need to send it)This line writes a null terminated string to the serial port. The Ethernet code will need some function to do this.


You can replace these three lines with some code that has an equivalent function but which uses Ethernet. Now because there are two sources (Serial and Ethernet) you would need to select which one to use, but my suggestion would be to drop the Serial stuff from your variant and stick to just Ethernet. If you want to use the config utility you would upload the stock AstroEQ firmware (with serial comms), then configure the mount, then upload your custom firmware (with Ethernet comms).



The alternative would be to use something like a raspberry pi setup to relay information between Ethernet and the USB port of AstroEQ. Or you could go for something similar to this. These would probably be a more reliable option. The final alternative would be to design a separate Ethernet to Serial circuit - could be another Arduino with your Ethernet shield, which would then do all of the heavy Ethernet processing and forward to the data to the AstroEQ board.

Personally I think the alternative options would probably be more useful in the long run. The ATMega's as useful as they can be aren't really designed for the raw processing power needed to run the Ethernet interface at the same time as doing the AstroEQ stuff - they really aren't that great for multitasking.
Logged
Tom Carpenter (AstroEQ)

cmosfreak

  • Full Member
  • ***
  • Posts: 11
    • View Profile
Re: Remote Access
« Reply #2 on: June 20, 2015, 14:48:04 »

Hi Tom,

you're right, why reinvent the wheel? I'll better buy such a converter and start immediately   :)

Thanks

Andreas
Logged

roblegion

  • Full Member
  • ***
  • Posts: 10
    • View Profile
Re: Remote Access
« Reply #3 on: July 19, 2015, 11:40:42 »

Hi, I don't know if this is of help, or even do-able. I am seriously into my normal photography and was looking for a way to wirelessly tether my Nikon D300s to my laptop, found a website where the guy was using a TP Link TL-MR3040 battery powered internet hub that had flashed firmware to run with dslr dashboard and my camera. I bought one, flashed the firmware and it works brilliantly for around £35 compared with the Nikon solution of £400.

Now, if this bit of kit is flashable, (or maybe it doesn't even need to be flashed) it simply works as a standalone wireless router. So I am thinking plug this into your astro eq, connect your pc or laptop to the router as if it were an internet connection and the maybe with some lines of code, instead of sending the eqmod instruction set or whatever date to the usb port, it is sent wirelessly to the router.

Sorry not very software savvy ( more of a electronics/ metal engineer) but does this sound do-able.

Rob.
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: Remote Access
« Reply #4 on: July 19, 2015, 14:22:17 »

If you can get the router to do tcp to serial conversion which is probably possible as it will run Linux, then you can use com2tcp on the laptop at the other end. AstroEQ should show up in Linux using the default USB Modem driver so depending on how stripped down the kernel on the router is it may already have the drivers required.
Logged
Tom Carpenter (AstroEQ)

roblegion

  • Full Member
  • ***
  • Posts: 10
    • View Profile
Re: Remote Access
« Reply #5 on: July 19, 2015, 16:33:15 »

 :D ;D ;D Sorry Tom, not even in the same country, let alone the same league, LOL. You have lost me already with TCP etc.
I just thought if this was ok for a solution sending, control and images from pc to camera and versi vica then it should be able to send ASCOM commands etc. The beauty is it is standalone and rechargeable via usb.


Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: Remote Access
« Reply #6 on: July 19, 2015, 18:05:42 »

AstroEQ talks via serial, so you something to relay serial commands to the router from EQMOD. The camera will have completely different control software. What is needed is a 'Virtual Serial Port'.

COM2TCP is a bit of software from Windows (see here: http://astrogeeks.com/AstroGeeks/COM2TCP/index.html) which will accomplish that on the Windows side of things. On the router side you need something which does the opposite - TCP to COM. Linux is very good at doing that sort of thing, but without knowing what software is on the router it's difficult to say how to do it. You'd need to have access to console on the router which would require access via something like SSH or a serial port terminal.
Logged
Tom Carpenter (AstroEQ)

roblegion

  • Full Member
  • ***
  • Posts: 10
    • View Profile
Re: Remote Access
« Reply #7 on: July 20, 2015, 12:37:58 »

OK Tom, thanks for reply. I think I get it ???, will have a play and let you know how I get on.

Rob.
Logged