Mitsubishi CP-D70 family, now with more Raspberry Pi Goodness!

Back in March, my reverse-engineered processing library for the Mitsubishi CP-D70DW family of printers reached quality parity with the official Windows/OSX drivers and their SDK. This was a huge milestone; it's now possible to drive these printers using entirely Free Software, with no quality compromises, on non-x86 CPU architectures. To do this, you will need Gutenprint 5.2.13-pre1 or newer, along with an up-to-date lib70x snapshot.

Here are the happy models:

  • Mitsubishi CP-D70DW
  • Mitsubishi CP-D707DW
  • Mitsubishi CP-D80DW
  • Mitsubishi CP-K60DW-S
  • Kodak 305
  • Fujifilm ASK-300 [completely untested]

I held off on announcing this achievement due to one rather annoying problem. It seems most folks interested in using this family of printers wanted to do so using the popular Raspberry Pi systems. Unfortunately, for (at the time) unknown reasons, the CP-D70DW spectacularly failed to print with RPi systems, with the image data failing to transfer to the printer.

To further complicate things, I was unable to recreate the problem on the Kodak 305 (aka a re-badged CP-K60DW-S) and an RPi2. Software-based sniffs were useless, and things stayed at this impasse for quite some time.

What finally broke the logjam was one particularly motivated user running into a similar problem with an RPi3 and a CP-D80DW model -- but only when there was nothing plugged into the Ethernet controller. This was a bizarre development, and a working theory that there was something funky going on with the RPi's onboard SMSC USB hub/Ethernet chip began to develop.

He convinced Mitsubishi/Europe that it was in their interests to help figure this problem out, and I soon found myself with a CP-D80DW and several boxes of media on my doorstep and a back-channel to their technical team.

Try as I might, I was unable to recreate the problem on a RPi1 or RPi2, but on an RPi3, I was finally able to trigger the failure. Armed with a true USB sniffer and a copy of the USB spec, I was able to rapidly identify what was actually going on.

The USB2 spec (section 8.5.1) dictates that, when in high-speed mode, a flow control mechanism (NYET/PING/[N]ACK) be used to maximize transfer throughput. NYET is sent by the device after a successful transfer to signal that it can't accept more. The controller then starts polling the device with PING requests, with the printer responding with a NACK until it's ready, at which point it responds with an ACK.

The problem, in a nutshell, is that the RPi's USB controller ends up sending the PING requests so rapidly -- about 400 nanoseconds apart) that it effectively triggers a denial-of-service (DoS) situation in the printer. The funny thing is that the RPi's controller starts with a PING interval of about 1.2 microseconds, and everything is fine until it pulls in the timing, triggering the DoS.

(A regular PC with an xHCI controller demonstrates variable PING timing; it starts at about 400ns, but backs off to about a 4us interval)

If other USB traffic is present, then the bus is too busy to send the PINGs so rapidly, and the printer is fine. Notably, simply establishing a physical link with the onboard (USB-attached) Ethernet controller (even if the interface is "down") generates sufficient traffic to mitigate the problem. Plugging in a thumb drive and dumping data back or forth is also more than adequate.

I've reported this problem to both Mitsubishi and the RPi kernel folks. I don't think one can expect much progress on the root cause of this problem, but the above workarounds are at least adequate to using these printers with RPi systems.

...Enjoy, folks, and happy printing.

UPDATE 2019-07-10: The Raspberry Pi 4 has a new USB controller that is free of this problem.

Holy Exploding Battery, Redux

229152:339625

In a strange coincidence, this one blew its top 23 months and two weeks after I put it into service, replacing the last one which also blew up after 23 months and two weeks.

This time I wasn't home when it happened. I only discovered it when I noticed the vent caps lying several feet away.

Moral of story: regularly check the water levels of your wet-cell lead-acid batteries!

Beauty isn't always skin-deep

As of about a week ago, this is how the house looked:

228971:339270 228972:339271

Every exterior opening except for the old front door has been removed, replaced, or otherwise changed. Better framing, proper headers, double-glazed impact windows, and new sheathing all around, wrapped in a spiffy moisture barrier.

As I write this, the "mountain sage" HardiePlank lap siding is going up, then the fascia, trim, and soffits to complete the main structure's exterior. The porch decking, new support posts, and a matching roof will round up the exterior work.

