pimodbus-master.service failed

Topics about the Software of Revolution Pi
RMeissnerCC
Posts: 58
Joined: 03 Dec 2019, 10:29
Answers: 0

pimodbus-master.service failed

Post by RMeissnerCC »

Dear all,
we are using the virtual modbus RTU master with a RevPi Core 3+. I have three different modbus devices. One of them has failed like two or three times in the past. As far as I can see it so far, if a modbus device is not reacting anymore, i.e., the slave address is not responding, the modbus RTU master will not start.

To get around this problem I though about changing the configuration of pictory automatically. That has worked okayish, in so far as I can run my script which changes the config, reboot, and then the modbus master works as intended.

However, I have to reboot, which is annoying. I noticed the following lines in the journalctl:

"Feb 20 17:02:10 RevPiXXXXX piModbusMaster[1093]: No modbus actions for device
Feb 20 17:02:10 RevPiXXXXX piModbusMaster[1093]: Scheduler initialization failed
Feb 20 17:02:10 RevPiXXXXX piModbusMaster[1093]: *** Error in `/usr/sbin/piModbusMaster': double free or corruption (out): 0x764004a0 ***
Feb 20 17:02:10 RevPiXXXXX systemd[1]: pimodbus-master.service: Main process exited, code=killed, status=6/ABRT
Feb 20 17:02:10 RevPiXXXXX systemd[1]: pimodbus-master.service: Unit entered failed state.
Feb 20 17:02:10 RevPiXXXXX systemd[1]: pimodbus-master.service: Failed with result 'signal'.
"

I understand that the pimodbus-master.service crashed. Is there a way of restarting that? Is the service configured to restart only upon boot? Where are the service files so I can change them to restart upon crash?

As our system has to be resilient, I need to be able to control that modbus master completely, otherwise in the worst case our system is useless until a technician arrives.

Best, Robert
RMeissnerCC
Posts: 58
Joined: 03 Dec 2019, 10:29
Answers: 0

Re: pimodbus-master.service failed

Post by RMeissnerCC »

I found some first hints. The service is located in
"/lib/systemd/system/"

It is not restarting upon failure, so I added

"Restart=on-failure"

to "Service".

The question still remains: is that okay? What should I look out for?

What do these error messages tell me? What triggered that error?
User avatar
dirk
KUNBUS
Posts: 1926
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: pimodbus-master.service failed

Post by dirk »

Hi Robert, thank you for your good feedback. We are analyzing this issue.
User avatar
lukas
Expert
Posts: 186
Joined: 13 Feb 2017, 10:29
Answers: 0

Re: pimodbus-master.service failed

Post by lukas »

RMeissnerCC wrote: 27 May 2020, 15:38 I found some first hints. The service is located in
"/lib/systemd/system/"
It is not restarting upon failure, so I added
"Restart=on-failure"
to "Service".
I guess that makes sense, so I've added it to the service files of both piModbusMaster and piModbusSlave. This change will be in the next version of their corresponding deb-packages.

My colleague Amar will look into the crash you've reported above. Could you provide us with steps to reproduce the crash? (And possibly the config.rsc?) Thanks!
RMeissnerCC
Posts: 58
Joined: 03 Dec 2019, 10:29
Answers: 0

Re: pimodbus-master.service failed

Post by RMeissnerCC »

Dear Lukas,
great to hear that I have been of help.

Regarding the crash. Basically what I do is, I unplug the device. We have had the case twice that the same device would just stop communicating. To simulate that, I unplugged the device and thought of strategies on how to fix the problem, e.g., by changing the configuration by code, which was created in piCtory.

If you still prefer, I can get the example config.rsc.

Best, Robert
Amar
KUNBUS
Posts: 157
Joined: 15 Jul 2019, 12:58
Answers: 4

Re: pimodbus-master.service failed

Post by Amar »

Hello Robert,
When any of your three different modbus devices fails do you change your config.rsc?

piModbusMaster also reads the config.rsc file for getting modbus configuration.The error which you had posted in beginning of the post appears to originate from here.
"Feb 20 17:02:10 RevPiXXXXX piModbusMaster[1093]: No modbus actions for device

As earlier discussed modbus master can be completely controlled with systemctl start/stop/restart command for pimodbus-master.service
However I could not produce the crash occurring at your side.Could you send the config.rsc and specific changes from your script in config.rsc ?
Regards,
Amar
KUNBUS
User avatar
dirk
KUNBUS
Posts: 1926
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: pimodbus-master.service failed

Post by dirk »

Robert, could you be so kind to send us your PiCtory configuration? File /etc/revpi/config.rsc
It should work that you zip it and post it here. Alternatively you may send an email to support@kunbus.com
User avatar
dirk
KUNBUS
Posts: 1926
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: pimodbus-master.service failed

Post by dirk »

Hello Robert, how is it going? Could you be so kind to provide the data?
User avatar
dirk
KUNBUS
Posts: 1926
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: pimodbus-master.service failed

Post by dirk »

Hello Robert, how is it going? Can you give us your precious feedback?
RMeissnerCC
Posts: 58
Joined: 03 Dec 2019, 10:29
Answers: 0

Re: pimodbus-master.service failed

Post by RMeissnerCC »

Dear Dirk,
I sincerely apologize for not writing to you earlier, I was out of the office.
Since the problem is now a few weeks past I do not have the config file from back then anymore BUT the one I attached is as close to the time then as possible. Does this help you?
Best, Robert
Attachments
_config.zip
(3.06 KiB) Downloaded 422 times
Post Reply