question

jabba80 avatar image
jabba80 asked

supervise daemon does not restart my (serial-starter started) dbus-script

Hello!

I recently started to write a dbus-driver for my RS485-connnected "Aurora PV-Inverter".
Over night, when the sun is down the inverter shuts down and the communication fails.
As stated in the wiki (chapter 4 -> https://github.com/victronenergy/venus/wiki/howto-add-a-driver-to-Venus) I just exit my script in that case.
But surprisingly the next day when electricity and pv-communication return, there still was no PV-inverter again in the system.

So i broke it down to a simple test-script instead of the pv-driver:

#!/usr/bin/env python3

import logging
import os
import time
import sys

def main():
    #configure logging
    logging.basicConfig(    format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
                            datefmt='%Y-%m-%d %H:%M:%S',
                            level=logging.DEBUG,
                            handlers=[
                                logging.FileHandler("%s/current.log" % (os.path.dirname(os.path.realpath(__file__)))),
                                logging.StreamHandler()
                            ])
    logging.info('Started... wating for 5 seconds')
    time.sleep(5)
    logging.info('Exiting...')
    sys.exit()

if __name__ == "__main__":
    main

The result was that even this simple script is only called once on system start, but never again after it exits.

So what am I doing wrong? What has to be considered that these so called "baby-sitters" care about my driver?

Hope somone knows...

Greetings,

Kai

Venus OSdriverpython
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

2 Answers
jabba80 avatar image
jabba80 answered ·

Seems as if i solved it myself:

I cribbed by looking at this project on github: https://github.com/transistorgit/dbus-solis-s5-pvinverter

It looks like i was missing the folowing line in my start-script:

. /opt/victronenergy/serial-starter/run-service.sh

Seems to work now with my stub-script, will try with my driver soon...

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

bathnm avatar image
bathnm answered ·

@jabba80 How do you all the script in the first place?

Take a look at this reference document. https://github.com/victronenergy/venus/wiki/howto-add-a-driver-to-Venus

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources

Additional resources still need to be added for this topic

Victron Venus OS Open Source intro page

Venus OS GitHub (please do not post to this)