-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service Failed to start #56
Comments
Did it work when started manually from the command line? If not, please start it with |
Hello Victor,
I'd like to say thank you for taking time to answer my query, appreciate for that. Per you question, the mbusd service failed to start at boot time as console displayed messages. To double check I run:
sudo systemctl status mbusd@ttyUSB0.service
and get this:
mbusd@ttyUSB0.service - Modbus TCP to Modbus RTU (RS-232/485) gateway.
Loaded: loaded (/lib/systemd/system/mbusd@.service; enabled; vendor preset: e
Active: failed (Result: exit-code) since Tue 2020-04-14 14:58:57 BST; 5h 51mi
Process: 349 ExecStart=/usr/local/bin/mbusd -d -v2 -L - -c /usr/local/etc/mbus
Main PID: 349 (code=exited, status=255/EXCEPTION)
Apr 14 14:58:57 raspberrypi systemd[1]: mbusd@ttyUSB0.service: Service RestartSe
Apr 14 14:58:57 raspberrypi systemd[1]: mbusd@ttyUSB0.service: Scheduled restart
Apr 14 14:58:57 raspberrypi systemd[1]: Stopped Modbus TCP to Modbus RTU (RS-232
Apr 14 14:58:57 raspberrypi systemd[1]: mbusd@ttyUSB0.service: Start request rep
Apr 14 14:58:57 raspberrypi systemd[1]: mbusd@ttyUSB0.service: Failed with resul
Apr 14 14:58:57 raspberrypi systemd[1]: Failed to start Modbus TCP to Modbus RTU
so I run:
sudo systemctl stop mbusd@ttyUSB0.service
sudo systemctl start mbusd@ttyUSB0.service
sudo systemctl status mbusd@ttyUSB0.service
then got this
● mbusd@ttyUSB0.service - Modbus TCP to Modbus RTU (RS-232/485) gateway.
Loaded: loaded (/lib/systemd/system/mbusd@.service; enabled; vendor preset: e
Active: activating (auto-restart) (Result: exit-code) since Tue 2020-04-14 20
Process: 541 ExecStart=/usr/local/bin/mbusd -d -v2 -L - -c /usr/local/etc/mbus
Main PID: 541 (code=exited, status=255/EXCEPTION)
which indicated that it's working.
then I run this
sudo mbusd -L/tmp/mbusd.log /dev/ttyUSB0 -s 38400 -P 502 -d -v9
but here is the log
14 Apr 2020 21:33:29 mbusd-0.4.1 started...
14 Apr 2020 21:33:29 conn_init(): can't open tty device /dev/ttyS0 (No such file or directory)
14 Apr 2020 21:33:29 conn_init() failed, exiting...
14 Apr 2020 21:34:10 mbusd-0.4.1 started...
14 Apr 2020 21:34:10 conn_init(): can't open tty device /dev/ttyS0 (No such file or directory)
14 Apr 2020 21:34:10 conn_init() failed, exiting...
14 Apr 2020 21:36:23 mbusd-0.4.1 started...
14 Apr 2020 21:36:23 conn_init(): can't open tty device /dev/ttyS0 (No such file or directory)
14 Apr 2020 21:36:23 conn_init() failed, exiting...
14 Apr 2020 21:36:31 mbusd-0.4.1 started...
14 Apr 2020 21:36:31 conn_init(): can't open tty device /dev/ttyS0 (No such file or directory)
14 Apr 2020 21:36:31 conn_init() failed, exiting...
14 Apr 2020 21:39:32 mbusd-0.4.1 started...
14 Apr 2020 21:39:32 conn_init(): can't open tty device /dev/ttyS0 (No such file or directory)
14 Apr 2020 21:39:32 conn_init() failed, exiting...
Here is my config file
#############################################
# #
# Sample configuration file for mbusd #
# #
#############################################
########## Serial port settings #############
# Serial port device name
device = /dev/ttyUSB0
# Serial port speed
speed = 38400
# Serial port mode
mode = 8n1
# RS-485 data direction control type (addc, rts, sysfs_0, sysfs_1)
trx_control = rts
# Sysfs file to use to control data direction
# trx_sysfile =
############# TCP port settings #############
# TCP server address to bind
address = 192.168.1.238
# TCP server port number
port = 502
# Maximum number of simultaneous TCP connections
maxconn = 32
# Connection timeout value in seconds
timeout = 60
######### Request/response settings #########
# Maximum number of request retries
retries = 3
# Pause between requests in milliseconds
pause = 250
# Response wait time in milliseconds
wait = 1000
One thing I noticed is my setting for serial port is ttyUSB0 but the log file showed /dev/ttyS0
Please advice. Thanks and have a great day.
Best Regards,
TLN
…________________________________
From: Victor Antonovich <notifications@github.com>
Sent: Tuesday, April 14, 2020 2:12 AM
To: 3cky/mbusd <mbusd@noreply.github.com>
Cc: NGUYEN, Thelam <Thelam_Nguyen@dril-quip.com>; Author <author@noreply.github.com>
Subject: [EXTERNAL] Re: [3cky/mbusd] Service Failed to start (#56)
CAUTION. This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
________________________________
Did it work when started manually from the command line? If not, please start it with -v9 -L/tmp/mbusd.log options and post generated mbusd.log file here.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://protect-us.mimecast.com/s/mSoFCPN6GXCKNBwpHzFKkb?domain=github.com>, or unsubscribe<https://protect-us.mimecast.com/s/oGEMCQWAXZHklnQ0tPJbJ6?domain=github.com>.
This email is intended solely for the person or entity to which it is addressed and may contain confidential and/or privileged information. Copying, forwarding or distributing this message and its attachments by persons or entities other than the intended recipient is prohibited. If you have received this email in error, please notify the sender immediately and delete the material from your computer and other electronic storage/delivery systems.
|
Hello Victor,
I'd like to say thank you for taking time to answer my query, appreciate for that. Per you question, the mbusd service failed to start at boot time as console displayed messages. To double check I run:
sudo systemctl status mbusd@ttyUSB0.service
and get this:
mbusd@ttyUSB0.service - Modbus TCP to Modbus RTU (RS-232/485) gateway.
Loaded: loaded (/lib/systemd/system/mbusd@.service; enabled; vendor preset: e
Active: failed (Result: exit-code) since Tue 2020-04-14 14:58:57 BST; 5h 51mi
Process: 349 ExecStart=/usr/local/bin/mbusd -d -v2 -L - -c /usr/local/etc/mbus
Main PID: 349 (code=exited, status=255/EXCEPTION)
Apr 14 14:58:57 raspberrypi systemd[1]: mbusd@ttyUSB0.service: Service RestartSe
Apr 14 14:58:57 raspberrypi systemd[1]: mbusd@ttyUSB0.service: Scheduled restart
Apr 14 14:58:57 raspberrypi systemd[1]: Stopped Modbus TCP to Modbus RTU (RS-232
Apr 14 14:58:57 raspberrypi systemd[1]: mbusd@ttyUSB0.service: Start request rep
Apr 14 14:58:57 raspberrypi systemd[1]: mbusd@ttyUSB0.service: Failed with resul
Apr 14 14:58:57 raspberrypi systemd[1]: Failed to start Modbus TCP to Modbus RTU
so I run:
sudo systemctl stop mbusd@ttyUSB0.service
sudo systemctl start mbusd@ttyUSB0.service
sudo systemctl status mbusd@ttyUSB0.service
then got this
● mbusd@ttyUSB0.service - Modbus TCP to Modbus RTU (RS-232/485) gateway.
Loaded: loaded (/lib/systemd/system/mbusd@.service; enabled; vendor preset: e
Active: activating (auto-restart) (Result: exit-code) since Tue 2020-04-14 20
Process: 541 ExecStart=/usr/local/bin/mbusd -d -v2 -L - -c /usr/local/etc/mbus
Main PID: 541 (code=exited, status=255/EXCEPTION)
which indicated that it's working.
then I run this
sudo mbusd -L/tmp/mbusd.log /dev/ttyUSB0 -s 38400 -P 502 -d -v9
but here is the log
14 Apr 2020 21:33:29 mbusd-0.4.1 started...
14 Apr 2020 21:33:29 conn_init(): can't open tty device /dev/ttyS0 (No such file or directory)
14 Apr 2020 21:33:29 conn_init() failed, exiting...
14 Apr 2020 21:34:10 mbusd-0.4.1 started...
14 Apr 2020 21:34:10 conn_init(): can't open tty device /dev/ttyS0 (No such file or directory)
14 Apr 2020 21:34:10 conn_init() failed, exiting...
14 Apr 2020 21:36:23 mbusd-0.4.1 started...
14 Apr 2020 21:36:23 conn_init(): can't open tty device /dev/ttyS0 (No such file or directory)
14 Apr 2020 21:36:23 conn_init() failed, exiting...
14 Apr 2020 21:36:31 mbusd-0.4.1 started...
14 Apr 2020 21:36:31 conn_init(): can't open tty device /dev/ttyS0 (No such file or directory)
14 Apr 2020 21:36:31 conn_init() failed, exiting...
14 Apr 2020 21:39:32 mbusd-0.4.1 started...
14 Apr 2020 21:39:32 conn_init(): can't open tty device /dev/ttyS0 (No such file or directory)
14 Apr 2020 21:39:32 conn_init() failed, exiting...
Here is my config file
#############################################
# #
# Sample configuration file for mbusd #
# #
#############################################
########## Serial port settings #############
# Serial port device name
device = /dev/ttyUSB0
# Serial port speed
speed = 38400
# Serial port mode
mode = 8n1
# RS-485 data direction control type (addc, rts, sysfs_0, sysfs_1)
trx_control = rts
# Sysfs file to use to control data direction
# trx_sysfile =
############# TCP port settings #############
# TCP server address to bind
address = 192.168.1.238
# TCP server port number
port = 502
# Maximum number of simultaneous TCP connections
maxconn = 32
# Connection timeout value in seconds
timeout = 60
######### Request/response settings #########
# Maximum number of request retries
retries = 3
# Pause between requests in milliseconds
pause = 250
# Response wait time in milliseconds
wait = 1000
One thing I noticed is my setting for serial port is ttyUSB0 but the log file showed /dev/ttyS0
Please advice. Thanks and have a great day.
Best Regards,
TLN
…________________________________
From: Victor Antonovich <notifications@github.com>
Sent: Tuesday, April 14, 2020 2:12 AM
To: 3cky/mbusd <mbusd@noreply.github.com>
Cc: NGUYEN, Thelam <Thelam_Nguyen@dril-quip.com>; Author <author@noreply.github.com>
Subject: [EXTERNAL] Re: [3cky/mbusd] Service Failed to start (#56)
CAUTION. This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
________________________________
Did it work when started manually from the command line? If not, please start it with -v9 -L/tmp/mbusd.log options and post generated mbusd.log file here.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://protect-us.mimecast.com/s/mSoFCPN6GXCKNBwpHzFKkb?domain=github.com>, or unsubscribe<https://protect-us.mimecast.com/s/oGEMCQWAXZHklnQ0tPJbJ6?domain=github.com>.
This email is intended solely for the person or entity to which it is addressed and may contain confidential and/or privileged information. Copying, forwarding or distributing this message and its attachments by persons or entities other than the intended recipient is prohibited. If you have received this email in error, please notify the sender immediately and delete the material from your computer and other electronic storage/delivery systems.
|
Looks like you forgot to add |
Hello Victor,
Yes, you're right. my command line was missing -p option.
After manually start the service here is the log output
15 Apr 2020 16:51:38 mbusd-0.4.1 started...
15 Apr 2020 16:51:38 tty: state now is TTY_PAUSE
15 Apr 2020 16:51:38 conn_loop(): select(): max_sd = 4, t_out = 000000:100000
15 Apr 2020 16:51:38 conn_loop(): select() returns 0
15 Apr 2020 16:51:38 tty: state now is TTY_READY
15 Apr 2020 16:51:38 conn_loop(): select(): max_sd = 4, t_out = 000060:000000
15 Apr 2020 16:52:16 conn_loop(): select() returns -1
15 Apr 2020 16:52:16 Terminated by signal: SIGINT
As a side note, I'm running your software on raspberry Pi model B.
Is there any hardware constrains that caused this problem with this platform? Thank you for your time.
Best Regards,
TLN
…________________________________
From: Victor Antonovich <notifications@github.com>
Sent: Wednesday, April 15, 2020 4:54 AM
To: 3cky/mbusd <mbusd@noreply.github.com>
Cc: NGUYEN, Thelam <Thelam_Nguyen@dril-quip.com>; Author <author@noreply.github.com>
Subject: [EXTERNAL] Re: [3cky/mbusd] Service Failed to start (#56)
CAUTION. This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
________________________________
sudo mbusd -L/tmp/mbusd.log /dev/ttyUSB0 -s 38400 -P 502 -d -v9
Looks like you forgot to add -p option before device name /dev/ttyUSB0, so mbusd is trying to open wrong serial port.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://protect-us.mimecast.com/s/tls3C68YMLUr09nyspBcQR?domain=github.com>, or unsubscribe<https://protect-us.mimecast.com/s/Z-faC73DMNuAV6OZuWlb38?domain=github.com>.
This email is intended solely for the person or entity to which it is addressed and may contain confidential and/or privileged information. Copying, forwarding or distributing this message and its attachments by persons or entities other than the intended recipient is prohibited. If you have received this email in error, please notify the sender immediately and delete the material from your computer and other electronic storage/delivery systems.
|
Well, the log output looks normal. Did you try to connect to mbusd with a TCP client? If mbusd works when started by hand, I would suspect some problem in your systemd instance config file, like wrong bind address. |
Hello Victor,
Thank you again for your support. I’ve tried connecting the device in the scheme listed below:
[Host PC running ModScan software] <-------> cat5 cable <-------> [Raspberry PI running Mbusd]<-------> [usb2ser converter] <----->[rs232/rs485 converter]<-----> [Real modbus slave device ID:3]
I tried to poll the slave device without success. I know the slave device is working because I can poll it from the host PC via serial link without any problem as shown here:
[Host PC running ModScan software] <--------> [usb2ser converter] <----->[rs232/rs485 converter]<-----> [Real modbus slave device ID:3]
Should I set the IP address of the Pi and my host PC to use static IP addresses?
Best Regards,
TheLam Nguyen
Design Engineer III - Electrical, Subsea Control Systems
Dril-Quip, Inc.
6401 N. Eldridge Pkwy
Houston, Tx 77041
Tel: (713) 939-0047 ext 6488
E-mail: Thelam_Nguyen@dril-quip.com<mailto:Thelam_Nguyen@dril-quip.com>
From: Victor Antonovich <notifications@github.com>
Sent: Friday, April 17, 2020 10:02 AM
To: 3cky/mbusd <mbusd@noreply.github.com>
Cc: NGUYEN, Thelam <Thelam_Nguyen@dril-quip.com>; Author <author@noreply.github.com>
Subject: [EXTERNAL] Re: [3cky/mbusd] Service Failed to start (#56)
CAUTION. This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
…________________________________
Well, the log output looks normal. Did you try to connect to mbusd with a TCP client? If mbusd works when started by hand, I would suspect some problem in your systemd instance config file, like wrong bind address.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://protect-us.mimecast.com/s/97IXCDkwxpt5nKvGcWVmnl?domain=github.com>, or unsubscribe<https://protect-us.mimecast.com/s/TK6eCERKyrt3gJ9XcwXKfg?domain=github.com>.
This email is intended solely for the person or entity to which it is addressed and may contain confidential and/or privileged information. Copying, forwarding or distributing this message and its attachments by persons or entities other than the intended recipient is prohibited. If you have received this email in error, please notify the sender immediately and delete the material from your computer and other electronic storage/delivery systems.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi Victor
I'm trying to use mbusd on my raspberry Pi as a Modbus TCP 2 serial server and every time I reboot the pi it always displayed a message : "Failed to start Modbus TCP to Modbus (RS-232/485) gateway.
Here is output form systemctl
I've noticed the messages saying that:
"Start request repeated too quickly"
"Failed with result 'exit-code'
Please advice on this matter. Thanks
The text was updated successfully, but these errors were encountered: