phm07 / marlinraker

Moonraker API Emulator for Marlin 3D Printers
https://marlinraker.readthedocs.io/
GNU General Public License v3.0
9 stars 0 forks source link

Dockerize API server #2

Closed AlmightyFrog closed 1 year ago

AlmightyFrog commented 1 year ago

Hi, I tried (and failed) to run marlinraker in a docker container. To be honest: I have no real clue when it comes to using npm and just tried to follow what you did for marlinraker at MarlinrakerOS using a node docker image as basis:

# See
#  https://github.com/pauhull/MarlinrakerOS/blob/master/src/modules/marlinraker/start_chroot_script

FROM node

RUN useradd -m user

RUN mkdir /marlinraker_files
RUN chown user: /marlinraker_files

USER user

WORKDIR /app

RUN wget -O tmp.zip "$(curl -s "https://api.github.com/repos/pauhull/marlinraker/releases/latest" | grep -o "http.*${3:-\.zip}")"
RUN unzip tmp.zip
RUN rm tmp.zip
RUN npm install

RUN mkdir marlinraker_files
RUN mkdir marlinraker_files/www

EXPOSE 7125

CMD [ "npm", "run", "start" ]

It looks like marlinraker is depending on systemctl and sudo which is not exposed in docker container

marlinraker-marlinraker-1  |
marlinraker-marlinraker-1  | > marlinraker@v0.2.2-alpha start
marlinraker-marlinraker-1  | > node index.js
marlinraker-marlinraker-1  |
marlinraker-marlinraker-1  | [INFO]  00:35:41 Config loaded
marlinraker-marlinraker-1  | [INFO]  00:35:41 App listening on port 7125
marlinraker-marlinraker-1  | [INFO]  00:35:41 Registered macro "start_print"
marlinraker-marlinraker-1  | [INFO]  00:35:41 Registered macro "pause"
marlinraker-marlinraker-1  | [INFO]  00:35:41 Registered macro "resume"
marlinraker-marlinraker-1  | [INFO]  00:35:41 Registered macro "cancel_print"
marlinraker-marlinraker-1  | [INFO]  00:35:41 Registered macro "sdcard_reset_file"
marlinraker-marlinraker-1  | [WARN]  00:35:41 Warning: "misc.allowed_services" was not found in /marlinraker_files/config/marlinraker.toml
marlinraker-marlinraker-1  | [WARN]  00:35:41 Using default value ["marlinraker","crowsnest","MoonCord","moonraker-telegram-bot","KlipperScreen","sonar","webcamd"] for property misc.allowed_services
marlinraker-marlinraker-1  | /bin/sh: 1: systemctl: not found
marlinraker-marlinraker-1  | [ERROR] 00:35:41 Cannot get active system services
marlinraker-marlinraker-1  | [ERROR] 00:35:41 Error: Command failed: systemctl list-units --all --type=service --plain --no-legend
marlinraker-marlinraker-1  | /bin/sh: 1: systemctl: not found
marlinraker-marlinraker-1  |
marlinraker-marlinraker-1  |     at checkExecSyncError (node:child_process:885:11)
marlinraker-marlinraker-1  |     at execSync (node:child_process:957:15)
marlinraker-marlinraker-1  |     at li.getActiveServices (/src/system/ServiceManager.ts:49:39)
marlinraker-marlinraker-1  |     at new li (/src/system/ServiceManager.ts:23:36)
marlinraker-marlinraker-1  |     at new ee (/src/system/SystemInfo.ts:27:31)
marlinraker-marlinraker-1  |     at new re (/src/MarlinRaker.ts:79:27)
marlinraker-marlinraker-1  |     at /src/Server.ts:135:5
marlinraker-marlinraker-1  | [INFO]  00:35:41 Searching for serial port
marlinraker-marlinraker-1  | [ERROR] 00:35:41 Error: Command failed: sudo apt update
marlinraker-marlinraker-1  | /bin/sh: 1: sudo: not found
marlinraker-marlinraker-1  |
marlinraker-marlinraker-1  |     at ChildProcess.exithandler (node:child_process:419:12)
marlinraker-marlinraker-1  |     at ChildProcess.emit (node:events:513:28)
marlinraker-marlinraker-1  |     at maybeClose (node:internal/child_process:1098:16)
marlinraker-marlinraker-1  |     at Socket.<anonymous> (node:internal/child_process:456:11)
marlinraker-marlinraker-1  |     at Socket.emit (node:events:513:28)
marlinraker-marlinraker-1  |     at Pipe.<anonymous> (node:net:305:12)
marlinraker-marlinraker-1  | [INFO]  00:35:41 Gracefully shutting down...
marlinraker-marlinraker-1 exited with code 0

