CM4 8GB/32GB eMMC, official Bullseye image: error installing upgrade to devterm-thermal-printer

This did the trick for me.

Please don’t touch the missing files. This breaks the Wi-Fi and causes all sorts of problems.

Hey jan-peter!

I’m happy things worked out for you :]

In my case, the WiFi broke even when I simply updated the two packages on a clean installation where I didn’t edit those files, so it’s unlikely the two things are related.

Admittedly though, as of today I still haven’t inspected the packages or their install scripts, so I haven’t pinpointed the exact cause of the WiFi failure either.

So far, blacklisting the printer driver packages from apt upgrade has been easier, since the printer works okay anyway.

If you’ve successfully updated your drivers, could you give a bit more details about your experience? What was your starting point? Clean image, fully updated system (as of when?), partially updated system…?

Thanks!

Certainly.

I updated the whole system (apt upgrade) and used the mentioned instruction.

But I didn’t test the printer yet. Paper is on its way.

fwiw, this didn’t do anything:

❯ sudo dpkg --remove --force-remove-reinstreq devterm-thermal-printer
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
(Reading database ... 128373 files and directories currently installed.)
Removing devterm-thermal-printer (0.37) ...
Failed to stop devterm-printer.service: Unit devterm-printer.service not loaded.
Failed to stop devterm-socat.service: Unit devterm-socat.service not loaded.
Failed to disable unit: Unit file devterm-printer.service does not exist.
Failed to disable unit: Unit file devterm-socat.service does not exist.
dpkg: error processing package devterm-thermal-printer (--remove):
 installed devterm-thermal-printer package pre-removal script subprocess returned error exit status 1
Failed to enable unit: Unit file devterm-socat.service does not exist.
Failed to start devterm-socat.service: Unit devterm-socat.service not found.
Failed to enable unit: Unit file devterm-printer.service does not exist.
Failed to start devterm-printer.service: Unit devterm-printer.service not found.
chmod: cannot access '/usr/local/bin/devterm_socat.sh': No such file or directory
dpkg: error while cleaning up:
 installed devterm-thermal-printer package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 devterm-thermal-printer

I also have been having a nightmare of a time with this.

Printer stops working after updates, tried the “remove devterm-thermal-printer-cups devterm-thermal-printer -y” command, and it doesnt work, returning an error.

Try again with a fresh Pi install, this time, running the command before updating anything. It works, now i dont have wifi. Unacceptable. Buy a 20$ USB wifi adapter hoping i could connect wifi again to run an update which would hopefully fix the problem and the usb wifi device wouldn’t be needed beyond that: straight up doesnt see the usb wifi device that is plugged right into it and still wont connect to wifi.

Another fresh Pi Install, this time running the “sudo dpkg --remove --force-remove-reinstreq devterm-thermal-printer” command: and I get the same result:
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
(Reading database … 128373 files and directories currently installed.)
Removing devterm-thermal-printer (0.37) …
Failed to stop devterm-printer.service: Unit devterm-printer.service not loaded.
Failed to stop devterm-socat.service: Unit devterm-socat.service not loaded.
Failed to disable unit: Unit file devterm-printer.service does not exist.
Failed to disable unit: Unit file devterm-socat.service does not exist.
dpkg: error processing package devterm-thermal-printer (–remove):
installed devterm-thermal-printer package pre-removal script subprocess returned error exit status 1
Failed to enable unit: Unit file devterm-socat.service does not exist.
Failed to start devterm-socat.service: Unit devterm-socat.service not found.
Failed to enable unit: Unit file devterm-printer.service does not exist.
Failed to start devterm-printer.service: Unit devterm-printer.service not found.
chmod: cannot access ‘/usr/local/bin/devterm_socat.sh’: No such file or directory
dpkg: error while cleaning up:
installed devterm-thermal-printer package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
devterm-thermal-printer

Why the hell is this such a huge issue? i have found nothing on any other forum as to why this is happening or how to fix it. This seems like the kind of thing that should have been fixed long before anyone should be allowed to purchase this product. :man_shrugging:

Great question! It’s really frustrating. I really wanted to be able to use the printer when I bought this thing.

Which official OS image did you install? I saw elsewhere that people had issues with the 32bit OS, so I installed the 64 bit one. I ran the fix after install and my wifi was never affected. I haven’t yet tested the printer, but I plan to do so soon and I’ll post my result.

But I suspect it may be the 32bit OS that’s broken?

Another difference in my case is that my CM4 has no eMMC. I bought it that way since I didn’t want to buy extra hardware just to flash the device, and because the no eMMC version is the one promoted/sold by ClockworkPi and presumably (?) tested by them.

Also, there’s a wifi antenna fix that must be done when using the 64bit OS. Might be needed on the 32bit OS as well, but I haven’t tested that. Like many useful/critical things, it’s kind of buried in the forum and in github, and easy to miss. It really should be added to the official OS.

I just tried printing and I guess I have the same issue, as after following the steps above to reinstall the driver, I still can’t print. The devterm_printer shows up in the print dialog, but when I select it and print, nothing happens. Also, sending the test print command to the console (echo -en “\x12\x54” > /tmp/DEVTERM_PRINTER_IN) doesn’t do anything either. No errors, but no printing.

