[LINUX] I tried to put HULFT IoT (Edge Streaming) in the gateway Rooster of Sun Electronics

Hello, Yorozu consultation responsible Sugimon: yum: It is.

This time, I created a package of HULFT IoT Edge Streaming on Sun Electronics Rooster (NSX7000), which is a Linux gateway device!

Try it first

Sun Electronics Rooster (NSX7000) is a device of Sun Electronics Co., Ltd.'s router Rooster series for IoT / M2M. The NSX7000 is said to be positioned as a Linux gateway that supports LTE communication for multiple carriers.

NSX7000 device information

It seems that it is necessary to prepare the package creation environment in advance to install HULFT IoT Edge Streaming, so I tried to create a package. image.png

Preparing the package creation environment

--[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)

--Terminology and operations related to HULFT IoT Edge Streaming can be found in "FirstStepGuide_jpn.pdf" in the zip file.

--NSX7000 package creation environment (* Development environment will be prepared separately) NSX7000 Manual From the above link, I referred to the manual of the procedure for building the package creation environment. --Add-on Application Development-Package Creation Manual.pdf --Add-on Application Development-Environment Construction Manual.pdf

This completes the preparations.

Preparation of modules to package

Use HULFT IoT EdgeStreaming Studio to implement stream processing and deploy it to your packaging environment.