Do you see an easy way to make this docker container possible? I have fluidd installed externally already - so i really only want to have the API server emulating moonraker API in my container.

Best Regards and thanks!

phm07 commented 1 year ago

Hi,

interesting idea you got there. MarlinRaker detects that it is running in a Linux environment and just assumes that systemctl and sudo exist, that's why it crashes. But I can add handlers for that, would be better anyway.

Other than that it would probably run fine in a NodeJS container. Only issue is the serial port, I'm not exactly sure if or how it is possible to pass it through to the docker container.

Why exactly are you planning on using a docker container for MarlinRaker? Are you trying to run multiple instances? Otherwise it would probably be quicker and easier to just let it run on your machine directly.

Best regards

AlmightyFrog commented 1 year ago

Hi, passing through an serial interface is simple, e.g. in docker compose this would be just one more line using parameter "devices". I am doing that already with my current octoprint container which i want to replace.

This is current docker-compose.yml file i used for testing besides the Dockerfile i just pasted in last comment:

version: '3'

services:
  marlinraker:
    build: .
    image: ul/marlinraker
    ports:
      - 7125:7125
    devices:
      - /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0:/dev/ttyUSB0

No native installation of nodejs, cause i want to keep that home server as "clean" as possible. That computer shall only have some basic applications installed and everything else in docker (or maybe qemu in future).

Also i had the idea to put it on my same RPI running already some of my klipper printers with debian and KIAUH. There is everything there already i need (fluidd or mainsail or whatever) just "another" moonraker api server would be needed to be added. Also there i'd like not to add additional native installed software if possible. Of cause (if easy and clean possible) on that pi there could marlinraker run natively...

Best Regards

phm07 commented 1 year ago

Okay, that seems reasonable. If you don't mind I would push your Dockerfile to the repo. Only problem would be updating, is there a way to make the marlinraker_files folder in the container persistent?

Try this version. It should just print a warning now instead of crashing.

AlmightyFrog commented 1 year ago

Sure, you can push anything you want to this repo as long as it might help others i am happy!

But please make it a little cleaner than I did it! ;) If you want help I can also try to make a PR, but is has been a long time since I last time cooperated on Github so not sure if I'd be doing it good on first try; you can also create a PR and I'll have a look for comments if you want to.

I always like it to have a simple Dockerfile + docker-compose.yml file in projects available directly, as that drastically lowers the barrier to try things out without getting into setup problems.

Using my pasted files here it is just like a four step

  1. git clone your repo
  2. check and modify docker-compose.yml
  3. docker-compose build
  4. docker-compose up to try it out.

When it comes to persistent folder, sure that is possible. Would only need to add a volume to docker-compose.yml like "volumes: - ./marlinraker_www_wherever_we_have_it_local:/mountpoint/in/container" to get that done. I am not sure which folder exactly to persist so i can't give you a proper example.

Running your version from previous comment btw gives me this error:

marlinraker-marlinraker-1  |
marlinraker-marlinraker-1  | > marlinraker@v0.2.2-alpha start
marlinraker-marlinraker-1  | > node index.js
marlinraker-marlinraker-1  |
marlinraker-marlinraker-1  | [INFO]  15:51:06 Config loaded
marlinraker-marlinraker-1  | [INFO]  15:51:06 App listening on port 7125
marlinraker-marlinraker-1  | [INFO]  15:51:06 Registered macro "start_print"
marlinraker-marlinraker-1  | [INFO]  15:51:06 Registered macro "pause"
marlinraker-marlinraker-1  | [INFO]  15:51:06 Registered macro "resume"
marlinraker-marlinraker-1  | [INFO]  15:51:06 Registered macro "cancel_print"
marlinraker-marlinraker-1  | [INFO]  15:51:06 Registered macro "sdcard_reset_file"
marlinraker-marlinraker-1  | [WARN]  15:51:06 Warning: "misc.allowed_services" was not found in /marlinraker_files/config/marlinraker.toml
marlinraker-marlinraker-1  | [WARN]  15:51:06 Using default value ["marlinraker","crowsnest","MoonCord","moonraker-telegram-bot","KlipperScreen","sonar","webcamd"] for property misc.allowed_services
marlinraker-marlinraker-1  | /bin/sh: 1: systemctl: not found
marlinraker-marlinraker-1  | [WARN]  15:51:06 Cannot get active system services, service manager disabled
marlinraker-marlinraker-1  | [INFO]  15:51:06 Searching for serial port
marlinraker-marlinraker-1  | [WARN]  15:51:06 Could not execute 'sudo apt update'
marlinraker-marlinraker-1  | [ERROR] 15:51:06 Error: spawn udevadm ENOENT
marlinraker-marlinraker-1  |     at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
marlinraker-marlinraker-1  |     at onErrorNT (node:internal/child_process:483:16)
marlinraker-marlinraker-1  |     at processTicksAndRejections (node:internal/process/task_queues:82:21)
marlinraker-marlinraker-1  | [INFO]  15:51:06 Gracefully shutting down...
marlinraker-marlinraker-1 exited with code 0

