Thanks, I'll look into that. It seems I could infer the initial heating phase by detecting the transition from Idle to Printing (heating begins) and then wait for all axis' to be homed (heating complete). It's just for lighting, not critical path.
Posts made by svenyonson
-
RE: Best way to detect printer state
-
RE: Best way to detect printer state
Well, looks like the PanelDue interface won't help me. I'm looking for a printer state that is not enumerated in PrinterStatus - where the printer is waiting for the bed and extruder(s) to heat to target temperature before the initial home all.
enum class PrinterStatus { connecting = 0, idle = 1, printing = 2, stopped = 3, configuring = 4, paused = 5, busy = 6, pausing = 7, resuming = 8, flashing = 9, toolChange = 10, simulating = 11, off = 12 };
-
RE: Best way to detect printer state
Thanks Frank - yeah if it was just start/end events then I could just use gcode scripts. I came across another post about wiring up a microprocessor to the PanelDue port - I think that's what I'll try to explore. I have lots of microcontrollers lying around from late night impulse purchases, so I'll likely give that a go. I just wanted to be sure there wasn't an easy way to register scripts to "listen" for printer events. Probably overkill for most but that would really be powerful. No mods to the firmware, just write some gcode scripts (for my Marlin build, I implemented some new codes - "U" (user) codes that would control GPIO pins for my LEDs. So some of the LED changes happened with the start/stop events that already exist, and the initial heating was triggered from within the firmware.)
-
RE: Hack: create a standalone desktop application out of the web UI.
@zapta I always err on the side of caution so I do appreciate your security concerns. However, both
npm
andnativefier
are interpreted javascript applications and you could explore the code if you so wished - not even minified or obfuscated so you can actually read it. Whilenativefier
is not a mainstream tool,npm
is a pretty universal package manager, likeapt
for linux. Bothnpm
andnativefier
do requirenode.js
to be installed, as it is the javascript interpreter for non-browser applications.npm -> ../lib/node_modules/npm/bin/npm-cli.js
and
nativefier -> ../lib/node_modules/nativefier/lib/cli.js
Not that you'd want to spend an evening looking at the code, but it's not opaque like a binary.
-
Best way to detect printer state
I am in the process of upgrading my custom printer with a Duet Wifi (from Ramps/Marlin). No worries/issues about the conversion, I've already converted my Ender 3.
But my old Marlin machine was easy to update the firmware with Arduino IDE. I had added hooks to set GPIO pins to generate PWM levels for RGB lighting for various states: Idle, Initial Heat, Printing, and finished. It looks to be far more difficult to build the Duet firmware - (maybe not?) - but I was wondering if there was another way to get this information (eg. into a microcontroller) without modifying the firmware? Just fishing here, I'm prepared to dig in and build firmware, but not before I ask if there is are pins to sample, scripts to write, etc.
-
RE: Hack: create a standalone desktop application out of the web UI.
@zapta Thanks for the link - always looking for new ways to do things. As far as the third party executable, it's open source and what you are actually running is javascript so you can see the source if you want to.
-
RE: Hack: create a standalone desktop application out of the web UI.
@zapta Also, for some applications where you want to download to a specific location on your file system, since nativefier uses a privileged webview, you can make it open a File Save As dialog instead of just downloading to your downloads directory (--file-download-options). Anyway, for some applications it might make a difference. FYI here are the available options when creating the application frame.
Options: -V, --version -n, --name <value> -p, --platform <value> -a, --arch <value> --app-version <value> --build-version <value> --app-copyright <value> --win32metadata <json-string> -e, --electron-version <value> --no-overwrite -c, --conceal --counter --bounce -i, --icon <value> --width <value> --height <value> --min-width <value> --min-height <value> --max-width <value> --max-height <value> --x <value> --y <value> -m, --show-menu-bar -f, --fast-quit -u, --user-agent <value> --honest --ignore-certificate --disable-gpu --ignore-gpu-blacklist --enable-es3-apis --insecure --flash --flash-path <value> --disk-cache-size <value> --inject <value> --full-screen --maximize --hide-window-frame --verbose --disable-context-menu --disable-dev-tools --zoom <value> --internal-urls <value> --crash-reporter <value> --single-instance --processEnvs <json-string> --file-download-options <json-string> --tray --basic-auth-username <value> --basic-auth-password <value> --always-on-top -h, --help
-
RE: Hack: create a standalone desktop application out of the web UI.
@zapta Yes that works - I was running an older version of chrome which didn't have the Create Shortcut feature. Even easier than using nativefier. That said, there may be more possibilities, such as tab support, window size, full screen mode with the nativefier method. Probably not needed for Duet Wifi control though.
-
RE: Hack: create a standalone desktop application out of the web UI.
@kungpaoshizi I suppose - but then you'd get a 404 every time you use a browser and your printer is turned off - which in my case is 99% of the time. And what if you have more than one printer? (everyone should have at least 2 :).
-
RE: Feature request - Web UI timeout retries
1.21 - I see I'm pretty far behind. I'll upgrade as soon as my print finishes. Thanks!
-
Hack: create a standalone desktop application out of the web UI.
If you are running the Web UI on a Mac, PC, or Windows here is a cool trick to create a native application for controlling the Duet WiFi. The advantage is that your control interface doesn't get lost in a sea of browser tabs, and you can keep it in your dock for easy access. I little techie experience is useful but not too difficult.
I installed this for my Ender 3. If you have multiple printers, create an app for each!
Note: These instructions are for macOS. Yours may be slightly different on other platforms.
More info: https://github.com/jiahaog/nativefier
You'll neednode.js
andnpm
installed on your machine. Then, it is easy:From the terminal app:
# Install nativefier $ sudo npm install nativefier -g # Lots of options for the application frame, like sizing, fullscreen, single-instance, etc. $ nativefier --help # Create the application frame. (substitute your IP address) $ nativefier -f -n "Duet Ender 3" --single-instance http://192.168.0.34/ # "Duet Ender 3.app" created. Move to where you want it and run.
-
Feature request - Web UI timeout retries
I love my Duet Wifi. Could you make a change so that the web UI will periodically attempt to reconnect after a timeout? Not a huge deal but would be simple to do. As it is, we lose the layer history/stats if we are disconnected. My timeouts are the result of concurrent large file downloads