CChen616 / QIDI_Max3_Bookworm

Apache License 2.0
7 stars 0 forks source link

Fix proxy & wifi issue / modify printer.cfg for max3 #3

Open billkenney opened 3 weeks ago

billkenney commented 3 weeks ago

Everything seems to be working (spoolman is also a very cool plugin by the way), but I wanted to open an issue and post the fix for the proxy issue. Also, here are the changes to get the max3 with the bltouch working. Finally, the current wlan configuration causes a communication failure with the screen, and the network tab on the screen does not work at all for me but you can still setup wifi with nmtui. The code preview seems to work when you print from the screen, but not when you upload and print from the slicer, which is the same behavior as the old software.

fix for the proxy: sudo rm /etc/environment ; sudo touch /etc/environment ; sudo sed -i '/^\[http\]/d;/^\[https\]/d;/proxy/d' /root/.gitconfig ; sed -i '/^\[https\]/d;/proxy/d' /home/mks/.gitconfig ; sudo mv /etc/apt/sources.list.bak /etc/apt/sources.list ; sudo sed -i '/Defaults env_keep+="http_proxy https_proxy no_proxy"/d' /etc/sudoers

fix for the wifi: sudo rm /etc/wpa_supplicant/wpa_supplicant-wlan0.conf ; sudo touch /etc/wpa_supplicant/wpa_supplicant-wlan0.conf ; sudo service makerbase-wlan0 restart

if you have the max3 with the bltouch, you also need to modify some references to 'probe' in the printer.cfg file and the gcode_macro.cfg: sed -i 's/pin: \^MKS_THR:gpio21/sensor_pin:\^\MKS_THR:gpio21\ncontrol_pin:MKS_THR:gpio11\nstow_on_each_sample: False/' ~/printer_data/config/printer.cfg ; sed -i 's/printer\.configfile\.settings\.probe\.x_offset/printer\.configfile\.settings\.bltouch\.x_offset/g;s/printer\.configfile\.settings\.probe\.y_offset/printer\.configfile\.settings\.bltouch\.y_offset/g' ~/printer_data/config/gcode_macro.cfg

you may or may not have to run the below command. i had to do this initially, but when i installed the btt sfs i had to reverse it. if you get errors about probecommandhelper then reverse it: sed -i s/endstop_pin:probe:z_virtual_endstop/endstop_pin:bltouch:z_virtual_endstop/;s/^\[probe\]/\[bltouch\]/ ~/printer_data/config/printer.cfg

to fix your locale/timezone: sudo dpkg-reconfigure locales. find your time zone here: https://en.m.wikipedia.org/wiki/List_of_tz_database_time_zones (it should be in the format America/Chicago), then run sudo timedatectl set-timezone [your_timezone] ; sudo timedatectl set-ntp 1 replacing [your_timezone] with your actual timezone

CChen616 commented 3 weeks ago

In your tutorial, you didn't install dhcpcd or rename the relevant interfaces, such as renaming end1 to eth0 and renaming the wireless network interface starting with wlx to wlan0, which caused the WiFi to not work properly.

In my image, there is a service that automatically renames the interfaces, but it requires a restart after generating the rules on the first boot to apply them. Not sure why it's not working on your side.

billkenney commented 3 weeks ago

In your tutorial, you didn't install dhcpcd or rename the relevant interfaces, such as renaming end1 to eth0 and renaming the wireless network interface starting with wlx to wlan0, which caused the WiFi to not work properly.

I didn't see anything in your instructions about installing dhcpcd or renaming network interfaces? If you can point me to those, I'll give them a shot and add them to my tutorial as well.

I've had a couple successful prints, so that's working. But I noticed when I cancel a print the printhead stays on the bed at the spot it was canceled, instead of moving up and back. So I have to move it manually. It looks like the cancel_print macro is the same though. Do you know how I can get this to work?

I also noticed the printer is much quieter during idle, which is awesome.

CChen616 commented 3 weeks ago

Those are already in the image. Refer to /etc/systemd/system/rename_interfaces.service. Not sure if mv /usr/lib/udev/rules.d/80-net-setup-link.rules to bak is needed.

For dhcpcd

sudo apt-get install dhcpcd
sudo dhcpcd wlan0
billkenney commented 3 weeks ago

dhpcpd was already installed. The rename_interfaces.service runs with no errors. The 70-persistent-net.rules has the correct addresses for my eth0 and wlan0. /usr/lib/udev/rules.d contains 80-net-setup-link.rules.bak, but no 80-net-setup-link.rules. I tried renaming 80-net-setup-link.rules.bak to 80-net-setup-link.rules and restarting but the menu still doesn't work.

