MiningOS Logo
Install MiningOSPowermeters

ABB Powermeter

ABB worker supports multiple ABB powermeter models B23, B24, M1M20, M4M20, REU615 via Modbus TCP.

Install the ABB Powermeter

1. Clone the Repository

Use the same working directory for all the workers.

Inside your working directory, run the following command to clone the (miningos-wrk-powermeter-abb) repository:

git clone https://github.com/tetherto/miningos-wrk-powermeter-abb.git

After cloning the repository, move into its directory:

cd miningos-wrk-powermeter-abb

2. Install Dependencies

Inside the miningos-wrk-powermeter-abb directory, run the following command to install dependencies using npm:

npm ci

3. Generate Configuration Files

Next, run the following script to scan the config/ directory, copy each .example file into an active configuration file by removing the .example suffix.

sh setup-config.sh

4. Configure the Worker

After generating the configuration files, edit the files in the config/ directory to match your environment:

  • common.json - Worker-wide settings including worker identity
  • base.thing.json - Device-specific configuration for your ABB powermeters

5. Enable Debugging and Start the Workers

You can now start the workers by running the following commands:

# B23
DEBUG="miningos:*" pm2 -s start worker.js --name 'b23-1' -- --wtype wrk-powermeter-rack-b23 --env development --rack rack-1

# B24
DEBUG="miningos:*" pm2 -s start worker.js --name 'b24-2' -- --wtype wrk-powermeter-rack-b24 --env development --rack rack-2

# M1M20
DEBUG="miningos:*" pm2 -s start worker.js --name 'm1m20-3' -- --wtype wrk-powermeter-rack-m1m20 --env development --rack rack-3

# M4M20
DEBUG="miningos:*" pm2 -s start worker.js --name 'm4m20-4' -- --wtype wrk-powermeter-rack-m4m20 --env development --rack rack-4

# REU615
DEBUG="miningos:*" pm2 -s start worker.js --name 'reu615-5' -- --wtype wrk-powermeter-rack-reu615 --env development --rack rack-5

6. Start Mock Servers (Development Only)

For development and testing without physical powermeters, use mock servers to simulate ABB devices:

# B23 mock
DEBUG="miningos:*" pm2 -s start mock/server.js --name 'mock-b23-1' -- --type B23 --env development --port 4020

# B24 mock
DEBUG="miningos:*" pm2 -s start mock/server.js --name 'mock-b24-2' -- --type B24 --env development --port 4021

# M1M20 mock
DEBUG="miningos:*" pm2 -s start mock/server.js --name 'mock-m1m20-3' -- --type M1M20 --env development --port 4022

# M4M20 mock
DEBUG="miningos:*" pm2 -s start mock/server.js --name 'mock-m4m20-4' -- --type M4M20 --env development --port 4023

# REU615 mock
DEBUG="miningos:*" pm2 -s start mock/server.js --name 'mock-reu615-5' -- --type REU615 --env development --port 4024

Mock servers are useful for testing the worker without connecting to actual powermeter hardware.

On this page