Loading ...
Sorry, an error occurred while loading the content.

Re: Trouble running PDDemulate.py on WindowsXP (Brother 930)

Expand Messages
  • bart_930
    Thanks for the reply Steve. I jimmied up my FTDI cable as per the instructions at http://www.ladyada.net/learn/electroknit/ftdicable.html so hopefully they are
    Message 1 of 14 , Apr 16, 2012
    • 0 Attachment
      Thanks for the reply Steve.

      I jimmied up my FTDI cable as per the instructions at http://www.ladyada.net/learn/electroknit/ftdicable.html so hopefully they are accurate. The red cable is split into 2 and inserted into pins 2 and 3.

      I tried the code modification that you suggested above. It definitely changed something. However the problem now is that as soon as I press 552 and hit 'Step', the knitting machine goes blank, seems to basically turn itself off. Here is the resulting output in command prompt:

      http://s136.photobucket.com/albums/q176/bartacres/?action=view¤t=cp1.jpg

      I appreciate your help here Steve, and I know that others have been encountering similar problems, see bottom post here for example http://forums.adafruit.com/viewtopic.php?f=8&p=135370 so it would be awesome to find a solution. I suppose I can always install Ubuntu on my dedicated knitting machine computer if all else fails!
    • bart_930
      Thanks for your reply too John. Update - since I have a computer designated specifically for use with the knitting machine (oh the joys of having room mates
      Message 2 of 14 , Apr 17, 2012
      • 0 Attachment
        Thanks for your reply too John.

        Update - since I have a computer designated specifically for use with the knitting machine (oh the joys of having room mates who like to upgrade their tech often), and I was eager to get my machine up and running, I opted to install Ubuntu as well, its so easy just insert the CD and it creates its own partition, dual boot option etc. Everything is working fine now and I have produced my first knitted panels of custom designs!!

        Thanks guys for being hardcore geeks and getting this info out there.

        My friends here in Dunedin, New Zealand are about to get themselves some crazy ass knitwear!!
      • John R. Hogerhuis
        Indicates to me that it s not a hardware problem so it is either a Python-Windows platform issue or a driver issue. Not a big believer in the flow control
        Message 3 of 14 , Apr 17, 2012
        • 0 Attachment
          Indicates to me that it's not a hardware problem so it is either a
          Python-Windows platform issue or a driver issue.

          Not a big believer in the flow control thing in this case since I
          don't think it's really necessary as request-response is self
          limiting, PC is not going to run out of buffers, and the PC has plenty
          of cycles to spare to handle serial port.

          -- John.
        • jackpups@rocketmail.com
          I am running into the same problem, its only reading 865bytes. But using the FTDI cable with DAK7 and trying to make a backup everything is ok. So i think
          Message 4 of 14 , Apr 23, 2012
          • 0 Attachment
            I am running into the same problem, its only reading 865bytes. But using the FTDI cable with DAK7 and trying to make a backup everything is ok.
            So i think there is something wrong with pddemulate.
          • Steve Conklin
            Are you using hardware flow control, or just using the PDDemulate software as it is? I d really like for someone who is having this problem to try using
            Message 5 of 14 , Apr 23, 2012
            • 0 Attachment
              Are you using hardware flow control, or just using the PDDemulate software as it is?

              I'd really like for someone who is having this problem to try using hardware flow control, as described a few emails back in this thread, and see if that solves it.

              Thanks!

              Steve

              On Mon, Apr 23, 2012 at 1:35 PM, jackpups@... <jackpups@...> wrote:
               

              I am running into the same problem, its only reading 865bytes. But using the FTDI cable with DAK7 and trying to make a backup everything is ok.
              So i think there is something wrong with pddemulate.


            • jackpups@rocketmail.com
              I do use Flow Control, but it doesn t solve the error.
              Message 6 of 14 , Apr 24, 2012
              • 0 Attachment
                I do use Flow Control, but it doesn t solve the error.

                --- In kminternals@yahoogroups.com, Steve Conklin <steve@...> wrote:
                >
                > Are you using hardware flow control, or just using the PDDemulate software
                > as it is?
                >
                > I'd really like for someone who is having this problem to try using
                > hardware flow control, as described a few emails back in this thread, and
                > see if that solves it.
                >
                > Thanks!
                >
                > Steve
                >
                > On Mon, Apr 23, 2012 at 1:35 PM, jackpups@... <
                > jackpups@...> wrote:
                >
                > > **
                > >
                > >
                > > I am running into the same problem, its only reading 865bytes. But using
                > > the FTDI cable with DAK7 and trying to make a backup everything is ok.
                > > So i think there is something wrong with pddemulate.
                > >
                > >
                > >
                >
              • Steve Conklin
                I don t really have any good ideas about what the problem could be, if it s not a flow control issue. It could possibly be a difference in the way pyserial
                Message 7 of 14 , Apr 24, 2012
                • 0 Attachment
                  I don't really have any good ideas about what the problem could be, if it's not a flow control issue.
                  It could possibly be a difference in the way pyserial works under windows.

                  Since bart_930 was able to switch to Linux and have it work, that indicates that the knitting machine is sending the expected amount of data, and the the emulator is expecting the right amount. So the difference has to be something that's affecting the serial data transfer.

                  Sorry, that's all I have to offer at the moment.

                  Steve

                  On Tue, Apr 24, 2012 at 5:37 AM, jackpups@... <jackpups@...> wrote:
                   

                  I do use Flow Control, but it doesn t solve the error.



                  --- In kminternals@yahoogroups.com, Steve Conklin <steve@...> wrote:
                  >
                  > Are you using hardware flow control, or just using the PDDemulate software
                  > as it is?
                  >
                  > I'd really like for someone who is having this problem to try using
                  > hardware flow control, as described a few emails back in this thread, and
                  > see if that solves it.
                  >
                  > Thanks!
                  >
                  > Steve
                  >
                  > On Mon, Apr 23, 2012 at 1:35 PM, jackpups@... <
                  > jackpups@...> wrote:
                  >
                  > > **

                  > >
                  > >
                  > > I am running into the same problem, its only reading 865bytes. But using
                  > > the FTDI cable with DAK7 and trying to make a backup everything is ok.
                  > > So i think there is something wrong with pddemulate.
                  > >
                  > >
                  > >
                  >


                • John R. Hogerhuis
                  ... I m betting on a problem with pyserial and how it sets up the serial DCB structure or some plain old bug in interaction with the windows api. It sure
                  Message 8 of 14 , Apr 24, 2012
                  • 0 Attachment


                    On Tue, Apr 24, 2012 at 8:40 AM, Steve Conklin <steve@...> wrote:
                     

                    I don't really have any good ideas about what the problem could be, if it's not a flow control issue.
                    It could possibly be a difference in the way pyserial works under windows.


                    I'm betting on a problem with pyserial and how it sets up the serial DCB structure or some plain old bug in interaction with the windows api. It sure smells like a platform dependency to me. Somebody's going to have to get in there with a protocol analyzer though to prove it.

                    There are software-only sniffers like

                    Portmon

                    That MIGHT give some clues.

                    There seem to be a lot of these programs around. Maybe someone can recommend a good Windows one that would be worth looking at.

                    A hardware sniffer or a software "man in the middle" two-serial-port thing is the ultimate tool for this work.

                    -- John.
                  • Steve Conklin
                    For hardware sniffing, this unit works for me: http://www.saleae.com/logic It s 5V only input, but it has protocol analyzers for async serial and a lot of
                    Message 9 of 14 , Apr 24, 2012
                    • 0 Attachment
                      For hardware sniffing, this unit works for me:


                      It's 5V only input, but it has protocol analyzers for async serial and a lot of other protocols.
                      I've been very happy with mine.

                      I don't have ownership or interest in the company that makes these, I just thought I'd mention it, since it's the tool I use.

                      Steve

                      On Tue, Apr 24, 2012 at 11:01 AM, John R. Hogerhuis <jhoger@...> wrote:
                       



                      On Tue, Apr 24, 2012 at 8:40 AM, Steve Conklin <steve@...> wrote:
                       

                      I don't really have any good ideas about what the problem could be, if it's not a flow control issue.
                      It could possibly be a difference in the way pyserial works under windows.


                      I'm betting on a problem with pyserial and how it sets up the serial DCB structure or some plain old bug in interaction with the windows api. It sure smells like a platform dependency to me. Somebody's going to have to get in there with a protocol analyzer though to prove it.

                      There are software-only sniffers like

                      Portmon

                      That MIGHT give some clues.

                      There seem to be a lot of these programs around. Maybe someone can recommend a good Windows one that would be worth looking at.

                      A hardware sniffer or a software "man in the middle" two-serial-port thing is the ultimate tool for this work.

                      -- John.


                    • andy.caslaw
                      Bart and others, I was having the exact same error on XP, Error, write of N bytes when expecting 1024 , with N around 900 from multiple attempts. I found that
                      Message 10 of 14 , May 6, 2012
                      • 0 Attachment
                        Bart and others,

                        I was having the exact same error on XP, "Error, write of N bytes when expecting 1024", with N around 900 from multiple attempts.

                        I found that by changing from timeout=1 second, to timeout=10 seconds ( or timeout=none ) the problem went away.

                        I changed this line in PDDEmulator.py to...

                                    self.ser = serial.Serial(port=cport, baudrate=9600, parity='N', stopbits=1, timeout=10, xonxoff=0, rtscts=0, dsrdtr=0)

                        I'm using the FTDI TTL-232R-5V cable with TXD/RXD/CTS/RTS all inverted and connected with KH950i. The emulator worked fine on Mac Leopard, but not on XP. Changing the rtscts hardware flow control did not seem to make any difference.

                        Caz

                      • Sally
                        Hi folks, Whilst re-installing my Windows XP laptop ready to take to Maker Faire UK next month I thought that (1) it was a good idea to make sure that the
                        Message 11 of 14 , Mar 27, 2013
                        • 0 Attachment
                          Hi folks,

                          Whilst re-installing my Windows XP laptop ready to take to Maker Faire UK next month I thought that (1) it was a good idea to make sure that the software was working on my machine, and (2) that I should document it to make sure that Windows users don't feel left out. I had written down pretty ropey notes last time, and I couldn't find a site that documented the Windows side of things.

                          So, here goes:

                          Install Python 2.7.3
                          Install PIL 1.1.7
                          Install pyserial 2.6 (remembering to run the [setup.py install] command).
                          Plug in FTDI cable (appropriately configured, lots of info already available on that).
                          Point driver installer at VCP driver (ie. CDM 2.08.28 WHQL Certified).
                          Edit line 287 of PDDemulate.py > change timeout=1 to timeout=5 (this works for Brother 950i, 930 may require timeout=10 given previous post).
                          Download files from GIT (either main trunk for 930, or 950i branch for 950i).
                          Create a CAT batch file, or install the CoreUtils-5.3.0.exe from GnuWin32.sourceforge.net (remembering to add BIN folder to PATH).
                          Reboot.
                          Test saving blank pattern to computer (I used 1x1 cards = 60sts x 150 rows).
                          Test inserting image in to blank pattern, and save back to machine.
                          Test using pattern on machine.

                          All up and running again :-)

                          Happy knitting everyone,
                          Sally

                          --- In kminternals@yahoogroups.com, "andy.caslaw" <andy@...> wrote:
                          >
                          > Bart and others,
                          > I was having the exact same error on XP, "Error, write of N bytes when
                          > expecting 1024", with N around 900 from multiple attempts.
                          > I found that by changing from timeout=1 second, to timeout=10 seconds (
                          > or timeout=none ) the problem went away.
                          > I changed this line in PDDEmulator.py to...
                          > self.ser = serial.Serial(port=cport, baudrate=9600,
                          > parity='N', stopbits=1, timeout=10, xonxoff=0, rtscts=0, dsrdtr=0)
                          > I'm using the FTDI TTL-232R-5V cable with TXD/RXD/CTS/RTS all inverted
                          > and connected with KH950i. The emulator worked fine on Mac Leopard, but
                          > not on XP. Changing the rtscts hardware flow control did not seem to
                          > make any difference.
                          > Caz
                          >
                        Your message has been successfully submitted and would be delivered to recipients shortly.