Phil1988 / FreeDi

LCD firmware for Qidi X-3 Series printers with mainline Klipper
Other
99 stars 3 forks source link

[Bug] "Repo has diverged from remote" after updating via Update Manager (v1.20 -> v1.30) #53

Closed pmbroth closed 3 weeks ago

pmbroth commented 4 weeks ago

Using x-max 3, your entire sw image and screen

image

pmbroth commented 4 weeks ago

What should I do to clean up the repo? This occurred after it said there were 4 commits to update. Thank you - Brian

Phil1988 commented 4 weeks ago

Thanks for your report. Please dont hit the INVALID button yet and be patient.

pmbroth commented 4 weeks ago

:-) I'm not - I'm going to go to bed, been up since 5:00 am, and will be up again in a few hours. Thank you!!!

Phil1988 commented 4 weeks ago

You are now on v1.30 (I know it says v1.31) and everything is allright. It is mostly a cosmetic issue. In the meantime I will see if there is a nice solution to fix it.

Reason for this is that you just updated while I was preparing the release.

Phil1988 commented 4 weeks ago

Please use a terminal and do this

cd ~/
rm -rf ~/FreeDi/
git clone --filter=blob:none --sparse https://github.com/Phil1988/FreeDi ~/FreeDi && cd ~/FreeDi && ./install.sh

It would be nice if you can share the output here. Then a reboot might be a good idea. This should solve it for you.

pmbroth commented 4 weeks ago

Good morning, I reflashed the emmc, before I went to bed. I will update today, and let you know if I get any of these issues. Thank you again!!!

Phil1988 commented 4 weeks ago

Why did you feel to reflash it? From my perspective that was not necessary for this issue. (its just cosmetic issue and could have been solved) I assume it had to do with something else?

pmbroth commented 4 weeks ago

I also installed timelapse by mistake, and it added unnecessary items - thinking I needed this to get the camera loaded. I appreciate your help! And after I set up will send you a thank you via your support link...

pmbroth commented 4 weeks ago

@Phil1988 I updated all, all is workring , except the webcam - still working on that. After I did an update to freeedi - I get this...

image

pmbroth commented 4 weeks ago

@Phil1988 Anything I need to do for the Repo Dirty issue? I got the webcam working.. Had to reinstall crowesnest!

Phil1988 commented 3 weeks ago

I also installed timelapse by mistake, and it added unnecessary items - thinking I needed this to get the camera loaded. I appreciate your help! And after I set up will send you a thank you via your support link...

Ahh ok! Understandable.

Please do what I posted above and feedback if it worked (and post the full output if possible): https://github.com/Phil1988/FreeDi/issues/53#issuecomment-2582204825

pmbroth commented 3 weeks ago

@Phil1988 Here you go, you will see there was one error below:, towards the bottom:

