Skip to content

Commit

Permalink
Merge branch 'ifm-snmpv3-upgrade' of https://github.com/usdot-fhwa-OP…
Browse files Browse the repository at this point in the history
…S/V2X-Hub into ifm-snmpv3-upgrade

Adding SNMP changes on top of the latest branch update
  • Loading branch information
willjohnsonk committed Jul 12, 2023
2 parents bc9a848 + 37f8fcf commit 8064841
Show file tree
Hide file tree
Showing 47 changed files with 666 additions and 73 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
Dockerfile
docker-compose.yml
*.md
**/build

2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ RUN ldconfig
COPY --from=dependencies /usr/local/plugins/ /usr/local/plugins/
COPY --from=dependencies /usr/local/lib/ /usr/local/lib/
COPY --from=dependencies /usr/local/bin/ /usr/local/bin/
COPY --from=dependencies /usr/lib/ /usr/lib/
COPY --from=dependencies /usr/bin/ /usr/bin/
COPY --from=dependencies /usr/local/share/ /usr/local/share/
COPY --from=dependencies /var/www/plugins/ /var/www/plugins/
COPY --from=dependencies /var/log/tmx/ /var/log/tmx/
Expand Down
4 changes: 2 additions & 2 deletions configuration/amd64/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- mysql-datavolume:/var/lib/mysql

php:
image: usdotfhwaops/php:7.4.0
image: usdotfhwaops/php:latest
container_name: php
network_mode: host
depends_on:
Expand All @@ -44,7 +44,7 @@ services:
- ./logs:/var/log/tmx
- ./MAP:/var/www/plugins/MAP
port_drayage_webservice:
image: usdotfhwaops/port-drayage-webservice:7.4.0
image: usdotfhwaops/port-drayage-webservice:latest
container_name: port_drayage_webservice
network_mode: host
secrets:
Expand Down
37 changes: 35 additions & 2 deletions configuration/amd64/initialization.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,45 @@
#!/bin/bash

# update and upgrade commands to update linux OS
sudo apt update -y && sudo apt upgrade -y

#installing necessary and useful apps
sudo apt-get install chromium-browser -y #Chrome required for CARMA platform/V2X Hub UI(?)
sudo apt install curl -y #Curl for downloading files over internet

#install docker
curl -L https://raw.githubusercontent.com/usdot-fhwa-stol/carma-platform/develop/engineering_tools/install-docker.sh | bash

#make passwords for mysql
mkdir secrets && cd secrets

#creates password files where user inputs password
read -p "enter password for the mysql_root_password: " sql_root_pass
echo "$sql_root_pass" > sql_root_pass.txt

read -p "enter password for mysql_password: " sql_pass
echo "$sql_pass" > sql_pass.txt

#remove endline characters from password files
tr -d '\n' <sql_root_pass.txt> mysql_root_password.txt && tr -d '\n' <sql_pass.txt> mysql_password.txt
rm sql_root_pass.txt && rm sql_pass.txt

#AMD64 initialzation
cd ..
sudo apt-get -y remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io
sudo apt -y install python3-pip
sudo pip3 install docker-compose
sudo docker-compose pull
sudo apt update -y && sudo apt upgrade -y
sudo docker-compose up -d

#create v2xhub user
cd mysql
./add_v2xhub_user.bash

chromium-browser "https://127.0.0.1" > /dev/null 2>&1 &
chromium-browser "https://127.0.0.1:19760" > /dev/null 2>&1 &
4 changes: 2 additions & 2 deletions configuration/arm64/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- mysql-datavolume:/var/lib/mysql

php:
image: usdotfhwaops/php_arm:7.4.0
image: usdotfhwaops/php_arm:latest
container_name: php
network_mode: host
depends_on:
Expand All @@ -44,7 +44,7 @@ services:
- ./logs:/var/log/tmx
- ./MAP:/var/www/plugins/MAP
port_drayage_webservice:
image: usdotfhwaops/port-drayage-webservice_arm:7.4.0
image: usdotfhwaops/port-drayage-webservice_arm:latest
container_name: port_drayage_webservice
network_mode: host
secrets:
Expand Down
36 changes: 34 additions & 2 deletions configuration/arm64/initialization.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,45 @@
#!/bin/bash
# update and upgrade commands to update linux OS
sudo apt update -y && sudo apt upgrade -y

#installing necessary and useful apps
sudo apt-get install chromium-browser -y #Chrome required for CARMA platform/V2X Hub UI(?)
sudo apt install curl -y #Curl for downloading files over internet

#install docker
curl -L https://raw.githubusercontent.com/usdot-fhwa-stol/carma-platform/develop/engineering_tools/install-docker.sh | bash

#make passwords for mysql
mkdir secrets && cd secrets

