Skip to content

Commit

Permalink
Merge pull request #4 from ljkeller/feature/ew_deploy
Browse files Browse the repository at this point in the history
Feature/ew deploy
ljkeller authored Apr 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 5063f53 + 3c8bb12 commit 158df8c
Showing 4 changed files with 13 additions and 5 deletions.
Binary file modified app/exe/spark
Binary file not shown.
8 changes: 4 additions & 4 deletions app/src/parkinglot_detection.cpp
Original file line number Diff line number Diff line change
@@ -222,7 +222,7 @@ void get_patches(int event, int x, int y, int flags, void *param)
rectangle(img, boxes[i], AVNET_COMPLEMENTARY, 2);
}
box_end = Point2f(x, y);
imshow("image", frame_copy);
imshow("Draw boxes with mouse, press <esc> to return to inference", frame_copy);
}
/*****************************************
* Function Name : draw_rectangle
@@ -238,9 +238,9 @@ int draw_rectangle(void)
putText(img, "id: " + to_string(i + 1), Point(boxes[i].x + 10, boxes[i].y - 10), FONT_HERSHEY_DUPLEX, 1.0, Scalar(255, 0, 0), 2);
}
unsigned int key = 0;
cv::namedWindow("image", cv::WINDOW_NORMAL);
cv::imshow("image", img);
cv::setMouseCallback("image", get_patches, &img);
cv::namedWindow("Draw boxes with mouse, press <esc> to return to inference", cv::WINDOW_NORMAL);
cv::imshow("Draw boxes with mouse, press <esc> to return to inference", img);
cv::setMouseCallback("Draw boxes with mouse, press <esc> to return to inference", get_patches, &img);
key = cv::waitKey(0);
std::cout << "key:" << key << "\n";
if (key == 114) // Wait for 'r' key press to redraw!!
1 change: 1 addition & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ TARGET=$1
set -ex

scp -r ./app/exe/ "root@${TARGET}:/home/root/dev/"
scp -r ./utils/ "root@${TARGET}:/home/root/dev/"
ssh "root@${TARGET}" "mkdir -p /opt/spark/iot"
scp ./app/iot/*.json "${TARGET}:/opt/spark/iot/"
scp ./app/iot/iotc-spark-server.service "${TARGET}:/etc/systemd/system/"
9 changes: 8 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -4,20 +4,27 @@
INSTALL_DIR=/opt/spark
mkdir -p "${INSTALL_DIR}"

echo "Installing SPARK executables, utils, and libs into RZBoard... The executables will be copied to ${INSTALL_DIR} directory."
cp -r ./app/exe/* "${INSTALL_DIR}" || { echo "Failed to copy SPARK to RZBoard"; exit 1;}
cp -r ./utils/* "${INSTALL_DIR}" || { echo "Failed to copy SPARK utils to RZBoard";}
cp ./runtime_deps/libtvm_runtime.so /usr/lib64/ || { echo "Failed to copy TVM runtime to RZboard"; exit 1;}
cat ./app/weston_conf/weston.ini.append >> /etc/xdg/weston/weston.ini || { echo "Failed to append weston.ini"; exit 1;}
cat ./app/weston_conf/weston.ini.append >> /etc/xdg/weston/weston.ini || { echo "Failed to append weston.ini. You will have to run spark from ${INSTALL_DIR}";}
echo "Done installing SPARK executables, utils, and libs into RZBoard..."

# IoT Config
echo "Installing IoT Connect configurations into RZBoard..."
mkdir -p ${INSTALL_DIR}/iot || { echo "Failed to create iot directory"; exit 1;}
cp ./app/iot/*.json ${INSTALL_DIR}/iot/ || { echo "Failed to copy iot json files"; exit 1;}
echo "Don't forget to update /opt/spark/iot/ config files with your own device keys/server orientation"
echo "Done installing IoT Connect configurations into RZBoard..."

# Service management
echo "Installing IoT Connect / SPARK Service into RZBoard... The service will be enabled (auto launches on internet connection) and started after installation."
cp ./app/iot/iotc-spark-server.service /etc/systemd/system/ || { echo "Failed to copy iotc-spark-server.service"; exit 1;}
systemctl daemon-reload
systemctl enable iotc-spark-server.service || { echo "Failed to enable iotc-spark-server.service"; exit 1;}
systemctl start iotc-spark-server.service || { echo "Failed to start iotc-spark-server.service"; exit 1;}
echo "Done installing IoT Connect / SPARK Service into RZBoard... The service is enabled and started after installation."

echo "SPARK installed successfully. Restarting Weston for changes to take effect."

0 comments on commit 158df8c

Please sign in to comment.