Category     

SDK MAKE.PY Documentation

« Go Back

Information

 
Content

The primary tool for packaging the Cradlepoint SDK Tar/GZip archives is called "make.py". With the root of your SDK code as your working directory, you run it like "python make.py -m status" or "python make.py -i -v -m build network.tcp_echo".


In general, anytime "make.py" needs to contact your local router under development, it uses information in the [router_api] section of your './config/settings.ini' file to obtain IP address and password.

Example lines from './config/settings.ini'
[router_api]
user_name=admin
local_ip=192.168.1.1
password=441b1702


Summary of options/actions:
  • -i = increment "minor_version" in your project directory settings.ini; only applies to the build/package action
  • -v = run verbosely, which generally means LOGGING runs at DEBUG level instead of INFO level.
  • -m build {app} = Build the Tar/GZip archive, leaving in file "./build/{app}.tar.gz"
  • -m clean = Delete temporary files used for building or packaging the archive
  • -m install {app} = use SCP to send the file "./build/{app}.tar.gz" to your router
  • -m package {app} = alias for "-m build {app}"
  • -m purge = use router API "control/system/sdk/action" to stop and delete all installed SDK applications
  • -m start {uuid} = use router API "control/system/sdk/action" to start an installed SDK application
  • -m status = query router API "status/system/sdk" data
  • -m stop {uuid} = use router API "control/system/sdk/action" to stop an installed SDK application
  • -m uninstall {uuid} = use router API "control/system/sdk/action" to uninstall an installed SDK application
* [[CP_SDK_make_build|Make BUILD action explained in more depth]]

Actions which do NOT access the local router

Action: build

python make.py [-i] -m build {app}

Create (or package) the SDK application, selectively creating & moving files to the ./build directory. {app} is required, and matches the base directory of your project - however, {app} can be formed as either like "network.tcp_echo" or "network/tcp_echo". The result (such as "tcp_echo.tar.gz") will reside in the "./build" directory. Note that the archive name is ONLY the final portion of the project name. So project "network.tcp_echo" creates "tcp_echo.tar.gz", not "network.tar.gz" nor "network.tcp_echo.tar.gz".

You can test the result by opening a command window with working directory = ./build/{app}, then running "main.py". For example, if your project is network.tcp_echo, then setting your working directory to "./build/tcp_echo" and running "python main.py network.tcp_echo" will run your application. If you are testing for missing dependencies, you can also unpack the tcp_echo.tar.gz in a completely unrelated location to run.

* [[CP_SDK_make_build|Make BUILD action explained in more depth]]

Action: clean

python make.py -m clean

Delete any temporary files used for testing or created during the Tar/GZip archive, including:
  • everything in the "./build" directory.
  • walk through all directories, deleting any "__pycache__" files.

Action: package

python make.py [-i] -m package {app}

Alias for "-m build" - see "Action: build"

Actions which must access the local router

Action: install

python make.py -m install

Take the existing ./build/{app}.tar.gz and send to router with SCP. On Windows, this is Putty's pscp.exe, a copy of which is located inside the ./tools directory. You need to watch the Syslog output from your router to see true status of the install!

Action: purge

python make.py -m purge

Issues a Router API call to "control/system/sdk/action" to stop and delete all SDK applications. No UUID is required, as all SDK instances are stopped and uninstalled.

Action: reboot

python make.py -m reboot

Issues a Router API call "control/system/reboot" to reboot your router.

Action: start

python make.py -m start
python make.py -m start [uuid]


Issues a Router API call "control/system/sdk/action" to start one SDK application. See "action: uninstall" for explanation of the optional UUID value

Action: stop

python make.py -m stop
python make.py -m stop [uuid]


Issues a Router API call "control/system/sdk/action" to start one SDK application. See "action: uninstall" for explanation of the optional UUID value

Action: uninstall

python make.py -m uninstall
python make.py -m uninstall [uuid]


Issues a Router API call "control/system/sdk/action" to uninstall one SDK application. If an optional UUID is included on the command line, then that value is used in the action. If no UUID is include, then make.py first issues a STATUS query to your router, attempting to read the UUID from the FIRST installed SDK application.

Action: uuid

python make.py -m uuid

Query the Router API "status/system/sdk/" and return the UUID of the first SDK application.

 
Knowledge Home | Product