Full printer control from different network via mobile and Astroprint Cloud


#1

I just set up my Astrobox and everything seems to be working great - I can move the axes, send g-code commands, monitor the print via a webcam. But I can only access full controls when I connect directly to the Astrobox hotspot.

I was under the impression (based on a few articles I’ve read, some on this forum) with Astroprint I would be able to have full control of the printer from everywhere, even a different network or a mobile device. I’ve connected the printer to my Astroprint cloud account, and I can view the webcam from there and set temperatures of the bed and extruder, but I can’t do anything else. Is full printer control not available from a different network, or are there extra steps I have yet to complete?


#2

You can start, cancel, pause and monitor print job from any network. However maintenance tasks like moving the head around, changing filament (extrusion, retraction) are only available when the device and the printer are in the same network.


#3

Hmm ok. Anyway to expand those possibilities of what can be controlled via different networks? I have some g-code controlled LEDs I’d like to be able to toggle on and off remotely.


#4

Workaround is to tunnel your port number 80 via ssh and connect remotely to your “local” Astrobox webpage. Then you will have full control.


#5

Could you elaborate on that a bit, or at least point me in the right direction for more resources? I don’t have much experience with network connections like that.


#6

In my case, I do not have a static IP address at home, so I am using reverse ssh tunnelling. I have an AWS server with Linux (free for 1 year) and I added a script to my astro box to connect to AWS server. Then I can connect from my phone via my AWS server to astrobox on both port 22 (ssh) and 80 (WWW).
Theoretically, you can expose your Astrobox to the internet to do not need the middle server but it could be a little unsafe.

In short words:

  1. Create ssh key for your AWS server and put public key on Astro box
  2. Add auto connect script to astrobox to connect to your AWS server with public key
    Something like this:
    /usr/bin/ssh -NTC -o ServerAliveInterval=5 -o ServerAliveCountMax=6 -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=no -i /home/pi/<your.ssh.key> -R 8822:localhost:22 <AWS_USER>@<AWS_IP> -p <AWS_PORT>
    /usr/bin/ssh -NTC -o ServerAliveInterval=5 -o ServerAliveCountMax=6 -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=no -i /home/pi/<your.ssh.key> -R 8880:localhost:80 <AWS_USER>@<AWS_IP> -p <AWS_PORT>
  3. Connect from any device to your AWS and ssh to localhost on ports 8822 for ssh and 8880 for http
    I am using JuiceSSH app for Android phone and I can set it up to just press a button and all this magic is done automaticaly and you are getting your astrobox “local” webpage thru secure ssh connection.