Setting up OctoPrint on Windows

For 34 years I coded on Windows-based computers; about 75%+ of the money I made was because of them. And now I'm on Macs and Ubuntu. I now rarely use Microsoft Windows. To me, it just feels like:

  1. Microsoft has lost their edge in the programming space
  2. about 99% of the open-space world is written for some other operating system and not well tested on Windows
  3. there was a period recently in which npm was basically dysfunctional on the Windows platform due to MAX_PATH issues
  4. backslashes versus forward slashes
  5. \n versus \r\n line endings
  6. In a panic, they've been trying to abruptly change their platform and their app delivery to catch up with Apple and Windows 10 is painfully broken as a result

I teach software development. Every day a student walks up with some installation problem on a Windows-based laptop. Mongo doesn't install. Loopback won't compile. Mysql won't install.


To me, the ~$35 cost of a Raspberry Pi 3B computer for OctoPrint is a no-brainer with respect to the minimal hassles you'll see.

Interesting perspective. I have linux machines, raspberry machines, chrome machines, and windows at home for various purposes. Some of which are brought up in your list (although I'm not sure why backslashes vs forward slashes is a factor.). So this is not a factor of a fear of working with non windows machines. I work on linux machines every day at work and home. I just happen to have a windows machine next to the printer (for windows reasons) . Also for reference (not that it's a lot of money) but a pi is closer to $100 by the time you finish getting power adaptors, sd card, camera, case (well I guess now that I have a printer I can print my own case).

The question isn't is linux better than windows but does this product fully work on windows. Why buy a low powered device when I have a full power server that has everything I need sitting 2 feet away?

P.S. I agree. I don't like running mongo or Mysql on windows. Same with Postgres and Oracle. All of these products were designed for Linux first and windows as an afterthought and are complex software.

2 Likes

That one turns up in countless scripts in the npmjs space (think "npm install ...") in which someone blindly fetches the macro __dirname and then tries to concatenate /whatever to it. For Windows, that always breaks.

Google: "__dirname + '/'" Windows for about 92,000 hits on that

There are correct ways of doing this with Node but because of that 99% factor, nobody puts the time into it. And then, there's an issue and someone then deals with it.

I have a fondness for most operating systems. And yet every evening I have a line of Windows-based students who bring me new problems to solve. Every single week I chalk up one more thing to remember within this space as in "ah, Mocha just rev'd to 5.2 and now it's doing this (insert random bad thing)".

An open-source program running under Windows as the operating system is a gamble from Day 1 as well as Day 60 (when you run updates). Gina's going to rev the underlying Python perhaps with v1.3.9 and then—even if it worked great for you on v1.3.8 with the earlier Python—will it continue to work as expected with a platform adjustment? You roll your dice, you take your chances, folks. That's mostly what I'm saying, that it's a new rule of thumb which I'll make up here inline:

In the world of open-source solutions your best chance of success is to have the same operating system, same major revisions of infrastructure and same browser choice as 80% of the coders who contribute to it.

For each degree of deviation from that norm you collectively inherit 10% of all new issues with each revision of each module. Windows represents several degrees of deviation from that norm.

There becomes a point where the aggregate number of hours chasing bug fixes over the span of a year greatly outweighs the cost of choosing the correct platform from the beginning.

~ OutsourcedGuru

I will say that a Raspberry Pi 3B computer has something that your workstations and mine do not: 40 GPIO pins. Do not underestimate the awesomeness of being able to add sensors, relays and such to your computer. Can you plug a USB-based whatever into your Windows computer? Yes. But can you just design something new that nobody else has ever done and do the same? Not necessarily. The true power of a 3D printer is to unleash your inventiveness. Once you get into this mode, you'll start to see possibilities for modding this thing.

1 Like

Linux ain't such a walk in the park either yaknow

I'm becoming more and more convinced that nobody ever actually RUNS programs on Linux, all it seems I ever do is watch the screen scroll up while I install one program so that I can run another program so that I can install the program that I wanted to run in the first place

Oh, you need nodejs for that. So I'll just install nodejs

No, you need to have git for that. So I'll just install git

No, you need to download a tarball for that. Ok, so I'll download a tarball

Okay, I downloaded the tarball. What the hell is a tarball, and how do I squeeze my program out of it ?

Well, you have to untar it

How do I do that ?

You just type tar

If I have to UNTAR it, why am I typing TAR ?

And don't forget the -x

What the hell does the -x do ?

Nevermind. I'll just use an abacus

8 Likes

That's so true that it hurts. :laugh:

2 Likes

This is a great thread! I'm also in the camp of "I had a windows 10 device lying around" I update mine a bit differently as I had SteveM help me out on the Google Plus forums. He always did a clean reinstall. It's worked so far for me. I really appreciate the community here. I love my OctoPrint!

Open a CMD prompt
Type cd c:\OctoPrint
Type virtualenv venv
Type venv\Scripts\activate.bat