#creates password files where user inputs password
read -p "enter password for the mysql_root_password: " sql_root_pass
echo "$sql_root_pass" > sql_root_pass.txt

read -p "enter password for mysql_password: " sql_pass
echo "$sql_pass" > sql_pass.txt

#remove endline characters from password files
tr -d '\n' <sql_root_pass.txt> mysql_root_password.txt && tr -d '\n' <sql_pass.txt> mysql_password.txt
rm sql_root_pass.txt && rm sql_pass.txt

#ARM initialization
cd ..
sudo apt-get -y remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
OS=$(lsb_release -i | awk 'FS=":" {print $3;}' | awk '{print tolower($0)}')
arch=$(dpkg --print-architecture)
curl -fsSL https://download.docker.com/linux/$OS/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=$arch] https://download.docker.com/linux/$OS $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo apt -y install python3-pip
sudo pip3 install docker-compose
sudo apt update -y && sudo apt upgrade -y
sudo docker-compose up -d

#create v2xhub user
cd mysql
./add_v2xhub_user.bash

chromium-browser "https://127.0.0.1" > /dev/null 2>&1 &
chromium-browser "https://127.0.0.1:19760" > /dev/null 2>&1 &
26 changes: 26 additions & 0 deletions docs/Release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
V2X-Hub Release Notes
---------------------------------

Version 7.5.0, released May 5th, 2023
--------------------------------------------------------

**Summary:**
V2X Hub release 7.5.0 is comprised of the following new features: a new ERVCloudForwardingPlugin to enable BSMs from active Emergency Response Vehicles (ERVs) to be forwarded to CARMA Cloud in support of message forwarding to V2X Hub instances along an ERV’s future route when deployed along with other CARMA tools to demonstrate move-over law when an ERV is approaching a CDA vehicle from behind; new features to support CARMA Simulation integration such as simulation clock functionality; and a newly developed CARMA Simulation adaptor shell and handshake functionality to allow multiple V2X Hub instances to connect with a single CARMA Simulation platform. Along with the above enhancements, several enhancements and bug fixes are included in this release.

**<ins>Freight Emergency Response Functionalities</ins>**

Enhancements in this release related to Freight Emergency Response:

- PR 460: The creation of a new ERVCloudForwardingPlugin that enables V2X Hub to register a connected RSU, along with its location information, with CARMA Cloud. Additionally, this plugin is responsible for sending received BSMs from active Emergency Response Vehicles (ERVs) to CARMA Cloud in support of message forwarding to V2X Hub instances located along the ERV’s future route.

**<ins>Other</ins>**

Enhancements in this release:

- Issue 262: Updated CARMA Streets plugin to receive and decode Mobility Path messages into JSON through Kafka.
- PR 486: Updated the V2X Hub docker images to Ubuntu 22 (Jammy) which has LTS support through April 2027. This will also support new libraries created using the Carma-builds project.
- PR 487: Added some changes to allow for Docker to be installed on different Linux distros for arm64.

Fixes in this release:

- Issue 484: Fixed PedestrianPlugin does not update when any configuration changes are made with in Plugin, either when plugin is off or on.
- PR 494: Sets some error message in the Command Plugin for file upload operations to ERROR instead of DEBUG so they can be seen on the command line by default.

Version 7.4.0, released Feb 10th, 2023
--------------------------------------------------------

Expand Down
15 changes: 9 additions & 6 deletions ext/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
# exit on errors
set -e

# Find number of cores available
numCPU=$(nproc)

# An OPENAPI based Qt webservice is needed by the plugins for http requests processing. A custom generated code using OPENAPI framework is located in GitHub.
pushd /tmp
QHTTPENGINE_VERSION=1.0.1
wget -O qhttpengine-${QHTTPENGINE_VERSION}.tar.gz https://github.com/nitroshare/qhttpengine/archive/refs/tags/${QHTTPENGINE_VERSION}.tar.gz
tar xvf qhttpengine-${QHTTPENGINE_VERSION}.tar.gz
cd qhttpengine-${QHTTPENGINE_VERSION}/
cmake .
make
make -j${numCPU}
make install
popd

Expand All @@ -20,7 +23,7 @@ wget -O date-${DATELIB_VERSION}.tar.gz https://github.com/HowardHinnant/date/arc
tar xvf date-${DATELIB_VERSION}.tar.gz
cd date-${DATELIB_VERSION}/
cmake .
make
make -j${numCPU}
make install
popd

Expand All @@ -29,19 +32,19 @@ ldconfig
# Server for the Qt webservice
pushd server
cmake .
make
make -j${numCPU}
make install
popd

pushd ccserver
cmake .
make
make -j${numCPU}
make install
popd

pushd pdclient
cmake .
make
make -j${numCPU}
make install
popd

Expand All @@ -50,6 +53,6 @@ pushd /tmp
git clone https://github.com/ckgt/NemaTode.git
cd NemaTode
cmake .
make
make -j${numCPU}
make install
popd
4 changes: 3 additions & 1 deletion scripts/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ DEPENDENCIES="build-essential \
cmake \
git \
libboost-all-dev \
libcpprest-dev \
libcurl4-openssl-dev \
libev-dev \
libgps-dev \
Expand Down Expand Up @@ -42,9 +41,12 @@ LIBRARY_DEPENDENCIES=" \
# install all things needed for deployment, always done
apt-get install -y $DEPENDENCIES ${LIBRARY_DEPENDENCIES}

numCPU=$(nproc)

# install gtest
cd /usr/src/googletest/
mkdir -p build/
cd build
cmake ..
make -j${numCPU}
make install
5 changes: 4 additions & 1 deletion src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ set -e
# script executes all tmx and v2i build and coverage steps so that they can be singularly
# wrapped by the sonarcloud build-wrapper

numCPU=$(nproc)

RELEASE_BUILD=0
if [ "$1" = "release" ]; then
RELEASE_BUILD=1
Expand All @@ -36,14 +38,15 @@ fi
pushd tmx
cmake -Bbuild -DCMAKE_PREFIX_PATH=\"/usr/local/share/tmx\;\/opt/carma/cmake\;\" -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" .
pushd build
make
make -j${numCPU}
make install
popd
popd

pushd v2i-hub
cmake -Bbuild -DCMAKE_PREFIX_PATH=\"/usr/local/share/tmx\;\/opt/carma/cmake\;\" -DqserverPedestrian_DIR=/usr/local/share/qserverPedestrian/cmake -Dv2xhubWebAPI_DIR=/usr/local/share/v2xhubWebAPI/cmake/ -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" .
pushd build
make -j${numCPU}
make install
popd
popd
4 changes: 2 additions & 2 deletions src/tmx/TmxApi/tmx/IvpMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ typedef unsigned int IvpMsgFlags;
#define IvpMsgFlags_RouteDSRC 0x01

typedef struct IvpDsrcMetadata {
int channel;
int psid;
int channel;
} IvpDsrcMetadata;

