Introduction
This website serves as an instruction manual for using the ARSLAB servers to develop and deploy Cadmium code. Go to the Cadmium Documentation section to learn more about Cadmium.
Each student/ group of students is given a unique username to SSH into the ARSLAB server. Go to the How to SSH into the Server section to learn how to set up and connect using VSCode.
The server has been configured with Cadmium and all its dependencies. To get started, use EXAMPLE GPT to learn how to run a simulation and interpret the output. Once you're comfortable with running the example, proceed with the following exercises:
- Create a simple model called 'Blinky' using the template from here with only a single atomic model that performs the following: hidden solution
git clone link_to_repo
to clone this template (replacelink_to_repo
with the appropriate link) - Create a custom message structure with 3 elements: R, G, and B. Call it Color. hidden solution
- Add a state variable of type Color called led_color, which changes to a random R, G and B value whenever toggle changes value. hidden solution
- Create an output port of type
int
and fill out the output function to output the value of led_color (convert the struct to int using bit manipulation like: output = R | G << 8 | B << 16) whenever the toggle is true. hidden solution - Use the
ta()
function to return a random time between 1 and 5 seconds. hidden solution - Use the
ESP_LED
atomic model from this repo and connect the output of the Blinky model to it. hidden solution - Finally, program the ESP32 and watch the magic happen!
You are encouraged to further experiment with these exercises to better understand how the simulator works. Further, to request addition of new software onto the server, fill out the following form:
How to SSH into the Server
Each student is provided with a unique username. Follow the steps below to SSH into the server and start programming:
- Download and install VSCode if you don’t already have it.
- Install the Remote - SSH extension for VSCode.
- Open VSCode and press Ctrl + Shift + P, then type Remote-SSH: Connect to Host.
- Enter the following command in the input box:
ssh your-username@server-address
(replace your-username with the username you were given). - Once connected, you will be able to edit and run your code directly on the server.
Important Notes:
- If you are comfortable working directly in the terminal, you can SSH into the server and edit code using
Vi
ornano
editors. - You do not have
sudo
permissions. If you need something installed, please contact the administrator.
Useful Terminal Commands:
scp
– Securely copy files between your local machine and the server. Example:scp path/to/source_file.txt your-username@134.117.53.14:~/path/to/destination/
grep
– Search through files or output. Example:grep 'search-term' file.txt
; or search for a file in a directory:ls -R | grep file_name.txt
passwd
– Change your password. Example:passwd