pimodbus-master.service failed

Topics about the Software of Revolution Pi
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58

Re: pimodbus-master.service failed

Post by Amar »

Hi Nate,
Please carry out following steps:
1) sudo apt-get update
sudo apt-get install libmodbus-dev

2) Check library version
pi@RevPi46563:~ $ dpkg -l | grep libmodbus
ii libmodbus-dev:armhf 3.1.6-2~bpo10+2 armhf development files for the Modbus protocol library
ii libmodbus5:armhf 3.1.6-2~bpo10+2 armhf library for the Modbus protocol

3) Download the provided attachment and replace with given files piModbusMaster & piModbusSlave under directory /usr/sbin/
4) At best reboot system and then check for piModbusMaster log

Attachment:
Modbus.zip
(20.46 KiB) Downloaded 917 times
Regards,
Amar
KUNBUS
Ladam
Posts: 16
Joined: 30 Jul 2019, 09:59

Re: pimodbus-master.service failed

Post by Ladam »

Hi Guys,

i have a similar Issue:
Restart service.PNG
Restart service.PNG (33.55 KiB) Viewed 11920 times
daemon.log.PNG
daemon.log.PNG (116.03 KiB) Viewed 11920 times
This started when i decided to 'sudo apt update' and 'sudo apt install pimodbus-slave pimodbus-master'.

I did all the suggested steps which were mentioned earlier in this thread.
Pictory is working fine i guess, i had no issues with the configuration there.
The Modbus RTU Connection was working earlier, but sometimes failed without changing anything with the devices or the wiring, so i decided to update. Since then i wasnt able to restart the piModbusMaster service.

Any suggestions on how to fix this error?

Thanks in advance and best regards,
Luke
ChrisDeveloper
Posts: 27
Joined: 03 Mar 2020, 00:58

Re: pimodbus-master.service failed

Post by ChrisDeveloper »

Hi Kunbus,

I upgraded pictory from 1.4.2 to 1.4.7 on a kunbus connects +32gb are got the same "pimodbus-master.service failed" in systemd.

Its happened on 2 kunbus devices.

It seems to happen when adding a modbus register to the 'extended data' on a Modbus Master RTU device.

OS details are:
Linux RevPi100304 4.19.95-rt38-v7 #1 SMP PREEMPT RT Wed, 19 May 2021 09:16:34 +0000 armv7l GNU/Linux

Please help! My HVAC controller is not working!

Thank you.
Chris
User avatar
dirk
KUNBUS
Posts: 2174
Joined: 15 Dec 2016, 13:19

Re: pimodbus-master.service failed

Post by dirk »

Hi please check if you have updated the packages "pictory" and the "pimodbus..." packages for master and slave.
Here you can see the versions on a Buster system with the latest packages.

Code: Select all

pi@RevPi35745:~ $ apt search pictory
Sorting... Done
Full Text Search... Done
pictory/buster,now 2.0.3 all [installed]
  Revolution Pi Configurator
  
pi@RevPi35745:~ $ apt search pimodbus
Sorting... Done
Full Text Search... Done
pimodbus-master/buster,now 1.0.8-2 armhf [installed]
  Revolution Pi Modbus master

pimodbus-master-dbgsym/buster 1.0.8-2 armhf
  debug symbols for pimodbus-master

pimodbus-slave/buster,now 1.0.8-2 armhf [installed]
  Revolution Pi Modbus slave

pimodbus-slave-dbgsym/buster 1.0.8-2 armhf
  debug symbols for pimodbus-slave

In case you already tried to update but it failed the root cause often consists in the running application that prevents the ressources.
So please stop the application and try to update. In case you are unsure how to do this here is an example:

Code: Select all

pi@RevPi35745:~ $ sleep 100 &
[1] 9520
pi@RevPi35745:~ $ ps ax| grep sleep
 9520 pts/0    S      0:00 sleep 100
 9577 ?        S      0:00 sleep 1
 9579 pts/0    S+     0:00 grep --color=auto sleep
pi@RevPi35745:~ $ sudo kill 9520
[1]+  Terminated              sleep 100
Remember after an upgrade from Stretch to Buster a script has to be executed for migration of old file structures i.e. Node-Red, etc. Have a look at the Release Notes here.
ChrisDeveloper
Posts: 27
Joined: 03 Mar 2020, 00:58

Re: pimodbus-master.service failed

Post by ChrisDeveloper »

Hi Dirk,

Thank you for your reply.

I have Stretch installed on the production systems, not Buster. Only SSH access. Reflashing the devices will involve a long trip to site.

What are my options for resolving this?

Do you recommend a in-place upgrade of Stretch to Buster?

Kind regards,
Chris
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58

Re: pimodbus-master.service failed

Post by Amar »

Hi Chris,
u could try firstly if this is what you have on stretch image after update and upgrade.


