jneilliii / OctoPrint-WindowsInstaller

77 stars 21 forks source link

How to install marlin-binary-protocol for FirmwareUpdater plugin? #21

Closed Xeevis closed 10 months ago

Xeevis commented 10 months ago

Hello, I'm trying setup FirmwareUpdater, but it's complaining about missing marlin-binary-protocol package.

image

I've followed these instructions, but I must be doing something wrong.

I've installed Python 3.10 from Microsoft Store and tried running commands like

CMD> C:\Users\Xeevis\AppData\Local\Programs\OctoPrint\WPy64-31050\python-3.10.5.amd64\Lib\venv\scripts\nt\activate.bat

But I have no idea what I'm doing and it just keeps on piling errors. Any idea what steps should I take on Windows?

jneilliii commented 10 months ago

The windows installer does it slightly different than the venv approach mentioned in those instructions. You would have to run the following command to do pip installs into the OctoPrint environment.

C:\Users\Xeevis\AppData\Local\Programs\OctoPrint\WPy64-31050\scripts\python.bat -m pip install https://github.com/p3p/pyheatshrink/releases/download/0.3.3/pyheatshrink-pip.zip

however, I just tried that from my machine and it gives compile errors.

I suspect the issue is related to python 3.10 as the heatshrink module does say that python 3 support is experimental.

jneilliii commented 10 months ago

I found a possible fix in the plugin's PRs using a tarball. Not sure if it works, but it did install. Download the file https://alfter.us/wp-content/uploads/2022/08/pyheatshrink-92ffa4e.tar.xz and then run this command.

C:\Users\Xeevis\AppData\Local\Programs\OctoPrint\WPy64-31050\scripts\python.bat -m pip install "C:\Users\Xeevis\Downloads\pyheatshrink-92ffa4e.tar.xz 
jneilliii commented 10 months ago

actually after doing the next step of installing marlin-binary-file-transfer, it is using heatshrink2 now.

image

so really you just need to run this I think.

C:\Users\Xeevis\AppData\Local\Programs\OctoPrint\WPy64-31050\scripts\python.bat -m pip install marlin-binary-protocol

EDIT: nope, that doesn't work.

Xeevis commented 10 months ago

Thanks a ton this did the trick! I've made PowerShell one-liner to simplify the process:

cd $env:LOCALAPPDATA\Programs\OctoPrint\WPy64-31050\scripts\ && Invoke-WebRequest -Uri https://alfter.us/wp-content/uploads/2022/08/pyheatshrink-92ffa4e.tar.xz -OutFile $env:temp\pyheatshrink-92ffa4e.tar.xz && ./python.bat -m pip install $env:temp\pyheatshrink-92ffa4e.tar.xz && ./python.bat -m pip install marlin-binary-protocol

image

rozhkovets commented 9 months ago

When I try install from https://alfter.us/wp-content/uploads/2022/08/pyheatshrink-92ffa4e.tar.xz I get an error that the file stdlib.h was not found

I additionally installed the Windows 10 SDK (10.0.20348.0) package using the supplied installer vs_BuildTools.exe in OctoPrint folder and this solved the problem