Sio serial module install problem with ActiveState

Discussion in 'Python' started by Conrad, Jul 14, 2003.

  1. Conrad

    Conrad Guest

    Greetings,

    I have a need to print from Win98SE to a little
    serial label printer provided by United Parcel, so
    based on Mark Hammond's recommendation in
    'Programming on Win32' I decided to try the Sio
    module at http://starship.python.net/crew/roger/

    My problem:

    The Sio installer dies looking for:
    HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.2\InstallPath

    I am using ActiveStates Python 2.2.2 build 224 on Win98SE.

    ActiveState apparently does do registry setup, for example,
    the HKEY_USERS\.DEFAULT\SOFTWARE tree contains the
    \Python\PythonCore\2.2\InstallPath keys. I re-installed
    Python, thinking I had blown the registry, but the keys
    that Sio wants are never set.

    FWIW, PyPGSQL, wxPython, and the egenix MxBase packages all
    find Python on machines with ActiveState and install OK.
    I don't know what they are checking on install.

    Can anyone suggest a fix/workaround for someone who is just
    a bit befuddled by registries, or did I perhaps grab the
    wrong Sio? ( I got SioModule22.EXE at 171184 bytes from:
    http://starship.python.net/crew/roger/ )

    BTW, this serial printer is apparently pretty much a 'dump
    and go' type device - the only thing the printer seems to
    be capable of returning is a 4-byte error code after a special
    error report command is sent to the printer - other than that,
    all of the data and commands seem to move downstream only,
    with no return from the printer expected. Is Sio overkill for
    this, i.e. is there some incredibly simple "open a serial port
    under Win32 for write only" command I'm missing in the basic
    Python stuff?

    Many thanks,

    Conrad
    Conrad, Jul 14, 2003
    #1
    1. Advertising

  2. Conrad

    Peter Hansen Guest

    Conrad wrote:
    >
    > Greetings,
    >
    > I have a need to print from Win98SE to a little
    > serial label printer provided by United Parcel, so
    > based on Mark Hammond's recommendation in
    > 'Programming on Win32' I decided to try the Sio
    > module at http://starship.python.net/crew/roger/
    >
    > My problem:


    Solution to problem (of a sort): don't use SIO module,
    which relies on a third-party external DLL. Instead,
    use http://pyserial.sourceforge.net/ or, if that doesn't work use
    http://balder.prohosting.com/ibarona/en/python/uspp/uspp_en.html

    -Peter
    Peter Hansen, Jul 14, 2003
    #2
    1. Advertising

  3. Conrad

    Conrad Guest

    Years ago, Nostradamus predicted that on Mon, 14 Jul 2003 19:33:23 -0400,
    Peter Hansen would write, saying:

    > Conrad wrote:
    >>
    >> Greetings,
    >>
    >> I have a need to print from Win98SE to a little
    >> serial label printer provided by United Parcel, so
    >> based on Mark Hammond's recommendation in
    >> 'Programming on Win32' I decided to try the Sio
    >> module at http://starship.python.net/crew/roger/
    >>
    >> My problem:

    >
    > Solution to problem (of a sort): don't use SIO module,
    > which relies on a third-party external DLL. Instead,
    > use http://pyserial.sourceforge.net/ or, if that doesn't work use
    > http://balder.prohosting.com/ibarona/en/python/uspp/uspp_en.html
    >
    > -Peter


    Thanks, Peter -

    I'll give them a shot tomorrow. USPP made me a little
    nervous, because frankly, it looks like it died a year
    and a half ago, with outstanding Linux bugs (eventually,
    my project will migrate to Linux), and a very conservative
    0.1 version label, and pyserial seemed from it's docs
    to require jython - which means pulling in a whole slew
    of third-party DLLs for Java. I'll give USPP a try first,
    because it's closest in spirit to what I want in terms of
    cross-compatibility and lack of dependencies - and after
    reflection, the fact that it hasn't changed in a while
    may just indicate the fact that RS-232 hardware has been
    much more static lately than, say, video hardware.

    Thanks again,

    Conrad
    Conrad, Jul 15, 2003
    #3
  4. Conrad

    Peter Hansen Guest

    Conrad wrote:
    >
    > I'll give them a shot tomorrow. USPP made me a little
    > nervous, because frankly, it looks like it died a year
    > and a half ago, with outstanding Linux bugs


    Thanks for checking that out better than I did. I was
    worried about that myself, having seen nothing about it
    for a very long time, but the name had stuck in my head.

    > pyserial seemed from it's docs
    > to require jython - which means pulling in a whole slew
    > of third-party DLLs for Java.


    No! Try PySerial first, for sure. It does NOT require
    Jython, but does support it. As the home page says,
    "It provides backends for stadard (sic) Python running
    on Windows, Linux, BSD (possibly any POSIX compilant system)
    and Jython. The module named "serial" automaticaly (sic)
    selects the appropriate backed (sic)."

    (Chris, if you'd like, I'll happily proofread that page
    and correct a few spelling errors for you. ;-)

    -Peter
    Peter Hansen, Jul 15, 2003
    #4
  5. [snip]

    > BTW, this serial printer is apparently pretty much a 'dump
    > and go' type device - the only thing the printer seems to
    > be capable of returning is a 4-byte error code after a special
    > error report command is sent to the printer - other than that,
    > all of the data and commands seem to move downstream only,
    > with no return from the printer expected. Is Sio overkill for
    > this, i.e. is there some incredibly simple "open a serial port
    > under Win32 for write only" command I'm missing in the basic
    > Python stuff?
    >
    > Many thanks,
    >
    > Conrad
    >


    I've written a pretty simple serial I/O module that will do what you want.
    Email me directly if you would like a copy.

    Gary Richardson
    Gary Richardson, Jul 15, 2003
    #5
  6. Peter Hansen <> wrote in
    news::

    > Conrad wrote:
    >> pyserial seemed from it's docs
    >> to require jython - which means pulling in a whole slew
    >> of third-party DLLs for Java.

    >
    > No! Try PySerial first, for sure. It does NOT require
    > Jython, but does support it. As the home page says,


    thanks for defending pyserial :)
    what you're saying is of course correct.

    > "It provides backends for stadard (sic) Python running
    > on Windows, Linux, BSD (possibly any POSIX compilant system)
    > and Jython. The module named "serial" automaticaly (sic)
    > selects the appropriate backed (sic)."
    >
    > (Chris, if you'd like, I'll happily proofread that page
    > and correct a few spelling errors for you. ;-)


    ok thanks, i fixed those and a few other details.

    chris
    --
    Chris <>
    Chris Liechti, Jul 15, 2003
    #6
  7. Conrad

    Peter Hansen Guest

    Gary Richardson wrote:
    >
    > [snip]
    >
    > > BTW, this serial printer is apparently pretty much a 'dump
    > > and go' type device - the only thing the printer seems to
    > > be capable of returning is a 4-byte error code after a special
    > > error report command is sent to the printer - other than that,
    > > all of the data and commands seem to move downstream only,
    > > with no return from the printer expected. Is Sio overkill for
    > > this, i.e. is there some incredibly simple "open a serial port
    > > under Win32 for write only" command I'm missing in the basic
    > > Python stuff?


    >
    > I've written a pretty simple serial I/O module that will do what you want.
    > Email me directly if you would like a copy.


    The benefit of the PySerial library is that it's cross-platform,
    available without emailing you, fully documented, and most
    important of all: if you find problems, you can fix them and
    everyone else benefits.

    Maybe you can contribute those parts of your own library which
    are better than PySerial to the PySerial project and we can avoid
    a proliferation of serial libraries in Python.

    Or put the file on a web page somewhere and we can all poke away
    at it, learn from it, and maybe incorporate the best parts into
    PySerial.

    -Peter
    Peter Hansen, Jul 15, 2003
    #7
  8. Conrad

    Conrad Guest

    OK, I'm posting on top, spank me. Many thanks to Peter
    and Gary for their help, and to Chris for writing
    pyserial, which is working just fine for what I'm
    doing - it took two lines to change my code, because
    I was already using file-type .write() methods to
    pump the data out - so I added an import, and changed
    my open statement, and it just worked. (once I killed
    the evil VB program that apparently opens the serial
    port and just hangs on to it forever!)

    Thanks again,

    Conrad


    Years ago, Nostradamus predicted that on Mon, 14 Jul 2003 22:38:57 +0000,
    Conrad would write, saying:

    > Greetings,
    >
    > I have a need to print from Win98SE to a little
    > serial label printer provided by United Parcel, so
    > based on Mark Hammond's recommendation in
    > 'Programming on Win32' I decided to try the Sio
    > module at http://starship.python.net/crew/roger/
    >
    > My problem:
    >
    > The Sio installer dies looking for:
    > HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.2\InstallPath
    >
    > I am using ActiveStates Python 2.2.2 build 224 on Win98SE.
    >
    > ActiveState apparently does do registry setup, for example,
    > the HKEY_USERS\.DEFAULT\SOFTWARE tree contains the
    > \Python\PythonCore\2.2\InstallPath keys. I re-installed
    > Python, thinking I had blown the registry, but the keys
    > that Sio wants are never set.
    >
    > FWIW, PyPGSQL, wxPython, and the egenix MxBase packages all
    > find Python on machines with ActiveState and install OK.
    > I don't know what they are checking on install.
    >
    > Can anyone suggest a fix/workaround for someone who is just
    > a bit befuddled by registries, or did I perhaps grab the
    > wrong Sio? ( I got SioModule22.EXE at 171184 bytes from:
    > http://starship.python.net/crew/roger/ )
    >
    > BTW, this serial printer is apparently pretty much a 'dump
    > and go' type device - the only thing the printer seems to
    > be capable of returning is a 4-byte error code after a special
    > error report command is sent to the printer - other than that,
    > all of the data and commands seem to move downstream only,
    > with no return from the printer expected. Is Sio overkill for
    > this, i.e. is there some incredibly simple "open a serial port
    > under Win32 for write only" command I'm missing in the basic
    > Python stuff?
    >
    > Many thanks,
    >
    > Conrad
    Conrad, Jul 15, 2003
    #8
  9. Conrad

    yaipa h. Guest

    All,

    Worked like a charm for me too! I used it to develop an
    automated attendant for a Serial Oven Controller. The
    attendant ran from Sparc Solaris using Python 2.1 and pySerial.

    The only weird thing, which I didn't get a chance to
    debug, was a perfectly working script under RS-232
    got terribly out of sync when R/W I/O to a RS-485
    serial network. Any reason why that would be?

    Thanks, just a bit of trivia if the boss wants me
    to revisit it again.

    --Alan

    Peter Hansen <> wrote in message news:<>...
    > Conrad wrote:
    > >
    > > I'll give them a shot tomorrow. USPP made me a little
    > > nervous, because frankly, it looks like it died a year
    > > and a half ago, with outstanding Linux bugs

    >
    > Thanks for checking that out better than I did. I was
    > worried about that myself, having seen nothing about it
    > for a very long time, but the name had stuck in my head.
    >
    > > pyserial seemed from it's docs
    > > to require jython - which means pulling in a whole slew
    > > of third-party DLLs for Java.

    >
    > No! Try PySerial first, for sure. It does NOT require
    > Jython, but does support it. As the home page says,
    > "It provides backends for stadard (sic) Python running
    > on Windows, Linux, BSD (possibly any POSIX compilant system)
    > and Jython. The module named "serial" automaticaly (sic)
    > selects the appropriate backed (sic)."
    >
    > (Chris, if you'd like, I'll happily proofread that page
    > and correct a few spelling errors for you. ;-)
    >
    > -Peter
    yaipa h., Jul 15, 2003
    #9
  10. Conrad

    Peter Hansen Guest

    "yaipa h." wrote:
    >
    > All,
    >
    > Worked like a charm for me too! I used it to develop an
    > automated attendant for a Serial Oven Controller. The
    > attendant ran from Sparc Solaris using Python 2.1 and pySerial.
    >
    > The only weird thing, which I didn't get a chance to
    > debug, was a perfectly working script under RS-232
    > got terribly out of sync when R/W I/O to a RS-485
    > serial network. Any reason why that would be?


    Well, one reason might be that RS232 is point-to-point, while
    RS-485 is many-to-many, at least in principle. Was this a
    bus network, or at least a "multidrop" situation with one master
    and many slaves? There are no guarantees in those situations, unless
    you've been very careful to ensure proper handshaking, timing,
    and such.

    If you want to discuss this, please define "out of sync" in more
    detail... it could mean anything.

    -Peter
    Peter Hansen, Jul 15, 2003
    #10
  11. Conrad

    yaipa h. Guest

    Peter,

    Thanks, basically one server feed many serial clients. From the sound
    of your post I had better get "Serial Port Complete" before giving it
    another run.

    Thanks.

    -Alan



    Peter Hansen <> wrote in message news:<>...
    > "yaipa h." wrote:
    > >
    > > All,
    > >
    > > Worked like a charm for me too! I used it to develop an
    > > automated attendant for a Serial Oven Controller. The
    > > attendant ran from Sparc Solaris using Python 2.1 and pySerial.
    > >
    > > The only weird thing, which I didn't get a chance to
    > > debug, was a perfectly working script under RS-232
    > > got terribly out of sync when R/W I/O to a RS-485
    > > serial network. Any reason why that would be?

    >
    > Well, one reason might be that RS232 is point-to-point, while
    > RS-485 is many-to-many, at least in principle. Was this a
    > bus network, or at least a "multidrop" situation with one master
    > and many slaves? There are no guarantees in those situations, unless
    > you've been very careful to ensure proper handshaking, timing,
    > and such.
    >
    > If you want to discuss this, please define "out of sync" in more
    > detail... it could mean anything.
    >
    > -Peter
    yaipa h., Jul 25, 2003
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Irwin Friedman
    Replies:
    1
    Views:
    2,198
    John Bokma
    Sep 6, 2003
  2. Steve
    Replies:
    1
    Views:
    255
    Trent Mick
    Jul 26, 2005
  3. loial
    Replies:
    0
    Views:
    304
    loial
    Jun 21, 2007
  4. SpringFlowers AutumnMoon
    Replies:
    1
    Views:
    98
    Jayson Williams
    Oct 14, 2007
  5. doolittle
    Replies:
    3
    Views:
    108
    Brian Helterline
    Oct 27, 2006
Loading...

Share This Page