Develop C++ application for mining loader's on-board computer.
On-board computer is ARM-based embedded PC running Linux, it have WLAN adapter and CAN connection to loader's ECU.
Signals are engine and hydraulics measurements:
- Engine RPM
- Engine Coolant temperature
- Engine Oil Temperature
- Engine Oil Pressure
- Hydraulic Oil Temperature
- Hydraulic Oil Pressure
Data is production measurements:
- Scoop bucket load weight
- Bucket dump timestamp
Signals and data should be collected by application and stored in SQLite database.
Trigger for data upload is configured minimal size of data packet and matched DDS subscriber.
Data is transmitted over DDS to logging server from which it will be forwarded using MQTT to cloud-based backend application.
Logging server could be built around NanoMQ MQTT Broker with DDS proxy
ECU mock will be sending randomly changing values with configured period over vcan interface.
Production data is generated by mock of bucket scales - it will send weight of unloaded rock at random intervals over CAN.
vcan setup:
sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ifconfig vcan0 up
can_logger application is mocking on-board computer app, it uses sqlite in-memory database for signals buffering.
install sqlite:
sudo apt-get install libsqlite3-dev
install FastDDS locally:
Process is complicated, proceed per FastDDS documentation
To build all parts, check out repository and run
export LD_LIBRARY_PATH=~/Fast-DDS/install/lib
cmake .
make
running:
in one terminal - ./ecu_mock
in another terminal - ./scales_mock
in yet another terminal - ./can_logger (you may need to do export LD_LIBRARY_PATH=~/Fast-DDS/install/lib once in this terminal)
can_logger will print received measurements.
If there is DDS subscriber to CanLoggerTopic then it will print "Sending data.." every 100 measurements.
DDS subscriber not included in this repository.