Ubuntu 16.04 使用 Libcoap

具体见:https://libcoap.net/doc/install.html#code

1.环境:

1.1.阿里云服务器

1.2.Ubuntu 16.04

 

2.配置环境:

2.1. 远程连接服务器(win10 Linux 子系统 Ubuntu)

$: ssh root@IP

2.2. 配置需要用到的工具:

$:sudo apt-get update

$:sudo apt-get install git

$: sudo apt-get install -y pkg-config

$: sudo apt-get install m4

$:sudo apt-get install autoconf

$:sudo apt-get install automake

$:sudo apt-get install libtool

$:sudo apt-get install doxygen

$:sudo apt-get install asciidoc

$:sudo apt-get install cunit

 

 

2.3.创建目录下载源码:

$:cd /home/liu

$:mkdir coap

$:cd coap

下载源码:

$:git clone https://github.com/obgm/libcoap.git

3.编译测试

3.1.进入目录:

$:cd libcoap

3.2.配置编译

$:./autogen.sh//生成脚本

$:./configure//配置脚本

$:make//编译

$:make install//安装

具体用法见:https://www.linuxidc.com/Linux/2011-02/32211.htm?_t_t_t=0.8881751426961273

3.3.测试

一切顺利之后 进入 该目录下的 examples 文件夹

$:cd examples/

里面有生成的 测试工具 运行

$:./coap-server

然后根据我们上次安装的 copper 插件

http://www.cnblogs.com/liuyunxiang/p/8894596.html

测试一下 是否成功 如果成功 则出现如下内容 获取了该服务器的时间

 

猜你喜欢

转载自www.cnblogs.com/liuyunxiang/p/8909488.html