pi@RevPi16860:~ $ apt search pimodbus
Sorting... Done
Full Text Search... Done
pimodbus-master/stretch,now 1.0.7-1stretch armhf [installed]
Revolution Pi Modbus master

pimodbus-slave/stretch,now 1.0.4-1stretch armhf [installed]
Revolution Pi Modbus slave

pi@RevPi16860:~ $ apt search pictory
Sorting... Done
Full Text Search... Done
pictory/stretch,now 1.4.7 all [installed]
Revolution Pi Configurator

python3-revpimodio/stretch 1.0.3-1 all
Python3 Programmierung für Kunbus RevolutionPi

python3-revpimodio2/stretch,now 2.5.7-1 all [installed]
Python3 programming for RevolutionPi of Kunbus GmbH

pi@RevPi16860:~ $ uname -a
Linux RevPi16860 4.19.95-rt38-v7 #1 SMP PREEMPT RT Wed, 19 May 2021 09:16:34 +0000 armv7l GNU/Linux

Replace piModbusMaster and piModbusSlave binaries provided in attachment under path /usr/sbin/ in your system.
Reboot and check if the issue still persists.Otherwise send a SOS report and you sample config.rsc internally over Kunbus support so that we could reproduce the issue.

Inplace upgrade from Stretch to Buster could be tried by first having the backup of complete system but you could also have potentially address some other project configuration issues
after update.

Attachment: piModbusMasterSlave.zip
piModbusMasterSlave.zip
(20.54 KiB) Downloaded 776 times
Regards,
Amar
KUNBUS
ChrisDeveloper
Posts: 27
Joined: 03 Mar 2020, 00:58

Re: pimodbus-master.service failed

Post by ChrisDeveloper »

Hi Amar,

Thank you for your reply.

I copied the piModbusMaster and piModbusSlave to /usr/sbin/ then I rebooted the Connect+. It did not work. I deleted the Master RTU Master in Pictory and tried again. It did not work:

Code: Select all

● pimodbus-master.service                                     loaded failed failed  Revolution Pi Modbus master
My application and OS version are the same as your listed:

Code: Select all

pi@RevPi100304:~ $ apt search pimodbus
Sorting... Done
Full Text Search... Done
pimodbus-master/stretch,now 1.0.7-1stretch armhf [installed]
  Revolution Pi Modbus master

pimodbus-slave/stretch,now 1.0.4-1stretch armhf [installed]
  Revolution Pi Modbus slave

pi@RevPi100304:~ $ apt search pictory
Sorting... Done
Full Text Search... Done
pictory/stretch,now 1.4.7 all [installed]
  Revolution Pi Configurator

python3-revpimodio/stretch 1.0.3-1 all
  Python3 Programmierung für Kunbus RevolutionPi

python3-revpimodio2/stretch,now 2.5.7-1 all [installed]
  Python3 programming for RevolutionPi of Kunbus GmbH

pi@RevPi100304:~ $ uname -a
Linux RevPi100304 4.19.95-rt38-v7 #1 SMP PREEMPT RT Wed, 19 May 2021 09:16:34 +0000 armv7l GNU/Linux
I have emailed my _config.rsc file to support.

Thank you,
Chris
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58

Re: pimodbus-master.service failed

Post by Amar »

Hi Chris,
I tested your _config.rsc and piModbusMaster it is working fine on my system.There seems to be something else in your system causing the crash of piModbusMaster after update.

Check libmodbus version
pi@RevPi16860:~$ dpkg -l | grep libmodbus
ii libmodbus5:armhf 3.1.6-2~bpo10+2 armhf library for the Modbus protocol

check symbolic link to _config.rsc exists
pi@RevPi16860:~$ ls -la /etc/revpi/config.rsc
lrwxrwxrwx 1 root root 37 Jun 25 2020 /etc/revpi/config.rsc -> /var/www/pictory/projects/_config.rsc

Could you then try if clearing cache helps and check the log again :
sudo systemctl stop pimodbus-master.service

Clear PageCache, dentries and inodes
sudo sync; echo 3 | sudo tee /proc/sys/vm/drop_caches >/dev/null

sudo systemctl start pimodbus-master.service

It would be helpful if you could provide a clone of your existing system image so that i could replicate the issue at my side.Provided you have a system backup,you could either proceed with buster image upgrade remotely or have to physically flash your existing default image inorder to get back system quickly running.

Regards,
Amar
KUNBUS
ChrisDeveloper
Posts: 27
Joined: 03 Mar 2020, 00:58

Re: pimodbus-master.service failed

Post by ChrisDeveloper »

Hi Amar,

Thank you for your reply.

I had an old version of libmodbus. Running the following fixed the issue:

Code: Select all

sudo apt update
sudo apt install libmodbus-dev
Thank you for you help.

Chris
Post Reply