import serial

I am trying : http://www.fablabitalia.it/wiki//TornioDigitale/TornioDigitale

I get the console message :
Importerror :No module named serial.

I ran the pySerial which installed in :
C:\Python32\Lib\site-packages\serial

I have the latest vesions of everything.

I can let the script make a vase by commenting out, but of course without control by the Arduino.

So I copied the pySerial package to Blender/…
I copied the files Python still nagged about to the “root”.

All very primitive. Looks like Linux. We are not amused.

The remaining error is probably not because there is no link to the Arduino yet. I don’t like an error in a lib file :

Traceback (most recent call last):
File “D:\RepairableMachines\ArduinoBlenderVaas ornio digitale.blend ornio”, line 3, in <module>
File “C:\Program Files\Blender Foundation\Blender\2.58\python\lib\serial_init_.py”, line 19, in <module>
from serialwin32 import *
File “C:\Program Files\Blender Foundation\Blender\2.58\python\lib\serialwin32.py”, line 12, in <module>
import win32
File “C:\Program Files\Blender Foundation\Blender\2.58\python\lib\win32.py”, line 164
MAXDWORD = 4294967295L # Variable c_uint
^
SyntaxError: invalid syntax

location:<unknown location>:-1

hi filipc,
i’m really happy that somebody else is trying to use my code to interface blender with Arduino.
Did you installed the library in the right way?

python3 setup.py install

checkout the pyserial installation page.

http://pyserial.sourceforge.net/pyserial.html#installation

Lore,

once again I installed pyserial_py3K-2.2.win32.exe.
I run Winows 7. I don’t think something can go wrong with this.
The problems seem more to be serialwin32.py and win32.py.

The italian program I try is not an add-on I suppose ?

Now I have the errors :

read blend: D:\RepairableMachines\ArduinoBlenderVaas ornio digitale.blend
Traceback (most recent call last):
File “D:\RepairableMachines\ArduinoBlenderVaas ornio digitale.blend ornio”,
line 3, in <module>
File “C:\Program Files\Blender Foundation\Blender\2.58\scripts\modules\serial
init.py”, line 19, in <module>
from serialwin32 import *
File “C:\Program Files\Blender Foundation\Blender\2.58\python\lib\serialwin32.
py”, line 12, in <module>
import win32
ImportError: No module named win32


I have 4 (3 different) files “win32.py” on my computer, all over the place.

I got help.
I copied the serial directory from c:python32\lib\site-packages
to …2.58\python\lib

the error I get now is most probably because the Arduino is not attached.
ser = serial.Serial("/dev/tty.usbmodemfa141",9600) # open first serial port

Vector((0.0, 0.0, 0.0, 6.0))


Vector((0.0, 30.0, 0.0, 6.0))


Vector((0.0, 30.0, 0.0, 6.0))


Vector((0.0, 30.0, 30.0, 6.0))


Vector((0.0, 30.0, 60.0, 6.0))


Vector((0.0, 30.0, 90.0, 6.0))
Traceback (most recent call last):
File “D:\RepairableMachines\ArduinoBlenderVaas ornio digitale.blend ornio”,
line 61, in <module>
File “C:\Program Files\Blender Foundation\Blender\blender-2.59-RC-windows32\2.
58\python\lib\serial\serialwin32.py”, line 30, in init
SerialBase.init(self, *args, **kwargs)
File “C:\Program Files\Blender Foundation\Blender\blender-2.59-RC-windows32\2.
58\python\lib\serial\serialutil.py”, line 260, in init
self.open()
File “C:\Program Files\Blender Foundation\Blender\blender-2.59-RC-windows32\2.
58\python\lib\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 /dev/tty.usbmodemfa141: [
Error 3] The system cannot find the path specified.

dear filipc,
now you have to change “/dev/tty.usbmodemfa141” with the name of the serial port where you have connected your arduino.
You can check the name of the serial port in Arduino ide:

Select the serial device of the Arduino board from the Tools | Serial Port menu. This is likely to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports). To find out, you can disconnect your Arduino board and re-open the menu; the entry that disappears should be the Arduino board. Reconnect the board and select that serial port.

now it must work.

And indeed it works.
First I refreshed my Arduino skills with the example : http://arduino.cc/en/Tutorial/AnalogReadSerial

My com port is COM20.

But a warning : stop the Arduino IDE, or the port will be busy.

Maybe I’ll increase the time delay, because the picture is rather unstable. I still have some issues, but first I’ll connect the other four pots.

Now showtime before everyone knows how easy it is.

Does anyone have a plan of the Hoberman contraption, or a better idea for turning the 5 pots ?
The fablab only reopens in september to do the laser cutting and to use the makerbot.

Hi everybody,

I´m trying to get pyserial run on blender 2.63 but it wont work. I tried everything I could find on the internet but nothing worked. Also the method in this thread isn´t the solution for me.

Using Python 3.2 and Pyserial 2.6.

If it works I will try to move a servo motor by blender.

Hope someone can help me.

Regards!

Hi filipc,

I’m attempting the same thing as you, but I’m stuck on this error. I’ve copied both ‘serial’ and ‘pyserial-2.6’ folders to the ‘2.65/Python/lib’ folder but am still getting the ‘MAXDWORD’ error…

Do you have any tips for how you got past this? Typing ‘import serial’ in a normal Python console seems to work fine, it just seems to be Blender which is acting up…

I’m running Windows 7, 64-bit, Python 2.7, Blender 2.65a

Any help would be really appreciated!