Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#13 Flow controw to reflect net connect

open
nobody
None
5
2011-11-02
2011-11-02
Anton Avramov
No

Hi,
I want to use ser2net to print with cups on some serial printers remotely.
My problem is that if the serial printer is disconnected or cannot accept the data currently (DSR is low) ser2net is still accepting the network data so cups is no way of knowing that there is a problem with the print and marks the job as done even if it is not.
The data is stored in ser2net cache and if the printer is reconnected it will print the job, but if ser2net is restarted the job is lost forever.

Is there a way ser2net to disconnect the client if it cannot send the data to the port instead of caching?

Discussion

  • Corey Minyard
    Corey Minyard
    2011-11-02

    ser2net does not currently have a mechanism to disconnect if DSR is down. The whole handling of DSR/DCD is kind of messy; there's all kinds of ways that systems interpret it. I'm not sure that dropping the connection on DSR dropping is the right thing to do, either. Perhaps on DCD, but even that is kind of messy.

    IMHO, the right way to handle this would be to use the modem control over telnet (RFC2217) which will transfer the state of DSR if you set it all up correctly. That would require writing a program on the host side (or perhaps modifying CUPS) to support that RFC.

    There is a very old tool from cyclades at http://www.coker.com.au/cyclades that might help you. It make a local PTY act like a serial port and supports RFC2217. Perhaps that would help.

     
  • Anton Avramov
    Anton Avramov
    2011-11-03

    Unfortunately I couldn't make it work with any other tools, including the one from cyclades.
    Isn't there a simple hack/patch to this?
    Like disable the buffer and then the connection should drop right away?

     
  • Corey Minyard
    Corey Minyard
    2011-11-03

    I don't completely understand the situation you are trying to solve. Such a feature could be added to ser2net, but I don't have any time to do that right now. If you could add the feature, I could take a patch to do it.

    I don't know if any other serial port proxies support this (like the very nice ones from Cyclades) but it seems like an unusual request.