GithubHelp home page GithubHelp logo

donkie / spoolman Goto Github PK

View Code? Open in Web Editor NEW
786.0 27.0 79.0 2.19 MB

Keep track of your inventory of 3D-printer filament spools.

License: MIT License

Python 52.09% Dockerfile 0.48% JavaScript 0.07% HTML 0.12% TypeScript 45.07% Mako 0.10% Shell 1.96% CSS 0.12%
3d-printing database inventory service

spoolman's Introduction

Icon of a filament spool

Keep track of your inventory of 3D-printer filament spools.

Spoolman is a self-hosted web service designed to help you efficiently manage your 3D printer filament spools and monitor their usage. It acts as a centralized database that seamlessly integrates with popular 3D printing software like OctoPrint and Klipper/Moonraker. When connected, it automatically updates spool weights as printing progresses, giving you real-time insights into filament usage.

Features

  • Filament Management: Keep comprehensive records of filament types, manufacturers, and individual spools.
  • API Integration: The REST API allows easy integration with other software, facilitating automated workflows and data exchange.
  • Real-Time Updates: Stay informed with live spool updates through Websockets, providing immediate feedback during printing operations.
  • Web-Based Client: Spoolman includes a built-in web client that lets you manage data effortlessly:
    • View, create, edit, and delete filament data.
    • Add custom fields to tailor information to your specific needs.
    • Print labels with QR codes for easy spool identification and tracking.
    • Contribute to its translation into 18 languages via Weblate.
  • Database Support: SQLite, PostgreSQL, MySQL, and CockroachDB.
  • Multi-Printer Management: Handles spool updates from several printers simultaneously.
  • Advanced Monitoring: Integrate with Prometheus for detailed historical analysis of filament usage, helping you track and optimize your printing processes.

Integrations:

Web client preview: image

Installation

Spoolman can be installed in two ways, either using Docker or standalone on your machine.

  • The Docker method can be used on any OS which supports Docker.
  • The standalone method requires a Debian (e.g. Ubuntu, Raspberry Pi OS) or Arch-based Linux distribution.
    • If you know what you're doing you can also install it standalone for any OS such as Windows, but there are no provided scripts for automated installation, follow the "Install from Source" instructions below.

Docker is the recommended installation method since it is more reliable and portable.

Spoolman comes with a built-in SQLite database that is used by default and will suit most users needs. The data is stored in a single .db file in the server's user directory. You can optionally instead use a PostgreSQL, MySQL or CockroachDB database.

Docker Install

First install

Docker is a platform for developing, shipping, and running applications in "containers". Containers are lightweight, portable, and self-contained environments that can run on any machine with Docker installed. The Spoolman docker image contains everything it needs to run, so you don't need to worry about for example what Python version you have installed on your local machine.

To install Docker on your machine, follow the instructions for your operating system on the Docker website. Docker also includes the docker-compose tool which lets you configure the container deployment in a simple yaml file, without having to remember all the command line options. Note: older versions of docker-compose require you to have a dash (-) in the following commands, like docker-compose instead of docker compose.

Here is a sample docker-compose config to get you started. Create a folder called spoolman in your home directory, CD in to it, copy-paste the below sample into a file called docker-compose.yml in the new directory and run docker compose up -d to start it. If you want to use the SQLite database as in this sample, you must first create a folder called data in the same directory as the docker-compose.yml, then you should run chown 1000:1000 data on it in order to give it the correct permissions for the user inside the docker container.

version: '3.8'
services:
  spoolman:
    image: ghcr.io/donkie/spoolman:latest
    restart: unless-stopped
    volumes:
      # Mount the host machine's ./data directory into the container's /home/app/.local/share/spoolman directory
      - type: bind
        source: ./data # This is where the data will be stored locally. Could also be set to for example `source: /home/pi/printer_data/spoolman`.
        target: /home/app/.local/share/spoolman # Do NOT modify this line
    ports:
      # Map the host machine's port 7912 to the container's port 8000
      - "7912:8000"
    environment:
      - TZ=Europe/Stockholm # Optional, defaults to UTC

Once you have it up and running, you can access the web UI by browsing to http://server.ip:7912. Make sure that the data folder you created now contains a spoolman.db file. If you cannot find this file in your machine, then your data will be lost every time you update Spoolman.

Type docker compose logs in the terminal to see the server logs.