mks@mkspi:~$ git clone --filter=blob:none --sparse https://github.com/Phil1988/FreeDi ~/FreeDi && cd ~/FreeDi && ./install.sh Cloning into '/home/mks/FreeDi'... remote: Enumerating objects: 748, done. remote: Counting objects: 100% (74/74), done. remote: Compressing objects: 100% (38/38), done. remote: Total 748 (delta 57), reused 39 (delta 36), pack-reused 674 (from 2) Receiving objects: 100% (748/748), 223.46 KiB | 2.69 MiB/s, done. Resolving deltas: 100% (356/356), done. remote: Enumerating objects: 6, done. remote: Counting objects: 100% (4/4), done. remote: Compressing objects: 100% (4/4), done. remote: Total 6 (delta 1), reused 0 (delta 0), pack-reused 2 (from 1) Receiving objects: 100% (6/6), 183.70 KiB | 3.75 MiB/s, done. Resolving deltas: 100% (1/1), done. Do you use the stock Mainboard? (y/n) y Starting the installation... remote: Enumerating objects: 10, done. remote: Counting objects: 100% (3/3), done. remote: Compressing objects: 100% (3/3), done. remote: Total 10 (delta 0), reused 0 (delta 0), pack-reused 7 (from 2) Receiving objects: 100% (10/10), 1.58 MiB | 7.30 MiB/s, done. remote: Enumerating objects: 4, done. remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 4 (from 1) Receiving objects: 100% (4/4), 5.91 MiB | 5.73 MiB/s, done. Resolving deltas: 100% (2/2), done. Updating files: 100% (4/4), done. remote: Enumerating objects: 1, done. remote: Counting objects: 100% (1/1), done. remote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0) Receiving objects: 100% (1/1), 581 bytes | 581.00 KiB/s, done. Successfully ignoring freedi_update.sh Creating a symbolic link for freedi.py from /home/mks/FreeDi/klipper_module to /home/mks/klipper/klippy/extras... Successfully installed freedi.py to /home/mks/klipper/klippy/extras. Restarting Klipper service... [sudo] password for mks: Klipper service restarted successfully. Installation complete. Setup dtbo for serial communication... dtbo install done! Customise the armbianEnv.txt file for serial communication... Line found. Replacing the line. armbianEnv.txt customization comlpleted. Setup the toolhead serial path in printer.cfg... Found serial device: /dev/serial/by-id/usb-Klipper_rp2040_D5D44D9552A25058-if00 Modifying printer.cfg Updated serial path for the toolhead in /home/mks/printer_data/config/printer.cfg Activating Klipper virtual environment and installing Python packages... Klipper environment python version: 3.11.2 Arranging Python requirements... Requirement already satisfied: pip in /home/mks/klippy-env/lib/python3.11/site-packages (24.3.1) Requirement already satisfied: configparser in /home/mks/klippy-env/lib/python3.11/site-packages (from -r /home/mks/FreeDi/requirements.txt (line 1)) (7.1.0) Requirement already satisfied: requests in /home/mks/klippy-env/lib/python3.11/site-packages (from -r /home/mks/FreeDi/requirements.txt (line 2)) (2.32.3) Requirement already satisfied: pyserial>=3.5 in /home/mks/klippy-env/lib/python3.11/site-packages (from -r /home/mks/FreeDi/requirements.txt (line 3)) (3.5) Requirement already satisfied: Pillow in /home/mks/klippy-env/lib/python3.11/site-packages (from -r /home/mks/FreeDi/requirements.txt (line 4)) (11.0.0) Requirement already satisfied: numpy in /home/mks/klippy-env/lib/python3.11/site-packages (from -r /home/mks/FreeDi/requirements.txt (line 5)) (1.26.2) Requirement already satisfied: matplotlib in /home/mks/klippy-env/lib/python3.11/site-packages (from -r /home/mks/FreeDi/requirements.txt (line 6)) (3.8.2) Requirement already satisfied: psutil in /home/mks/klippy-env/lib/python3.11/site-packages (from -r /home/mks/FreeDi/requirements.txt (line 7)) (6.1.1) Requirement already satisfied: websocket-client in /home/mks/klippy-env/lib/python3.11/site-packages (from -r /home/mks/FreeDi/requirements.txt (line 8)) (1.8.0) Requirement already satisfied: charset-normalizer<4,>=2 in /home/mks/klippy-env/lib/python3.11/site-packages (from requests->-r /home/mks/FreeDi/requirements.txt (line 2)) (3.4.0) Requirement already satisfied: idna<4,>=2.5 in /home/mks/klippy-env/lib/python3.11/site-packages (from requests->-r /home/mks/FreeDi/requirements.txt (line 2)) (3.10) Requirement already satisfied: urllib3<3,>=1.21.1 in /home/mks/klippy-env/lib/python3.11/site-packages (from requests->-r /home/mks/FreeDi/requirements.txt (line 2)) (2.2.3) Requirement already satisfied: certifi>=2017.4.17 in /home/mks/klippy-env/lib/python3.11/site-packages (from requests->-r /home/mks/FreeDi/requirements.txt (line 2)) (2024.12.14) Requirement already satisfied: contourpy>=1.0.1 in /home/mks/klippy-env/lib/python3.11/site-packages (from matplotlib->-r /home/mks/FreeDi/requirements.txt (line 6)) (1.3.1) Requirement already satisfied: cycler>=0.10 in /home/mks/klippy-env/lib/python3.11/site-packages (from matplotlib->-r /home/mks/FreeDi/requirements.txt (line 6)) (0.12.1) Requirement already satisfied: fonttools>=4.22.0 in /home/mks/klippy-env/lib/python3.11/site-packages (from matplotlib->-r /home/mks/FreeDi/requirements.txt (line 6)) (4.55.3) Requirement already satisfied: kiwisolver>=1.3.1 in /home/mks/klippy-env/lib/python3.11/site-packages (from matplotlib->-r /home/mks/FreeDi/requirements.txt (line 6)) (1.4.7) Requirement already satisfied: packaging>=20.0 in /home/mks/klippy-env/lib/python3.11/site-packages (from matplotlib->-r /home/mks/FreeDi/requirements.txt (line 6)) (24.2) Requirement already satisfied: pyparsing>=2.3.1 in /home/mks/klippy-env/lib/python3.11/site-packages (from matplotlib->-r /home/mks/FreeDi/requirements.txt (line 6)) (3.2.0) Requirement already satisfied: python-dateutil>=2.7 in /home/mks/klippy-env/lib/python3.11/site-packages (from matplotlib->-r /home/mks/FreeDi/requirements.txt (line 6)) (2.9.0.post0) Requirement already satisfied: six>=1.5 in /home/mks/klippy-env/lib/python3.11/site-packages (from python-dateutil>=2.7->matplotlib->-r /home/mks/FreeDi/requirements.txt (line 6)) (1.17.0) Python requirements installed from requirements.txt. Installing required packages for input shaping (if not already installed)... Reading package lists... Done Building dependency tree... Done Reading state information... Done libatlas-base-dev is already the newest version (3.10.3-13). libopenblas-dev is already the newest version (0.3.21+ds-4). 0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded. System dependencies installed successfully. Adding FreeDi section to moonraker update manager... Moonraker configuration file /home/mks/printer_data/config/moonraker.conf found The section [update_manager FreeDi] already exists in the file. Permit Moonraker to restart FreeDi service... "FreeDi" is already present in the moonraker.asvc file. No changes made. Changing permissions to enable nmcli commands without sudo (necessary for setting wifi via screen)... Adding the user mks to the 'netdev' group... 'auth-polkit=false' is already present in /etc/NetworkManager/NetworkManager.conf. User mks has been successfully configured to run nmcli commands without sudo. Installing WiFi... Hit:1 http://deb.debian.org/debian bookworm InRelease Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB] Get:3 http://deb.debian.org/debian bookworm-backports InRelease [59.0 kB] Get:4 http://security.debian.org bookworm-security InRelease [48.0 kB] Hit:6 https://download.docker.com/linux/debian bookworm InRelease Hit:5 http://fi.mirror.armbian.de/apt bookworm InRelease Fetched 162 kB in 3s (53.6 kB/s) Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done usb-modeswitch is already the newest version (2.6.1-3+b1). 0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded. Detecting WiFi chip... RTL8188GU detected. vendor_id: 0bda, product_id: b711 Look for default devices ... Found devices in default mode (1) Access device 005 on bus 004 Get the current device configuration ... Current configuration number is 1 Use interface number 0 with class 255 Error: can't use storage command in MessageContent with interface 0; interface class is 255, expected 8. Abort