Aside from arranging next rounds of work, my next visit will have me clearing trails -- cutting up and hauling away downed trees in perpetration for a proper bush hoggin'.

And so it goes!

Reconstruction

A lot's happened at the tick farm over the past month. Most visibly, the farmhouse now has a shiny new metal roof that is warrantied longer than I'm likely to be alive. Underneath that barn-red top, the old gal is undergoing some serious surgery.

228967:339253

This is most evident in the Florida Room -- The floor is now level and reinforced in a few places. The noticeable dip in the roof has been corrected, in part by replacing the single 2x4 in the center with eight, but also through use of proper headers and heavily-reinforced ceiling joists that are no longer inappropriately notched (and in some cases, actually cracked), now properly strapped to the main structure.

Two large 96" windows will look eastward, while the two ends will have 36" windows, letting in quite a bit of light.

228963:339258

This shows three of the four 60" windows wrapping the master bedroom, which will take up the entire north wing -- now with proper headers to provide strength and rigidity. Roughly a 13' section in the middle will be the master bath, closet, and HVAC+pantry space, with the southern wing consisting of a large open kitchen/common area joined by the Florida room.

Tomorrow, the habitable section will start getting torn apart so that its windows and doors can be replaced -- larger, better insulated, and hurricane-rated -- and to finish strapping the roof and floor together.

When this massive phase is all done, the exterior will be complete: windows, sheathing, moisture barriers, siding, soffits and venting, and of course, capped by the new roof. Oh, and a rebuilt porch and proper gutters all around.

Afterwards, the interior work can resume. Framing out the floor plan is all that's on the current quotes, but coming down the pipe is electrical, HVAC, plumbing, the LPG tank and lines... and then ceilings, walls, floors, outfitting a kitchen and bathrooms... the list goes on and on and on.

Yes, I'm essentially building a new house using the skeleton of an old one. And it's going to be awesome.

That'll Buff Out...

What is it with trees in Live Oak? Between the house and the car, I'm now 0 for 2.

228886:339101

This shot was taken after I pulled the fender away from the tire and partially re-attached the bumper. With pink zip ties.

All in all I was rather fortunate; the only thing damaged (aside from my pride) was the fender. And some (more) paint scrapes on the hood and bumper...

Mixed Progress

228809:338964

Finally, some tangible progress -- the demolition work inside is nearly complete; we're down to the minimal center support until the 13' and 18' beams that'll open up the master bedroom and kitchen can be installed and properly braced.

That's the good news. Unfortunately, this was tempered by some bad news that arrived while I was in a hotel in China during my first night without my luggage:

228814:338969 228815:338970

Yup, I'm blessed with three new skylights. Here's the roof after the structural damage was repaired:

228820:338975

So, instead of framing out the new interior walls, a change of plans is in order. First, an new roof; then new exterior walls, windows, and siding -- which will require partial demolition of the livable space, and only then can I resume the interior work. First the walls, then plumbing, electrical, insulation, HVAC, and, and, and...

Other accomplishments -- two peach trees, four blackberry bushes, and a raspberry bush. The stove is now igniting, the exterior lights are now on proper motion sensors, and a whole ton of old lumber is neatly stacked away in the shed.

After seven months of barely measurable progress, things are going to happen a lot faster now. Or at least they will once I pull a proper permit for the roof and other exterior work.

Happy Second New Year of the Year

Through a convoluted series of events, I found myself in Qingdao, China for a customer visit. It was a crazy trip, starting with missed connections, continuing with lost luggage, but the tail end of my visit coincided with the Chinese New Year:

228551:338436

There's no large, municipal fireworks shows, but every family tends to set off a carload of stuff of their own. For hours, I was buffeted by mortars and meters-long strings of firecrackers erupting from every courtyard and public space. A truly memorable experience.

But, another new year calls for another sunrise. This was shot with the camera sticking out of a window of my fifteenth floor hotel room.

228801:338947

Strictly speaking, this was the day after New Year's -- The actual new year's day was dreary, wet, overcast, and at best, barely above freezing.

Despite some beautiful moments, this was a miserable trip in general -- and I spent that beautiful day not exploring Qingdao during a local holiday, but instead scrambling to figure out if I would be able to return home to the United States.

You see, I was born in Iran, one of the VeryBadPlaces(tm) that our esteemed President is still petulantly trying to ban.

I did manage to get back in without hassle, but suffice it to say I'm quite livid about this situation.