usb driver problem

Claudi Cornaz claudi.c at fiberworld.nl
Sun Jan 23 18:15:13 EST 2011


Hello all,

It's good to see this thread is picking up some steam, because this could realy be something LC could shine in.
A easy and powerful environment to control all things around us, motors, sensors, solarpanels, your thermostat, you name it, the sky is the limit.

Ok, it's getting strange now. On my macbook with os 10.5.8 and my test stack sending and the aduino echoing all goes well, more or less.
Now I uploaded a scetch where the arduino does the sending all on it's own with:
 Serial.print,("Hello world");
 Serial.print("some more");
 delay(300);

I seem to recieve nothing. No I send something and suddenly I see a lot of "hello world some more" and then livecode freezes up and crashes hard.
It just quits. So there defenitly seems to be a problem with LC. I even tryed a try clause around the recieving code but no avail what soever.
It's just a hard crash. LC 4.5.3,LC 4.5.2 and LC 4.5.1

Now I changed the arduino scetch a bit and it does just  
Serial.print("1");

Now initialy I don't seem to recieve anything (using read from driver send at regular intervals)
Next I send a char to the arduino and suddenly I recieve a lot of one's 
first there are a lot on one line ( each succesive read is on a new line so these were in the buffer and read in one go)
then some 1 on one line and sometimes there are two 1 on one line.  ( I  scan the input each half sec's and send every 300 millisecs so this looks ok)

This raises at least 2 questions:
1. Why do I need a send at least one char before I can recieve?
2. Why does LC crash when I do?
      Serial.print,("Hello world");
      Serial.print("some more");

After a bit more expirimentation I discovered that I can send up to "hello " chars and all works fine with 10.5.8
one char more and troubles start, LC crashes. 
Well it's a bit more complex. I now send "hello" every 300 millisecs. In LC I read the port every sec ( to build up in the buffer). So as soon as I send a char to start recieving ( I know this is strange but somehow needs to be done) I recieve a lot of hello's as one block then they trickle in but very soon LC will just crash hard.

I'll do some more sleuthing and post the results as soon as I have some time. 
LC just crashes all the while after recieving now.
I think I need some sleep. It just drives me crazy.

This seems to me a big problem  'cause LC could be a great environment just for this kind of stuff. Specialy with the firmata project
of arduino which, if I understand it correctly will allow people to use the arduino without need to learn to programming the thing. 
It will just expose/make accesible all the pins of the ardiuino to the environment like LC. This means you can configuer each pin 
and read and write to each pin on the arduino completly from within LC. No programming of the arduino required
A great opportunity which could open up  a exciting new world: interaction with the outer world without learning a new language.
LC realy should not just crash and dye on us in this horribly way when reading from a driver or file as serial port.

Another question: where are these drivers installed on my disk? Perhaps I could swap the 10.5/x version with the 10.6.x version to see if that
will help. No idea but I am willing to try anything. (When installing choosing custom I can see there are 2 different drivers but one is always greyed
out. A different one is greyed out for 10.5.x and 10.6.x) I read somewhere there is also some kex file or something like that. Anyone any idea's?


Lots of succes,
   Claudi



On 23 jan 2011, at 22:57, Jerry J wrote:

> On Jan 23, 2011, at 7:09 AM, Thomas McGrath III wrote:
> 
>> Jerry,
>> 
>> Maybe you can answer this? The Arduino ide prefers to use the cu.usbmodem* and some of the tests I have done in LC have shown that the tty.usbmodem* is the better choice for receiving data from the Arduino Uno and the cu.usbmodem* when trying to send. I am not sure what the difference between the two of them are and why LC prefers the tty for receiving and the cu for sending??? And my test are suspect to begin with due to a lack of understanding at the start into this wonderful world  of serial communications.
> 
> I don't have much experience with UNIX drivers, or how they're named. I can guess what tty is short for, but no clue about cu. As for the chars at the end (like 3d11 or 3a21) are those identifiers assigned by UNIX to be sure each driver is unique? I know that happens with disk names, but its just a guess here. Over to you, UNIX guts gurus!
> 
> --Jerry
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list