16

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.

3
  • 8
    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, 2020 at 19:58
  • 9
    Serial ports these days come as USB-dongles. Sep 13, 2020 at 10:28
  • You can buy usb infrared dongles for the PC. Cost upwards of £5.
    – cup
    Dec 4, 2021 at 12:49

2 Answers 2

23

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. Edit: C-Kermit maintainer is working with Debian (in 2020) to get it included again!
  • 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 (menu or SERVER command), 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 (with VAR and possibly NXT, find your object in the menu, press ' and the A-F key showing the object) and issue SEND command.

Tested, success

Tested today on a PC running Xubuntu 20.04.

Both worked!

8
  • Tested also on Raspberry Pi 4 running Raspbian and kernel 5.4.51-v7l+, worked just the same! Sep 12, 2020 at 17:55
  • @TomasBy I saw many USB-to-serial adapters, never worked with USB-to-IR adapters. Are they compatible with the IR used in HP48? That one is older than IrDA (see wikipedia page and reference HP 48 I/O Technical Interfacing Guide). Feel free to offer an additional answer, IR-oriented. Sep 12, 2020 at 20:55
  • 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 Sep 13, 2020 at 10:38
  • @ThorbjørnRavnAndersen good reference. kermitproject.org/ckupdates.html actually shows that C-Kermit maintainer has made a number of changes, including fixing many warnings (and explaining that code was clean in a sense, while being compatible with older systems). Nov 29, 2020 at 12:50
  • 1
    ckermit is back in Debian bullseye. If you can avoid building kermit, I'd recommend it. ISTR that the HP-48 uses a slightly different IR wavelength from IRDA, so reception/transmission may not be too reliable with an IRDA interface
    – scruss
    Dec 5, 2021 at 16:39
5

I had the problem that the data transfer got interrupted after 73 Bytes of data. The HP48's Kermit Server always terminated with 'Protocol Error'. Smaller ASCII-Objects, <= 72 bytes, however were transferred correctly.

My solution for ckermit 9.0.305, compiled from the source C-Kermit “Daily” Source-Code Archive mentioned above, is to set an additional transfer parameter for wermit:

SET SEND PACKET-LENGTH 64

I hope this is helpful to anyone who needs a file transfer to or from a HP48.

1
  • 1
    Could that be a flow-control issue? (The receiving side has various ways of telling the sender to pause and resume.) It may be fixed by finding out whether the HP48 expects hardware or software flow control, and ensuring C-Kermit is set for that (and, if hardware, that the USB-to-serial adapter supports it).
    – gidds
    Dec 4, 2021 at 18:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .