RS804 - EmbeddedSDK - Manual - 20200812
RS804 - EmbeddedSDK - Manual - 20200812
User's Manual
Version 1. 1
-1-
Revision Pages Description By Date
V1.0 Release Matisse 2020/05/08
V1.1 Add hierarchy of sample code Matisse 2020/05/18
Add administration page
Add GPIO/LED/RS232 page
-2-
Table of Contents
-3-
Chapter 1: Prepare Environment
Host PC OS: Ubuntu 16.04 x64
RS804 OS: #200508
http://w3.tw.ute.com/pub/rd/RS804/OS-200508/openwrt-omap-ti_am335x
-rs804-squashfs-sdcard.img.gz
RS804 Embedded SDK:
http://w3.tw.ute.com/pub/rd/RS804/OS-200508/openwrt-sdk-omap_gcc-7.
3.0_musl_eabi.Linux-x86_64.tar.xz.zip
-4-
Chapter 2: Install/Setup SDK
-5-
2.2 Setup SDK
Setup SDK
$ cd openwrt-sdk
$ make defconfig
-6-
Chapter 3: Sample C Application
-7-
1. Build:
$ cd openwrt-sdk
$ make package/indysample/compile
2. Install
1. Copy indysample package to RS804
$ cd openwrt-sdk/bin/packages/arm_cortex-a8_vfpv3/base
$ scp -o StrictHostKeyChecking=no
indysample_2.6.0-1_arm_cortex-a8_vfpv3.ipk [email protected]:/tmp
2. Install indysample on RS804
$ ssh -o StrictHostKeyChecking=no [email protected]
(RS804)$ opkg install /tmp/indysample_2.6.0-1_arm_cortex-a8_vfpv3.ipk
3. Run
$ ssh -o StrictHostKeyChecking=no [email protected]
(RS804)$ /bin/inventory_live
-8-
Fig. Install IndySample
-9-
3.2 Using WebAPI - WebAPISample
Description: Sample C program using WebAPI (thru libcurl).
Source
Dir: openwrt-sdk/package/example/webapisample
Hierarchy of webapisample
Makefile: openwrt Makefile for webapisample
src/webapigetversion.c: Main program code
src/curl/*: include files of libcurl library.
src/lib/*: libraries of libcurl library
Output
Dir: openwrt-sdk/bin/packages/arm_cortex-a8_vfpv3/base
File: webapisample_1.0.0-1_arm_cortex-a8_vfpv3.ipk
Target App: /bin/webapigetversion
WebAPI URL: localhost
WebAPI Port: 8443
1. Build:
$ cd openwrt-sdk
$ make package/webapisample/compile
2. Install
1. Copy webapisample package to RS804
$ cd openwrt-sdk/bin/packages/arm_cortex-a8_vfpv3/base
$ scp -o StrictHostKeyChecking=no
webapisample_1.0.0-1_arm_cortex-a8_vfpv3.ipk [email protected]:/tmp
2. Install webapisample package on RS804
$ ssh -o StrictHostKeyChecking=no [email protected]
(RS804)$ opkg install
/tmp/webapisample_1.0.0-1_arm_cortex-a8_vfpv3.ipk
3. Run
$ ssh -o StrictHostKeyChecking=no [email protected]
(RS804)$ /bin/webapigetversion
- 10 -
Fig. Build WebAPISample
- 11 -
Fig. Run WebAPISample
- 12 -
Chapter 4: Disable RFID Service
- 13 -
Chapter 5: Administration
- 14 -
Chapter 6: Hardware Interface
6.1 GPIO
GPI (1~4)
GPI 1: /dev/gpio_in0/value
GPI 2: /dev/gpio_in1/value
GPI 3: /dev/gpio_in2/value
GPI 4: /dev/gpio_in3/value
GPO (1~4)
GPO 1: /dev/gpio_out0/value
GPO 2: /dev/gpio_out 1/value
GPO 3: /dev/gpio_out 2/value
GPO 4: /dev/gpio_out 3/value
Example
Get GPI 1 status
(RS804)$ cat /dev/gpio_in0/value
Set GPO 1 output
(RS804)$ echo 1 > /dev/gpio_out0/value
- 15 -
6.2 User LED
User LED
Green LED: /dev/led_APP_green/brightness
Red LED: /dev/led_APP_red/brightness
Example
Set Green LED On
(RS804)$ echo 1 > /dev/led_APP_green/brightness
Set Red LED Off
(RS804)$ echo 0 > /dev/led_APP_red/brightness
- 16 -
- 17 -
6.3 RS232
RS232
Port: /dev/ttyS1
Baud rate: 9600 (default)
Example
Set string “Hello” thru RS232 port
(RS804)$ echo “Hello” > /dev/ttyS1
Monitor input from RS323 port
(RS804)$ cat /dev/ttyS1
- 18 -
- 19 -