|
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 | |
Share:
|
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...p/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 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 | | |
[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 | | |
Peter Hansen <pe***@engcorp.com> wrote in
news:3F***************@engcorp.com: 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 <cl******@gmx.net> | | |
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 | | |
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 | | |
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 <pe***@engcorp.com> wrote in message news:<3F***************@engcorp.com>... 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." 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,
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 <pe***@engcorp.com> wrote in message news:<3F***************@engcorp.com>... "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 | | This discussion thread is closed Replies have been disabled for this discussion. Similar topics
21 posts
views
Thread by Gavin |
last post: by
|
16 posts
views
Thread by Jeff Wagner |
last post: by
|
reply
views
Thread by Craig Edgmon |
last post: by
|
1 post
views
Thread by Irwin Friedman |
last post: by
|
1 post
views
Thread by Steve |
last post: by
|
4 posts
views
Thread by rowan@sylvester-bradley.org |
last post: by
| | | | | | | | | | | | | |