typedef struct IvpMessage {
Expand Down Expand Up @@ -64,7 +64,7 @@ typedef enum {
*/
IvpMessage *ivpMsg_create(const char *type, const char *subtype, const char *encoding, IvpMsgFlags flags, cJSON *payload);

IvpMessage *ivpMsg_addDsrcMetadata(IvpMessage *msg, int channel, int psid);
IvpMessage *ivpMsg_addDsrcMetadata(IvpMessage *msg, int psid, int channel);

/*!
* Creates a new IvpMessage from a json string.
Expand Down
51 changes: 50 additions & 1 deletion src/tmx/TmxApi/tmx/TmxApiMessages.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,56 @@ static CONSTEXPR const char *STATUS_STARTED_STRING = "Started, waiting for conne
static CONSTEXPR const char *STATUS_RUNNING_STRING = "Running";
static CONSTEXPR const char *STATUS_STALE_STRING = "Connection going stale";
static CONSTEXPR const char *STATUS_STOPPED_STRING = "Stopped / Disconnected";


enum msgPSID
{
None_PSID = 0x00,
mapData_PSID = 0x8002,
signalPhaseAndTimingMessage_PSID = 0x8002,
basicSafetyMessage_PSID = 0x20,
commonSafetyRequest_PSID = 0x20,
emergencyVehicleAlert_PSID = 0x8005,
intersectionCollision_PSID = 0x8002,
nmeaCorrections_PSID = 0x8000,
probeDataManagement_PSID = 0x8004,
probeVehicleData_PSID = 0x8004,
roadSideAlert_PSID = 0x8003,
rtcmCorrections_PSID = 0x8000,
signalRequestMessage_PSID = 0xE0000016,
signalStatusMessage_PSID = 0x8002,
travelerInformation_PSID = 0x8003,
personalSafetyMessage_PSID = 0x27,
testMessage00_PSID = 0xBFEE,
testMessage01_PSID = 0xBFEE,
testMessage02_PSID = 0xBFEE,
testMessage03_PSID = 0xBFEE,
testMessage04_PSID = 0x8003,
testMessage05_PSID = 0x8003
};

static CONSTEXPR const char *MSGPSID_NONE_PSID_STRING = "None";
static CONSTEXPR const char *MSGPSID_MAPDATA_PSID_STRING = "0x8002";
static CONSTEXPR const char *MSGPSID_SIGNALPHASEANDTIMINGMESSAGE_PSID_STRING = "0x8002";
static CONSTEXPR const char *MSGPSID_BASICSAFETYMESSAGE_PSID_STRING = "0x20";
static CONSTEXPR const char *MSGPSID_COMMONSAFETYREQUEST_PSID_STRING = "0x20";
static CONSTEXPR const char *MSGPSID_EMERGENCYVEHICLEALERT_PSID_STRING = "0x8005";
static CONSTEXPR const char *MSGPSID_INTERSECTIONCOLLISION_PSID_STRING = "0x8002";
static CONSTEXPR const char *MSGPSID_NMEACORRECTIONS_PSID_STRING = "0x8000";
static CONSTEXPR const char *MSGPSID_PROBEDATAMANAGEMENT_PSID_STRING = "0x8004";
static CONSTEXPR const char *MSGPSID_PROBEVEHICLEDATA_PSID_STRING = "0x8004";
static CONSTEXPR const char *MSGPSID_ROADSIDEALERT_PSID_STRING = "0x8003";
static CONSTEXPR const char *MSGPSID_RTCMCORRECTIONS_PSID_STRING = "0x8000";
static CONSTEXPR const char *MSGPSID_SIGNALREQUESTMESSAGE_PSID_STRING = "0xE0000016";
static CONSTEXPR const char *MSGPSID_SIGNALSTATUSMESSAGE_PSID_STRING = "0x8002";
static CONSTEXPR const char *MSGPSID_TRAVELERINFORMATION_PSID_STRING = "0x8003";
static CONSTEXPR const char *MSGPSID_PERSONALSAFETYMESSAGE_PSID_STRING = "0x27";
static CONSTEXPR const char *MSGPSID_TESTMESSAGE00_PSID_STRING = "0xBFEE";
static CONSTEXPR const char *MSGPSID_TESTMESSAGE01_PSID_STRING = "0xBFEE";
static CONSTEXPR const char *MSGPSID_TESTMESSAGE02_PSID_STRING = "0xBFEE";
static CONSTEXPR const char *MSGPSID_TESTMESSAGE03_PSID_STRING = "0xBFEE";
static CONSTEXPR const char *MSGPSID_TESTMESSAGE04_PSID_STRING = "0x8003";
static CONSTEXPR const char *MSGPSID_TESTMESSAGE05_PSID_STRING = "0x8003";

} /* End namespace api */

} /* End namespace messages */
Expand Down
4 changes: 2 additions & 2 deletions src/v2i-hub/CARMACloudPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( CARMACloudPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( CARMACloudPlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME "CARMACloud")
add_compile_options(-fPIC)
Expand Down Expand Up @@ -30,7 +30,7 @@ BuildTmxPlugin ()

TARGET_INCLUDE_DIRECTORIES ( ${PROJECT_NAME} PUBLIC ${XercesC_INCLUDE_DIRS} ${NETSNMP_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS})

TARGET_LINK_LIBRARIES ( ${PROJECT_NAME} PUBLIC tmxutils ${XercesC_LIBRARY} ${NETSNMP_LIBRARIES} ${QHttpEngine_LIBRARY} ${Boost_SYSTEM_LIBRARY} ZLIB::ZLIB curl cpprest Qt5Widgets Qt5Core Qt5Network ssl crypto qhttpengine v2xhubWebAPI)
TARGET_LINK_LIBRARIES ( ${PROJECT_NAME} PUBLIC tmxutils ${XercesC_LIBRARY} ${NETSNMP_LIBRARIES} ${QHttpEngine_LIBRARY} ${Boost_SYSTEM_LIBRARY} ZLIB::ZLIB curl Qt5Widgets Qt5Core Qt5Network ssl crypto qhttpengine v2xhubWebAPI)


link_directories(${CMAKE_PREFIX_PATH}/lib)
4 changes: 2 additions & 2 deletions src/v2i-hub/CARMAStreetsPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( CARMAStreetsPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( CARMAStreetsPlugin VERSION 7.5.0 LANGUAGES CXX )

BuildTmxPlugin ( )

Expand All @@ -9,7 +9,7 @@ TARGET_LINK_LIBRARIES (${PROJECT_NAME} tmxutils rdkafka++ jsoncpp)
#############
enable_testing()
include_directories(${PROJECT_SOURCE_DIR}/src)
add_library(${PROJECT_NAME}_lib src/J2735MapToJsonConverter.cpp src/JsonToJ2735SpatConverter.cpp src/J2735ToSRMJsonConverter.cpp)
add_library(${PROJECT_NAME}_lib src/J2735MapToJsonConverter.cpp src/JsonToJ2735SSMConverter.cpp src/JsonToJ2735SpatConverter.cpp src/J2735ToSRMJsonConverter.cpp)
target_link_libraries(${PROJECT_NAME}_lib PUBLIC ${TMXAPI_LIBRARIES}
${ASN_J2735_LIBRARIES}
${MYSQL_LIBRARIES}
Expand Down
Loading

0 comments on commit 8064841

Please sign in to comment.