For the implementation method and deployment method of stream processing, refer to "FirstStepGuide_jpn.pdf" in the zip file obtained when downloading the product.

  1. Start HULFT IoT EdgeStreaming Studio and create a script that represents stream processing
  2. Deploy the developed script to any directory on the NSX7000 package creation environment --ʻEs-agent.tar.gz` has been deployed to any directory you specify
  3. Extract the deployed file with the following command
   tar zxf es-agent.tar.gz
  1. When the command is executed, the following files are expanded in the same directory.

Creating a package

Let's create a package for HULFT IoT EdgeStreaing runtime 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

  1. Create a specified directory
Top directory/
|
+-- object/
|    |
|    +-- run-es-agent start script
+-- rpk/
|    |
|    +-- CONTROL/
|    |      |
|    |      +--control file
|    |
|    +--appctl script
|
+-- EdgeStreaming-runtime
+-- Makefile

  1. I copied the following files to the object directory.
  1. Next, try creating a control file. I created it as follows.
Package: EdgeStreaming-runtime
Version: 2.0.0
Depends: 
Runtime-Depends: 
Maintainer: Company
Architecture: nsx7000
Provides: 
Replaces: 
Description: 
  1. Create an appctl script

I created it as follows.

#!/bin/sh

PACKAGE_NAME=EdgeStreaming-runtime
PACKAGE_DIR=/app/package

exec $PACKAGE_DIR/$PACKAGE_NAME/sbin/$PACKAGE_NAME $@

  1. Create an EdgeStreaming-runtime script that will be executed from the appctl script.
#!/bin/sh /etc/rc.common

USE_PROCD=1

PACKAGE_NAME=EdgeStreaming-runtime
PACKAGE_DIR=/app/package
COMMAND=$PACKAGE_DIR/$PACKAGE_NAME/sbin/run-es-agent

start_service() {
	procd_open_instance
	procd_set_param command $COMMAND
	procd_set_param respawn
	procd_close_instance
}

stop_service() {
	return 0
}
  1. Create a startup script (run-es-agent)

I created it as follows.

#!/bin/sh

PACKAGE_NAME=EdgeStreaming-runtime
PACKAGE_DIR=/app/package

LD_LIBRARY_PATH=${PACKAGE_DIR}/${PACKAGE_NAME}/lib
BIN_DIR=${PACKAGE_DIR}/${PACKAGE_NAME}/bin
COMMAND=${BIN_DIR}/es-agent

export LD_LIBRARY_PATH
cd $BIN_DIR

exec $COMMAND run -c es-agent.yaml
  1. Grant execute permission to the start script (run-es-agent).
chmod 755 run-es-agent
  1. Create a Makefile.

I created it as follows.

ROOSTER_TOP_DIR ?= $(HOME)/RoosterOS-SDK

ADD_ON_PKG_NAME := EdgeStreaming-runtime
ADD_ON_PKG_VERSION := 2.0.0
ADD_ON_PKG_MAINTAINER := Company
ADD_ON_PKG_DESCRIPTION := 

OBJ_DIR=./object

include $(ROOSTER_TOP_DIR)/mk/add-on-package.mk


EdgeStreaming-runtime: 


contents: $(ROOSTER_PACKAGE_ADD_ON_CONTENTS_DIR) EdgeStreaming-runtime
	mkdir -p $(ROOSTER_PACKAGE_ADD_ON_CONTENTS_DIR)/bin
	cp $(OBJ_DIR)/es-agent* $(ROOSTER_PACKAGE_ADD_ON_CONTENTS_DIR)/bin
	cp $(OBJ_DIR)/script.bql $(ROOSTER_PACKAGE_ADD_ON_CONTENTS_DIR)/bin
	cp -r $(OBJ_DIR)/plugins $(ROOSTER_PACKAGE_ADD_ON_CONTENTS_DIR)/bin

	mkdir -p $(ROOSTER_PACKAGE_ADD_ON_CONTENTS_DIR)/sbin
	cp $(OBJ_DIR)/run-es-agent $(ROOSTER_PACKAGE_ADD_ON_CONTENTS_DIR)/sbin
	$(call replace_add_on_keyword,\
		$(ADD_ON_PKG_NAME),\
		$(ROOSTER_PACKAGE_ADD_ON_CONTENTS_DIR)/sbin/$(ADD_ON_PKG_NAME))
	chmod +x $(ROOSTER_PACKAGE_ADD_ON_CONTENTS_DIR)/sbin/$(ADD_ON_PKG_NAME)

	touch $(ROOSTER_PACKAGE_ADD_ON_CONTENTS_PREPARED)


$(eval $(DefaultTarget))

  1. Execute the following command to create a package.
make rpk
  1. When the command is executed, the following files are created.

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

Finally

This time, I installed HULFT IoT Edge Streaming on a Linux gateway device. How was it? I tried to create a package, but the manual was also extensive, so the work itself was easier than I expected!

Also, this time, I first tried to create the initial package, I would like to use HULFT IoT Edge Streaming concretely at another time! I would like to talk about more specific points there!

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!

Recommended Posts

I tried to put HULFT IoT (Edge Streaming) in the gateway Rooster of Sun Electronics
I tried to put HULFT IoT (Agent) in the gateway Rooster of Sun Electronics
I tried to create a plug-in with HULFT IoT Edge Streaming [Development] (2/3)
I tried to create a plug-in with HULFT IoT Edge Streaming [Execution] (3/3)
I tried to create a plug-in with HULFT IoT Edge Streaming [Setup] (1/3)
I tried to display the altitude value of DTM in a graph
I tried to touch the API of ebay
I tried to correct the keystone of the image
I tried to predict the price of ETF
I tried to vectorize the lyrics of Hinatazaka46!
I tried to graph the packages installed in Python
I tried to visualize the spacha information of VTuber
I tried to erase the negative part of Meros
I tried to classify the voices of voice actors
I tried to summarize the string operations of Python
[Linux] I learned LPIC lv1 in 10 days and tried to understand the mechanism of Linux.
I tried to put out the frequent word ranking of LINE talk with Python
I tried to extract the text in the image file using Tesseract of the OCR engine
[First data science ⑥] I tried to visualize the market price of restaurants in Tokyo
I tried to find the entropy of the image with python
[Horse Racing] I tried to quantify the strength of racehorses
I tried the accuracy of three Stirling's approximations in python
I tried to find the average of the sequence with TensorFlow
I tried to summarize the code often used in Pandas
I tried to illustrate the time and time in C language
[Python] I tried to visualize the follow relationship of Twitter
I tried to create a Python script to get the value of a cell in Microsoft Excel
I tried to summarize the commands often used in business
I tried to implement the mail sending function in Python
[Machine learning] I tried to summarize the theory of Adaboost
I tried to fight the Local Minimum of Goldstein-Price Function
I wrote a doctest in "I tried to simulate the probability of a bingo game with Python"
[Natural language processing] I tried to visualize the remarks of each member in the Slack community
I tried to implement blackjack of card game in Python
I tried to find the trend of the number of ships in Tokyo Bay from satellite images.
I tried to unlock the entrance 2 lock sesame with a single push of the AWS IoT button
I tried to summarize the contents of each package saved by Python pip in one line
[RHEL7 / CentOS7] I put in the log monitoring tool swatch and tried to notify by email
I tried fitting the exponential function and logistics function to the number of COVID-19 positive patients in Tokyo
[Linux] I tried to summarize the command of resource confirmation system
I tried to get the index of the list using the enumerate function
I tried to automate the watering of the planter with Raspberry Pi
I tried to build the SD boot image of LicheePi Nano
I tried to process the image in "sketch style" with OpenCV
I wrote the code to write the code of Brainf * ck in python
I tried to make an analysis base of 5 patterns in 3 years
I tried to expand the size of the logical volume with LVM
I tried to summarize the frequently used implementation method of pytest-mock
I want to know the population of each country in the world.
I tried to improve the efficiency of daily work with Python
I tried to visualize the common condition of VTuber channel viewers
I tried to move the ball
I tried to estimate the interval.
I tried to display the analysis result of the natural language processing library GiNZA in an easy-to-understand manner
[Python] I tried to summarize the set type (set) in an easy-to-understand manner.
I tried to get the batting results of Hachinai using image processing
I tried to visualize the age group and rate distribution of Atcoder
zoom I tried to quantify the degree of excitement of the story at the meeting
I tried to estimate the similarity of the question intent using gensim's Doc2Vec
I tried how to improve the accuracy of my own Neural Network
I tried to solve the 2020 version of 100 language processing [Chapter 3: Regular expressions 25-29]