Vehcr is platfom SaaS to help productivity in manufacturing through Technology
Running in Kubernetes Engine, it can be cloud or on premises.
Vechr (Manufacturing Execution System). This is Under Vechr.
The concep of this application is use UNS (Unified Namespace) as big node of the data.
Unified Namespace is an extended event-driven architecture, in which all data gets published regardless of whether there is an actual consumer or not. We leverages MQTT/NATS as a central message broker.
If we compare with ISA-95, the data will flow from the Bottom (PLC) to the until Upper (Cloud), this is industry 3.0, In Industry 3.0 setups the general dataflow would be somewhat linear and would only flow in one direction: From the sensors to the PLC to SCADA and MES to the ERP. With a unified this would be much more connected, so if we compare with UNS, (ERP, SCADA, etc) we can say node and node will publish and consume the data from UNS system, so this will achieve integration more easy.
Before pulling you'll need to all access for submodule repository.
Download or Import root certificate or you can generate by your self, be aware that you need to create for ./certificate/self-signed/ingress and ./certificate/self-signed/nats as well. Import in our browser or OS so we will have secure connection https
If you don't now how to generate your own certificate, you can try to follow this tutorial
Here are some article how to import the certificate:
In MAC
In Chrome
git clone --recursive https://github.com/vechr/vechr-iiot.git
Edit .env
file, configure APP_LISTS
, this line will decided what are the list of container that you'll run.
APP_LISTS=api-gateway,redis,grafana,tempo,loki,promtail,prometheus,notification-service,mail-dev,web-app,postgres-db,pg-admin4,things-service,auth-service,db-logger-service,influxdb,nats-server,mosquitto,nats-box
IMPORTANT NOTE!!: If you run on windows please checkout documentation, because some of bash script is doesn't work, or you might be want to access using kubernetes please checkout this page
You need to setup the .env variable file, and see in each application have .env.example
application/web-app/.env
<== Seeapplication/web-app/.env.example
microservices/auth-service/.env
<== Seemicroservices/auth-service/.env.example
microservices/db-logger-service/.env
<== Seemicroservices/db-logger-service/.env.example
microservices/notification-service/.env
<== Seemicroservices/notification-service/.env.example
microservices/things-service/.env
<== Seemicroservices/things-service/.env.example
.env
<==.env.example
Script must be have an access before executing
chmod 777 scripts/
chmod 777 ./dockerfiles/database/postgres/create-multiple-db.sh
Running all container
./up.sh
Try to ping the connection, if cannot be access, you need to settings the hosts files
ping app.vechr.com
ping nats.vechr.com
In MAC or Linux, and set /etc/hosts
, if your environment windows setting in C:\Windows\System32\drivers\etc\hosts
127.0.0.1 app.vechr.com
127.0.0.1 nats.vechr.com
You can try to access the application, you can visit the app in here https://app.vechr.com
./up.sh
./down.sh
#example
./logs.sh influxdb
#example
./ssh.sh nats-box
Open 4 terminal, and run each command below
This command will listen on topic NATS/MQTT/Test/#
mqtt
# ssh to container
./ssh.sh "mosquitto"
# Subscribe message
/scripts/mqtt-sub.sh
# or using this instead mqtt-sub.sh
mosquitto_sub -h nats-server -p 1883 -t "NATS/MQTT/Test/#"
This command will listen on subject NATS.MQTT.Test/>
nats
# ssh to container
./ssh.sh "nats-box"
# Subscribe message
nats -s nats://nats-server sub "NATS.MQTT.Test.>"
You can execute this command several time
# ssh to container
./ssh.sh "nats-box"
# Publish message
nats -s nats://nats-server pub "NATS.MQTT.Test.>" "This is message from nats"
You can execute this script several time
# ssh to container
./ssh.sh "mosquitto"
# Publish message
/scripts/mqtt-pub.sh
#or using this instead mqtt-pub.sh
mosquitto_pub -h nats-server -p 1883 -t "NATS/MQTT/Test/" -m "This is message from mqtt"
Please use this topic format to store in database
Vechr/DashboardID/<Your Dashboard ID>/DeviceID/<Your Device ID>/topic/<Your Topic Name>
mosquitto_pub -h nats-server -p 1883 -t "Vechr/DashboardID/87jk234/DeviceID/9jk2b2189/topic/temp" -m "80.23"
while true; do nats pub -s nats://nats.vechr.com:4222 Vechr.DashboardID.04916c8e-0ff5-4a18-943a-bf5e428035c2.DeviceID.c1e241db-3d93-4eb5-a58d-c6b2a57c9ae3.TopicID.bde3bd17-dd97-46b2-990f-eca2fc80f356.Topic.oee.availability $(($RANDOM%(100-80+1)+80)) && sleep 0.5; done