c:>cd c:\OctoPrint
c:\OctoPrint>virtualenv venv
New python executable in c:\OctoPrint\venv\Scripts\python.exe
Installing setuptools, pip, wheel...done.
Overwriting c:\OctoPrint\venv\Scripts\activate with new content
Overwriting c:\OctoPrint\venv\Scripts\activate.bat with new content

c:\OctoPrint>venv\Scripts\activate.bat

Type git pull && python setup.py clean && python setup.py install

(venv) c:\OctoPrint>git pull && python setup.py clean && python setup.py install

...Bunch Of Stuff...

Using c:\octoprint\venv\lib\site-packages\pytz-2017.3-py2.7.egg
Finished processing dependencies for OctoPrint==1.3.6

(venv) c:\OctoPrint>

Type octopring serve

(venv) c:\OctoPrint> octoprint serve
2017-12-27 14:08:45,977 - octoprint.startup - INFO - ******************************************************************************
2017-12-27 14:08:45,982 - octoprint.startup - INFO - Starting OctoPrint 1.3.6
2017-12-27 14:08:45,983 - octoprint.startup - INFO - ******************************************************************************

...Bunch More Stuff...

I will point out that there are two scopes for applications on Windows and UNIX (which includes Raspbian/Ubuntu/OSX):

Global-scope vs. owner User-scope vs. owner
Raspian /usr/bin /home/pi/
root pi
OSX /Applications /Users/me/Applications
root me
Windows C:\Program Files or C:\Program Files (x86) C:\Users\you
Administrator you

The OctoPi image of OctoPrint appears to be installed into the user scope of pi. Since OctoPrint runs under the security context of this user, it would have all read/write/execute rights to anything that it would need to do within this folder's control. The only other things that OctoPrint needs to do is to run shutdown, reboot which are outside of the user scope; Guy has taken care of that, though, in his scripts which make the OctoPi image.

So now, you're attempting to install OctoPrint at the global scope ("C:\OctoPrint") rather than within the user scope of yourself or by creating another user called pi and putting it under that user's home directory. In short, Windows and Microsoft don't really think you should be doing this. Their preferred method would be for you to decide if it's 32-bit or 64-bit and to put it into one of the two program files—related areas mentioned in the table above. And then, they expect that your program's application be in a hidden folder off the root, etc.

You may find that you have to right-mouse click cmd and "Run as administrator" for all this to work correctly. It might technically work for you but it is to be noted that this unnecessarily runs all of OctoPrint as Administrator (root) throughout. If you were to install a plugin with evil intent, it could do almost anything. Best practice is to run things with the least overall rights and without elevating the user privileges to root unless a single task is necessary (and then only for that task).

1 Like

Hi is there also a way to use a relay for the power supply.

From a Windows-based installation of OctoPrint, it's not as easy.

but is you use a usb relay you dont need the gpio pins but you need to change the program and that is were i have a problem

And a arduino with a esp 8266

Ok. So I've now installed it on both windows and Raspberry.

The Instructions here are great. Very easy to get this up and running. If you are going to do long prints be aware that windows 10 is much more difficult to prevent auto reboots but it is doable.

Raspberry Setup is fewer steps but in the end they are both easy to set up and the interface is the same once you are in.

Web cam setup is much easier on the Raspberry pi. Basically plug in the camera and it just works. Windows you need to install and set up YawCam and then connect the two.

For me I'm going to stick with the Raspberry pi but only because I forgot why I got that machine for free. It has stability issues and restarts randomly. Some kind of hardware issue that my work couldn't figure out.

Thanks for all of the help. Of course this means I've stolen my son's raspberry until I can pick up another one.

Check the microUSB power connection to make sure that it's snug. A company I worked for got in a batch where the connector side was quite loose.

Thank you for this! I was just following the instructions and didn't want to mess up if my syntax was incorrect. That's why I installed it at C:

I guess I've been lucky and have not had my server restart for updates. I remote into it every so often and there are updates waiting, but it doesn't restart. My longest print so far has been 50 hours and I'm more worried about a hiccup in the power grid than anything else.

Ricky

You also need to worry about Microsoft's fondness for automatically adding updates (say, on a Sunday night) just because it feels like it. Check your update settings and adjust to turn off the automatic application of same.

Check the power-saving settings and turn them all off, especially the part where it turns off the hard drive.

Absolutely, I've turned all of those off. I've been running it since December and I have never had a print fail due to a update or restart. It's working fantastic.

Ricky

Hi. I simply cannot get the webcam streaming to work. I have Yawcam installed, and it seems to be working. I can collect the HTTP and streaming information from it, but when I use it as you've shown in your screenshots, I get a modal saying, " If you see your webcam stream below, the entered stream URL is ok." There's a little broken image marker next to that with the URL I used in the Octoprint settings.

I think I may be missing something basic. This kind of installation and the software are very new to me. If this has already been addressed, I would appreciate being pointed in the right direction.

1 Like

@obeydesign Are you trying to use the IE browser? It's not compatible with the <img src="yourwebcamurlhere"> technique that OctoPrint uses. Try another browser.

Thanks for responding. I'm using Chrome on Windows 10. Do you suspect it will only work with IE/Edge? I'm loathe to use Edge. Maybe Firefox for Windows?