Networking

General discussion topics
sprior
Posts: 385
Joined: Thu Apr 10, 2014 8:37 pm

Re: Networking

Post by sprior » Mon May 19, 2014 3:44 am

Are you running the master branch or the devel branch of Octoprint?

markb
Posts: 180
Joined: Tue Apr 15, 2014 11:06 pm

Re: Networking

Post by markb » Mon May 19, 2014 5:06 am

sprior wrote:Are you running the master branch or the devel branch of Octoprint?
I am running master this is what I installed. 2014-01-07-wheezy-octopi-0.8.0.img

I added these lines in my config.yaml right after my webcam at the bottom of the file I used nano -w to edit it.
events:
systemCommandTrigger:
enabled: True
subscriptions:
- event: PrintDone
command: curl -o /tmp/printDone.jpg "http://127.0.0.1:8080/?action=snapshot"
&& mpack -s "Print of %(filename)s finished" /tmp/printDone.jpg myemailAddress
But when I reboot I get

“503 Service Unavailable
No server is available to handle this request.”

Edit out my new entries and it is very happy again.
I am close can you point me in the right direction.
Last edited by markb on Mon May 19, 2014 1:14 pm, edited 1 time in total.

jsc
Posts: 1864
Joined: Thu Apr 10, 2014 4:00 am

Re: Networking

Post by jsc » Mon May 19, 2014 5:56 am

I don't know anything about Octopi, but just double checking here: you don't have an actual line break before && do you? Because that won't work.

markb
Posts: 180
Joined: Tue Apr 15, 2014 11:06 pm

Re: Networking

Post by markb » Mon May 19, 2014 6:08 am

jsc wrote:I don't know anything about Octopi, but just double checking here: you don't have an actual line break before && do you? Because that won't work.
I do and I just changed it but I am getting the same results

“503 Service Unavailable
No server is available to handle this request”

At least when I take out my changes everything works. Thanks for the tip.
I know I am close because I can send email from the command line.
I am editing the file through putty ssh session using nano. If that helps.

jsc
Posts: 1864
Joined: Thu Apr 10, 2014 4:00 am

Re: Networking

Post by jsc » Mon May 19, 2014 6:13 am

Where are you getting that error message? When you try to connect to the RaspPi with your browser? Or is it showing up as the output in a log somewhere?

503 means the server is unavailable. If you are seeing the former case, that means OctoPi isn't starting up correctly, and you should probably double check the syntax of your config file. If the latter case, it means it is running, but it can't run your command, and the 503 is probably coming from curl. In that case, you have to make sure the server is listening on 127.0.0.1 as well as whatever external IP address it has. And make sure the port is correct.

markb
Posts: 180
Joined: Tue Apr 15, 2014 11:06 pm

Re: Networking

Post by markb » Mon May 19, 2014 6:29 am

After I reboot the server I try to login OctoPrint web page and I get the error.

At the command line I can copy the line right out of my config.yaml file and run it. it sends a email with a file attachment printDone.jpg.
curl -o /tmp/printDone.jpg http://127.0.0.1:8080/?action=snapshot && mpack -s "Print of %(filename)s finished" /tmp/printDone.jpg myemailAddress
curl -o /tmp/printDone.jpg http://localhost:8080/?action=snapshot && mpack -s "Print of %(filename)s finished" /tmp/printDone.jpg myemailAddress
Either one will sent a email at the command line.

jsc
Posts: 1864
Joined: Thu Apr 10, 2014 4:00 am

Re: Networking

Post by jsc » Mon May 19, 2014 8:32 am

Okay, that indicates OctoPrint is not getting started properly, which means you have syntax errors in your changes to config.yaml.

YAML is indentation sensitive. Are you properly indenting all the lines?

markb
Posts: 180
Joined: Tue Apr 15, 2014 11:06 pm

Re: Networking

Post by markb » Mon May 19, 2014 1:57 pm

Thanks! That was it. In windows white space is usually ignored. I am running a short print right now to test it.
Yes my lack of Linux experience shows through. I kept thinking I had a syntax error. Or my editor was putting in bad charters.

Well it worked fine but the picture is very funny. You cant see the print the way I have the camera setup. Getting a email when the print is done is priceless.

Here is the Timelapse video this is a nice feature.
http://www.youtube.com/watch?v=fYLvdnbc ... e=youtu.be

I just created an image of my SD card just in case.
Attachments
printDone.jpg
printDone.jpg (40.37 KiB) Viewed 15758 times
Last edited by markb on Mon May 19, 2014 3:15 pm, edited 1 time in total.

sprior
Posts: 385
Joined: Thu Apr 10, 2014 8:37 pm

Re: Networking

Post by sprior » Mon May 19, 2014 3:13 pm

Glad you got past this. The devel branch of OctoPrint has an option that lets you add a still shot at the end of the timelapse - makes it more satisfying.

Note that moving to the devel branch requires you to change your event config because the placeholder variables changed.

markb
Posts: 180
Joined: Tue Apr 15, 2014 11:06 pm

Re: Networking

Post by markb » Mon May 19, 2014 3:18 pm

Ok what do I have to do to move to the devel branch? I must have that option.
Thanks for your help through this process.

Post Reply