Building and Deploying Apps on alwaysAI
by Lila Mullany | Jul 07, 2020 | Tutorials | 3 minute read
by Lila Mullany | Jul 07, 2020 | Tutorials | 3 minute read
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. You can then deploy your code in the following ways:
To build the app, enter the following on the command line
aai app install
To start the app, enter on the command line
aai app start
NOTE: If you’re having trouble with your edge device set up, you can refer to this document.
You may first need to configure your settings. To do this, type into the command line
aai app configure
Then follow the instructions that are shown on the terminal. 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.
After the app has been configured, you can build it by entering the following on the command line
aai app deploy
Then to start the app, use the command
aai app start
Now open a web browser to ‘localhost:5000’. That’s it! You should see output in the browser.
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.