@stelladoradus/hermes-cli v0.7.0
Hermes CLI
This is CLI tool to help using MQHermes (MQTT Hermes File Transfer protocol).
Videos
BE SURE TO WATCH THOSE EXCELLENT VIDEOS AS THEY EXPLAIN FEATURES OF THE CLI TOOL IN DETAIL
- Hermes CLI: Installation & Prerequsites
- Hermes CLI: Usage : Core commands - send-file, receive
- Hermes CLI: Usage : Debugging commands - send-frame, split-file
- Hermes CLI : Usage : Getting detailed info with Verbose output
- Hermes CLI : How to debug/monitor MQHermes message exchange over MQTT
Prerequsites
This CLI tool supports all multiple operating systems:
- Windows
- MacOS
- Linux
In order to run this system you must have installed NodeJS version 8 or above. You can visit site https://nodejs.org/en/download/ to download NodeJS (an LTS version is recommended). Node comes with package manager called NPM (Node Package Manager) which is automatically installed together with NodeJS.
Installation
You can install this CLI tool from the private npm package @stelladoradus/hermes-cli
.
Because this is a private package, before you can install it please login to npm using the credentials provided to you:
# login with provided username & pass (type email as shown below)
$ npm login
Username: stellacollaborator
Password:
Email: (this IS public) stellacollaborator@apptentic.com
Logged in as stellacollaborator on https://registry.npmjs.org/.
# you can always check whether you're logged in or now using
$ npm whoami
stellacollaborator
To install package type:
$ npm install --global @stelladoradus/hermes-cli
# The package is installed globally and should be availble for you in your command line
# Now you can run command 'herm' to see available commands and options
$ herm
Usage: herm [options] [command]
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
send-file send an entire file (file will be automatically split and sent in small parts)
send-frame debugging: send raw single frame of the file
receive debugging: start device emulator which can emulate receiving file
help [cmd] display help for [cmd]
Usage
Getting Help
You can always use --help
option to get help on how to use command.
# To get help on all subcommands and options
herm --help
# To get help on 'send-file' subcommand
herm send-file --help
Send file
To send a bootlogo use command:
# Sending file (longhand )
herm send-file --input-file data/full/meridian_raw.bootlogo --serial egg123
# Sending file (shorthand)
herm send-file -i data/full/meridian_raw.bootlogo -s egg123
# Sending file and overriding default timeout from to 30 seconds (longhand)
herm send-file --input-file data/full/meridian_raw.bootlogo --serial egg123 --delivery-timeout 30
# Sending file and overriding default timeout from to 30 seconds (shorthand)
herm send-file -i data/full/meridian_raw.bootlogo -s egg123 -t 30
Send single raw frame
For debugging you may want to send a frame which you have previously prepared as binary file.
Use:
herm send-frame --serial egg123 -i data/frame/t-totoro-4-4.frame
Split file into frames (for debugging)
For debugging you may want to split file into frames and save them as separate files
If you want to save files to current directory remember to add
-d .
option
Use:
herm split-file -i data/full/meridian_raw.bootlogo -d .
Legacy files
You probably won't need them, but just in case. In future they will be delted from main branch and only available in
legacy
branch.
You can still check legacy implementations
Check cli/send-file.js
for code which sends entire logo.
Check send-earlierst-prototype.js
to see now to send only individual parts/frames.
In data/ folder you will see:
- frames (alredy constructed file frames)
- part (simply part split to number of bytes (no frame data))
- full logos which are full