hi all....

I'm hoping someone can shed some light onto a project I'm working on.
I have an Mdrive 23 step motor that works with a serial terminal.

The whole serial terminal is new to me and I'm confused by what it means.

I have been able to make the motor work with screen program.
Now I need to be able to control it with Python and I started with the
PySerial module.

So far I've been able to connect to the motor but no commands have had any effect.

import serial

ser = serial.Serial('/dev/ttyUSB0', 19200)

ser.isOpen() # returns True

ser.write('ma 100000\r\n') # does nothing...

ser.inWaiting() # returns 0


I could use some help here...I'm at a lose...


I didn't set the variables below...I'm betting that's a problem...not sure
which parity to use, will research, stop bits and byte size also unknown at this time...

The MDrive 23 doesn't appear to have a lot of doc about this...
I didn't use ser.open() either, but I think it happens anyways when the Serial object
is contructed, since ser.isOpen() returned True.


reading about PyUSB now...

This motor uses a ribbon connection to a box with an ethernet and USB ports on it. I'v been thinking of it
as a serial-to-USB but perhaps it isn't....

however, I see Arduino pple using PySerial and I'd bet this motor uses something Arudion-ish to make the programming interace so easy...

Edited 3 Years Ago by die_windoze

This article has been dead for over six months. Start a new discussion instead.