If you want to modify things like database connection, add environment variables to the environment: section of the docker-compose.yml like shown in the sample above and then restart the service: docker compose restart. See the .env.example file for a list of all environment variables you can use.

Updating

If a new version of Spoolman has been released, you can update to it by first browsing to the directory where you have the docker-compose.yml file and then running docker compose pull && docker compose up -d.

Standalone Install

First install

This installation method assumes you are using a Debian-based Linux distribution such as Ubuntu or Raspberry Pi OS. If you are using Arch, or any other distribution, please modify as appropriate.

Make sure your current directory is in your logged in user's home directory. Copy-paste the entire below command and run it on your machine to install the latest release of Spoolman.

sudo apt-get update && \
sudo apt-get install -y curl jq && \
mkdir -p ./Spoolman && \
source_url=$(curl -s https://api.github.com/repos/Donkie/Spoolman/releases/latest | jq -r '.assets[] | select(.name == "spoolman.zip").browser_download_url') && \
curl -sSL $source_url -o temp.zip && unzip temp.zip -d ./Spoolman && rm temp.zip && \
cd ./Spoolman && \
bash ./scripts/install.sh

If you want to modify things like database connection, edit the .env file in the Spoolman folder and restart the service.

Updating

Updating Spoolman is quite simple. If you use the default database type, SQLite, it is stored outside of the installation folder (in ~/.local/share/spoolman), so you will not lose any data by moving to a new installation folder.

Copy-paste the entire below commands and run it on your machine to update Spoolman to the latest version. The command assumes your existing Spoolman folder is named Spoolman and is located in your current directory.

# Stop and disable the old Spoolman service
sudo systemctl stop Spoolman
sudo systemctl disable Spoolman
systemctl --user stop Spoolman
systemctl --user disable Spoolman

# Download and install the new version
mv Spoolman Spoolman_old && \
mkdir -p ./Spoolman && \
source_url=$(curl -s https://api.github.com/repos/Donkie/Spoolman/releases/latest | jq -r '.assets[] | select(.name == "spoolman.zip").browser_download_url') && \
curl -sSL $source_url -o temp.zip && unzip temp.zip -d ./Spoolman && rm temp.zip && \
cp Spoolman_old/.env Spoolman/.env && \
cd ./Spoolman && \
bash ./scripts/install.sh && \
rm -rf ../Spoolman_old

Frequently Asked Questions (FAQs)

QR Code Does not work on HTTP / The page is not served over HTTPS

This is a limitation of the browsers. Browsers require a secure connection to the server to enable HTTPS. This is not a limitation of Spoolman. For more information read this blog from Mozilla.

OctoEverywhere.com is An easy way to get secure HTTPS access to Spoolman. Remote access with OctoEverywhere is always secure and easier than setting up a reverse proxy + SSL self-signed certificate.

Another option is to put Spoolman behind a reverse proxy like Caddy or Nginx to enable HTTPS. See for example this guide for Caddy.

Can Spoolman be translated into my language?

Yes, head over to Weblate to start the translation!

Install from source

Advanced users only.

If you want to run the absolute latest version of Spoolman, you can either use the edge tagged Docker image, or follow these steps to install from source. Keep in mind that this is straight from the master branch which may contain unfinished and untested features. You may also not be able to go back to a previous version since the database schema may change.

  1. Make sure you have at least NodeJS 20 or higher installed, and Python 3.9 or higher installed.
  2. Clone this repo or download the zip source.
  3. Inside the client/ folder:
    1. Create a .env file with VITE_APIURL=/api/v1 in it
    2. Run npm ci
    3. Run npm run build
  4. Install PDM using pip install --user pdm
  5. Build the requirements.txt file: pdm export -o requirements.txt --without-hashes > requirements.txt
  6. Give scripts permissions: chmod +x ./scripts/*.sh
  7. Run the installer script like the normal install: ./scripts/install.sh

Development

Server/Backend (Python)

The Python backend is built using Python 3.9 standards. It's built on FastAPI for the REST API, and SQLAlchemy to handle the databases.

To setup yourself for Python development, do the following:

  1. Clone this repo
  2. CD into the repo
  3. Install PDM: pip install --user pdm
  4. Install Spoolman dependencies: pdm sync

And you should be all setup. Read the Style and Integration Testing sections below as well.

Style

Black and Ruff is used to ensure a consistent style and good code quality. You can install extensions in your editor to make them run automatically.

Pre-commit is used to ensure the style is maintained for each commit. You can setup pre-commit by simply running the following in the Spoolman root directory:

pip install pre-commit
pre-commit install

Integration Testing

The entire backend is integration tested using an isolated docker container, with all 4 database types that we support (Postgres, MySQL, SQLite and CockroachDB). These integration tests live in tests_integration/. They are designed to "use" the REST API in the same way that a client would, and ensures that everything remains consistent between updates. The databases are created as part of the integration testing, so no external database is needed to run them.

If you have docker installed, you can run the integration tests using pdm run itest for all databases, or e.g. pdm run itest postgres for a single database.

Client (Node/React/Typescript)

The client is a React-based web client, built using the refine.dev framework, with Ant Design as the components.

To test out changes to the web client, the best way is to run it in development mode.

Prerequisites:

  • NodeJS 20 or above installed, along with NPM. Running node --version should print a correct version.
  • A running Spoolman server, with the following two environment variables added in the docker-compose.yml:
    environment:
      - FORWARDED_ALLOW_IPS=*
      - SPOOLMAN_DEBUG_MODE=TRUE

Instructions:

  1. Open a terminal and CD to the client subdirectory
  2. Run npm install. If it doesn't succeed, you probably have an incorrect node version. Spoolman is only tested on NodeJS 20.
  3. Run echo "VITE_APIURL=http://192.168.0.123:7901/api/v1" > .env, where the ip:port is the address of the running Spoolman server. This should create a .env file in the client directory. If you don't already have one running on your network, you can start one up using the docker-compose.yml showed above.
  4. Run npm run dev. The terminal will print a "Local: xxxx" URL, open that in your browser and the web client should show up. Your existing spools etc in your Spoolman database should be loaded in.
  5. Any edits in .ts/.tsx files will be automatically reloaded in your browser. If you make any change to .json files you will need to F5 in your browser.

spoolman's People

Contributors

allram avatar bahoue avatar besser avatar bittin avatar clevelandcs avatar comradekingu avatar contrasens avatar coopergerman avatar copro avatar daviteusz avatar dependabot[bot] avatar donkie avatar drperrycoke avatar goodwin avatar hcooper avatar luger16 avatar maxkreja avatar mickcz avatar mkevenaar avatar momszx avatar patofoto avatar pdsccode avatar petersilius avatar samuel-0-0 avatar serega124 avatar spyder007 avatar srbjessen avatar thapg avatar tomw1605 avatar unreadablename avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spoolman's Issues

Help: {"detail":"Not Found"} error

While I can interact with the web interface, I am unable to use any API requests as it returns {"detail":"Not Found"}. Refreshing the web interface also shows the same error. It's my first time working with API request sbut I looked up the proper formatting (i.e http://my-ip:7912/vendor?name=test). Thanks in advance.

No spool filament usage

I'm running Spoolman with Docker. I can SET_ACTIVE_SPOOL ID=1 and confirm the spool is activated at http://mylocalprinterir:7125/server/spoolman/spool_id:

{"result": {"spool_id": 1}}

After printer job complete, Spoolman doesn't register the filament usage as supposed.

When looking in moonraker.log I can see this:

2023-07-15 19:12:18,321 [server.py:_process_event()] -
Error processing callback in event server:status_update
Traceback (most recent call last):
File "/home/pi/moonraker/moonraker/components/http_client.py", line 115, in request
resp = await asyncio.wait_for(fut, timeout)
File "/usr/lib/python3.9/asyncio/tasks.py", line 481, in wait_for
return fut.result()
tornado.simple_httpclient.HTTPTimeoutError: Timeout while connecting

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/pi/moonraker/moonraker/components/spoolman.py", line 112, in _handle_status_update
await self.track_filament_usage()
File "/home/pi/moonraker/moonraker/components/spoolman.py", line 152, in track_filament_usage
response.raise_for_status()
File "/home/pi/moonraker/moonraker/components/http_client.py", line 363, in raise_for_status
raise ServerError(msg, code) from self._error
moonraker.utils.ServerError: Timeout while connecting

How can I solve this problem?

Address idempotency issues with the spool use operation

The /spool/{spool_id}/use operation currently isn't idempotent, which could cause issues if requests gets retried etc.

This could be addressed by either allowing the client to send some unique token with every request, and if that token is seen more than once the request is rejected, or by utilizing the ETag/If-Match system, or perhaps some other way.

Pressure Advance Data Field

Please include a data field for PA (Pressure Advance for Klipper users)
Typical setting expected is 0 to 1.000 for PA.

This setting is spool specific and goes hand in hand with flow % for an individual spool.

Believe this was first mentioned by @locki-cz in issue #10.

Also, thanks for moving this project forward! Keep up the good work!

Return estimated remaining_length in addtion to remaining_weight

I am looking to grab the filament required for a print and see if that amount is available on the active spool. If there is not enough filament on the spool to satisfy the print I want to throw an error in the UI or return something like a 409 (which may be more complex).

The amount filament required for a gcode file can be found via a call to /server/files/metadata?filename={filename}. The value provided by the slicer is provided in millimeters

Although you could leave it up to the developer to create a helper function as you done here I think it would be nice if Get Spool returned remaining_length as well as remaining_weight

Mainsail Active Spool Not setting

I don't beleive that the active spool is not changing in mainsail anymore. I set to a couple different spools but my used weight are not changing. Is there a way to see what spool is set to active?

Custom sorting tabs in lists show filament colour in box

Custom sorting tabs in lists, also sort filament by name type, vendor, colour, show filament colour in box, posible hide some not need tabs. It helps for search in lots of spools! :)

It would be nice if the filament color was also displayed in the lists, as it is on the octoprint.

listSpools-tab

Colour tab, please make it little bit biger and wider :)

Thank you

data folder empty

Hello,

I am not sure what I am doing wrong, but I ran the docker-compose.yml and it looks as if it installed, but the portal doesn't load. As I looked into this, the data folder is empty. Any idea what I may be doing wrong. Can anyone help me out?

no webui

Hi any idea why I can't hit the webui seems like it's live? http://10.0.1.89:7912

# Spoolman Container for Docker https://github.com/Donkie/Spoolman
version: '3.8'
services:
  spoolman:
    container_name: "spoolman"
    image: ghcr.io/donkie/spoolman:latest
    labels:
      - "com.centurylinklabs.watchtower.enable=true"
      - "com.centurylinklabs.watchtower.monitor-only=false"
    volumes:
       - /var/lib/libvirt/images/usb001/docker-storage/spoolman/data:/home/app/.local/share/spoolman
    mac_address: "de:ad:be:ef:00:41"
    networks:
      - dhcp
    restart: "no"
    ports:
      - "7912:8000"
    environment:
      - TZ=Europe/Stockholm # Optional, defaults to UTC
networks:
  dhcp:
    name: "dbrv700"
    external: true
ping 10.0.1.89

Pinging 10.0.1.89 with 32 bytes of data:
Reply from 10.0.1.89: bytes=32 time=4ms TTL=63
Reply from 10.0.1.89 bytes=32 time=2ms TTL=63
Reply from 10.0.1.89 bytes=32 time=2ms TTL=63

Can't seem to look at the console through docker as well.

INFO:     Waiting for application startup.
spoolman.main              INFO     Setting up database...
spoolman.database.database INFO     No database type specified, using a default SQLite database located at "/home/app/.local/share/spoolman/spoolman.db"
spoolman.main              INFO     Performing migrations...
alembic.runtime.migration  INFO     Context impl SQLiteImpl.
alembic.runtime.migration  INFO     Will assume non-transactional DDL.
spoolman.database.database INFO     Scheduling automatic database backup for midnight.
spoolman.main              INFO     Startup complete.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
WARNING:  Invalid HTTP request received.
WARNING:  Invalid HTTP request received.
WARNING:  Invalid HTTP request received.
WARNING:  Invalid HTTP request received.
WARNING:  Invalid HTTP request received.
WARNING:  Invalid HTTP request received.

QR code generation

I think a Barcode/QRCode would be very useful.

Being able to easily scan a QR code and be able to have the printer select that spool would be nice. You would need a way to select the printer first, maybe add a qrcode to the printer as well so you could scan that one first, then scan the spool. But a dropdown of printers would be just as easy unless you are running a farm. This may involve more interaction with the printer software then what is possible.

I know this would be a strech and may not be worth the effort, but if you could scan UPC and have it populate all the info it could pull from it, that would be amazing. But I don't know enough on how UPC codes work to even know if that data could be pulled.

Configurable currency for price

Somehow people should be able to make prices take a specific currency. Not sure where that would be configured though. Environment variable?

MainsailOS integration

I am adding the steps here I took to add Spoolman to MainsailOS.

(1) Install on MainsailOS

cd ~/
git clone https://github.com/Donkie/Spoolman.git
mv Spoolman spoolman
virtualenv -p python3 ~/spoolman-env
source ~/spoolman-env/bin/activate
cd spoolman
git checkout v0.9.1
pip install -U pip pdm
pdm sync --prod

(2) Build npm assets on dev PC/Mac

(This assumes you have npm set up there)

git clone https://github.com/Donkie/Spoolman.git
cd Spoolman/client
npm install
echo "VITE_APIURL=/api/v1" > .env.production
npm run build

(3) Copy npm assets from Spoolman/client/dist to MainsailOS ~/spoolman/client/dist

(4) Create spoolman.service under /etc/systemd/system/

[Unit]
Description=Spoolman
Documentation=https://github.com/Donkie/Spoolman
After=network-online.target
Wants=network-online.target
Before=nginx.service

[Install]
Alias=spoolman
WantedBy=multi-user.target

[Service]
Type=simple
User=pi
RemainAfterExit=yes
WorkingDirectory=/home/pi/spoolman
Environment="PATH=/home/pi/spoolman-env/bin"
ExecStart=/home/pi/spoolman-env/bin/uvicorn spoolman.main:app --host 0.0.0.0 --port 8000
Restart=always
RestartSec=10

(5) Add to moonraker.conf

[spoolman]
server: http://localhost:8000
sync_rate: 5

Add images to https://hub.docker.com/

Hi,
i really would like to thank you for your work! Spoolman is really something i would like to have for a long time. I've installed it on my Synology NAS using command line from SSH. However, if you add images to https://hub.docker.com/ it would be easier for everyone to keep it updated from the UI instead of SSH into the NAS everytime.
I tried to add also the ghcr.io/donkie url to repositories list but it doesn't work. Sorry but i'm not so experienced with docker. If there is already a solution please let me know.

Michele

Error while creating transparent filaments (status code: 422)

I've just got my hands on the Spoolman and even if my printer is currently down & I can't connect my Moonraker to your software - I'm on my way to build the database of used filaments :) so far - looking good! with one small issue.

when I try to set semi-transparent filament - as the color-dialogue lets me to do it:
image

there is an error when trying to save this filament - and it pops up both on new filaments, and when I edit old ones and try to make them transparent:
image

if the color setting is 100% - everything works smoothly.

if it's important for the issue, my installation is:

  • docker install [via docker-compose/portainer stack]
  • database used: MariaDb [also in docker]

Archive Spool from UI

Hello - Thank you for the project, tracking spool usage has been sorely missed since switching from Octoprint.

I noticed in release 0.9.0, the ability to archive the spool was added. In 0.9.1, I don't see a way to "archive" the spool in the UI.

Edit: Closing issue.. Forgot to reload the UI after updating.... :-)

Add create w/spool to filament creation page

It would be nice if I could add a filament, and have it automatically add a spool of it at the same time. Could add a "create with spool" button in addition to the create filament, or maybe a checkbox to create a spool.

No Web UI

Hi. I want to run Docker in the same Raspberry Pi as Klipper/Moonraker.

I installed Docker with this line commands:
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker pi

My Docker installation is running well:
When I run command "docker run hello-world" I get the right info.

Then I created a folder called spool man and inside it I created a file called docker-compose.yml and a folder called data.

Inside docker-compose.yml I pasted the text:

version: '3.8'
services:
spoolman:
image: ghcr.io/donkie/spoolman:latest
restart: unless-stopped
volumes:
- ./data:/home/app/.local/share/spoolman
ports:
- "7912:8000"
environment:
- TZ=Europe/Lisbon # Optional, defaults to UTC

Then did run "chown 1000:1000 data".

Last command was:
docker compose up -d

I rebooted but I cannot get access to WebUI at 192.168.1.10:7912 (my raspberry Pi IP is correct).

If I run the command "docker info", I get:

Server:
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 1

It appears that the container is not running. I tried to start it, but no success.

What can be the problem?

Mobile Support

Is it possible to get a better layout for mobile? I think there are things like responsive sites that will automatically format the layout to fit the screensize. An app would be ideal, but I know that would take a lot of development and a good mobile site can be just as effective.

Printer item

Add optional ability to add printers in the database.

Spoolman would then be the one that keeps track of spool assignment.

SW like Moonraker could still keep track of assignment like before, but could optionally instead assign itself to a specific printer ID, and then run filament tracking on the printer endpoint.

Database of Spool Weights by Manufacturer

First off, this is exceptional work and since I have been watching there has been a remarkable explosion of ideas.

I would like to add one more that I think would help the project.

What about a database of spool weights by manufacturer? It would be great if it were a central database that could accept submissions by users (or ideally manufacturers) for empty spool weights. Then Spoolman could update from that website and not have the user need an empty spool to know what the approximate empty spool weight is.

But I can understand having a central database for all users is quite an undertaking so would it be a good idea to have a dedicated local table (populated by the user) that stores spool weights by manufacturer and type? For example:
Sparta3D | Cardboard Spool | 100g
Sparta3D | Clear Plastic Spool | 80g
Fusion Filaments | Plastic Spool | 85g
Fusion Filaments | Refill Spool | 91g
etc... (these numbers are totally made up, but I do have these empty spools so I could provide these details for future users)

There would be an added benefit of a pre-made list of manufacturers that could populate a drop-down menu when creating new filaments in Spoolman

ARM v7 build

Docker image is currently not built for the ARM v7 platform, which is what Raspberry Pi uses. Would be nice to add support for that.

Spool Sets Status Tab

Not sure if a idea was already planned for this or status in general.

Please add separate tab to show which printer or instance ip/port currently has "set" a spool and which one it is set on.

This can be used to verify the printer is set to a spool and the correct one without flipping between printer instances.

Hardware?

What hardware do you use to actively measure the spool weights in mainsailOS while the printer is printing to update spoolman is there a page about this?

Forgive me if it is covered someplace.

Maybe you can enable discussion on the Repo as well so stuff like this doesn't need to go in the issues tracker.

Not an issue - Really counting upwards?

Hi @Donkie ,

Just came from the moonraker thread where I found your standalone service. Now I saw, that you have changed to count usage upwards.

Coming from OctoPrint I was thinking about it, that I like it the most that when Starting a print, octoprint will tell me: Hey your spool doesn't have enough filament for your gcode. If i then resume to print, and it really comes to 0, it just proceeds counting downwards and you have a negative filament amount. But that is like a cross check. I personally are always specifying 20g less then what is specified so to have a buffer.

I didn't know where I should discuss this, so sorry for the issue.

One more thing: what do you assume, by when will such a feature be available in moonraker/mainsail ? Filament Manager is the only thing hindering me to switch from octoprint.

Thanks for your great work
Patrick

Respond with 404 on spool use

Currently if you try to run the filament usage request on a spool which doesn't exist, it responds with a 500 error. It should infact respond with a 404 and a more helpful error message.

Search

Being able to search (comments/notes/tags) would be nice too. E.g., you add information like objects you printed with a certain spool, then you can go back and search for that object name and it will show all the spools that were tagged with it. So you search Iron Man, and all the spools you used for an iron man print would show.

side note:
Is there a way for us to tag feature request or will you just take care of it on your end? I think I have seen githubs that would let the user select. Just trying to save a little work for yourself.

Ability to select which columns to show

Some people don't need all fields, like Location for example.

Also, other fields like extruder temp is currently not shown in the list, and some people may want that.

From #14

Ability to have filament profiles into slicers

Before going any further, I'd like to thank you for this project. It's been on my mind for a long time, but never came to fruition.

Having the ability to retrieve the entire Spoolman filament in your slicer could be useful.

Ideally, we could synchronize from the slicer GUI, but this would require extensive development of slicer parts and as most slicers are managed by major brands, it will be a long road.

Another solution would be to download filament profiles and import them into the slicer. This would require a specific export format for each slicer, as it is not standardized.

Perhaps storing additional information such as extrusion multiplier, cooling, custom g-code could be handy (PA, for example).

Weight attribute for Filament

Hey there, thank you so much for putting your time into building Spoolman! Like others this is a feature I would love to have.

I'm curious to why the model for Filament has an attribute for weight and spool_weight - seems like this would be better tracked in the Spool model. The same "filament" can come in various quantities or you can have multiple spools of the same filament.

For example:
Matter hackers pro abs comes in 2 spool sizes:

The work around here would be creating multiple Filament objects for the same filament but with different weights which isn't a huge deal but thought I'd chime in.

Love to see the momentum on this project, lets keep it going!

Manually Adjust Spool Usage

Can you add an option to manually adjust spool usage after creating the spool. I find times, I forget to set the active spool before a print. It would be nice to be able to manually make the adjustments after the print.

Archive used spools

It would be nice to retire spools once they are empty. Keep in a database to revisit if you ever want to see what you used in the past and notes you may have left with them. Being able to search (comments/notes) would be nice too. eg. if you add information like objects you printed with a certain spool, and you go back and search for that object name. It will show all the spools that were tagged with it. So you search Iron Man, and all the spools you used for iron man would show. I am not sure how many others care about this. But I guess I like to be overly informed.

As far as UI. Maybe a dropdown on the spool list where Actions are, that give option to View, Edit, Retire, Delete. so you can do it right from the list screen.

How to install docker and test it

Hi please add some basic info how to run it to others on RPI:

How to install docker:

To install the latest stable versions of Docker CLI, Docker Engine, and their dependencies:

  1. make folder spoolman:

mkdir spoolman
cd spoolman

  1. download the script
    $ curl -fsSL https://get.docker.com -o install-docker.sh

  2. verify the script's content
    $ cat install-docker.sh

  3. run the script with --dry-run to verify the steps it executes
    $ sh install-docker.sh --dry-run

  4. run the script either as root, or using sudo to perform the installation.

$ sudo sh install-docker.sh

Set proper rights to run docker:

sudo usermod -aG docker pi

Then logout and login again to refresh your pi user rights.

Then i created folder in my home/pi/spoolman created file: docker-compose.yml

nano docker-compose.yml
paste this:

version: '3.8'
services:
  spoolman:
    image: ghcr.io/donkie/spoolman:latest
    restart: unless-stopped
    volumes:
      - ./data:/home/app/.local/share/spoolman
    ports:
      - "7912:8000"

Create folder data:
mkdir data

Set rights to data folder
chown 1000:1000 data

then just run:
docker compose up -d

check docker containers:
docker ps -a

more info how to stop docker remove it etc i found there:

https://docs.docker.com/engine/reference/run/

Configuration on printer side:

https://moonraker.readthedocs.io/en/latest/configuration/#spoolman

# moonraker.conf

[spoolman]
server: http://192.168.0.123:7912
#   URL to the Spoolman instance. This parameter must be provided.
sync_rate: 5
#   The interval, in seconds, between sync requests with the
#   Spoolman server.  The default is 5.
# printer.cfg

[gcode_macro SET_ACTIVE_SPOOL]
gcode:
  {% if params.ID %}
    {% set id = params.ID|int %}
    {action_call_remote_method(
       "spoolman_set_active_spool",
       spool_id=id
    )}
  {% else %}
    {action_respond_info("Parameter 'ID' is required")}
  {% endif %}

[gcode_macro CLEAR_ACTIVE_SPOOL]
gcode:
  {action_call_remote_method(
    "spoolman_set_active_spool",
    spool_id=None
  )}

update in my case is only run in my folder spoolman:

cd spoolman

docker compose pull && docker compose up -d

Multiple printers same PC not working.

I am trying to run Spoolman on two instants of moonraker on the same machine. They are separated by ports. One is port 7125 and the other 7126. They each have their own moonraker config in the following folders (7125 in RedRover_data/config and 7126 in WhiteLighting_data/config).

The version that has been working and still is, is 7126. When I change the active spool, in that machine, it works no problem. But when I try on the 7125 (RedRover) printer. Nothing happens. I have both moonraker.conf with the following.

[spoolman]
server: http://192.168.0.93:7912

I also try setting it manually with the curl commands but both old and new commands do not work for either machine. See txt file for details.
spoolman commands with errors.txt

Websocket subscription

Add support for subscribing to changes to spools/filaments/vendors via websockets, so you can receive updates immediately without having to poll.

Super excited about this, please continue working on this project!

Hello, I have a hx711 strain gauge (weight scale) and RFID tagging set up through home assistant (esp32), but I've been searching for a way to integrate it into klipper/mainsail. I liked the filament manager plugin that is available on Octoprint, but I really prefer the layout and simplicity of mainsail, just need a way to either pull info from home assistant or push it to moonraker, and display it in mainsail. I'm willing to contribute with testing, ideas, even throw a little cash your way if it means this project gets completed :) Again thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.