6

Context at the time

Handheld graphing calculator HP 48 series - Wikipedia, produced between 1990 and 2003, include infrared and serial communication ports to send and receive data and programs between each other and computers using the Kermit protocol (first S/SX model), and also Xmodem (later G/GX model).

At the time :

  • common computers were PCs
  • virtually all had a serial port (DB9 or DB25 connector)
  • HP transfer cable were easy to buy, or make from any cable that has a DB-9 end (e.g. salvaged from a broken serial mouse)
  • they were overwhelmingly running DOS or Windows
  • Kermit-capable programs were available (some free-as-in-beer).

Kermit is a "implemented on hundreds of different computer and operating system platforms", I remember transferring files between my HP48 and an Amiga computer around 2000.

The original Kermit file transfer protocol implementation "C-Kermit" has existed on Linux for ages, yet not open-source.

Current context

Now it is 2020:

  • PCs are still common
  • most (especially laptops) don't have DB9/DB25 serial ports.
  • HP48 cable are available on e.g. ebay (wow, $25-$100 I consider that very expensive)
  • alternatives to Windows are available (may I even say "common"?)
  • it is somewhat accepted that open-source software tend to rot not as fast as closed-source software distributed as binary only.

Question: how to transfer files in practice?

Is there an easy solution to transfer files with currently common hardware and open-source software? Assuming a modern Linux and open-source software may have the benefit of not restricting the solution to x86/AMD64 (a.k.a. Intel architecture) machines.

  • 1
    CKermit went open source on 20 July 2011 after Columbia University dropped the project. Good documentation of your solution, though! (gkermit should work, but choosing the right kermit/comms parameters will be difficult) – scruss Sep 12 at 19:58
  • 1
    Serial ports these days come as USB-dongles. – Thorbjørn Ravn Andersen Sep 13 at 10:28
11

Prepare hardware

Gather hardware

  • Get or make a serial cable from HP48 to DB9 (most common) or DB25 (instructions on https://www.hpcalc.org/hp48/docs/faq/48faq-12.html, the core of it being: looking at the calculator socket from left to right, pins are shield,tx,rx,ground ).
  • Get a USB-to-Serial adapter with matching DB connector, or add an adapter. Beware, some cheap adapters don't respect RS232 levels (-12/+12) and do 0-5V instead, this can be a cause of failure to communicate.

Ensure PC recognizes hardware

We assume here that the PC side operating system runs Linux.

  • Plug the USB-to-serial adapters: (PC)[USB]---[USB](USB-to-Serial adapter).
  • In most cases, the adapter will be recognized by Linux as /dev/ttyUSB0.
  • Running dmesg may provide a confirmation, or hints if the port is different. (Depending on distribution and settings, you might need root access to run dmesg.)
  • Plug the rest: (PC)[USB]---[USB](USB-to-Serial adapter)[DB]---<hp48cable>---[4pin connector](HP48)

Prepare software

Information: why the software choice below

  • A ckermit package used to be included in Debian (and thus derivatives like Ubuntu) but no longer.
  • A gkermit package exists but it seems restricted to a different use case: transferring files on a text-terminal-oriented session, which is what was common before TCP/IP and the web, and does not fit this use case.

Get C-Kermit source code and build it

Perform transfer

Run software, set HP48-specific parameters

Since Kermit protocol is very general and this implementation supports many use cases, software needs some parameters to work in our case.

The lines below worked for me, words after the semicolons are comments for the curious.

./wermit

set port /dev/ttyUSB0
set speed 9600          ; Serial port speed, HP48 defaults to 9600, also supports 4800 2400 1200
set carrier-watch off   ; Full serial wiring includes a "carrier detect" pin, tell it's not needed here.
set modem type direct   ; Probably means no need to send AT commands to a modem or anything.
set flow none           ; Don't use hardware (RTS/CTS wires) or software (XON/XOFF characters) flow control.
set parity none         ; 8 data bits, no parity
set control prefix all  ; Not sure about what this means, worked after I set it.
set file type binary    ; May not always be needed, safe default IMHO because it avoids the transfer program to corrupt the transferred data believing we expect it to change line feed characters and the like.

Transfer files

From that on, it's up to your knowledge of the Kermit protocol.

For example to send from PC to HP48, on the HP48 start a kermit server, and on the PC prompt type:

send myfilename

Or to send from HP48 to PC, on PC type

server

and on the HP48 put a file name on the stack and issue SEND.

Tested, success

Tested today on a PC running Xubuntu 20.04.

Both worked!

| improve this answer | |
  • Tested also on Raspberry Pi 4 running Raspbian and kernel 5.4.51-v7l+, worked just the same! – Stéphane Gourichon Sep 12 at 17:55
  • There is IR also, which may be more convenient. – Tomas By Sep 12 at 18:46
  • 1
    I have one or two that I cannot get to work (at all, never even tried with HP). But I did see some web page about (I think) HP48 <-> Linux via IR, using Arduino. – Tomas By Sep 12 at 21:12
  • 1
  • 1
    I tried to figure out why ckermit was removed, and my guess from looking at tracker.debian.org/pkg/ckermit is that it uses too old a version of libssl – Thorbjørn Ravn Andersen Sep 13 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.