[]【HarmonyOS HiSpark AI Camera试用连载 】HiSpark AI Camera(Hi3516DV300)环境搭建与编译HarmonyOS源码

阅读量0
0
0


开发板开箱上电运行起来,确认硬件就绪后,便开始环境搭建与源码编译,记录如下。
首先参考的社区帖子,通览许多篇,对比各种方式、了解各个问题点,做到心中有数(近乎是胸有成竹)。
首先查看这篇“官贴”——《[文章] 【烧录指引】Hi3861、Hi3516、Hi3518 新手指引》,很不错!该文章链接如下:
https://bbs.elecfans.com/jishu_1991961_1_1.html
我选择的是 Windows 10 运行VMware 16,创建虚拟机安装 Ubuntu 16.04.6 Server,之所以选择这个Server版,是由于其小巧强悍,快如闪电。无桌面UI,只有这才跟得上咱程序员的速度,能显著降低人等机器的时间。
一、安装虚拟机 Ubuntu 16.04.6。
1、在Windows 10下安装VMware 16,VMware 16需要输入许可证密钥,注册完成即可使用。

2、打开VMware 16,点击“创建新的虚拟机”;
0.jpg

3、选择“自定义(高级)(C)”,然后点击“下一步”;
1.jpg

4、硬件兼容性值为默认,点击“下一步”;
2.jpg

5、安装来源选择“安装程序光盘映像文件(iso)(M)”,找到要安装的映像,然后选择“下一步”;
3.jpg

6、输入用户信息,这些信息可以随意设置。注意记下自己设置的用户名和密码。输入完成后,点击“下一步”;
4.jpg

7、填写虚拟机的名称及选择存储位置,虚拟机的名称可以随意填写,不过最好要见名知意,存储位置建议选择在剩余容量比较多的盘内(后面步骤还要手动分配磁盘空间)。上述完成后点击“下一步”;
5.jpg

8、处理器配置,根据自己的PC实际资源分配即可。点击“下一步”;
6.jpg

9、选择虚拟内存,按默认即可,然后点击“下一步”;
7.jpg

10、选择网络连接“使用网络地址转换(NAT)(E)”,然后点击“下一步”;
8.jpg

11、选择I/O控制器类型“LSI Logic(L)”,然后点击“下一步”;
9.jpg

12、选择磁盘类型“SCSI(S)”,然后点击“下一步”;
10.jpg

13、选择磁盘“创建新虚拟磁盘(V)”,然后点击下一步;
11.jpg

14、指定磁盘容量,可以根据自己的硬盘剩余容量进行设置,建议配置足够大,避免后续使用中空间不足,然后点击“下一步”;  
12.jpg

15、磁盘文件名,默认即可。点击“下一步”;
13.jpg

16、到这一步配置就结束了,点击“完成”;
14.jpg
15.jpg

17、自动安装完毕后,便是Ubuntu 16.04.6 系统的配置与应用程序的安装。
更新软件列表:sudo apt-get update
之后安装常用的软件与服务:sudo apt-get install xxx
如:vim、ssh、ftp、samba、nfs、tftp;
修改网络接口配置。以上这些决定了后续开发的便捷性,尤其是ssh、tftp、nfs,至关重要。
参考上述“官贴”其中的 环境搭建篇——《[文章] Hi3516开发板环境搭建》,https://bbs.elecfans.com/jishu_1991415_1_1.html
安装与配置相关服务:shell、Python3.7+、gn、nijia、LLVM、hc-gen等;

二、源码的编译。参照滤波电容兄的文章指引,顺利编译通过。链接如下:
https://bbs.elecfans.com/jishu_1992603_1_1.html
拷贝源码、解压后,源码目录执行:python build.py ipcamera_hi3516dv300 -b debug
编译完成后查看:ll out/ipcamera_hi3516dv300/
20.jpg


三、安装过程中遇到问题及解决方法。
(一)、以下载包的方式在Ubuntu 16上安装python,执行过程中遇到问题如下:
***@ubuntu:~$ sudo pip3 install --upgrade pip
WARNING: The directory '/home/***/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Requirement already up-to-date: pip in /usr/local/lib/python3.8/site-packages (20.1.1)
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
***@ubuntu:~$
解决方法:
(1):对于
        WARNING: The directory '/home/***/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
        根据提示,执行命令:sudo -H pip3 install --upgrade pip
(2):对于
        ...TLS/SSL, however the ssl module in Python is not available.
         执行:
        sudo apt-get install python-dev
        sudo apt-get install libffi-dev
        sudo apt-get install libssl-dev
        然后重新编译Python,即可以解决安装和使用pip时找不到SSL模块的问题。



回帖

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容图片侵权或者其他问题,请联系本站作侵删。 侵权投诉
链接复制成功,分享给好友