WiFi installation for RTL8188GU completed! Installing the service to starts this program automatically at boot time... Stopping FreeDi service... FreeDi service stopped. Moving new FreeDi.service to /etc/systemd/system/ FreeDi.service moved to /etc/systemd/system/ Setting user to mks in FreeDi.service Reloading systemd manager configuration... systemd manager configuration reloaded! Enabling FreeDi.service to start at boot... FreeDi.service enabled to start at boot! Starting FreeDi.service... FreeDiLCD.service started! Updating package lists... Hit:1 http://security.debian.org bookworm-security InRelease Hit:2 http://deb.debian.org/debian bookworm InRelease Hit:3 http://deb.debian.org/debian bookworm-updates InRelease Hit:4 http://deb.debian.org/debian bookworm-backports InRelease Hit:6 https://download.docker.com/linux/debian bookworm InRelease Hit:5 http://armbian.tnahosting.net/apt bookworm InRelease Reading package lists... Done Building dependency tree... Done Reading state information... Done 8 packages can be upgraded. Run 'apt list --upgradable' to see them. Setup complete! Please restart your system for the changes to take effect. mks@mkspi:~/FreeDi$

pmbroth commented 3 weeks ago

@Phil1988 Still has the issue after running the steps above and rebooting. image

colin-small commented 3 weeks ago

I have the same message. I successfully upgraded to 1.30 and update manager looked clean with no issues. I refreshed the check for updates and this message appeared.

image

Phil1988 commented 3 weeks ago

No need to worry guys — this issue is purely cosmetic and doesn’t affect functionality. 😊

Here’s a little behind-the-scenes insight for you: The new version 1.30 requires a few additional installations to work correctly. Unfortunately, these installations can’t be triggered directly via the Moonraker uploader. To address this, there’s a temporary workaround that runs these installations during the first load when upgrading from version 1.20. This process removes itself afterward, but marks the repository as “dirty,” even though the file is ignored in .gitignore.

I’m fully aware of it and appreciate your patience as I work on the solution.

I’ve just published a new commit, and I’m actively working on a proper fix. I wonder why your system cant see it, when you delete the FreeDi folder and git clone the latest version again.

Can one of you please tell me the what you get at this?:

cd ~/FreeDi
git rev-parse HEAD
colin-small commented 3 weeks ago

388855caaf7619243f9b5ae923f3a301b4a4cb83

pmbroth commented 3 weeks ago

image

Phil1988 commented 3 weeks ago

