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!
Develop your code on whatever device you prefer. You can then deploy your code in the following ways:
Deploying on Windows or Mac
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
Deploying on an Edge Device or Linux
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.
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 email@example.com’ for a Raspberry Pi, and ‘ssh user@device’ for Jetson Nano on a Windows or Linux, or ‘ssh firstname.lastname@example.org’ 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
Viewing the Application Output
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.