Building and Deploying Apps on alwaysAI
Building and running your app on alwaysAI can be done a few different ways, depending on the platform you want to develop on and the device you want to deploy on. We’ve concentrated these options in one place for your convenience and we’ll update this document as the platform evolves!
You can develop and deploy on Windows, Mac, Linux, or an edge device, such as Raspberry Pi, Jetson Nano.
NOTE: See this documentation page if you need help setting up your development environment. You can also find step-by-step tutorials on our blog for Windows installation and Mac installation.
Develop your code on whatever device you prefer. Read on for instructions on how to deploy your app!
Deploying on the Application
To deploy the app, either locally or on an edge device, enter the following on the command line
aai app install
Then, simply follow the instructions that are shown on the terminal. You'll need to specify both a Project, as well as an installation location. You can choose an existing Project, or create a new one. If you need help working with Projects, check out this documentation. You can choose to run the app locally, on your development machine, or choose an edge device. If you select an edge device, you can choose a previously set up device, or configure a new one.
Deploying Your Application on an Edge Device
If you want to set up a new device, you will be asked for the device name and the password the first time you configure a device.
For a Raspberry Pi, the name is typically 'pi@IP_address'. The password will be alwaysai if you flashed the correct image as described here.
NOTE: To find the ip address of your pi, you can open the terminal and type ‘hostname -I’
For a Jetson Nano, the name is typically username@device_name. For a Mac, you should use the ‘.local’ suffix’: username@device_name.local. The password will be what you set when you booted up the device the first time.
NOTE: For the Jetson Nano, your username can be found under ‘Settings->User Accounts’ and the device_name can be found under the main menu (upper right hand corner)-> ‘About this computer’-> ‘Device name’. You can edit username and device name here as well, if you would like.
You can test out your connection before running ‘aai app configure’ by using ssh followed by the name for the edge device as described above (i.e. ‘ssh pi@1.2.3.4’ for a Raspberry Pi, and ‘ssh user@device’ for Jetson Nano on a Windows or Linux, or ‘ssh user@device.local’ on a Mac). Once ssh is successful, you can type ‘exit’ into the command line to get out of the ssh.
NOTE: If you have trouble with the ssh timing out, just keep trying ‘aai app configure’, it should work within a few tries. If you get a ‘device not found’ type of error, try restarting the device, especially if you just enabled wifi (on the Jetson Nano) or booted up for the first time.
If you ever want to change the installation location, you can always run
aai app configure
and follow the prompts again.
Starting Your Application
To start the app, enter on the command line
aai app start
Viewing the Application Output
Now open a web browser to ‘localhost:5000’. That’s it! You should see output in the browser.
Next Steps
You can also deploy an alwaysAI application to multiple devices at once! You can find this and many other tutorials that help you expand the functionality of your applications on the alwaysAI blog page.