@colin-small : you have not yet done this have you? https://github.com/Phil1988/FreeDi/issues/53#issuecomment-2582204825

@pmbroth : This looks good 👍 You got the latest commit. Can you restart the system and click the refresh button at the Update Manager ? (The round arrow on the right top)

And can you show the output at

ls -lha ~/FreeDi/FreeDiLCD
colin-small commented 3 weeks ago

@Phil1988 No. I have not done anything yet.

pmbroth commented 3 weeks ago

@Phil1988 ended up stopping the print, lost bed adhesions :-( so here is the result. it looks good, now I have the issue with croswesnets. :-( But all seems ot be workring, includeing timelapse.. so, Im not worrying about it.

image

Phil1988 commented 3 weeks ago

Thank you for the feedback! I’m glad to hear the fix works. I’m sorry for the inconvenience! 🙏

As mentioned earlier, I’ve summarized and highlighted the steps below to help others who might encounter the same issue.


How to Fix It:

  1. Use these terminal commands:

    cd ~/
    rm -rf ~/FreeDi/
    git clone --filter=blob:none --sparse https://github.com/Phil1988/FreeDi ~/FreeDi && cd ~/FreeDi && ./install.sh
  2. (Optional but recommended) Once the installation script completes, reboot your system.

  3. Open the Update Manager and click the Refresh button: image

You should now be good to go!


Explanation:

This process removes the FreeDi software (to wipe the Git tracking) and reinstalls it. During the first run, FreeDiLCD will apply all the necessary changes, ensuring that Git no longer detects a "dirty" repository. The Refresh button in the Update Manager verifies that everything is working correctly.

In the meantime, the underlying issue has been fixed. Users on version v1.20 who hit Update now should no longer encounter this problem.

Thank you for your report and your patience! 🙌


Follow-Up:

I’ll leave this issue open for now to ensure the fix is solid. The Git and Moonraker mechanics and restrictions can be tricky with setups like this.

@colin-small
It would be great if you could confirm whether this resolves the issue for you!

@pmbroth Regarding your Crowsnest issue (and moonraker seems also to be affected): This is unrelated to FreeDi! 🙂
Just to clarify, neither I nor the update caused this issue. 😄

That said, I might be able to help you or at least seeing whats the problem.

Please show:

cd ~/crowsnest
git status
pmbroth commented 3 weeks ago

@Phil1988 I know you or your software did not cause anything. Something I did. :-)

image

pmbroth commented 3 weeks ago

@Phil1988 all is good, I removed the directory, and just reinstated via git repository. Again, Everything is working perfectly! Thank you!

Phil1988 commented 3 weeks ago

Here are the results of the CSI FreeDi investigation 👮‍♂️ : You are accused of deleting the resources/crowsnest.conf file via terminal or similar. You then created a new one yourself and adapted it. What do you have to say in your defense?

To fix this:

  1. Save your crowsnest.cfg now please somewhere on your computer.
  2. use a terminal and do:
    cd ~/crowsnest
    git restore crowsnest.cfg
    rm crowsnest.cfg
    git checkout origin/main -- crowsnest.cfg
    git status
  3. show me the outputs
  4. reboot the sytem
  5. hit refresh on the update manager
  6. copy the content (not the file itself) of your backed up crowsnest.cfg
  7. open crowsnest.conf on your machine via Mainsail -> Machine
  8. insert the copied content of your backed up crowsnest.cfg
  9. hit save
  10. be happy 😃
pmbroth commented 3 weeks ago

@Phil1988 I also posted link to your site on a few boards, as a thank you for everything you do! i hope you get many sponsors...

Phil1988 commented 3 weeks ago

I would be glad to get feedback from you @colin-small to make sure this fix does work.

Not in a hurry, but I just want to mark it :)

colin-small commented 3 weeks ago

@Phil1988 I will be testing in a little while and will report back.

colin-small commented 3 weeks ago

@Phil1988 It seems to have resolved the issue in update manager. After I performed commands and rebooted, there were a few dozen packages for the OS to upgrade and then I rebooted again after those were installed and checked for updates again. It all looks clean now.

image

Phil1988 commented 3 weeks ago

@Phil1988 I also posted link to your site on a few boards, as a thank you for everything you do! i hope you get many sponsors...

Thank you mate! That's very kind of you, and I truly appreciate the support.
Your effort to share this project will definetly help - thank you for helping spread the word! 😊

@Phil1988 It seems to have resolved the issue in update manager. After I performed commands and rebooted, there were a few dozen packages for the OS to upgrade and then I rebooted again after those were installed and checked for updates again. It all looks clean now.

Thanks for your feedback! I’m glad to hear the issue is resolved now.
Your patience throughout the process has been wonderful 🙏