Skip to content

Quick Start.zh

wenzong.fwz edited this page Mar 11, 2019 · 11 revisions

EN | 中文

快速开始

本文通过直接在一台 linux 机器上运行 AliOS Things 来带您快速体验它。
如果您在 Windows 或 Mac 上工作,也可以使用我们提供的IDE

配置环境

您可以尝试一键安装脚本Setup Script for Linux/Mac, 或者按以下命令手动安装依赖的软件包 例:在一台 Ubuntu 16.04 LTS (Xenial Xerus) 64-bit PC 上

sudo apt-get install -y python
sudo apt-get install -y gcc-multilib
sudo apt-get install -y libssl-dev libssl-dev:i386
sudo apt-get install -y libncurses5-dev libncurses5-dev:i386
sudo apt-get install -y libreadline-dev libreadline-dev:i386
sudo apt-get install -y python-pip
sudo apt-get install -y minicom

安装 aos-cube

首先, 用 python 包管理器 pip 来安装 aos-cube相关的依赖包在全局环境,以便于后续使用 AliOS Things Studio 进行开发。

$ pip install setuptools
$ pip install wheel
$ pip install aos-cube

请确认pip环境是基于 Python 2.7 的。如果遇到权限问题,可能需要 sudo 来执行。

下载代码

git clone https://github.com/alibaba/AliOS-Things.git

编译运行

AliOS Things 2.1及其后续版本(需要aos-cube 0.3.x)

cd AliOS-Things
aos make helloworld@linuxhost -c config && aos make
./out/helloworld@linuxhost/binary/[email protected]

AliOS Things 2.0及之前的版本:

cd AliOS-Things
aos make helloworld@linuxhost
./out/helloworld@linuxhost/binary/[email protected]

效果

可以看见 app_delayed_action 在1秒时启动,每5秒触发一次。

$ ./out/helloworld@linuxhost/binary/[email protected]
 [   1.000]<V> AOS [app_delayed_action#9] : app_delayed_action:9 app
 [   6.000]<V> AOS [app_delayed_action#9] : app_delayed_action:9 app
 [  11.000]<V> AOS [app_delayed_action#9] : app_delayed_action:9 app
 [  16.000]<V> AOS [app_delayed_action#9] : app_delayed_action:9 app
Clone this wiki locally