Re: serial port problems

2010-11-08 Thread Bob Sneidar
Okay, this may be unrelated, but I have a setup that was using Parallels 4 
under Snow Leopard. The guest OS was Windows Server 2003, and the software in 
Windows was MusicMaster, which (and here's the important thing) was using a USB 
key to authenticate a certain number of users accessing Server 2003 in a 
terminal session. 

Why is this relevant you ask? Because everything was working like a peach until 
one day after doing some system updates, the usb key was not connected to the 
virtual machine. Parallels thought it was, but there was no communication. 
Unplugging and replugging the USB key re-registered the USB device and it 
worked for about a day, and then disconnected again. 

After having them ship me out a new USB key to no avail, I began to think that 
maybe it was an incompatibility with the current OS and Parallels 4, but then 
why did it work for months and suddenly start having fits?? Well I upgraded to 
Parallels 6 and lo and behold, the problem went away and has not returned. 

I think that Apple recently did some kind of kernel change in the way USB 
devices are registered and maintained, probably as a security update. I would 
go back and check it in 4.0 (if you haven't already) to see if it actually DOES 
still work, and you aren't just remembering that it did. 

Just a shot in the dark. 

Bob


On Nov 7, 2010, at 10:07 AM, J. Landman Gay wrote:

 On 11/7/10 9:18 AM, Larry Walker wrote:
 I am trying to read data from a serial port (using a USB-serial adaptor).
 
 Glad to see this here Larry. Just to fill everyone in, Larry and I have been 
 going around with this issue for about a week in the tech queue without 
 success (and I really appreciate his patience, he's been incredibly 
 reasonable about it.) I asked Mark Waddingham about the problem and he said 
 that basically the serial commands haven't been changed since their initial 
 implementation back in MetaCard, and that any device that represents itself 
 as a serial device should work with open file (but not necessarily with the 
 device name returned by the drivernames. Use modem: or printer: instead.) 
 He also said that they have never been reworked to support OS X; they were 
 originally written for OS 9 and have always continued to work in OS X, so the 
 code hasn't been examined.
 
 Eric's comment that it works in 4.0 and not in 4.5 is something I don't think 
 the team knows about. Since serial access hasn't changed in the engine, there 
 must be some other change that peripherally affects serial port access. If 
 that's so, then a bug report in the QCC would be in order.
 
 I hope either Sarah or Phil will see this, since they are the serial/USB 
 experts here. Maybe they have some comments to add or a workaround they've 
 discovered.
 
 -- 
 Jacqueline Landman Gay | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.com
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


serial port problems

2010-11-07 Thread Larry Walker
I am trying to read data from a serial port (using a USB-serial  
adaptor).


I am on a MacBook Pro running 10.5.8, using LiveCode 4.5, and Prolific  
model 2303 USB-serial adaptor.


The following code does not work:

on mouseUp
   put modem: into usbSerial
   put empty into field Field

   open driver usbSerial for text read
   read from driver usbSerial for 5 chars
   put it after field field

   close driver usbSerial
end mouseUp

Setting a breakpoint on the read from shows that the open does not  
appear to fail. Single-stepping through the read does not wait for any  
input from the connected terminal, it returns immediately. It is  
empty afterward.


By reading for N chars I believe I am side-stepping any line - 
terminator issues.


I have confirmed that the USB-serial adaptor and the terminal can talk  
to each other properly, using the command-line invocation: 'screen / 
dev/tty.usbserial'. I have confirmed that the serialControlString  
matches the terminal's settings.


This fail whether I use open file or open driver.
This fails whether I use modem or printer as the device.

If I use /dev/tty.usbserial, the IDE hangs and I have to Force-Quit it.

I have tried using the SerialTest.rev stack (http://www.troz.net/rev/stacks/SerialTest.rev 
) as well: identical results.


I have read Phil Worthington's paper on serial communication (http://www.pdslabs.net/usb/rev-usb1.pdf 
); I believe I'm doing just as he suggests (except for the no-name  
adaptor I bought), but no luck. I did notice that the DeviceNames  
seems to now return its results in a format different from the one  
Phil describes, for whatever that might be worth (LC4.5 changes?).


Has anything changed in LC4.5 regarding serial communication? Can  
others run the serialTest.rev script properly under LC4.5?


Any suggestions welcome!


