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

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

Expand Messages
  • 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 1 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 2 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 3 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 4 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 5 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.