Please note i didn't add any printer configuration there as i didn't know exactly where what to supply. I'm going to try marlinraker first with my KP3S (as it is nearby), but will later maybe use it mainly for Ender 3 V2. As KP3S is still on stock FW, I am not sure what marlin-kind-of is exactly running on there, but Octoprint seems to work fine out-of-the-box.

phm07 commented 1 year ago

Would be nice if you would test MarlinRaker on the KP3S, afaik that has not been done yet. Check out this build, it should work now. If not I will have to investigate that issue further.

AlmightyFrog commented 1 year ago

Still seems to have some issue. Here i let it run with just your version in last comment. Seems like it still wants to spawn something with sudo:

marlinraker-marlinraker-1  |
marlinraker-marlinraker-1  | > marlinraker@v0.2.2-alpha start
marlinraker-marlinraker-1  | > node index.js
marlinraker-marlinraker-1  |
marlinraker-marlinraker-1  | [INFO]  21:33:11 Config loaded
marlinraker-marlinraker-1  | [INFO]  21:33:11 App listening on port 7125
marlinraker-marlinraker-1  | [INFO]  21:33:11 Registered macro "start_print"
marlinraker-marlinraker-1  | [INFO]  21:33:11 Registered macro "pause"
marlinraker-marlinraker-1  | [INFO]  21:33:11 Registered macro "resume"
marlinraker-marlinraker-1  | [INFO]  21:33:11 Registered macro "cancel_print"
marlinraker-marlinraker-1  | [INFO]  21:33:11 Registered macro "sdcard_reset_file"
marlinraker-marlinraker-1  | [WARN]  21:33:11 Warning: "misc.allowed_services" was not found in /marlinraker_files/config/marlinraker.toml
marlinraker-marlinraker-1  | [WARN]  21:33:11 Using default value ["marlinraker","crowsnest","MoonCord","moonraker-telegram-bot","KlipperScreen","sonar","webcamd"] for property misc.allowed_services
marlinraker-marlinraker-1  | /bin/sh: 1: systemctl: not found
marlinraker-marlinraker-1  | [WARN]  21:33:11 Cannot get active system services, service manager disabled
marlinraker-marlinraker-1  | [ERROR] 21:33:11 Error: spawn sudo ENOENT
marlinraker-marlinraker-1  |     at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
marlinraker-marlinraker-1  |     at onErrorNT (node:internal/child_process:483:16)
marlinraker-marlinraker-1  |     at processTicksAndRejections (node:internal/process/task_queues:82:21)
marlinraker-marlinraker-1  | [INFO]  21:33:11 Gracefully shutting down...
marlinraker-marlinraker-1  | [INFO]  21:33:11 Searching for serial port
marlinraker-marlinraker-1 exited with code 0

Here i just installed sudowhereas here i also installed sudo in the container (not sure if password for sudo is needed, i guess not, anyhow the binary is available):