cat /etc/udev/rules.d/70-persistent-net.rules SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?", ATTR{address}=="22:ca:85:0d:e8:68", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth0" SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?", ATTR{address}=="50:2b:73:a8:a5:80", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="wlan0"

when I press the network button on the screen journalctl -xe shows me this: Jun 07 21:47:12 mkspi bash[1599]: [Jun 3 2024][10:10:59] /root/makerbase-client/src/ui.cpp: 148 Jun 07 21:47:12 mkspi bash[1599]: 0x1c Jun 07 21:47:12 mkspi bash[1599]: [Jun 3 2024][10:10:59] /root/makerbase-client/src/ui.cpp: 149 Jun 07 21:47:12 mkspi bash[1599]: 0xff Jun 07 21:47:12 mkspi bash[1599]: [Jun 3 2024][10:10:59] /root/makerbase-client/src/ui.cpp: 150 Jun 07 21:47:12 mkspi bash[1599]: 0xff Jun 07 21:47:12 mkspi bash[1599]: [Jun 3 2024][10:10:59] /root/makerbase-client/src/ui.cpp: 151 Jun 07 21:47:12 mkspi bash[1599]: 0xff Jun 07 21:47:12 mkspi bash[1599]: [Jun 3 2024][10:10:59] /root/makerbase-client/src/ui.cpp: 147 Jun 07 21:47:12 mkspi bash[1599]: [33B blob data]

billkenney commented 3 weeks ago

I'm not sure what changed, but it seems like image previews are now working on my screen, whether the files are printed from qidi slicer or the screen.

Edit: it works on occasion, not all the time. Not really sure why

billkenney commented 3 weeks ago

For some reason your image thinks there are always 698 layers in the print. My image didn't know how many layers there were, so I've been using M117 to show the layers. image

CChen616 commented 3 weeks ago

I'm not quite sure why the layers display is fixed; it might be due to some cached data in Moonraker's database.

billkenney commented 3 weeks ago

I'm not quite sure why the layers display is fixed; it might be due to some cached data in Moonraker's database.

I did restore my old database, so maybe there's some corruption there

billkenney commented 3 weeks ago

@CChen616 how were you able to turn the board fan off during idle on your image? I switched back to my image because I had some issues with the screen controls, but now that fan is running all the time and it's really annoying

CChen616 commented 3 weeks ago

I haven't paid much attention to this, but according to user feedback, it seems to be non-dismissible. https://github.com/QIDITECH/QIDI_MAX3/issues/45

You could also try if there are other ways to control the fan switch in the latest version of Klipper.

billkenney commented 3 weeks ago

I haven't paid much attention to this, but according to user feedback, it seems to be non-dismissible. QIDITECH/QIDI_MAX3#45

You could also try if there are other ways to control the fan switch in the latest version of Klipper.

In your image, the board fan does not run constantly. I thought you did this on purpose. That's why I said it's awesome that it's so much quieter in another comment. I copied all of the config files over to my image, so I know it's not the printer.cfg. Not sure what else it could be.

cptcl commented 3 weeks ago

For some reason your image thinks there are always 698 layers in the print. My image didn't know how many layers there were, so I've been using M117 to show the layers. image

I have 838 Layers.. so i guess its not a fixed value

billkenney commented 2 weeks ago

For some reason your image thinks there are always 698 layers in the print. My image didn't know how many layers there were, so I've been using M117 to show the layers. image

I have 838 Layers.. so i guess its not a fixed value

@cptcl add this to your after layer change code in the slicer: M117 laying {layer_num+1}/{total_layer_count}

CChen616 commented 2 weeks ago

The old printer.cfg file used output_pin to control the fan, while the new configuration file uses fan_generic. Additionally, the Xindi control system has been updated accordingly. This may be the reason for the different fan behavior.

billkenney commented 2 weeks ago

@CChen616 someone installed my image and ran into trouble with the wifi on the x-max3. they apparently have an AIC wifi module on their printer. they followed this guide and got it working: https://www.cyberciti.biz/faq/linux-find-wireless-driver-chipset/. .

Is qidi shipping printers with the AIC module now? Does your image include these drivers?

CChen616 commented 2 weeks ago

The AIC8800DC was included in an update package in a certain version; it should not be present in the stock image. My image uses rtl8xxxu.