CupCarbon Klines

Installation Guide

Table of Contents

1. Introduction

This document presents the installation and usage steps for CupCarbon Klines. It covers installation on different operating systems as well as integration with Python for developing IoT projects.

2. Downloading CupCarbon Klines

To download CupCarbon, visit the following website and click on the button download:

http://cupcarbon.com/download_klines.php

After downloading, unzip the file cupcarbon_klines.zip. You will get several files depending on your operating system:

  • Windows: cupcarbon.jar, utils (dir), win (dir), cupcarbon_win.bat
  • MacOS M: cupcarbon.jar, utils (dir), macm (dir), cupcarbon_macm.command
  • MacOS x64: cupcarbon.jar, utils (dir), macx (dir), cupcarbon_macx.command
  • Linux ARM: cupcarbon.jar, utils (dir), linuxm (dir)
  • Linux x64: cupcarbon.jar, utils (dir), linuxx (dir)

3. Installation by Operating System

First, you must install Java JDK 23 or 24 from this link:
https://www.oracle.com/java/technologies/downloads

Then, you must install Python from the following link:
https://www.python.org

CupCarbon does not require installation. Simply follow the steps below to run it directly:

3.1 Windows

3.2 macOS M (aarch64)

3.3 macOS x64

3.4 Linux ARM

java --module-path linuxm/lib --add-modules javafx.controls,javafx.fxml,javafx.swing -jar cupcarbon.jar

3.5 Linux x64

java --module-path linuxx/lib --add-modules javafx.controls,javafx.fxml,javafx.swing -jar cupcarbon.jar

4. Java Configuration

CupCarbon Klines requires Java version 23 or 24 to function properly.

4.1 Checking Java Version

To verify the Java version installed on your system:

java -version

Verify that the version is 23.0.xx or 24.

4.2 Installing Java 23/24

If you don't have the correct version, visit:

In case the version is not 23 or 24, depending on your system you should either change the current default version to 23 or 24 or install the JRE directly from Oracle's website.

5. Python Configuration

5.1 Python Installation

You can install any version of Python you want. To verify if Python is installed:

python -V

5.2 Execution Path Configuration

Python is completely independent from CupCarbon. Once installed, you have to use the system command used to execute Python programs. Basically this command can be:

You can add this command (or path) in the Executor Path Configuration window in CupCarbon.

6. Python-CupCarbon Interface

6.1 Sending Commands to CupCarbon

To interface with CupCarbon from your Python codes, you can send commands to CupCarbon using the Python print command normally. The message of the print will be considered as a CupCarbon command.

Important:

You need to flush each command to send it directly, otherwise all commands will be sent once at the end of the program.

print("CupCarbon command", flush=True)

6.2 Utility Function

You can create a utility function to simplify sending commands:

def cup(com): print(com, flush=True) cup("print Hello World!")

7. Available CupCarbon Commands

7.1 Print Command

To print any message on the executing device, use the command print as follows:

print("print Hello World!", flush=True)

You can display alternatively Hello and World! each second as follows:

import time def cup(com): print(com, flush=True) while True: cup("print Hello ") time.sleep(1) cup("print World!") time.sleep(1)

7.2 Mark/Unmark Commands

To mark or unmark the executing device, use the mark or unmark commands as follows:

print("mark", flush=True) print("unmark", flush=True)

7.3 Move Command

To move the executing device to a given GPS location, use the move command as follows:

print("move 50.002 21.344", flush=True)

7.4 Information Commands

To get any information about the executing device such as its id, its name and its location, use the following commands:

# Get device ID print("getid", flush=True) id = input() # Get device name print("getname", flush=True) name = input() # Get device location (x,y) print("getxy", flush=True) location = input() # Get x coordinate print("getx", flush=True) x = input() # Get y coordinate print("gety", flush=True) y = input()

8. IoT Projects with MQTT

To create IoT Projects using the MQTT protocol, just install MQTT for Python.

You can use the following command:

pip install paho-mqtt

or

pip3 install paho-mqtt

8.1 Recommended MQTT Resources

Many tutorials exist on the web. We suggest the following websites:

9. Troubleshooting

If CupCarbon starts, then you are lucky, you can continue to use it normally.

Otherwise, it means you have to check the version of Java. CupCarbon Klines works with version 23 or 24. Therefore, you must install version 23 or 24 of Java in your system.

If CupCarbon does not start, then you must check the version of Java installed in your system using:

java -version

10. Conclusion

Now you can use CupCarbon, enjoy! This guide allows you to install and configure CupCarbon Klines on your system, as well as establish an interface with Python to develop IoT applications. Once the configuration is complete, you can use CupCarbon normally for your wireless sensor network simulations.