Larry Walker

Walker Energy Systems LLC
Madison, WI  USA

Strategies  Technologies

www.walkerenergysystems.com








___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: serial port problems

2010-11-07 Thread Erik Schwartz
I have had problems with 4.5 and serial comms. I have not had time to
diagnose it properly. I just regressed back to use 4.0 until the bugs
in 4.5 get dealt with (kind of annoyed that I paid for the upgrade I
can't use yet though). I hope you get it figured out.

Erik



On Sun, Nov 7, 2010 at 10:18 AM, Larry Walker
la...@walkerenergysystems.com wrote:
 I am trying to read data from a serial port (using a USB-serial adaptor).

 I am on a MacBook Pro running 10.5.8, using LiveCode 4.5, and Prolific model
 2303 USB-serial adaptor.

 The following code does not work:

 on mouseUp
   put modem: into usbSerial
   put empty into field Field

   open driver usbSerial for text read
   read from driver usbSerial for 5 chars
   put it after field field

   close driver usbSerial
 end mouseUp

 Setting a breakpoint on the read from shows that the open does not
 appear to fail. Single-stepping through the read does not wait for any input
 from the connected terminal, it returns immediately. It is empty
 afterward.

 By reading for N chars I believe I am side-stepping any line -terminator
 issues.

 I have confirmed that the USB-serial adaptor and the terminal can talk to
 each other properly, using the command-line invocation: 'screen
 /dev/tty.usbserial'. I have confirmed that the serialControlString matches
 the terminal's settings.

 This fail whether I use open file or open driver.
 This fails whether I use modem or printer as the device.

 If I use /dev/tty.usbserial, the IDE hangs and I have to Force-Quit it.

 I have tried using the SerialTest.rev stack
 (http://www.troz.net/rev/stacks/SerialTest.rev) as well: identical results.

 I have read Phil Worthington's paper on serial communication
 (http://www.pdslabs.net/usb/rev-usb1.pdf); I believe I'm doing just as he
 suggests (except for the no-name adaptor I bought), but no luck. I did
 notice that the DeviceNames seems to now return its results in a format
 different from the one Phil describes, for whatever that might be worth
 (LC4.5 changes?).

 Has anything changed in LC4.5 regarding serial communication? Can others run
 the serialTest.rev script properly under LC4.5?

-- 
==
er...@sisyph.us                                  http://sisyph.us
(530) 213-ERIK                          http://twitter.com/eriks
(530) 213-3745   http://www.linkedin.com/in/erikschwartz
==
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: serial port problems

2010-11-07 Thread J. Landman Gay

On 11/7/10 9:18 AM, Larry Walker wrote:

I am trying to read data from a serial port (using a USB-serial adaptor).


Glad to see this here Larry. Just to fill everyone in, Larry and I have 
been going around with this issue for about a week in the tech queue 
without success (and I really appreciate his patience, he's been 
incredibly reasonable about it.) I asked Mark Waddingham about the 
problem and he said that basically the serial commands haven't been 
changed since their initial implementation back in MetaCard, and that 
any device that represents itself as a serial device should work with 
open file (but not necessarily with the device name returned by the 
drivernames. Use modem: or printer: instead.) He also said that they 
have never been reworked to support OS X; they were originally written 
for OS 9 and have always continued to work in OS X, so the code hasn't 
been examined.


Eric's comment that it works in 4.0 and not in 4.5 is something I don't 
think the team knows about. Since serial access hasn't changed in the 
engine, there must be some other change that peripherally affects serial 
port access. If that's so, then a bug report in the QCC would be in order.


I hope either Sarah or Phil will see this, since they are the serial/USB 
experts here. Maybe they have some comments to add or a workaround 
they've discovered.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: serial port problems

2010-11-07 Thread stephen barncard
I think that the no-name adaptor might be a problem.  I've successfully used
the KEYSPAN adaptor with  Rev recently with version 4. I have not tested the
KEYSPAN with 4.5.

search google for
keyspanhttp://www.google.com/search?q=keyspan+serial+adaptorhl=ensafe=offclient=safarirls=enprmd=ssource=univtbs=shop:1tbo=uei=dPzWTMK8HIS2sAOrpYCNCwsa=Xoi=product_result_groupct=titleresnum=3ved=0CEIQrQQwAgbiw=1577bih=951

On 7 November 2010 07:18, Larry Walker la...@walkerenergysystems.comwrote:

 I am trying to read data from a serial port (using a USB-serial adaptor).

 I am on a MacBook Pro running 10.5.8, using LiveCode 4.5, and Prolific
 model 2303 USB-serial adaptor.


 ; I believe I'm doing just as he suggests (except for the no-name adaptor I
 bought),





Stephen Barncard
San Francisco Ca. USA

more about sqb  http://www.google.com/profiles/sbarncar
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: serial port problems

2010-11-07 Thread Sarah Reichelt
On Mon, Nov 8, 2010 at 1:18 AM, Larry Walker
la...@walkerenergysystems.com wrote:
 I am trying to read data from a serial port (using a USB-serial adaptor).

 I am on a MacBook Pro running 10.5.8, using LiveCode 4.5, and Prolific model
 2303 USB-serial adaptor.

 The following code does not work:

 on mouseUp
   put modem: into usbSerial
   put empty into field Field

   open driver usbSerial for text read
   read from driver usbSerial for 5 chars
   put it after field field

   close driver usbSerial
 end mouseUp

 Setting a breakpoint on the read from shows that the open does not
 appear to fail. Single-stepping through the read does not wait for any input
 from the connected terminal, it returns immediately. It is empty
 afterward.

 By reading for N chars I believe I am side-stepping any line -terminator
 issues.

 I have confirmed that the USB-serial adaptor and the terminal can talk to
 each other properly, using the command-line invocation: 'screen
 /dev/tty.usbserial'. I have confirmed that the serialControlString matches
 the terminal's settings.

 This fail whether I use open file or open driver.
 This fails whether I use modem or printer as the device.

 If I use /dev/tty.usbserial, the IDE hangs and I have to Force-Quit it.

OK, I haven't tried any of this with LC 4.5, but if Mark says nothing
has changed, then this should still be valid.

Firstly, modem: is unlikely to work. Some Keyspans allow you to
configure one of their connections to appear to be a modem, but unless
your Mac actually has a modem, then this is not going to connect to
anything.

You MUST install drivers for your adapter. In your case, Prolific
supply all the drivers at
http://www.prolific.com.tw/eng/downloads.asp?id=31.

Once you have the drivers installed, check the driverNames again and
hopefully something will show up. Here is what I get on a Mac with a
Keyspan (two port) and a generic FTDI adapter attached and Rev 4.0:

usbserial-FTC8J5X3,/dev/tty.usbserial-FTC8J5X3,/dev/cu.usbserial-FTC8J5X3
KeySerial1,/dev/tty.KeySerial1,/dev/cu.KeySerial1
USA28X1a2P1.1,/dev/tty.USA28X1a2P1.1,/dev/cu.USA28X1a2P1.1
USA28X1a2P2.2,/dev/tty.USA28X1a2P2.2,/dev/cu.USA28X1a2P2.2
Bluetooth-PDA-Sync,/dev/tty.Bluetooth-PDA-Sync,/dev/cu.Bluetooth-PDA-Sync

Each line of the driverNames contains 3 items. The one you need to use
is the last one,  starting with /dev/cu.. To open the port to the
first device on the list, I would use:

global gPortName
put /dev/cu.usbserial-FTC8J5X3 into gPortName
open driver gPortName for binary update
if the result is not empty then
answer error Unable to open port  cr  the result
end if

When finished, close the port using:
close driver gPortName

But you may need to adjust the serial port settings before you can
actually send and receive data. This depends on the device you are
communicating with, rather than the adapter, but my serial test stack
allows easy access to the common settings, so you can test this.

When writing, again it depends on the device. Some require a fixed
number of bytes, some need a specific end-of-line. Use my test stack
to work this out if you don't have the docs.

Reading: the problem with reading a fixed number of bytes is that the
bytes you don't read are still in the buffer and will mess up your
next read. This may not matter if you are closing the port after each
read, but I always prefer to use:
read from driver gPortName until empty in 90 ticks

This grabs everything it can inside the time limit.
Then I can work out whether I have received multiple signals, or a
partial signal and act accordingly, either processing the segments in
a loop, or asking the serial port for more data.

I hope this helps you get started, but if not, feel free to get back
to me, either on or off list.

Cheers,
Sarah
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution