Right, not sure where I should post this. So I'll plop it here!
If anyone is trying to hack their Brother Electro-Knit 930-E via Lady Ada's site, she forgot to link to soem files that you HAVE to download to make the python script work on a windoze machine.
Here: http://sourceforge.net/projects/pyserial/
You need those, and they should be installed right about this portion of the project:
http://ladyada.net/learn/electroknit/pythonstart.html
Right! Back to knitting!
(I'm so proud that I figured this out, I don't program or know anything about Python, but I figured it out. Nice. Back to crafting).
Hacking the Brother Knitting Machine - Extra files!!
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 4
- Joined: Fri Dec 24, 2010 2:58 pm
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: Hacking the Brother Knitting Machine - Extra files!!
thats right! we'll add a note
-
- Posts: 4
- Joined: Fri Dec 24, 2010 2:58 pm
Re: Hacking the Brother Knitting Machine - Extra files!!
Awesome! This is a tough project for non-programmers, but I really want to knit skulls and squids instead of fluffy kitties. I am SO VERY glad that you put together all this information!
I'm stuck again, though. PDDemulate.py is giving me this error: "Error, write of 850 bytes when expecting 1024, Failed to write data for sector 0, quitting" with trackbacks to lines 631, 382, 603, 253, and 172, IOError.
I have a full set of .dat and .id files in the img folder, all read as 1kb. The machine isn't beeping, but freezes while my laptop shows the error with pddemulate.py.
I'll try reprogramming the cable, since that' something I can DO (*grin*), but thought I'd ask in case it was a known problem.
Then I'm going to see if I can solve this one:
Insertpattern.py has an ImportError for line 22, import Image, "No module named Image"
Time to walk away from the screen and tackle it later, thanks!
I'm stuck again, though. PDDemulate.py is giving me this error: "Error, write of 850 bytes when expecting 1024, Failed to write data for sector 0, quitting" with trackbacks to lines 631, 382, 603, 253, and 172, IOError.
I have a full set of .dat and .id files in the img folder, all read as 1kb. The machine isn't beeping, but freezes while my laptop shows the error with pddemulate.py.
I'll try reprogramming the cable, since that' something I can DO (*grin*), but thought I'd ask in case it was a known problem.
Then I'm going to see if I can solve this one:
Insertpattern.py has an ImportError for line 22, import Image, "No module named Image"
Time to walk away from the screen and tackle it later, thanks!
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: Hacking the Brother Knitting Machine - Extra files!!
Sadly we don't have a machine (despite writing the code ) but we've asked Becky to pop In if she can.
Image is In another python library called pyimage ...we think
Image is In another python library called pyimage ...we think
- bekathwia
- Posts: 215
- Joined: Sat Dec 25, 2010 1:18 am
Re: Hacking the Brother Knitting Machine - Extra files!!
I haven't run into the same issue, but be sure to check the following things:
-the FTDI serial drivers are installed
-the FTDI cable is plugged into the computer before you attempt to start up the emulator
-you're passing the right serial port to the emulator when you start it up... I'm on a mac so mine looks like this:
python ./PDDemulate-1.0.py img /dev/tty.usbserial-A7TKMHYD
The cable doesn't have to be connected to the knitting machine to successfully start up the emulator, if that helps you narrow down the source of the problem at all. I'm not so great at serial stuff on a PC and I'm away from my knitting machine and special cable until Monday but paste up the commands you're entering and the response you're getting back. Can't wait to get you knitting squiddies! =]
-the FTDI serial drivers are installed
-the FTDI cable is plugged into the computer before you attempt to start up the emulator
-you're passing the right serial port to the emulator when you start it up... I'm on a mac so mine looks like this:
python ./PDDemulate-1.0.py img /dev/tty.usbserial-A7TKMHYD
The cable doesn't have to be connected to the knitting machine to successfully start up the emulator, if that helps you narrow down the source of the problem at all. I'm not so great at serial stuff on a PC and I'm away from my knitting machine and special cable until Monday but paste up the commands you're entering and the response you're getting back. Can't wait to get you knitting squiddies! =]
-
- Posts: 4
- Joined: Fri Dec 24, 2010 2:58 pm
Re: Hacking the Brother Knitting Machine - Extra files!!
I just need to say how much I ADORE y'all for all your work. If I can get this working, I'd be more than happy to knit you both up a custom something as a thank you. Send me a file and I'll knit it.
I'm going to reprogram the cable and double check the drivers today. I'll also hunt for info on windows serials, I thought it might just be listed just as com9, but it might be the device or hardware instance, I'll see what I can dig up.
I'm going to reprogram the cable and double check the drivers today. I'll also hunt for info on windows serials, I thought it might just be listed just as com9, but it might be the device or hardware instance, I'll see what I can dig up.
-
- Posts: 4
- Joined: Fri Dec 24, 2010 2:58 pm
Re: Hacking the Brother Knitting Machine - Extra files!!
Another module you need to download, which isn't included in the basic Python 2.7 for windows, is Python Image library, over here: http://www.pythonware.com/products/pil/
If you have Python 2.7, it's hidden over here: http://effbot.org/downloads/#pil and you need PIL-1.1.7.win32-py2.7.exe
Also, FTDI's MPROG has been replaced by FT_PROG, which is easier to use, but the default IO controls are all set to TXDEN. So I copied the values from http://ladyada.net/learn/electroknit/ftdicable.html so that:
CO - TXLED#, C1 - RXLED# C2 - TXDEN C3 - PWRON# C4 - SLEEP#
But, that didn't solve the problem so I reprogrammed them all back to TXDEN, especially since I wasn't sure what the IOcontrol settings should be
I also double checked the cable, reseated a loose connection, and reprogrammed the cable (erm, well, twice, because I just HAD to futz with the IO controllers!). I double checked the drivers for the cable, and the FTDI drivers were all in the right place and loaded.
Here's a link to a screenshot of the error sequence, in case it's an easier fix than I thought: http://www.flickr.com/photos/hellga/5297084635/
If you have Python 2.7, it's hidden over here: http://effbot.org/downloads/#pil and you need PIL-1.1.7.win32-py2.7.exe
Also, FTDI's MPROG has been replaced by FT_PROG, which is easier to use, but the default IO controls are all set to TXDEN. So I copied the values from http://ladyada.net/learn/electroknit/ftdicable.html so that:
CO - TXLED#, C1 - RXLED# C2 - TXDEN C3 - PWRON# C4 - SLEEP#
But, that didn't solve the problem so I reprogrammed them all back to TXDEN, especially since I wasn't sure what the IOcontrol settings should be
I also double checked the cable, reseated a loose connection, and reprogrammed the cable (erm, well, twice, because I just HAD to futz with the IO controllers!). I double checked the drivers for the cable, and the FTDI drivers were all in the right place and loaded.
Here's a link to a screenshot of the error sequence, in case it's an easier fix than I thought: http://www.flickr.com/photos/hellga/5297084635/
-
- Posts: 1
- Joined: Wed Dec 29, 2010 1:30 pm
Re: Hacking the Brother Knitting Machine - Extra files!!
Hellga,
Pardon me for the quick interlude. I'm in Berlin right now and neither have my full dev environment I originally used to help becky nor a knitting machine. If I recall all of the things I was doing used an earlier version of python. I think on mine it was 2.6.3. I don't recall what it was on the mac side.
Becky, can you run a "python -V" from the command line to see which version your're using? I seem to remember that we hard coded the version in initially.
Like I said, this is a hail mary. But double check your versions, and good luck. Also, possibly try something further back in the code tree. Limor has added so much since she forked my bits it will make your head spin, but possibly there are some version specific calls in PIL:
https://github.com/brianredbeard/knitti ... ne/network
--redbeard
Pardon me for the quick interlude. I'm in Berlin right now and neither have my full dev environment I originally used to help becky nor a knitting machine. If I recall all of the things I was doing used an earlier version of python. I think on mine it was 2.6.3. I don't recall what it was on the mac side.
Becky, can you run a "python -V" from the command line to see which version your're using? I seem to remember that we hard coded the version in initially.
Like I said, this is a hail mary. But double check your versions, and good luck. Also, possibly try something further back in the code tree. Limor has added so much since she forked my bits it will make your head spin, but possibly there are some version specific calls in PIL:
https://github.com/brianredbeard/knitti ... ne/network
--redbeard
-
- Posts: 1
- Joined: Wed Feb 09, 2011 9:31 am
Re: Hacking the Brother Knitting Machine
I have several electronic knitting machines that I would like to hack. Sometimes the 80's tech is stifling. How did you find the pin out info?
-
- Posts: 1
- Joined: Sun Mar 20, 2011 3:36 pm
Re: Hacking the Brother Knitting Machine - Extra files!!
Hellga,
I'm having the exact same error message. I'm also using Windows. The only thing that I have to add is that after getting that error my Brother gives me the flashing 888 error.
I've tried everything I can think of. I have PIL installed. When it comes to reprogramming the cable I've tried both the TXDEN for all the C values and changing them to match the tutorial's values for MProg.
I'm really at a loss here. I've been working on finding a solution for a while now. It feels like I've tried everything.
I'm having the exact same error message. I'm also using Windows. The only thing that I have to add is that after getting that error my Brother gives me the flashing 888 error.
I've tried everything I can think of. I have PIL installed. When it comes to reprogramming the cable I've tried both the TXDEN for all the C values and changing them to match the tutorial's values for MProg.
I'm really at a loss here. I've been working on finding a solution for a while now. It feels like I've tried everything.
- bekathwia
- Posts: 215
- Joined: Sat Dec 25, 2010 1:18 am
Re: Hacking the Brother Knitting Machine - Extra files!!
My friend Andrew has been using the knitting machine in his artist residency, and I've tried in every way I know how to get the code working on his windows laptop, to no avail. In my research I came across plenty of complaints of restrictions imposed on the pyserial library by the operating system, ones that linux/mac machines doesn't. We've since gotten the code running successfully on several macs varying in operating system version and processor type. Know any hotshot python programmers on windows? Send them our way.
-
- Posts: 2
- Joined: Thu Nov 17, 2011 9:28 am
Re: Hacking the Brother Knitting Machine - Extra files!!
I have problems connecting my brother 930 to my computer
The FTDI cable works, I have tested it
I have installed Python 3.2.2 and Pyserial 2.5.win32
My comport is (COM7) and I work with Windows 7
I have followed the steps mentioned in http://ladyada.net/learn/electroknit/backup.html
I give the
Command:
H:\Brother\ladyada\Brother>python PDDemulate-1.0.py img 7
Error:
File “PDDemulate-1.0.py”, line 1
{000214A0-0000-0000-C000-000000000046}
^
SyntaxError: invalid token
What am I doing wrong? Should I use an older version of Python? Or does this not work with Windows 7?
Who can help me?
The FTDI cable works, I have tested it
I have installed Python 3.2.2 and Pyserial 2.5.win32
My comport is (COM7) and I work with Windows 7
I have followed the steps mentioned in http://ladyada.net/learn/electroknit/backup.html
I give the
Command:
H:\Brother\ladyada\Brother>python PDDemulate-1.0.py img 7
Error:
File “PDDemulate-1.0.py”, line 1
{000214A0-0000-0000-C000-000000000046}
^
SyntaxError: invalid token
What am I doing wrong? Should I use an older version of Python? Or does this not work with Windows 7?
Who can help me?
-
- Posts: 2
- Joined: Thu Nov 17, 2011 9:28 am
Re: Hacking the Brother Knitting Machine - Extra files!!
I am getting a little bit further. I have downloaded all over again. At the moment my usb connector is on com7 but I get the following message
C:\TEMP\adafruit>python PDDemulate-1.0.py img 7
Preparing . . . Please Wait
Traceback (most recent call last):
File "PDDemulate-1.0.py", line 627, in <module>
emu.open(cport=sys.argv[2])
File "PDDemulate-1.0.py", line 287, in open
self.ser = serial.Serial(port=cport, baudrate=9600, parity='N', stopbits=1,
timeout=1, xonxoff=0, rtscts=0, dsrdtr=0)
File "C:\PROGRAM FILES\PYTHON27\lib\site-packages\serial\serialwin32.py", line
30, in __init__
SerialBase.__init__(self, *args, **kwargs)
File "C:\PROGRAM FILES\PYTHON27\lib\site-packages\serial\serialutil.py", line
260, in __init__
self.open()
File "C:\PROGRAM FILES\PYTHON27\lib\site-packages\serial\serialwin32.py", line
56, in open
raise SerialException("could not open port %s: %s" % (self.portstr, ctypes.W
inError()))
serial.serialutil.SerialException: could not open port 7: [Error 2] Het systeem
kan het opgegeven bestand niet vinden.
The system isn't able to find port 7 what am I doing wrong?
C:\TEMP\adafruit>python PDDemulate-1.0.py img 7
Preparing . . . Please Wait
Traceback (most recent call last):
File "PDDemulate-1.0.py", line 627, in <module>
emu.open(cport=sys.argv[2])
File "PDDemulate-1.0.py", line 287, in open
self.ser = serial.Serial(port=cport, baudrate=9600, parity='N', stopbits=1,
timeout=1, xonxoff=0, rtscts=0, dsrdtr=0)
File "C:\PROGRAM FILES\PYTHON27\lib\site-packages\serial\serialwin32.py", line
30, in __init__
SerialBase.__init__(self, *args, **kwargs)
File "C:\PROGRAM FILES\PYTHON27\lib\site-packages\serial\serialutil.py", line
260, in __init__
self.open()
File "C:\PROGRAM FILES\PYTHON27\lib\site-packages\serial\serialwin32.py", line
56, in open
raise SerialException("could not open port %s: %s" % (self.portstr, ctypes.W
inError()))
serial.serialutil.SerialException: could not open port 7: [Error 2] Het systeem
kan het opgegeven bestand niet vinden.
The system isn't able to find port 7 what am I doing wrong?
-
- Posts: 8
- Joined: Wed Jan 11, 2012 4:54 pm
Re: Hacking the Brother Knitting Machine - Extra files!!
My KM Hacking Guru says this:
The last message there is from Fjente on Nov 17. She needs to use "COM7" instead of "7" for the last parameter in her command. I was going to send her a message, but didn't want to take the time to register on the forum.
I hope this is something useful.
The last message there is from Fjente on Nov 17. She needs to use "COM7" instead of "7" for the last parameter in her command. I was going to send her a message, but didn't want to take the time to register on the forum.
I hope this is something useful.
Fjente wrote:I am getting a little bit further. I have downloaded all over again. At the moment my usb connector is on com7 but I get the following message
C:\TEMP\adafruit>python PDDemulate-1.0.py img 7
Preparing . . . Please Wait
Traceback (most recent call last):
File "PDDemulate-1.0.py", line 627, in <module>
emu.open(cport=sys.argv[2])
File "PDDemulate-1.0.py", line 287, in open
self.ser = serial.Serial(port=cport, baudrate=9600, parity='N', stopbits=1,
timeout=1, xonxoff=0, rtscts=0, dsrdtr=0)
File "C:\PROGRAM FILES\PYTHON27\lib\site-packages\serial\serialwin32.py", line
30, in __init__
SerialBase.__init__(self, *args, **kwargs)
File "C:\PROGRAM FILES\PYTHON27\lib\site-packages\serial\serialutil.py", line
260, in __init__
self.open()
File "C:\PROGRAM FILES\PYTHON27\lib\site-packages\serial\serialwin32.py", line
56, in open
raise SerialException("could not open port %s: %s" % (self.portstr, ctypes.W
inError()))
serial.serialutil.SerialException: could not open port 7: [Error 2] Het systeem
kan het opgegeven bestand niet vinden.
The system isn't able to find port 7 what am I doing wrong?
-
- Posts: 2
- Joined: Thu Feb 09, 2012 9:01 pm
Re: Hacking the Brother Knitting Machine - Extra files!!
Hi!
I am trying to hack kh 940 brother knitting machine. Unfortunately i am not able to backup the pattern and keep getting following error message:
python PDDemulate-1.0.py img COM12
Preparing . . . Please Wait
Ready!
Traceback (most recent call last):
File "PDDemulate-1.0.py", line 631, in
emu.handleRequests()
File "PDDemulate-1.0.py", line 382, in handleRequests
self.handleFDCmodeRequest(inc)
File "PDDemulate-1.0.py", line 504, in handleFDCmodeRequest
self.write(id)
AttributeError: PDDemulator instance has no attribute 'write'
any ideas what can be wrong?
i am thinking maybe i have modified cable wrong.
I have followed these instructions http://www.ladyada.net/learn/electroknit/ftdicable.html and dont understand very well whether pin2 and pin3 are interconnected and both red and green wires cut and not connected to the pins or red wire goes to pin3 and pin2?
I am trying to hack kh 940 brother knitting machine. Unfortunately i am not able to backup the pattern and keep getting following error message:
python PDDemulate-1.0.py img COM12
Preparing . . . Please Wait
Ready!
Traceback (most recent call last):
File "PDDemulate-1.0.py", line 631, in
emu.handleRequests()
File "PDDemulate-1.0.py", line 382, in handleRequests
self.handleFDCmodeRequest(inc)
File "PDDemulate-1.0.py", line 504, in handleFDCmodeRequest
self.write(id)
AttributeError: PDDemulator instance has no attribute 'write'
any ideas what can be wrong?
i am thinking maybe i have modified cable wrong.
I have followed these instructions http://www.ladyada.net/learn/electroknit/ftdicable.html and dont understand very well whether pin2 and pin3 are interconnected and both red and green wires cut and not connected to the pins or red wire goes to pin3 and pin2?
Please be positive and constructive with your questions and comments.