Hi Peter, I remember having discovered basically the same problem. Here is what I got on the mailing list back then (the thread subject was "detect a usb connection"):
Robert Szewczyk wrote: > This issue has been fixed in Boomerang but was never propagated to the > main TinyOS tree. The underlying problem is that the TinyOS 1.x keeps > UART on all the time, and one of the UART pins is kept high in the > default state. When a node is disconnected from USB, that pin powers > the USB circuit, and, through a loop, provides a logical 1 on pin 1.2 > In Boomerang I solved the problem by turning off the peripheral when > not in use, and setting the UART pins to low. > > The behavior you observed will also cause much higher power > consumption when a node is disconnected from USB. I would suggest > that you switch your development from tinyos 1.x to Boomerang. > > Best regards, > > Rob > > Robert Szewczyk > Moteiv Corporation > > On 5/24/07, Urs Hunkeler <[email protected]> wrote: >> Hi, >> >> I tried reading Port 1 Pin 2. It seems to work until the mote is >> re-disconnected. Somehow after the mote has been connected and then >> disconnected again, the pin always reads a logical one. Do I have to >> reset the pin somehow? >> >> Cheers, >> Urs I have not spent any time on trying to fix this problem, but of course I would be interested as well if you manage to get this solved in TinyOS 2.x. Cheers, Urs Peter Bigot wrote: > I'm using TinyOS 2.1 (from a recent CVS checkout) with a tmote sky. I have > a component which hooks into the MSP430 Port1 Pin 2 to monitor the USB > connection and indicate whether it's connected by lighting LED1. This > works fine. > > Now, I want to hook it into a program like TestSerial which transmits > information over the serial line, so that LED1 goes out when the USB > connection goes down. This does not work. The serial communications works > fine, but when I pull the mote out of the USB port, LED1 never turns off. > Because LED0 stops flickering, though, I believe the serial port stops > transmitting. > > If I run the same program but with the call to TestSerialC.Control.start() > commented out, the USB LED code works fine, but (of course) no serial > communications occurs. > > I'm guessing that somewhere down in the guts of TinyOS, the serial stack is > detecting that the mote has been disconnected from the PC and is shutting > itself off. As a side effect, it seems to be disabling my USB monitor. > > Is this diagnosis correct? If so, what code is causing this to happen, 'cuz > I can't find it? Beyond that, is there any other information I need in > order to get a USB-disconnected event in an application that uses serial > communications? > > Thanks. > > Peter > _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
