Recent Changes - Search:

edit SideBar

CapeCode0.1.devel Release

June 15, 2018: CapeCode 0.2.1 is available for download

December 21, 2017: CapeCode0.1.devel is available for download.

CapeCode is a development environment and host for applications that use accessors, described at CapeCode provides a block diagram editor for prototyping IoT applications and code generators for deploying those applications on other accessor hosts.

CapeCode is a configuration of Ptolemy II.


Quick start: Install Java 8 (not Java 9) and choose:

Below are details:


The CapeCode Accessor Host is an extension of, an actor-oriented modeling and design environment. For a tutorial on CapeCode, see the tutorial page. An example of a swarmlet rendered in Vergil, the graphical block-diagram editor for Ptolemy II, is:

This block diagram realizes a simple augmented-reality application that identifies devices or services in the field of view of a video camera and dynamically instantiates an accessor that provides an interface to the device or service. Following the instructions below, you can run this application.


Rather than using the prebuilt installers below, we suggest Setting up CapeCode using SVN.

Installing CapeCode using prebuilt installers

If the above fails or is too difficult for some reason, you can use the installers from the nightly build as explained below. This will give you the most up-to-date version at the time you perform the installation, but to update to a newer version, you will have to reinstall. This is why installing from the Git repository as above is preferred.

  • The platform specific installers include the CapeCode sources, ant, node and npm. Note that Node 8.x will not work with the Node Host because of npm design flaws, so node 7.10.1 and npm 3.10.10 are included
  • The installer requires that a Java 1.8 Java Runtime Environment (JRE) be installed.
    • The Java 1.9 JRE will not work with the installer at this time.
    • If you plan on compiling Java files, then instead of installing just the JRE, install the Java Development Kit (JDK).
  • After installing either the JDK or JRE, choose one of the nightly build installers below:
  • Source: capecode0.3.devel.tar.gz
    • The source tar.gz file is not often tested, but could be used to install if git is not working, for example if the target machine does not have access to

For more information, see the more detailed instructions. If you plan to do any Java programming to extend Ptolemy II, then we recommend installing Eclipse and setting up Ptolemy II as a Java project.

Running CapeCode

Once you have installed Ptolemy II, you can run CapeCode with the following command:


This will bring up the welcome window, which looks like this:

We suggest browsing the links here, particularly the Tour.

To directly execute a simple demo that uses your machine's built-in camera, try:

$PTII/bin/capecode $PTII/ptolemy/actor/lib/jjs/modules/imageFilters/demo/imageFilters/Random.xml

Tutorial documents and solutions are available with the following command:

$PTII/bin/capecode $PTII/ptolemy/demo/CapeCode/CapeCode.xml

To execute a more interesting demo that creates a networked application, try:

$PTII/bin/capecode $PTII/ptolemy/actor/lib/jjs/modules/webSocket/demo/WebSocketChat/Client.xml

This demo is a chat client. The comments in the demo include a link to the chat server, which you must also run for the chat client to work. Click on the annotation that mentions the Server model and the run the Server model by clicking on the Run icon in the tool bar (it looks like play button). Then you can run the chat client and type into the dialog. You can start any number of chat clients and they will all connect to the same chat server. The chat server uses WebSockets to communicate with all clients. You can browse these models and open each of the icons (right click and select Open Actor) to see how the accessors are implemented.

See Also

Edit - History - Print - Recent Changes - Search
Page last modified on June 16, 2018, at 04:29 AM