Date: 11-Jun-90 8:45:05 PDT Subject: Re: Interesting uses of networking Message-ID: Originator: "cfe+%transarc:COM:Xerox", UniqueString: "11-Jun-90 8:45:05 PDT" To: tcp-ip%nic.ddn:MIL:Xerox Cc: John.Zsarnay%cs.cmu:EDU:Xerox, butcher:PA:Xerox, Mike_Kazar%transarc:COM:Xerox, nichols:PA:Xerox, durham%adobe:COM:Xerox From: Craig_Everhart%transarc:COM:Xerox The cs.cmu.edu Coke machine was hooked up to a computer by John Zsarnay and/or Lawrence Butcher (now at Xerox PARC); essentially, the six little out-of-product lights on the pushbuttons were monitored. These would flash on for a couple seconds while a particular bottle was dispensed, and of course stay on when a column was empty. They were connected, I believe, to a terminal server machine that was programmed by Mike Kazar to keep track of the time of the last transition (short-term and long-term) for each column. He and Dave Nichols put together a simple Coke@+(TM) protocol by which any machine on the local University-grant Ethernet, and later the Internet as a whole, could probe the current status of the machine; Dave wrote the program that became the ``coke'' command, which printed out the length of time since each column had been totally empty. (The idea, you see, was to notice when a column, having gone empty, was refilled with (warm, room-temperature) Coke, because in principle you wanted to select the coldest Coke available, and thus avoid those colums that had recently been refilled.) Ivor Durham, I believe, wrote the Finger server that, if you fingered ``coke@somemachine.cs.cmu.edu'' would execute the ``coke'' command and print out the column coldnesses. I don't know who wrote the program, which was one of the most-used Perq/Canvas applications, which displayed the status of the (imputed) coldnesses as an array of bar graphs displayed in the same layout as the selector buttons on the Coke machine itself. There was even a Gosling Emacs package that would run the coke command for you and tell you, as a one-liner, where the coldest one was. The Coke machine even had an internal holding bin, to combat the ``warm Coke'' problem, such that it would never dispense the last two bottles in a column. Thus, to sense when a newly-loaded bottle would be dispensed, you had to notice when the last two bottles had been dispensed. The protocol had a way to describe, separately, the imputed coldnesses (the refrigeration time) of these last two bottles, and it would recommend their use when appropriate. Sure, there are dozens of hacks throughout the world, but I know something about this one and it's fun. As far as I can tell, Dave Nichols spearheaded this one, having loved the idea of the SAIL (r.i.p.) Pony. =============================================================== Message-Id: Date: Mon, 23 Jul 90 13:51:46 -0700 (PDT) From: David Nichols To: zsarnay@CS.CMU.EDU, nichols@parc.xerox.com, durham@CS.CMU.EDU, Robert.Frederking@ISL1.RI.CMU.EDU, cs25@cs.cmu.edu Subject: Attn: Joe Newcomer, Coke machine history Cc: Craig_Everhart@transarc.com, butcher@parc.xerox.com, Kazar@transarc.com I've been asked about this from another source, so I'll reply to everyone with my memory of events. I know next to nothing about who ran the machine in its various incarnations, only about the Coke machine status hardware and software. This message will probably have far more detail than you want; edit as appropriate. I remember this starting when I was sitting in my office one day wanting a Coke. My office was in DH3319, a relatively long way from the machine, and I knew that there was a good chance the machine would be empty, causing me to waste the trip. Suddenly, I remembered tales of the Prancing Pony at Stanford and realized that we didn't have to put up with this, that we had the technology. I fired off mail to a few friends of mine and then went to get my Coke (I don't remember if the machine was empty or not). While this was hardly a new idea, my message seemed to get people talking about it again, but most of my friends were software people, and what we needed the most was a hardware interface of some sort. Fortunately, unknown to me, John Zsarnay had taken an interest in the idea, and was busily designing the hardware. Our Coke machine had six columns of bottles, each of which held 24 bottles when full, along with two "escrow" bottles. When 24 Cokes were sold, the column empty light went on, and there were still two bottles left in the feeding mechanism. The column empty light also came on for about two or three seconds whenever a Coke was sold, a happy coincidence. The wires for the lights from the door came to a connector before going to the rest of the machine. We could get parts fot this connector, so we were able to make all the changes without damage to he machine. If we had asked Coke to design a machine to allow us to build such a beast, we wouldn't have done much better. John (with anyone else?) finished the hardware, which sensed the lights and had an RS-232 line going out to the host computer. When you sent it a byte, it would reply with a byte, the middle six bits of which had the lights' status. An amusing side note is that I believe the detection circuit caught fire at some point! It was in the ceiling above the Coke machine, and something got miswired, sending 110 V AC power into the digital circuitry. Or something like that. John and Lawrence could tell you more. We connected the RS-232 line to the Lemon gateway, a dedicated LSI-11 that providing incoming Chat service (the Pup version of telnet) for CMUA. Mike Kazar had written the software for the gateway, and added code that would poll the Coke machine once a second, maintain state about the columns, and respond to Pup request packets. What it remembered was the time in the machine in minutes for the first escrow bottle, the second escrow bottle, and the rest of the column. We never attempted to report temperatures to the user, only times in the machine. It assumed that the bottles advanced whenever a light came on for 2-5 seconds (or so), and that the column was empty if the light came on for more than 15 seconds. It also assumed that a column never had bottles added when it wasn't empty. I wrote the first client, a C program for Unix called "coke", and we announced the service to the community. I had also documented the protocol for talking to Coke machine, so other clients quickly sprang up. Someone implemented a Tops-20 command (I think Glenn Marcy, but it might have been someone else), and someone else much later wrote a program for the Perq (don't know who that was). Ivor added code to CMUA's finger program so that you could get the status by fingering "Coca.Cola" or "Coke". Since it was difficult for Tops-10 programs to send and receive Pup packets, this was implemented by having a Unix program run the Unix version every 15 minutes and FTPing the result to a known place on CMUA. Finger simply printed the contents of that file. Ivor's code was important in that it made this vital Coke machine status information available to the entire Arpanet community. Since the clients gave the status of each column individually, the program was useful not just to decide whether to make the trip to the terminal room, but also for deciding which column to buy from once you got there. By using the coke program (available from not-logged-in on the GP Vax), you could steal that last cold escrow bottle left over from the last refilling. Eventually, Pup support went away, and we reimplemented things with UDP. John Zsarnay moved the polling code to an Appletalk gateway, and I rewrote the Unix client. The UDP client on Unix was named "jf" and was intended to deal with the M&M machine as well, but that project never got off the ground. At some point, things seemed to stop working, but I'm not sure what happened. Perhaps it died when we got the new Coke machine. John is probably the best source if information here. I'm pretty sure I have the code for the Unix client lying around somewhere, and I might be able to dig up the protocol document if anyone is interested. If anyone else has other things to add or corrections to make, please do so. David =============================================================== Message-Id: <9007241711.AA04401@osprey.parc.xerox.com> Date: Tue, 24 Jul 90 10:11:06 PDT Sender: eddie.caplan@MEAT.PIE.CS.CMU:EDU:Xerox Cc: nichols.PA.Xerox@parc.xerox.com, durham%decwrl.dec:COM:Xerox@adobe.uucp, zaremsky@FAS.RI.CMU:EDU:Xerox, wilkins@csoa1.enet.dec:COM:Xerox, berman@BERMAN.FAC.CS.CMU:EDU:Xerox From: eddie.caplan@MEAT.PIE.CS.CMU:EDU:Xerox To: newcomer@CS.CMU:EDU:Xerox Subject: junk food at cmu cs joe, cathy copetas asked me to send you some mail about the junk food server at cmu. currenly, the M&M machine is online, but the Coke machine isn't. as you know, the Coke machine was long ago instrumented and put online such that people could find out the status (cold, empty, full) from their offices. however, the local Coke distributer (Cameron) decided to stop selling the bottles that fit into that machine, and the Coke machine went offline. i don't remember the dates of these events. before the Coke machine was decommissioned, in 1985, Mark Zaremsky designed a hardware interface to the terminal room M&M machine. then Mark Wilkins and he built it. David Nichols w/Ivor Durham designed and implemented client and server software that could handle status requests for both the Coke machine and the M&M machine. this was called "jf" for "junk food". the Coke machine communicated through PUP packets, which is no longer supported in the CMU-CS environment. the M&M machine, however, was just attached through a RS-232 connection to the back of the jf server's host machine. although the software and hardware was ready in 1985, a number of events kept the machine from actually being brought up: just at that time, it would have been nearly impossible to run the cabling from the M&M machine (in the terminal room) to any host (in the machine room.) by the time new cabling had been laid the M&M controller box couldn't be found, and i presumed that it had been stolen or trashed. in the intervening years, i tried to rope a number of people into rebuilding the M&M controller from the wiring diagrams and documentation that the Marks Zaremsky and Wilkins had left behind. (neither was at CMU any longer.) no luck. anyway, around Thanksgiving, Steve Berman found the controller box in the back of machine room C, buried under some slide mounts and DMF-32 panels. he tested it (it still works!) i tested the software (it still works!) Steve and i brought it online again. then i wrote an X11 (xmnm) client that displays a graphic of the M&M machine showing how full it is. there are plans to instrument the new Coke machine, but given the past history i would expect that it might take another 5 years. any volunteers? LQ credits are available. eddie