Hello, Yorozu consultation responsible Sugimon: yum: It is.
Last time, I created a package of HULFT IoT Edge Streaming on Sun Electronics Rooster (NSX7000), which is a Linux gateway device. (The above) This time, as the second step, I also summarized the package creation of HULFT IoT Agent on the blog.
There may be clues to solve your problems, so please take a look.
Sun Electronics Rooster (NSX7000) is a device of Sun Electronics Co., Ltd.'s router Rooster series for IoT / M2M. NSX7000 is positioned as a Linux gateway that supports LTE communication for multiple carriers.
--NSX7000 device information
Please refer to the link below for details on the equipment. NSX7000 device information
To install HULFT IoT Agent, you need to prepare the packaging environment in advance. I actually tried to create a package.
Please prepare the following.
--Download the zip file containing the product itself from the specified site (https://www.hulft.com/download?&_ga=2.188013544.1972116588.1573457228-475003281.1503981102#anc_24) and unzip it. --xxx is the product version --For terms and operations related to HULFT IoT, see "readme.html" included in the zip file or [Online Manual](https://www.hulft.com/help/ja-jp/IoT/index.htm?_ga= 2.188153064.1972116588.1573457228-475003281.1503981102)
```
hulftiot_vxxx/
+-- Agent/
| |
| +--HULFT IoT Agent installation module
|
+-- Agent UpdateModule/
| |
| +--HULFT IoT Agent Update Module
|
+-- License/
| |
| +--License file
|
+-- Manager/
| |
| +--HULFT IoT Manager installation module
|
+-- Manual/
| |
| +--HULFT IoT Manual
|
+-- readme.html
```
--NSX7000 package creation environment (* Development environment will be prepared separately) NSX7000 Manual Refer to the following manual for the procedure for building the package creation environment. --Add-on Application Development-Package Creation Manual.pdf --Add-on Application Development-Environment Construction Manual.pdf
HULFT IoT Manual Build the Manager environment according to the HULFT IoT manual.
Note: Perform the following steps as the root user
tar zxf HULFT_IoT_Agent_Linux_AArch32_Vxxx.tar.gz
iot_agent/
+-- modules/
| +-- huliotcore
| +-- huliotinfo
| +-- huliotsend
| +-- huliotservice
|
+-- defaultsettings.ini
|
+-- huliotsetup
|
+-- huliotsetup.ini
Edit the HULFT IoT Agent configuration file.
Copy the following text and save it in a directory of your choice with the file name agent.conf
devicename =
server_hostname =
proxy =
proxy_user =
protocol = 0
cert_verification = 0
activation_key =
first_conn_retry_interval = 3600
remarks_file =
: (colon)
: (colon)
--Specify if the Agent is in a proxy environment: (colon)
For explanations of other items, refer to the manual.
devicename = nsx7000
server_hostname = server:8765
proxy =
proxy_user =
protocol = 0
cert_verification = 0
activation_key = 11e1400a-0989-4699-9703-88f85c653c35
first_conn_retry_interval = 3600
remarks_file =
Create a HULFT IoT Agent package in the NSX7000 package creation environment. For the parameters of various files, refer to the following Manual.
--Add-on Application Development-Package Creation Manual.pdf
Top directory/
|
+-- object/
+-- rpk/
| |
| +-- CONTROL/
| | |
| | +--control file
| | +--postrm script
| |
| +--appctl script
|
+-- Makefile
I created it as follows.
Package: hulftiot-agent
Version: 2.0.0
Depends:
Runtime-Depends:
Maintainer: Company
Architecture: nsx7000
Provides:
Replaces:
Description:
#!/bin/sh
PATH=/usr/sbin:/sbin:$PATH
export PATH
: ${ROOSTER_OS_LOG_STDERR:=yes}
: ${ROOSTER_OS_LOG_FACILITY:=user}
. /lib/functions.sh
include /lib/functions/rooster-os/base
include /lib/functions/rooster-os/rpkg
PACKAGE_NAME=hulftiot-agent
on_remove() {
rm -rf /app/var/${PACKAGE_NAME}
return 0
}
case "$1" in
*)
if [ $PKG_ROOT = "/" ]; then
on_remove
fi
;;
esac
exit 0
I created it as follows.
#!/bin/bash
PACKAGE_NAME=hulftiot-agent
PACKAGE_DIR=/app/package
EXEC_DIR=/app/var/${PACKAGE_NAME}
WORK_DIR=${EXEC_DIR}/work
LOG_DIR=${EXEC_DIR}/log
HASH_CMD=sha1sum
HASH_FILE=huliot.sha1
IOT_FILE=("huliotcore" "huliotinfo" "huliotsend" "huliotservice")
make_hash() {
if [ -e ${EXEC_DIR}/${HASH_FILE} ]; then
rm -f ${EXEC_DIR}/${HASH_FILE}
fi
for ((i = 0; i < ${#IOT_FILE[@]}; i++)) {
${HASH_CMD} ${PACKAGE_DIR}/${PACKAGE_NAME}/bin/${IOT_FILE[i]} >> ${EXEC_DIR}/${HASH_FILE}
}
}
start_app() {
if [ ! -d ${EXEC_DIR} ]; then
mkdir -p ${EXEC_DIR}
mkdir -p ${WORK_DIR}
mkdir -p ${LOG_DIR}
cp -p ${PACKAGE_DIR}/${PACKAGE_NAME}/bin/* ${EXEC_DIR}
echo "workfile_path = ${WORK_DIR}" >> ${EXEC_DIR}/agent.conf
echo "logfile_path = ${LOG_DIR}" >> ${EXEC_DIR}/agent.conf
make_hash
else
${HASH_CMD} -c ${EXEC_DIR}/${HASH_FILE} > /dev/null 2>&1
if [ $? -ne 0 ]; then
cp -pf ${PACKAGE_DIR}/${PACKAGE_NAME}/bin/huliot* ${EXEC_DIR}
make_hash
fi
fi
${EXEC_DIR}/huliotservice
}
stop_app() {
${EXEC_DIR}/huliotservice --stop
}
case "$1" in
start)
start_app
;;
stop)
stop_app
;;
restart)
stop_app
start_app
;;
*)
;;
esac
exit 0
I created it as follows.
ROOSTER_TOP_DIR ?= $(HOME)/RoosterOS-SDK
ADD_ON_PKG_NAME := hulftiot-agent
ADD_ON_PKG_VERSION := 2.0.0
ADD_ON_PKG_MAINTAINER := Company
ADD_ON_PKG_DESCRIPTION :=
include $(ROOSTER_TOP_DIR)/mk/add-on-package.mk
OBJ_DIR=./object
hulftiot-agent:
contents: $(ROOSTER_PACKAGE_ADD_ON_CONTENTS_DIR) hulftiot-agent
mkdir -p $(ROOSTER_PACKAGE_ADD_ON_CONTENTS_DIR)/bin
cp $(OBJ_DIR)/huliot* $(ROOSTER_PACKAGE_ADD_ON_CONTENTS_DIR)/bin
cp $(OBJ_DIR)/agent.conf $(ROOSTER_PACKAGE_ADD_ON_CONTENTS_DIR)/bin
touch $(ROOSTER_PACKAGE_ADD_ON_CONTENTS_PREPARED)
$(eval $(DefaultTarget))
make rpk
After that, you can use it by bringing this created package file to Rooster and installing it referring to the following manual.
--Add-on Application Development-Environment Construction Manual.pdf
What did you think. This time, I tried to create a HULFT IoT Agent package. There are many steps, but if you follow the manual and respond steadily, you've done it to the end!
In this blog, I would like to continue to introduce the contents of consultations at the "Yorozu Consultation Counter" of technology and the tricks that were born.
Please continue to check it out and follow us if you like.
See you again!