marlinraker-marlinraker-1  |
marlinraker-marlinraker-1  | > marlinraker@v0.2.2-alpha start
marlinraker-marlinraker-1  | > node index.js
marlinraker-marlinraker-1  |
marlinraker-marlinraker-1  | [INFO]  21:32:19 Config loaded
marlinraker-marlinraker-1  | [INFO]  21:32:19 App listening on port 7125
marlinraker-marlinraker-1  | [INFO]  21:32:19 Registered macro "start_print"
marlinraker-marlinraker-1  | [INFO]  21:32:19 Registered macro "pause"
marlinraker-marlinraker-1  | [INFO]  21:32:19 Registered macro "resume"
marlinraker-marlinraker-1  | [INFO]  21:32:19 Registered macro "cancel_print"
marlinraker-marlinraker-1  | [INFO]  21:32:19 Registered macro "sdcard_reset_file"
marlinraker-marlinraker-1  | [WARN]  21:32:19 Warning: "misc.allowed_services" was not found in /marlinraker_files/config/marlinraker.toml
marlinraker-marlinraker-1  | [WARN]  21:32:19 Using default value ["marlinraker","crowsnest","MoonCord","moonraker-telegram-bot","KlipperScreen","sonar","webcamd"] for property misc.allowed_services
marlinraker-marlinraker-1  | /bin/sh: 1: systemctl: not found
marlinraker-marlinraker-1  | [WARN]  21:32:19 Cannot get active system services, service manager disabled
marlinraker-marlinraker-1  | [INFO]  21:32:19 Searching for serial port
marlinraker-marlinraker-1  | [ERROR] 21:32:19 Error: spawn udevadm ENOENT
marlinraker-marlinraker-1  |     at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
marlinraker-marlinraker-1  |     at onErrorNT (node:internal/child_process:483:16)
marlinraker-marlinraker-1  |     at processTicksAndRejections (node:internal/process/task_queues:82:21)
marlinraker-marlinraker-1  | [INFO]  21:32:19 Gracefully shutting down...
marlinraker-marlinraker-1 exited with code 0
phm07 commented 1 year ago

So after some investigation it seems like the error is now caused by the serialport library. Upon removing the code responsible for connecting to the port the error went away, but of course that's not very useful because now you can't properly use the program.

Unfortunately, my machine runs Windows and I don't have a Linux machine at my disposal, so I can't really test much beyond that. I do have some ideas for you to test though:

If you find a solution that works, please report back so that I can add it to the docs and/or push files to the repo. Thanks.

AlmightyFrog commented 1 year ago

Short: I didn't find a solution that works, but seems like there is a problem with CORS only left currently.

I used for everything here shown now node:alpine, but i guess that is not the problem, i tried it also with buster and there is same result. Also i changed access permission to /dev/ttyUSB0 on my PC after connecting device manually so that there is no problem with access denied which i got before that action by marlinraker.

Before installing "sudo" command inside container:

marlinraker-marlinraker-1  | > marlinraker@v0.2.2-alpha start
marlinraker-marlinraker-1  | > node index.js
marlinraker-marlinraker-1  |
marlinraker-marlinraker-1  | [INFO]  20:17:45 Config loaded
marlinraker-marlinraker-1  | [INFO]  20:17:45 App listening on port 7125
marlinraker-marlinraker-1  | [INFO]  20:17:45 Registered macro "start_print"
marlinraker-marlinraker-1  | [INFO]  20:17:45 Registered macro "pause"
marlinraker-marlinraker-1  | [INFO]  20:17:45 Registered macro "resume"
marlinraker-marlinraker-1  | [INFO]  20:17:45 Registered macro "cancel_print"
marlinraker-marlinraker-1  | [INFO]  20:17:45 Registered macro "sdcard_reset_file"
marlinraker-marlinraker-1  | [WARN]  20:17:45 Warning: "misc.allowed_services" was not found in /marlinraker_files/config/marlinraker.toml
marlinraker-marlinraker-1  | [WARN]  20:17:45 Using default value ["marlinraker","crowsnest","MoonCord","moonraker-telegram-bot","KlipperScreen","sonar","webcamd"] for property misc.allowed_services
marlinraker-marlinraker-1  | /bin/sh: systemctl: not found
marlinraker-marlinraker-1  | [WARN]  20:17:45 Cannot get active system services, service manager disabled
marlinraker-marlinraker-1  | [ERROR] 20:17:45 Error: spawn sudo ENOENT
marlinraker-marlinraker-1  |     at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
marlinraker-marlinraker-1  |     at onErrorNT (node:internal/child_process:483:16)
marlinraker-marlinraker-1  |     at processTicksAndRejections (node:internal/process/task_queues:82:21)
marlinraker-marlinraker-1  | [INFO]  20:17:45 Gracefully shutting down...
marlinraker-marlinraker-1  | [INFO]  20:17:45 Using serial port /dev/ttyUSB0 with baud rate 115200
marlinraker-marlinraker-1 exited with code 0

After installing "sudo" command inside container:

marlinraker-marlinraker-1  | > marlinraker@v0.2.2-alpha start
marlinraker-marlinraker-1  | > node index.js
marlinraker-marlinraker-1  |
marlinraker-marlinraker-1  | [INFO]  20:24:57 Config loaded
marlinraker-marlinraker-1  | [INFO]  20:24:57 App listening on port 7125
marlinraker-marlinraker-1  | [INFO]  20:24:57 Registered macro "start_print"
marlinraker-marlinraker-1  | [INFO]  20:24:57 Registered macro "pause"
marlinraker-marlinraker-1  | [INFO]  20:24:57 Registered macro "resume"
marlinraker-marlinraker-1  | [INFO]  20:24:57 Registered macro "cancel_print"
marlinraker-marlinraker-1  | [INFO]  20:24:57 Registered macro "sdcard_reset_file"
marlinraker-marlinraker-1  | [WARN]  20:24:57 Warning: "misc.allowed_services" was not found in /marlinraker_files/config/marlinraker.toml
marlinraker-marlinraker-1  | [WARN]  20:24:57 Using default value ["marlinraker","crowsnest","MoonCord","moonraker-telegram-bot","KlipperScreen","sonar","webcamd"] for property misc.allowed_services
marlinraker-marlinraker-1  | /bin/sh: systemctl: not found
marlinraker-marlinraker-1  | [WARN]  20:24:57 Cannot get active system services, service manager disabled
marlinraker-marlinraker-1  | [INFO]  20:24:57 Using serial port /dev/ttyUSB0 with baud rate 115200
marlinraker-marlinraker-1  | [WARN]  20:24:57 'sudo apt update' exited with error code 1
marlinraker-marlinraker-1  | [INFO]  20:24:57 Identified 3D Printer on Marlin 1.0.0 (Github) with 14 capabilities

This looks good, but sadly i can't connect to it from my central hosted fluidd instance. Cause whith fluidd tells me is "blocked by CORS policy" and I can't find any option in marlinraker.toml(?) to set that trusted domains. Then I thought I'd play it easy and spin up a fluid container on same host with simple docker run -p 9988:80 cadriel/fluidd but there same problem. I also added id to docker-compose.yml directly but still same error.

Here my latest docker-compose.yml (not yet cleaned and beautified):

version: '3'

services:
  marlinraker:
    build: .
    image: ul/marlinraker
    hostname: marlinraker
    ports:
      - 7125:7125
    devices:
      - /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0:/dev/ttyUSB0:rwm
      - /dev:/dev
      - /run/udev:/run/udev:ro
    volumes:
      - ./marlinraker_files/:/marlinraker_files/
    privileged: true

  fluidd:
    image: cadriel/fluidd
    container_name: fluidd
    ports:
      - 9988:80

Here my latest Dockerfile (not yet cleaned and beautified):

FROM node:alpine
RUN apk add --update python3 make g++ sudo

USER node

WORKDIR /app

#RUN wget -O tmp.zip "$(curl -s "https://api.github.com/repos/pauhull/marlinraker/releases/latest" | grep -o "http.*${3:-\.zip}")"
RUN wget -O tmp.zip https://github.com/pauhull/marlinraker/files/10333863/marlinraker.zip
RUN unzip tmp.zip
RUN rm tmp.zip
RUN npm install

EXPOSE 7125

VOLUME ["/marlinraker_files"]

CMD [ "npm", "run", "start" ]

Any idea how to solve the CORS issue?

phm07 commented 1 year ago

Looks very good to me! Marlinraker can identify the printer, so the connection is definitely working. Only weird thing is that it reports Marlin 1.0.0 (which is almost a decade old by now). If that's true and you don't want your house to burn down I would strongly recommend upgrading your firmware. Also Marlinraker probably won't work well (if at all).

By default CORS is disabled in express (the http server library Marlinraker is using), so that's why you get this error. I didn't really think about CORS because usually the API is served on the same address as the interface so there haven't been any issues.

This build has CORS enabled. It can be configured in marlinraker.toml now. You can specify the allowed origins in web.cors_domains. For example, this is how your config could look like if your fluidd installation was running on http://localhost:9988:

[web]
port = 7125
cors_domains = ["http://localhost:9988"]

You can enable access from all origins by entering "*". I would avoid this though because it could be a security hazard.

Please report back if this build works for you so I can commit the changes. Thanks.

AlmightyFrog commented 1 year ago

Looks very good to me! Marlinraker can identify the printer, so the connection is definitely working. Only weird thing is that it reports Marlin 1.0.0 (which is almost a decade old by now). If that's true and you don't want your house to burn down I would strongly recommend upgrading your firmware. Also Marlinraker probably won't work well (if at all).

Yeah... that identify is correct, but i read just it saying 1.0.0 might be any version of Marlin or Marlin similar firmware even. At some time i will check and update firmware on that printer, but this is the one left in "original" state like so that i have always a working printer.

Using cors_domains = ["*"] does not work. Defining specific cors_domains = ["http://1.2.3.20:8899", "http://1.2.3.170:80", "http://1.2.3.170:81"] does have strange outcome: 1.2.3.20:8899 (fluidd) seems to connect but

marlinraker-marlinraker-1  | [INFO]  23:32:16 Identified 3D Printer on Marlin 1.0.0 (Github) with 14 capabilities
marlinraker-marlinraker-1  | [ERROR] 23:32:18 Error in server.files.metadata: Error: Invalid filename
marlinraker-marlinraker-1  | [ERROR] 23:32:23 Error in server.database.get_item: Error: webcams doesn't exist

1.2.3.20.170:80 (fluidd) says still CORS.

1.2.3.170:81 (mainsail) prints error

marlinraker-marlinraker-1  | [INFO]  23:27:54 Identified 3D Printer on Marlin 1.0.0 (Github) with 14 capabilities
marlinraker-marlinraker-1  | [ERROR] 23:29:03 Error in server.files.metadata: Error: Invalid filename

What am I doing wrong?

phm07 commented 1 year ago

Fluidd tries to access the webcams database object and it doesn't exist. You can safely ignore this error or add "webcams": {} to marlinraker_files/database.json to make it disappear.

About the other errors I'm not so sure. Try setting extended_logs to true in marlinraker.toml and post the result here.

Concerning CORS, try this build and set cors_domains to []

AlmightyFrog commented 1 year ago

Yeah... partial success! :) Using cors_domains = [] i can access using mainsail also.

Mainsail seems to work (quite long log so i won't attach it cause i guess that's fine now); extended logs contain sensefull information, homing and controll z axis per UI worked and even staring a print was fine now. There is only one point so far looking strange, the temperature graph: 2023-01-08_01-33-mainsailtemp That red line has tooltop caption "@0" and is 0°C when print is stopped and at max 127°C displaying. As I never really used Mainsail, not sure what that is. Might this have something to do with it?

[DEBUG] 00:34:15 {"gcode":"M73 P5","log":false,"response":["ok"],"queued":1673138055127,"sent":1673138055128,"completed":1673138055132,"timeInQueue":4}
[DEBUG] 00:34:15 sent   G1 X82.144 Y107.779 E341.75085
[DEBUG] 00:34:15 got     T:214.39 /215.00 B:60.08 /60.00 T0:214.39 /215.00 @:65 B@:127 @0:65
(...)
[DEBUG] 00:34:29 got     T:215.09 /215.00 B:60.53 /60.00 T0:215.09 /215.00 @:51 B@:0 @0:51
[DEBUG] 00:34:30 got     T:215.09 /215.00 B:60.41 /60.00 T0:215.09 /215.00 @:51 B@:0 @0:51
[DEBUG] 00:34:30 got    echo:busy: processing
[DEBUG] 00:34:31 got     T:215.09 /215.00 B:60.45 /60.00 T0:215.09 /215.00 @:52 B@:0 @0:52

Cause e.g. those values @:51 and @:52 do appear in the graph and are otherwise quite unique but @:127 i could only find with that B prefix. Note: The first 127 peak at about 1:27:00 started the same moment i turned manually on the extruder heater - might it be that that is kind of a 7 bit representation of how much the heater is powered? Target temp was 100°C and directly when overshoot started about 30 seconds later that number goes back to 0 which makes sense. Could of cause be that that's a KP3S firmware quirk (like you already recognized not newest version).

On the other hand, Fluidd is still making problems; does not show UI. Sadly extended_logs does not really help either. Where with mainsail it is flodding the log with info fluidd only gets to following (tried in this log two times to connect):

