HaaS 700¶
3 环境搭建¶
3.1 硬件环境搭建¶
3.2 软件环境搭建¶
HaaS700开发板提供基于VS Code和HaaS Studio的集成开发环境,关于如何搭建HaaS700开发环境,请参考 Python 轻应用开发工具 HaaS-Studio (HaaS700定制版)。
4 快速验证¶
开机之后会默认进入Shell命令行交互模式(ash),打开串口工具,选择对应的串口设备,设置波特率为115200,并连接。以下是系统启动日志:
15A SPL 2019.10.0-V4.0.08-00006-g822eb45 spl[0us],load kernel[0us] Jumping to linux (ash:/)# [A/BEN] cpu freq: 438 MHz [A/BEN] hclk/dclk freq: 219 MHz [A/BEN] dphyclk freq: 438 MHz [A/BEN] asic freq: 480 MHz [A/BEN] gclk freq: 120 MHz [A/BEN] vclk freq: 240 MHz [A/BEN] peri freq: 600 MHz [A/BEN] phys memory start addr: 0x80000000 size: 0x4000000 [A/BEN] phys reserved memory addr: 0x82000000 size: 0x2000000 [A/DRV] anyka,ak37d-spi0 register ok [F/DRV] spinand_dev_reg: anyka,ak-spinand disabled [A/AOS] // | \\ - AliOS - Things Operating System \\ | // 3.4.2 build Aug 24 2021 16:23:37 by wenjunchen.cwj@localhost 2017 - 2021 Copyright by Alibaba Group [A/AOS] Memory Total: 1024 KB, Used: 218 KB, Free: 805 KB [A/AOS] vfs_register_fs path /tmp, ret 0 [A/BEN] Mount ramfs on /tmp successfully. [A/AOS] IDX :Name Size Offset Device [A/AOS] ---------------------------------------------------- [A/AOS] MTD1:SPL 64KB 0x00000000 /dev/mtdblock0 [A/AOS] MTD2:ENV 4KB 0x00010000 /dev/mtdblock1 [A/AOS] MTD3:ENVBK 4KB 0x00011000 /dev/mtdblock2 [A/AOS] MTD4:DTB 64KB 0x00012000 /dev/mtdblock3 [A/AOS] MTD5:KERNEL 2560KB 0x00022000 /dev/mtdblock4 [A/AOS] MTD6:ROOTFS 3072KB 0x002a2000 /dev/mtdblock5 [A/AOS] MTD7:CONFIG 2048KB 0x005a2000 /dev/mtdblock6 [A/AOS] MTD8:APP 376KB 0x007a2000 /dev/mtdblock7 [A/AOS] vfs_register_fs path /, ret 0 [A/BEN] Mount romfs on / successfully. [A/AOS] vfs_register_fs path /etc/config, ret 0 [E/DRV] no default pinctrl state, need check! [E/DRV] video register finish [E/DRV] i2c0: no sleep pinctrl state, reset to default pinctrl setting [A/AOS] netdev_register netdev 0x8039f3e0 name usb4g [A/AOS] netdev_register netdev 0x803a6ce8 name eth0 [A/DRV] anyka,ak37d-ethernet register ok [F/DRV] mmc1: card_status@probe =1.(1=CARD_PLUGED, 0=CARD_UNPLUGED) [E/DRV] of_get_named_gpiod_flags: can't parse 'reset-pins' property of node '/soc/mmc2@201B0000[0]' [E/DRV] of_get_named_gpiod_flags: can't parse 'power-pins' property of node '/soc/mmc2@201B0000[0]' [F/DRV] mmc2: card_status@probe =1.(1=CARD_PLUGED, 0=CARD_UNPLUGED) [A/BEN] total time taken by kernel is 357971565 us [A/AOS] Kernel is ready, jumping user space ANYKA:welcome user space, timestamp:358080 [A/BEN] load /usr/user.strip.elf success [A/BEN] Mount littlefs on /etc/config successfully. [F/DRV] mmc1: detect thread start [F/DRV] mmc2: detect start [A/BEN] CISTPL_MANFID 0x0296, 0x5347 [F/DRV] mmc2: clock: 40000000Hz [A/
可以在命令行运行命令,简单验证HaaS700的基本功能:
命令行输入
ls
查看Flash文件系统上根目录的目录内容:(ash:/)# ls . .. sbin python tmp mnt lib dev usr etc var bin
命令行输入
python /python/apps/network/wifi/wifi_connect.py <路由器SSID> <路由器密码>
查看WiFi联网功能:(ash:/)# python /python/apps/network/wifi/wifi_connect.py aha aos123456789 (ash:/)# Welcome to MicroPython [WARN]:27:hichannel 2020-11-10 17:00:00 [INFO]:1510:oal_sdio_init, tick 450634 [WARN]:1123:hcc_task_rx_gpio_thread start [INFO]:171:sdio state changed, tx[0=>1],rx[0=>1] (1:on, 0:off) [INFO]:1281:sdio request gpio:49 as irq done [INFO]:1285:oal_sdio_probe done! [INFO]:1389:sdio_register_driver done! [E/DRV] [init xfer_count:0] [INFO]:247:hcc_task_tx_thread:: hcc_task_tx_thread enter [INFO]:221:hcc_task_rx_thread:: hcc_task_rx_thread enter [WARN]:910:hcc_host_init SUCCESSFULLY [WARN]:57:wlan drv insmod SUCCESSFULLY [A/AOS] netdev_register netdev 0x8043c288 name wlan0 wifi_connect_handle:192 wifi_connect_handle ssid aha password aos123456789 [E/DRV] wifi device has inited [F/DRV] sta_info->ssid.val :aha, sta_info->key.val aos123456789 ************* python task init******* [F/DRV] hi3861l_report_mac:report mac=54:77:87:1e:61:70 [F/DRV] hi3861l_report_ip:get ip=192.168.43.166 mask=255.255.255.0 gw=192.168.43.1 [F/DRV] hi3861l_get_mac:get mac=54:77:87:1e:61:70 [F/DRV] hi3861l_get_mac:get mac=54:77:87:1e:61:70 [E/ACT] activation_thread_entry:311 report_data:{"activationStr":"V=3.4.1&P=AliOS Things Team&A=alios_kernel&B=sky3750d-mk&C=mcu_ak39ev33x&N=ETH&X=IPC&S=RTSP+RTCP+RTP&O=rtos&T=solo&M=03-03-03-03-f0-3d&Y=aliyun"} [E/ACT] activation_thread_entry:315 report http data:POST /report HTTP/1.1 Host:os-activation.iot.aliyun.com User-Agent: AliOS-Things Content-Length:163 Accept: */* Content-Type:application/json Connection: Keep-Alive {"activationStr":"V=3.4.1&P=AliOS Things Team&A=alios_kernel&B=sky3750d-mk&C=mcu_ak39ev33x&N=ETH&X=IPC&S=RTSP+RTCP+RTP&O=rtos&T=solo&M=03-03-03-03-f0-3d&Y=aliyun"} [UWLAN_I] event ID = 106, 3 event ID = 106, 3 [UWLAN_I] event ID = 106, 0 event ID = 106, 0 [UWLAN_I] event ID = 106, 0 event ID = 106, 0 wifi_event_cb:69 wifi_event_cb event 3 wifi_event_cb:69 wifi_event_cb event 0 wifi_event_cb:69 wifi_event_cb event 0 [E/ACT] socket connect success
5 编程接口能力¶
HaaS700支持Python语言开发,除了支持全量的Python原生接口外,还提供了丰富的外设及物联网接口。各个接口的详细使用请参考 编程接口。
具体支持能力如下:
¶ 基础库
支持能力
cmath
支持
math
支持
uarray
支持
ubinascii
支持
ucollections
支持
uerrno
支持
uhashlib
支持
uheapq
支持
uio
支持
ujson
支持
uos
支持
ure
支持
uselect
支持
usocket
支持
ussl
支持
ustruct
支持
usys
支持
utime
支持
uzlib
支持
_thread
支持
¶ 轻应用特定库
支持能力
micropython
支持
¶ Driver库
支持能力
BoardConfig
支持
UART
不支持
GPIO
支持
ADC
不支持
DAC
不支持
PWM
不支持
I2C
不支持
SPI
不支持
TIMER
不支持
¶ 高级组件库
支持能力
camera
支持
recorder
支持
OSS
不支持
http
不支持
mqtt
不支持
network
支持
modbus
不支持
ulog
不支持
ota
不支持
注意事项
HaaS700的Python环境目前只支持文件解析模式,暂时不支持REPL交互模式。