Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This script setup-pib.sh can be found in this repository: https://github.com/pib-rocks/pib-backend/blob/main/setup/setup-pib.sh

It’s assumed that the user running this script has “pib“ as a username and the operating system is Ubuntu 22.04.2 LTS. Before running the script, the user name used on this device must be set in the DEFAULT_USER variable. The default user is "pib"the latest Raspberry Pi OS.

Here is the description of some variables being used in the script:

...

…_FILE and …_ZIP variables describe the filenames to save the downloaded resources.

To make the script executable run in the terminal the following command:

Code Block
sudo chmod 755 setup-pib.sh

To run the script type the following:

Code Block
./setup-pib.sh

As soon as the script is completely executed, the system will automatically reboot.

To check if ROS successfully started, execute the command:

...

In this case, the output will be simpler:

...

To stop Cerebra:

Code Block
sudo systemctl stop nginx

To stop ROS (assuming that ROS is running on port 9090):

Code Block
sudo kill -9 `lsof -t -i:9090`

To start Cerebra again:

Code Block
languagebash
sudo systemctl start nginx

And to start ROS again:

Code Block
languagebash
ros2 launch rosbridge_server rosbridge_websocket_launch.xml

Be aware that with the last command, ROS will lock your terminal by starting for writing its logs there. And if you take control over the terminal back by clicking “ctrl+C” it will cause ROS to stop. Therefore the best way to start ROS again is to reboot the system.

Deploy script

These scripts are intended to install new versions of the Cerebra application.

This script deploy_cerebra.sh can be found here:

Jira Legacy
serverSystem Jira
serverId48275ca6-f2f8-34e0-856e-cb4db2bdd2dc
keyPR-92

While the script is running, an archive with a new version of Cerebra is being downloaded from Pib.Rocks (https://pib.rocks/wp-content/uploads/pib_data/cerebra-latest.zip) and then installed on the target device.

The script runs directly on the target device.

The script should be executable as well. To make it executable run in terminal the following command:

Code Block
sudo chmod 755 deploy_cerebra.sh

To run the script type the following:

...