[DEBUG] 00:21:18 sent   M114 R
[DEBUG] 00:21:18 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:18 got    ok
[DEBUG] 00:21:18 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137278004,"sent":1673137278004,"completed":1673137278012,"timeInQueue":8}
[DEBUG] 00:21:18 got     T:21.39 /0.00 B:20.83 /0.00 T0:21.39 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:19 sent   M114 R
[DEBUG] 00:21:19 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:19 got    ok
[DEBUG] 00:21:19 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137279004,"sent":1673137279004,"completed":1673137279012,"timeInQueue":8}
[DEBUG] 00:21:19 got     T:21.11 /0.00 B:20.97 /0.00 T0:21.11 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:20 sent   M114 R
[DEBUG] 00:21:20 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:20 got    ok
[DEBUG] 00:21:20 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137280004,"sent":1673137280004,"completed":1673137280011,"timeInQueue":7}
[DEBUG] 00:21:20 got     T:21.11 /0.00 B:20.83 /0.00 T0:21.11 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:21 sent   M114 R
[DEBUG] 00:21:21 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:21 got    ok
[DEBUG] 00:21:21 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137281003,"sent":1673137281003,"completed":1673137281011,"timeInQueue":8}
[DEBUG] 00:21:21 got     T:21.39 /0.00 B:20.83 /0.00 T0:21.39 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:22 sent   M114 R
[DEBUG] 00:21:22 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:22 got    ok
[DEBUG] 00:21:22 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137282004,"sent":1673137282004,"completed":1673137282012,"timeInQueue":8}
[DEBUG] 00:21:22 got     T:21.39 /0.00 B:20.97 /0.00 T0:21.39 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:23 sent   M114 R
[DEBUG] 00:21:23 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:23 got    ok
[DEBUG] 00:21:23 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137283004,"sent":1673137283004,"completed":1673137283012,"timeInQueue":8}
[DEBUG] 00:21:23 got     T:21.39 /0.00 B:20.83 /0.00 T0:21.39 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:24 sent   M114 R
[DEBUG] 00:21:24 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:24 got    ok
[DEBUG] 00:21:24 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137284004,"sent":1673137284004,"completed":1673137284011,"timeInQueue":7}
[DEBUG] 00:21:24 got     T:21.25 /0.00 B:20.83 /0.00 T0:21.25 /0.00 @:0 B@:0 @0:0
[HTTP]  00:21:24 GET /server/database/item?namespace=fluidd 
[HTTP]  00:21:24 GET /server/database/item?namespace=webcams 
[ERROR] 00:21:24 Error in server.database.get_item: Error: webcams doesn't exist
[DEBUG] 00:21:25 sent   M114 R
[DEBUG] 00:21:25 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:25 got    ok
[DEBUG] 00:21:25 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137285004,"sent":1673137285004,"completed":1673137285012,"timeInQueue":8}
[DEBUG] 00:21:25 got     T:21.39 /0.00 B:20.69 /0.00 T0:21.39 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:26 sent   M114 R
[DEBUG] 00:21:26 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:26 got    ok
[DEBUG] 00:21:26 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137286003,"sent":1673137286003,"completed":1673137286011,"timeInQueue":8}
[DEBUG] 00:21:26 got     T:21.11 /0.00 B:21.11 /0.00 T0:21.11 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:27 sent   M114 R
[DEBUG] 00:21:27 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:27 got    ok
[DEBUG] 00:21:27 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137287004,"sent":1673137287004,"completed":1673137287011,"timeInQueue":7}
[DEBUG] 00:21:27 got     T:21.39 /0.00 B:20.83 /0.00 T0:21.39 /0.00 @:0 B@:0 @0:0
[HTTP]  00:21:27 GET /server/database/item?namespace=fluidd 
[HTTP]  00:21:27 GET /server/database/item?namespace=webcams 
[ERROR] 00:21:27 Error in server.database.get_item: Error: webcams doesn't exist
[DEBUG] 00:21:28 sent   M114 R
[DEBUG] 00:21:28 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:28 got    ok
[DEBUG] 00:21:28 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137288004,"sent":1673137288004,"completed":1673137288011,"timeInQueue":7}
[DEBUG] 00:21:28 got     T:21.25 /0.00 B:20.83 /0.00 T0:21.25 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:29 sent   M114 R
[DEBUG] 00:21:29 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:29 got    ok
[DEBUG] 00:21:29 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137289003,"sent":1673137289003,"completed":1673137289011,"timeInQueue":8}
[DEBUG] 00:21:29 got     T:21.25 /0.00 B:21.25 /0.00 T0:21.25 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:30 sent   M114 R
[DEBUG] 00:21:30 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:30 got    ok
[DEBUG] 00:21:30 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137290004,"sent":1673137290004,"completed":1673137290011,"timeInQueue":7}
[DEBUG] 00:21:30 got     T:21.25 /0.00 B:20.83 /0.00 T0:21.25 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:31 sent   M114 R
[DEBUG] 00:21:31 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:31 got    ok
[DEBUG] 00:21:31 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137291004,"sent":1673137291004,"completed":1673137291011,"timeInQueue":7}
[DEBUG] 00:21:31 got     T:21.39 /0.00 B:20.69 /0.00 T0:21.39 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:32 sent   M114 R
[DEBUG] 00:21:32 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:32 got    ok
[DEBUG] 00:21:32 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137292004,"sent":1673137292004,"completed":1673137292011,"timeInQueue":7}
[DEBUG] 00:21:32 got     T:21.11 /0.00 B:20.97 /0.00 T0:21.11 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:33 sent   M114 R
[DEBUG] 00:21:33 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:33 got    ok
[DEBUG] 00:21:33 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137293004,"sent":1673137293004,"completed":1673137293012,"timeInQueue":8}
[DEBUG] 00:21:33 got     T:21.11 /0.00 B:20.83 /0.00 T0:21.11 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:34 sent   M114 R
[DEBUG] 00:21:34 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:34 got    ok
[DEBUG] 00:21:34 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137294004,"sent":1673137294004,"completed":1673137294012,"timeInQueue":8}
[DEBUG] 00:21:34 got     T:21.39 /0.00 B:20.97 /0.00 T0:21.39 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:35 sent   M114 R
[DEBUG] 00:21:35 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:35 got    ok
[DEBUG] 00:21:35 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137295005,"sent":1673137295005,"completed":1673137295012,"timeInQueue":7}
[DEBUG] 00:21:35 got     T:21.11 /0.00 B:20.69 /0.00 T0:21.11 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:36 sent   M114 R
[DEBUG] 00:21:36 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:36 got    ok
[DEBUG] 00:21:36 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137296005,"sent":1673137296005,"completed":1673137296013,"timeInQueue":8}
[DEBUG] 00:21:36 got     T:21.39 /0.00 B:21.25 /0.00 T0:21.39 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:37 sent   M114 R
[DEBUG] 00:21:37 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:37 got    ok
[DEBUG] 00:21:37 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137297005,"sent":1673137297005,"completed":1673137297013,"timeInQueue":8}
[DEBUG] 00:21:37 got     T:21.25 /0.00 B:20.97 /0.00 T0:21.25 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:38 sent   M114 R
[DEBUG] 00:21:38 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:38 got    ok
[DEBUG] 00:21:38 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137298004,"sent":1673137298004,"completed":1673137298013,"timeInQueue":9}
[DEBUG] 00:21:38 got     T:21.25 /0.00 B:20.83 /0.00 T0:21.25 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:39 sent   M114 R
[DEBUG] 00:21:39 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:39 got    ok
[DEBUG] 00:21:39 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137299004,"sent":1673137299004,"completed":1673137299012,"timeInQueue":8}
[DEBUG] 00:21:39 got     T:21.25 /0.00 B:20.97 /0.00 T0:21.25 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:40 sent   M114 R
[DEBUG] 00:21:40 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:40 got    ok
[DEBUG] 00:21:40 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137300004,"sent":1673137300004,"completed":1673137300012,"timeInQueue":8}
[DEBUG] 00:21:40 got     T:21.25 /0.00 B:20.97 /0.00 T0:21.25 /0.00 @:0 B@:0 @0:0
[DEBUG] 00:21:41 sent   M114 R
[DEBUG] 00:21:41 got    X:0.00 Y:0.00 Z:25.00 E:0.00 Count X:0 Y:0 Z:20000
[DEBUG] 00:21:41 got    ok
[DEBUG] 00:21:41 {"gcode":"M114 R","log":false,"response":["ok"],"queued":1673137301005,"sent":1673137301005,"completed":1673137301012,"timeInQueue":7}
[DEBUG] 00:21:41 got     T:21.39 /0.00 B:20.83 /0.00 T0:21.39 /0.00 @:0 B@:0 @0:0

