Skip to content

MMS Setup

FreeBSD client configuration for MBSystemManager

You can install MBMMS by using a package or you can also install it manual.
After MBMMS is installed please check the configuration and customize it to your needs.

Installation using FreeBSD package

The package includes the latest version of MMS Startup Tool and it enables the auto start.
Copy the package file from D:\Tools\MBMMS\Beckhoff_Install\mbmmsstartup-3.15.30.0.pkg to location /etc/pkg on Beckhoff CPU.

Note

Alternative path

\\RO-FILEDAT1-SRV\Automation\DSRP\Software-Eng\Machine Setup\1ClickInstall\Windows_NEW\Setup\Source\[MinimalTemplate]\Tools\MBMMS\Beckhoff_Install\FreeBSD\

File:

mbmmsstartup-< version number >.pkg

WinSCP

Install WinSCP on master PC. Open WinSCP->New Session. Edit the following entries:

File protocol : SFTP
Hostname : Administrator@192.168.201.2
Port number : 22

Under Advanced->Enviroment->SFTP edit SFTP server:

doas /usr/libexec/sftp-server

Copy package mbmmsstartup-< version number >.pkg to path "/etc/pkg".

Then install package with:

doas pkg add ./mbmmsstartup-1.4.pkg

Output should look like this:

Administrator@PC-699363:~ $ doas pkg add ./mbmmsstartup-< version number >.pkg
Password:
Installing mbmmsstartup-1.4...
Extracting mbmmsstartup-1.4: 100%
set rights
activate startup script
MBStart enabled in /etc/rc.conf
pkg: Fail to kill all processes:No such process

Create StartUp Script

The scrip should be copied by default if installed from package. If not create file:

doas ee /usr/local/etc/rc.d/MBStart

Copy the following content:

#!/bin/sh
# SPDX-License-Identifier: MIT
# Copyright (C) Muehlbauer GmbH & Co. KG Author: Vinzenz Petr

# PROVIDE: MBStart
# REQUIRE: DAEMON networking IPCDiagnostics TcSystemService CXID bwf nginx sshd
# KEYWORD: nojail shutdown

. /etc/rc.subr

name="MBStart"
rcvar="${name}_enable"

#executable
command="/home/Administrator/MMS/StartUp.sh"
pidfile="/var/run/${name}.pid"
#working directory todo
MBStart_chdir="/home/Administrator/MMS/"

start_precmd="${name}_prestart"
stop_postcmd="${name}_poststop"
stop_cmd="${name}_stop"

MBStart_prestart() {
        rc_flags="-p ${pidfile} ${rc_flags}"
}

MBStart_poststop() {
        rm -f "$pidfile"
}

MBStart_stop() {
        pkill -QUIT -f "$pidfile"
        pwait $(cat ${pidfile})
}

load_rc_config $name
: ${MBStart_enable:=no}
run_rc_command "$1"

Make the file runnable with following command:

doas chmod +x /usr/local/etc/rc.d/MBStart

Test the Script Manually

You can test the script without rebooting. Type in following command:

doas /usr/local/etc/rc.d/MBStart onestart

Note

In case you get an error saying "libuastack.so" is missing or similiar, you need to add the mentioned file to /lib.
doas mv <path to the file> /lib/libuastack.so

Disable and Enable the Script

When everything works you can switch that script on and off with these commands:

doas /usr/local/etc/rc.d/MBStart enable
doas /usr/local/etc/rc.d/MBStart disable

Activate the Script

When the command to enable the script is performed, it will do the following steps automatically. So this step is just necessary for troubleshooting. Open the file /etc/rc.conf with command:
doas ee /etc/rc.conf

and add following line:

MBStart_enable="YES"

Configuration

The configuration of the Startup Tool you can find in /usr/home/Administrator/MMS/M2KSys.ini. Please check if these settings are fitting to your needs.</p>
[MachineManagerService]
Debug = false                       ;switch on debug logs (ILOGs)

IsMachineClient = false             ;it's NOT a machine client - means service is a standalone tool
ShutDownAfterUpdate = true          ;close tool after downloading all files and start up real machine software

ClientType = 1                      ;type of client - must match to configured directory on host pc !!!
ClientId = 1                        ;id of client - must match to configured directory on host pc !!!

RemoteAddress = 192.168.201.1       ;ip of service host
UdpPort = 1981
TcpPort = 10020                     ;requested tcp port - only neccessarry to change if you have more than one client
TcpPortSec = 5000


TargetDir = /Machine/       ;temp. folder on beckhoff - should be on ram disk

ClientType

defines the machine type which is configured in MBMMS

ClientId

defines the client id, if you have more than one client connected to MBMMS

RemoteAddress

IP address of host system, where MBMMS is installed, mostly this is the Master PC (GUI PC)

TcpPort

requested tcp port for communication between MBMMS and machine application It is only necessary to change when you have more than one client connected to MBMMS

TcpPortSec

Requested ProcessLogger Port for machine application. This must be the same as in your applications Params.ini. It is only necessary to change when you have more than one client connected to MBMMS

Note

If you are having the following problem : MachineManagerService:CheckFilesExists: Can not open file! try to change in M2kSys.ini of the machine sofware app TargetDir = ./