Wifi has disappeared, as well.

My printer worked fine with the A06 board, as did the wifi.

Has anyone managed to get the printer and wifi to work on the CM4 64 bit OS? Also, is there a way to restore wifi without reflashing the OS?

Thanks for pointing out the antenna fix! Quite helpful indeed.

FWIW — I’m on the 64bit system, and I’m able to print (though with some minor issues, especially when I try to print black-rich files). I simply didn’t update the driver, and used the default one.

Also, I made a mistake, and I didn’t specify that my CM4 also has no eMMC. I had overlooked the fact that it was mentioned on the title ^_^"

1 Like

I wonder… is there a way to roll back to the original driver? I guess I’d still have the wifi problem though. Sounds like I need to do a fresh install, which won’t hurt too much since I haven’t done a lot of customization yet.

You mentioned you blacklisted the driver to prevent it updating – what command did you use? Thanks!

I actually didn’t try a rollback, now that you mention it! Maybe that could work? Not sure.

Anyway, to prevent the package from upgrading, I ran sudo apt-mark hold devterm-thermal-printer devterm-thermal-printer-cm4 devterm-thermal-printer-cups

1 Like

I haven’t tried rolling it back (wasn’t even sure if that was possible, but I found this which indicates it is and has some example commands to identify version and roll back to a specific version of a package How to downgrade a package via apt-get? - Ask Ubuntu). Once I’m done with the CPU frequency/battery life testing I’ll try it.

Thanks for the info on preventing an update for a package.

Ok, I got my printer working again, after using these commands to get information about what was installed:

apt-cache policy devterm-thermal-printer
apt-cache policy devterm-thermal-printer-cm4
apt-cache policy devterm-thermal-printer-cups

In my case, after updating it only had …-printer and …-printer-cups installed. But …printer-cm4 was NOT installed. When I installed …printer-cm4, it removed …printer. But THAT caused printing to work again!

So apparently with the CM4 based Devterm, we don’t want to have devterm-thermal-printer installed and ONLY want to have devterm-thermal-printer-cm4 and devterm-thermal-printer-cups installed.

Here’s what things look like for my (working) printer now:

cpi@devterm-cm4:~ $ apt-cache policy devterm-thermal-printer
devterm-thermal-printer:
  Installed: (none)
  Candidate: 0.38
  Version table:
     0.38 500
        500 https://raw.githubusercontent.com/clockworkpi/apt/main/debian stable/main arm64 Packages
cpi@devterm-cm4:~ $ apt-cache policy devterm-thermal-printer-cm4
devterm-thermal-printer-cm4:
  Installed: 0.11
  Candidate: 0.11
  Version table:
 *** 0.11 500
        500 https://raw.githubusercontent.com/clockworkpi/apt/main/debian stable/main arm64 Packages
        100 /var/lib/dpkg/status
cpi@devterm-cm4:~ $ apt-cache policy devterm-thermal-printer-cups
devterm-thermal-printer-cups:
  Installed: 0.12.1
  Candidate: 0.12.1
  Version table:
 *** 0.12.1 500
        500 https://raw.githubusercontent.com/clockworkpi/apt/main/debian stable/main arm64 Packages
        100 /var/lib/dpkg/status

I just did a

sudo apt update
sudo apt upgrade

and accepted everything. And the printer still works! I didn’t use apt-mark hold as you mentioned above, @RaelZero and it still kept the cm4 package and didn’t install the other one and break things. I also didn’t need to downgrade anything, just needed to remove devterm-thermal-printer.

Incidentally, when I say the printer worked, I mean I successfully printed the test page from Preference->Print Settings. And I also successfully ran the test print command from the terminal:
echo -en "\x12\x54" > /tmp/DEVTERM_PRINTER_IN

Can confirm that it did work for me, too, @adcockm by uninstalling devterm-thermal-printer and updating the other two packages.

WiFi now works, and everything seems in order. Many thanks!

Incidentally, could you send a picture of your test print?

In particular, I’m curious about the last "checkerboard pattern, which seems to be quite wrong on my printer…?

These are two test prints I made: it looks like when a line that is supposed to be fully black, the paper isn’t advanced at the right pace? Not 100% sure, but noticed that on other test prints with full-black lines that I tried to make.

Cheers!

its ink blobs on the printer head, you can clean them with a cotton swab and alcohol

Here’s what mine looks like…

And here’s the Print Settings test from cups. It’s rather small and fuzzy, but I figure it wasn’t designed to be printed in such a small space.

1 Like

I installed the 64-bit version because it’s a 64-bit machine. There is no conceivable reason the device having eMMC would cause this to happen. I also did not have to change the parameter mentioned in order to get the WiFi antenna to work.

Hate to necro this again but its still a problem.
To simplify the instructions on CM4:

sudo apt remove devterm-thermal-printer -y
then update as you normally do.

As an aside this image needs to be updated and posted somewhere on a dedicated software page and not have to dig through the forums for it. Also many links for the download are not working and the one that does (the first one) is an unsecured download and browsers will not download it without forcing a download. The image also was not working for me once downloaded and I had to use an image I had downloaded months ago on another pc.

2 Likes