Meili CLI
Meili CLI is a command-line utility tool for secret management, system setups, and map synchronisation with the server.
Meili CLI is divided into 5 separate applications, which need to be passed alongside the command as command-line arguments
| Command | Description |
|---|---|
| init | Run the system initialization script. Creates ~/.meili directory |
| verify | /Runs the verification on the existing configuration data inside ~/.meili folder |
| maps | Runs map utilities (needs an extra argument up or down passed) |
| setup | Runs the fleet setup initialization script on the machine. Pulls the repo, creates files for vehicles |
| pull-schedules | Generate the task.yaml file used for offline execution of tasks |
Download
The first step is to download Meili CLI:
curl https://meili-fms-production.s3.eu-north-1.amazonaws.com/helpers/meili-cli --output meili-cli
chmod +x meili-cliOr using wget:
wget https://meili-fms-production.s3.eu-north-1.amazonaws.com/helpers/meili-cli --output meili-cli
chmod +x meili-clicurl.exe https://meili-fms-production.s3.eu-north-1.amazonaws.com/helpers/meili-cli-win386.exe -o meili-cli.exeOr using wget:
wget https://meili-fms-production.s3.eu-north-1.amazonaws.com/helpers/meili-cli-win386.exeInvoke-WebRequest -Uri "https://meili-fms-production.s3.eu-north-1.amazonaws.com/helpers/meili-cli-win386.exe" -OutFile "meili-cli.exe"The commands above download the 386 build. Replace the URL with the one for your platform if needed.
Download URLs for every platform
| Platform | Download URL |
|---|---|
| Linux 386 | https://meili-fms-production.s3.eu-north-1.amazonaws.com/helpers/meili-cli |
| Linux AMD64 | https://meili-fms-production.s3.eu-north-1.amazonaws.com/helpers/meili-cli-amd64 |
| Linux ARM64 (Raspberry Pi) | https://meili-fms-production.s3.eu-north-1.amazonaws.com/helpers/meili-cli-arm64 |
| Windows 386 | https://meili-fms-production.s3.eu-north-1.amazonaws.com/helpers/meili-cli-win386.exe |
| Windows AMD64 | https://meili-fms-production.s3.eu-north-1.amazonaws.com/helpers/meili-cli-win-amd64.exe |
| macOS Intel | https://meili-fms-production.s3.eu-north-1.amazonaws.com/helpers/meili-cli-darwin-amd64 |
| macOS Apple Silicon | https://meili-fms-production.s3.eu-north-1.amazonaws.com/helpers/meili-cli-darwin-arm64 |
Initialisation
For non ROS integration type–> Before initialize it is important to setup these environmental variables:
export ACCESS_TOKEN=<access_token_value_provided_by_meili>
export PACKAGE_PATH=<path_where_integrations_repository_will_be_downloaded>set ACCESS_TOKEN=<access_token_value_provided_by_meili>
set PACKAGE_PATH=<path_where_integrations_repository_will_be_downloaded>$env:ACCESS_TOKEN="<access_token_value_provided_by_meili>"
$env:PACKAGE_PATH="<path_where_integrations_repository_will_be_downloaded>"Once Meili CLI is downloaded, you can run the system initialisation script. When running this, the fleet setup regenerates tokens and encryption keys and sends unencrypted data back to the CLI.
You need to pass PIN from a newly created fleet setup using the following -pin flag.
./meili-cli init -pin <FLEET_SETUP_PIN>meili-cli.exe init -pin <FLEET_SETUP_PIN>.\meili-cli.exe init -pin <FLEET_SETUP_PIN>FLEET_SETUP_PIN should be a string bound to 5 characters.
Example
./meili-cli init -pin ABC12A Communication Channel must be created before initializing the system, which will also provide the pin. Check Communication channels.
If the system is set up correctly, you should receive the following message:
System successfully setupThis means that the configuration file — cfg.yaml — has successfully been created in ./meili. For your information, this configuration file is where data regarding your robot fleets, tokens, and public and private keys are stored. An example of this cfg.yaml general structure is shown below:
Example
uuid: afa508a2b3a4e7798450ffad72a4d199
fleet: 97bb047173213605fd36ed8d2b93a8cf3d8fb9f5
mqttId: meili-agent-1112233d-ccde-448c-eee99-dc4e7612659
token: befd0ffc805bc19399f9d7b3bc19399bc19399
publicKey: |-
-----BEGIN PUBLIC KEY-----
gkqhkgKCAQEAxHqIIBIjANBnoOCpDQEFABCAQ8AMIIiG9w0BA/HMwqxQanhSAOC8[...]
-----END PUBLIC KEY-----
privateKey: |-
-----BEGIN RSA PRIVATE KEY-----
wgzUYq2P1DsJ6HIdclJEoQIBAAKCAQEAsdtHbrXUMIIY5AzXAPZ22zziV1VA8BDC[...]
-----END RSA PRIVATE KEY-----
version: 1
timestamp: "2021-07-14T01:00:04.140797Z"You are now ready to modify the maps using the Meili FMS web application.
If you run the initialisation script again, all the encryption keys and tokens will be regenerated. Therefore, all the data that was encrypted before executing the initialisation script will not be able to be decrypted.
Verification
This script can only produce valid results after running the initialisation process.
After running it, you can verify the system configuration using verification functionality.
./meili-cli verifymeili-cli.exe verify.\meili-cli.exe verifyIf ~/.meili folder does not exist, it will not be able to execute the command.
If everything went successfully, you should receive the following message:
OKAgent setup
When running the Agent SetUp initialisation script, the repository will be pulled. It will automatically create a file for the previously established vehicles on the fleet setup. To add vehicles to your fleet and create a fleet setup, find detailed instructions here.
The agent will be installed in the path of ROS_PACKAGE_PATH. To check which one is set to your computer run the following command:
echo $ROS_PACKAGE_PATHIf you want the agent to be installed in your own workspace, create it first:
Create your own workspace
mkdir -p ~/ros_melodic_ws/src
cd ~/ros_melodic_ws/
catkin_make
source devel/setup.bashWhen echoing the path you will get the following output:
user:$ echo $ROS_PACKAGE_PATH
/home/ubuntu/ros_melodic_ws/src:/opt/ros/melodic/sharemkdir -p ~/ros_noetic_ws/src
cd ~/ros_noetic_ws/
catkin_make
source devel/setup.bashWhen echoing the path you will get the following output:
user:$ echo $ROS_PACKAGE_PATH
/home/ubuntu/ros_noetic_ws/src:/opt/ros/noetic/shareAgent setup for fleets
./meili-cli setupmeili-cli.exe setup.\meili-cli.exe setupAfter running this, you should see a meili-agent directory in the ROS_PACKAGE_PATH with config directory inside, and the following output should be produced:
Enumerating objects: 188, done.
Counting objects: 100% (188/188), done.
Compressing objects: 100% (80/80), done.
Total 188 (delta 115), reused 168 (delta 97), pack-reused 0
Repository cloned to /devel/Meili/meilirosinit/meili-agent
commit 695644b50a14ff2e2e806fa4ddb07d702d246416
Author: juan76 <juan@meilirobots.com>
Date: Thu Jul 02 13:20:14 2020 +0200
Fixed battery data sentThe config folder will include an automatically generated configuration file where information about the fleet and its vehicles can be found. An example of a configuration file with three robots in the fleet is shown below:
Example
vehicles:
- uuid: bae59388be704a6e89e5c8a7907b7424
token: 3916580dc7297fcc5254c8d93c9c5d4e79b32628
prefix: /robot1
- uuid: 8b14591a4dbfd8b425ba2fe39f9dfa11
token: 06305d21094f7663fea4676bd2c2397a69264bee
prefix: /robot2
- uuid: fe5fbc57c7c4a896342bd94b55af5e73
token: 53b3c15e048213bbf7470b9c3e63d838db252dbb
prefix: /robot3
fleet: e9570c71cd426e16eb5cdedfcc8b1ede9329993c
mqttid: meili-agent-71a705fb-bf62-48bb-8999-c29bbf116f38Agent setup for individual vehicles
When running the agent individually (one agent per robot) in a fleet, you need to add the flag –split.
./meili-cli setup --splitmeili-cli.exe setup --split.\meili-cli.exe setup --splitIt is a generated config file, in the config directory of the Meili Agent (ros ws), with the different robot UUID code appended to the ‘config’ word. An example of a file’s name:
config-24cc7ffd39d3494388e1e8a19697015c.yaml
For the agent to work correctly, it is necessary to remove the UUID from the name, and leave only “config.yaml” (You need to leave this name only for the specific robot you are using)
Installing Meili Agent dependencies
After executing setup command for fleets or for individual vehicles you are ready to finalise the Setting Up of the Agent for ROS Melodic or Noetic. Go to the Meili Agent folder and install the ROS dependencies.
Windows does not support ROS Melodic or Noetic natively. Use WSL or a Linux environment for these commands.
source /opt/ros/melodic/setup.bash
cd ~/ros_melodic_ws
rosdep install --from-paths src --ignore-src --rosdistro melodic -y -r
cd ~/ros_melodic_ws/src/meili-agent/src
pip3 install -r requirements.txtsource /opt/ros/noetic/setup.bash
cd ~/ros_noetic_ws
rosdep install --from-paths src --ignore-src --rosdistro noetic -y -r
cd ~/ros_noetic_ws/src/meili-agent/src
pip3 install -r requirements.txtTroubleshooting: required Python packages
| Package | Version | CLI Command |
|---|---|---|
| paho-mqtt | 1.5.0 | pip3 install paho-mqtt==1.5.0 |
| influxdb-client | 1.16.0 | pip3 install influxdb-client==1.16.0 |
| websocket-client | 0.56.0 | pip3 install websocket-client==0.56.0 |
Finally, let’s build it and source it:
source /opt/ros/melodic/setup.bash
cd ~/ros_melodic_ws
catkin build # or catkin_make
source devel/setup.bashsource /opt/ros/noetic/setup.bash
cd ~/ros_noetic_ws
catkin build # or catkin_make
source devel/setup.bashThe name of the workspace may vary depending on your previously configured workspace.
You are now ready to start using Meili FMS. Go to Running Meili Agent.
Generating file for Offline use - Pulling schedules
To use Meili Agent with no internet connection, it is necessary to generate a yaml/json file containing the scheduled task, generated from the Meili FMS when marking a mission as offline. By default, it would generate a yaml file containing all the relevant information. File is created in the folder .meili (in your home directory).
./meili-cli pull-schedulesmeili-cli.exe pull-schedules.\meili-cli.exe pull-schedulesThere is the possibility of generating a file that follows the smach format. To get this file, it is necessary to mark the format as smach. Check the example below:
./meili-cli pull-schedules --format=smachmeili-cli.exe pull-schedules --format=smach.\meili-cli.exe pull-schedules --format=smachHitting different whitelabel
Use –site to specify the site you want to access. You do not need to enter the full domain, just the prefix for .meilirobots.com
./meili-cli --site=app.devmeili-cli.exe --site=app.dev.\meili-cli.exe --site=app.devUsing command above will hit app.dev.meilirobots.com URL.
Map management
Go to Uploading a map.