This guide will help you set up and use custom scripts for your Contiki NG environment. Follow the steps below to get everything configured and running.
This will create a Makefile and a c file. The files will be created dependant on your current directory so i.e. inside ~/contiki-ng/exercises/hello-world running makemote will create makefile and hello-world.c
This will run the commands to upload the files in the current directory and log in to the mote
This will log in to the mote
-
Navigate to the Directory (inside of vagrant):
cd /usr/local/bin/ -
Clone the Repository:
sudo git clone https://github.com/WokeCode/myTelosCommands.git
-
Make the Scripts Executable:
Run the following commands to set the executable permissions for your scripts:
sudo chmod +x /usr/local/bin/myTelosCommands/makemote sudo chmod +x /usr/local/bin/myTelosCommands/uploadmote sudo chmod +x /usr/local/bin/myTelosCommands/loginmote
-
Update Your PATH:
-
Open your shell configuration file in a text editor:
nano ~/.bashrc -
Add the following line to the end of the file:
export PATH=$PATH:/usr/local/bin/myTelosCommands
-
Save and close the file:
- Press
Ctrl+Oto save. - Press
Enterto confirm. - Press
Ctrl+Xto exit.
- Press
-
-
Apply the Changes:
Update your current shell session with the new PATH:
source ~/.bashrc
-
Verify the Setup:
-
Navigate to your Contiki NG exercises directory:
cd ~/contiki-ng/exercises
-
Create a test directory:
mkdir test-exercises
-
Test the commands:
makemote uploadmote
- Press
Ctrl+Cto stopuploadmoteif it’s running.
loginmote
- Press
-
If you follow these steps, your custom commands should be set up and ready to use. If you encounter any issues, ensure that the paths and file permissions are correct.