question

ks4z avatar image
ks4z asked

[solved] serial-starter blocking ports

Hello,

I am developing a driver for a MODBUS device that is conected via USB. I want the serial-starter to start the driver. Everything works fine so far. I plug in the USB, the driver gets started, queries the MODBUS wheter there is a matching device and exits if it doesn't find one.

And now the problem arises. The serial-starter does not seem to recognize that. It does not continue trying other drivers, hence several of my devices won't be detected, because several USB-Ports are blocked by the one driver that is not running anymore.

The driver takes some time to check the modbus because it tries several addresses. Can this be the reason for the problem?

I tried it with 2.93 and 2.94 both behave identically.

If anybody wants to have a look at the code, I uploaded it to Github

https://github.com/kscholty/dbus-modbus-suninv

Any hint would be most welcome.

Ks4z

Multiplus-II
2 |3000

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

3 Answers
bathnm avatar image
bathnm answered ·

@ks4z Have you taken a look at this wiki?

2 |3000

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

ks4z avatar image
ks4z answered ·

Hi, thanks for the hint.

That was my reference for the implementation of my driver. It states

The drivers are implemented such that if they can't detect a device at the other end of the line that they support, they exit again. Serial-starter will then try the next one, and so forth.


The first part (exiting) is what my driver does, only the second thing does not happen. Serial-starter does not try the next driver. It simply stops.

I was hoping to get more insight on why that might be.

Thanks

ks4z


2 |3000

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

ks4z avatar image
ks4z answered ·

Seems I solved it. It's not the way the driver behaves but the starting mechanism.

I used to start the python code directly from the Service-Template's run script, which made the daemontools not recognize that the service stopped.

I now switched over using the start function from the serial-starter and that works perfectly.

Thanks

ks4z


2 |3000

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