SOLVED DWC Interface to SBC resizing with M81 or ATX off
Since both the 3.1.0 and 3.1.1 firmware releases, the DWC interface resizes the web page/interface at the end of print and/or when M81 is called (or ATX power off button is clicked). I'm using a Duet 3, 6HC Mainboard, Rev 1.0 with a Raspberry Pi 3b, and a Raspberry Pi 7" display with touch screen.
Because of the smaller display, I have the page scaled to get most of the page information more visible. However as stated above, when the page re-scales, the page zoom goes to 200%++. Additionally, DWC becomes unresponsive and DWC requires to be restarted with:
sudo service duetcontrolserver restart
Note this doesn't happen when accessing the system remotely, just the display connected to the SBC (Raspberry Pi 3b in this case). Also, restarting the service only regains control, the display still requires significant effort to reset/resize to be usable on the 7" display.
Any ideas on how to fix this?
Here is a video of the problem in action, notice how the display goes bonkers....
This when my end G-Code executes the M81 command to turn off the main power supply.
Sometimes restarting the DCS will not recover (this includes web clients accessing the Pi remotely) and the whole system has to be powered down and then back on.
Thanks. Probably one for @chrishamm
The question is how do you resize the web interface. Do you start Chromium with an extra command line parameter? Using a dev pixel scale has worked well AFAIK, see https://forum.duet3d.com/topic/13693/duet-3-pi-hdmi-touchscreen?_=1590147732853
I made a change to DWC2 in 3.1.0 to disable manual zoom so double-clicks on cell phones don't cause any zoom. So I am quite surprised to see this happening on your setup.
@chrishamm I resize the web interface manually using a mouse and keyboard by holding the keyboard control button and scrolling the mouse wheel a couple clicks. The slightly smaller size allows the 7" Pi display to provide more information.
As far as starting Chromium I'm full stock no changes to the command line. I do get a notice that Chromium needs an update, but shouldn't apt-get update/apt-get upgrade cover that?
Yes, updating Chromium via apt-get should work but I have not yet checked if the latest version from the Raspbian mirrors is up-to-date.
Please try to change the Chromium start script and don't use manual zoom. I suspect that manual zooming can cause the glitch you're seeing.
Can you give a little more detail on changing the Chromium start script? The details here https://forum.duet3d.com/topic/13693/duet-3-pi-hdmi-touchscreen/6?_=1590147732853 are kind of cryptic as to that method. Will edit accordingly. Thanks.
@chrishamm To confirm, this is what needs to be edited?
# If you want to make the DWC on your attached touchscreen bigger: sudo nano /usr/bin/launch-dwc # Add this at the end of the line --force-device-scale-factor=3 # You can use fractions, like 2.5. Change and reboot until it looks good to you.
Yes, append that to the line where
chromium-browseris started and run
launch-dwcto check your changes.
Thanks! 0.85 scale looks good - will run a print or two to see if this corrects things.
@chrishamm ran a couple prints and after adding the fix, the display still zooms out of control
Also DWC becomes unresponsive
@Wally I am sorry to hear that but I find it hard to believe that this isn't caused by your Pi config or display. If you had to make any system adjustments for the display, please share them as well as your config and print file. I'll try to reproduce this problem then.
@chrishamm here you go:
Note the screen zoom didn't happen with RRF 3.x Release candidates up to #10, I jumped from 10 to 3.1.0, and then the current release 3.1.1
I had installed xscreensaver with
sudo apt install xscreensaver
But uninstalled xscreensaver it when this started happening.
No change after uninstall.
my config.g file:
; 2020-05-15 MK9 Default Setup ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves ; Network Settings M550 P"duet3pi" ; set printer name M551 P"password" ; set printer password M555 P1 ; set compatibility to RepRap_Firmware ; Drives M569 P0.5 S0 ; X-AXIS - physical drive 5 goes backwards M569 P0.4 S1 ; Y-AXIS - physical drive 4 goes forwards M569 P0.3 S1 ; Z-AXIS - physical drive 3 goes forwards M569 P0.0 S1 ; EXTRUDER 0 - physical drive 0 goes forwards M584 X0.5 Y0.4 Z0.3 E0.0 ; set drive mapping M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation M92 X400.00 Y400.00 Z400.00 E93.75 ; set steps per mm E was 90 M201 X2400.00 Y2400.00 Z1500.00 E1000.00 ; set accelerations (mm/s^2) M203 X7200.00 Y7200.00 Z3000.00 E1320.00 ; set maximum speeds (mm/min) M204 P1200 T1200 ; set printing and travel accelerations M566 X600.00 Y600.00 Z120.00 E120.00 ; set maximum instantaneous speed changes (mm/min) M906 X905 Y905 Z1200 E300 I20 ; X&Y was 1010, E was 400 set motor currents (mA) and motor idle factor in per cent M207 S1.8 F1800 Z0.8 ; Firmware retraction M84 S30 ; Set idle timeout, 30 sec ; Axis Limits M208 X0 Y0 Z0 S1 ; set axis minima M208 X190 Y190 Z180 S0 ; set axis maxima ; Endstops M574 X2 S1 P"!io2.in" ; configure active-low endstop for high end on X via pin !io2.in M574 Y1 S1 P"!io1.in" ; configure active-low endstop for low end on Y via pin !io1.in ; Z-Probe - Part 1 ;->> M950 S0 C"io7.out" moved to bottom ; create servo pin 0 for BLTouch M950 S0 C"io7.out" ; BL Touch needs time to POST, then ; POST == Power On Self Test ; connect to the io7.out pin ; M558 P9 C"io7.in" H5 R0.5 F100 T2000 A5 ; set Z probe type to bltouch and the dive height + speeds - was M558 P9 C"io7.in" H5 R0.5 F120 T6000 A5 ; Set Z Probe to type Switch or Digital output where Z probe connector is used. Used for z only ; This sets probe type 9 for BLTouch, 120mm/min probe speed, 5mm dive height, 0.5 second pause time ; before probe move, 100mm/s travel moves between probe points, probe up to 5 times, ; or until 2 consecutive probe results match G31 P500 X0 Y37 Z1.88 ; set Z probe trigger value, offset and trigger height M557 X29:161 Y95:227 S66 ; define mesh grid ; Heater 0 - Bed M308 S0 P"temp0" Y"thermistor" T114500 B4138 ; configure sensor 0 as thermistor on pin temp0 M950 H0 C"out0" T0 ; create bed heater output on out0 and map it to sensor 0 M143 H0 S120 ; set temperature limit for heater 0 to 120C M307 H0 A209.5 C558.4 D2.1 V31.0 B0 S0.7 ; PID Tune Results from M303 HO S110 command M304 P223 I6.460 D333.1 ; Bed PID Settings from Tune Results M140 H0 ; map heated bed to heater 0 ;Heater 0 model: gain 209.5, time constant 558.4, dead time 2.1, max PWM 1.00, calibration voltage 31.0, mode PID ;Computed PID parameters for setpoint change: P223.0, I6.460, D333.1 ;Computed PID parameters for load change: P223.0, I22.793, D333.1 ; Heater 1 - Extruder - MK9 M308 S1 P"temp1" Y"thermistor" T100000 B4138 ; configure sensor 1 as thermistor on pin temp1 M950 H1 C"out1" T1 ; create nozzle heater output on out1 and map it to sensor 1 M143 H1 S265 ; set temperature limit for heater 1 to 265C M307 H1 A628.3 C305.4 D6.2 V31.0 B0 S0.4 ; PID Tune Results from M303 H1 S255 command M301 H1 P14.0 I0.323 D60.7 ; Extruder PID Settings from Tune Results ;Heater 1 model: gain 628.3, time constant 305.4, dead time 6.2, max PWM 0.40, calibration voltage 31.0, mode PID ;Computed PID parameters for setpoint change: P14.0, I0.323, D60.7 ;Computed PID parameters for load change: P14.0, I0.752, D60.7 ; Fan - Extruder - 40 mm M950 F0 C"out7" Q25000 ; create fan 0, extruder fan, on pin out7 and set its frequency M106 P0 S0 ; set fan 0 value. Thermostatic control is turned off ; Fan - Duet Board Cooling 50 mm M308 S3 Y"mcutemp" A"mcutemp" ; https://duet3d.dozuki.com/Wiki/Gcode#Section_M308_Set_or_report_sensor_parameters M950 F1 C"!out4" Q25000 ; create fan 1, Duet 3 Board fan, on pin out4 PWM use QXXX to set its frequency M106 P1 T32:45 H3 ; https://forum.duet3d.com/topic/13529/duet-3-fan-control/3 min fan start at 32C full at 45C ; Tools M563 P0 S"Extruder_0" D0 H1 F1 ; define tool 0 G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C ; Miscellaneous M911 S28.5 R29.5 P"M913 X0 Y0 G91 M83 G1 Z3 F1000" ; set voltage thresholds and actions to run on power loss ; Z-Probe - Part 2 G4 S5 ; wait 5 sec for Z-Probe, then connect to out PIN M950 S0 C"io7.out" ; create servo pin 0 for BLTouch G4 S1 ; wait 1 sec M280 P0 S160 I1 ; Alarm Release BL Touch and Push-Pin UP just in case it's in alarm and deployed G4 S1 ; wait 1 sec M402
The end of print g-code:
M118 P0 S"PRINT_COMPLETE" ; announce print complete G91 ; relative positioning G1 Z+5 E-50 F1000 ; raise head 5 mm & retract the filament 50mm G90 ; absolute positioning G1 X180 F4000 ; move x axis to near home G1 Y180 F4000 ; move y axis forward M140 S0 ; turn off bed temperature M104 S0 ; turn off extruder M106 P0 S255 ; turn on cooling fan M84 ; disable motors G4 S120 ; wait 2 minutes to help cool extruder & Duet 3 Board M106 P0 S0 ; turn off cooling fan G4 S2 ; wait 2 secs M122 B0 ; sys diagnostics M81 ; turn off main power
The zoom happens on a fresh cold start after a formal/proper shutdown.
I can just power on and run this g-code (see below) and Chromium will zoom.
M80 ; turn om G4 S30 ; wait 30 sec M140 S0 ; turn off bed temperature M104 S0 ; turn off extruder M106 P0 S255 ; turn on cooling fan M84 ; disable motors G4 S30 ; wait 30 sec to help cool extruder & Duet 3 Board M106 P0 S0 ; turn off cooling fan G4 S2 ; wait 2 secs M122 B0 ; sys diagnostics M81 ; turn off main power
However, after zooming, I can close Chromium, and restart DWC, and then open a new Chromium with
sudo service duetcontrolserver restart /usr/bin/launch-dwc
Launching this way, running the end code above 5 of 5 runs will not zoom. However, the terminal sends these errors:
pi@duet3pi:~ $ /usr/bin/launch-dwc --disable-quic --enable-tcp-fast-open --ppapi-flash-path=/usr/lib/chromium-browser/libpepflashplayer.so --ppapi-flash-args=enable_stagevideo_auto=0 --ppapi-flash-version= libEGL warning: DRI2: failed to authenticate [7986:7986:0522/115911.657841:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process. [8153:7:0522/115913.301810:ERROR:command_buffer_proxy_impl.cc(124)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer. [7929:8196:0522/115913.367552:ERROR:object_proxy.cc(632)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files [7929:8196:0522/115913.370464:ERROR:object_proxy.cc(632)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files [7929:8196:0522/115913.384491:ERROR:object_proxy.cc(632)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files [7991:8044:0522/120017.516024:ERROR:ssl_client_socket_impl.cc(969)] handshake failed; returned -1, SSL error code 1, net_error -100
Thank you for the help..
@chrishamm I have a work around; however, it makes me ask what was done "to disable manual zoom so double-clicks on cell phones don't cause any zoom" ?
My work around, use:
AND disconnect my USB mouse & USB Keyboard connected to the Pi. Then power on the system & boot, and DWC start, then connect mouse and keyboard. After doing that, the zoom problem doesn't appear. The 7" display with touch screen appear to be setup for touch screen, larger scroll bar, buttons, etc.
Does your tests include using a USB Mouse & Keyboard?
@chrishamm Follow up, verified that if a mouse is attached to the Raspberry Pi USB port, the re-zoom happens, confirmed with 3 different mfg of USB mouse (or mice?) . No mouse - no re-sizing or zooming ...
@Wally I always have a mouse attached to my Pi 4 and I have never seen this problem on my setup.
@chrishamm - finally figured this out. I was using 5V from the 6HC mainboard to power my display. During power off with M81, the 5V line voltage to the display would vary a lot (enough to cause the problems seen). Connecting the display to a separate (dedicated) 5V power source has eliminated the problem reliably. Probably should have used an O-Scope to quantify the variation; however, the cleaner power clears up the display.