Not sure but i tried misc.allowed_services = ["marlinraker"] but seems like nothing changed.

phm07 commented 1 year ago

Yeah, this is the heater power state that Marlin reports. This is a bug in Marlinraker, it thinks that the @0:xx part is a temperature, just like the T:xx.xx part for example. If you click on the settings button in the upper right corner you will see that you can toggle these graphs on and off. I will have a look at that.

And for fluidd, did you already try adding the webcams object to the database? Just add "webcams":{}, after the first { in marlinraker_files/database.json

AlmightyFrog commented 1 year ago

The Fluidd problem seems to be solved by adding your suggested empty webcams entry. I can home and preheat. I can't run a printjob now cause it's already too late now, but i guess that will work out also...

Thanks so far for your help! :) Not sure when I find next time to tinker with marlinraker, might be a day or a week or who knows.

Btw that heater power state bug I can't see at Fluidd, there graph does not show it. Not sure why though.

phm07 commented 1 year ago

Okay, I will push the changes to the repo and release a new version. As your original question was resolved I will close this issue. If you have any problems or questions in the future please open a new issue. Thanks.

phm07 commented 1 year ago

There is now an official Docker image hosted on GitHub. I will soon create a repo with a premade docker-compose.yml, but it's not that different from the one you already had. Just remember to mount the /marlinraker_files volume, grant privileges and expose the port. Let me know if it works for you.