2016-03-31

Start building an IoT gateway HTTPS program on the Ubuntu Linux platform



Many ARM IoT platforms support Ubuntu Linux. Once we've selected an IoT gateway hardware board, we then can put this image into the board and start running Ubuntu. This Ubuntu on an IoT board actually is just like your desktop PC. It provides web browser, editors,.., and so on. Once we link the board into internet and enable the auto ethernet from the desktop, we can start our development of the https application program.

First, we should download an openssl example program:

http://www.ibm.com/developerworks/linux/library/l-openssl.html

Then we can start the trial as follows:

-Edit sources.list file
$ sudo vi /etc/apt/sources.list
Insert the following lines:
deb http://ports.ubuntu.com/ubuntu-ports/ trusty main universe restricted
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security universe
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe


-Update apt-get
$ sudo apt-get update

-Install gcc and libxml2
$ sudo apt-get install gcc
$ sudo apt-get install libxml2-dev


-Compile program
$ gcc test.c -I/usr/include/libxml2 -lxml2 -o test

-Test program
$ ./test


-Install libssl,pkg-config

$ sudo apt-get install libssl
$ sudo apt-get install pkg-config


-Check libs needed by libssl

$ pkg-config --libs libssl
-lssl -lcrypto



-Compile and link libs

$ gcc nossl.c -I/usr/include -lssl -lcrypto

沒有留言:

張貼留言