Hello all

I have an app that takes data from a sensor in the mobile device and uses 
the IOIO to transform the numeric value into the frequency of a transducer 
by turning an output pin on and off and controlling the transducer with a 
FET.

I have successfully done this in other apps but something is different now. 
My problem is that when I run:

*...*

 

int vibPin = 40;

*...*


led_ = ioio_.openDigitalOutput(IOIO.LED_PIN);

out = ioio_.openDigitalOutput(vibPin);

*...*


while (true) {


* //out.write(false);*

led_.write(false);

Thread.sleep((long) 100);

* //out.write(true);*

led_.write(true);

Thread.sleep((long) _incomingValue);

Log.d(TAG, "Sensor Value " + _incomingValue);

}


with the "out" pin commented out, everything works and LogCat shows the 
Sensor Value indefinitely. But if I uncomment the out pin, the app will run 
for a bit but then IOIO will disconnect and re-connect. Log cat will show 
this:

08-22 17:13:28.351: I/IOIOImpl(20170): IOIO connection established

08-22 17:13:28.356: D/IOIOConnectionVibThread(20170): Thread [Thread-78589] 
is running.

08-22 17:13:28.961: D/IOIOConnectionVibThread(20170): Sensor Value 485.0

08-22 17:13:29.591: D/IOIOConnectionVibThread(20170): Sensor Value 485.0

08-22 17:13:30.221: D/IOIOConnectionVibThread(20170): Sensor Value 485.0

08-22 17:13:30.851: D/IOIOConnectionVibThread(20170): Sensor Value 485.0

08-22 17:13:31.476: D/IOIOConnectionVibThread(20170): Sensor Value 485.0

08-22 17:13:32.096: D/IOIOConnectionVibThread(20170): Sensor Value 485.0

08-22 17:13:32.721: D/IOIOConnectionVibThread(20170): Sensor Value 485.0

08-22 17:13:33.351: D/IOIOConnectionVibThread(20170): Sensor Value 485.0

08-22 17:13:33.466: I/IOIOProtocol(20170): IOIO disconnected

08-22 17:13:33.486: D/IOIOImpl(20170): Physical disconnect.

08-22 17:13:33.486: V/BluetoothIOIOConnection(20170): Client initiated 
disconnect

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): 
ConnectionLostException

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): 
ioio.lib.api.exception.ConnectionLostException: java.io.IOException: Broken 
pipe

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): at 
ioio.lib.impl.DigitalOutputImpl.write(DigitalOutputImpl.java:53)

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): at 
mit.edu.obmg.cellsensors.IOIOConnection$Vibration.run(IOIOConnection.java:170)

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): Caused by: 
java.io.IOException: Broken pipe

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): at 
android.net.LocalSocketImpl.writeba_native(Native Method)

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): at 
android.net.LocalSocketImpl.access$600(LocalSocketImpl.java:33)

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): at 
android.net.LocalSocketImpl$SocketOutputStream.write(LocalSocketImpl.java:132)

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): at 
android.bluetooth.BluetoothSocket.write(BluetoothSocket.java:482)

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): at 
android.bluetooth.BluetoothOutputStream.write(BluetoothOutputStream.java:85)

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): at 
java.io.BufferedOutputStream.flushInternal(BufferedOutputStream.java:185)

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): at 
java.io.BufferedOutputStream.flush(BufferedOutputStream.java:85)

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): at 
ioio.lib.impl.IOIOProtocol.endBatch(IOIOProtocol.java:186)

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): at 
ioio.lib.impl.IOIOProtocol.setDigitalOutLevel(IOIOProtocol.java:245)

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): at 
ioio.lib.impl.DigitalOutputImpl.write(DigitalOutputImpl.java:50)

08-22 17:13:33.496: E/IOIOConnectionVibThread(20170): ... 1 more

08-22 17:15:53.466: I/IOIOConnection(20170): All workers dead

08-22 17:15:53.476: D/IOIOImpl(20170): Waiting for IOIO connection

08-22 17:15:53.476: V/IOIOImpl(20170): Waiting for underlying connection

08-22 17:15:53.506: V/BluetoothIOIOConnection(20170): Attempting to connect 
to Bluetooth device: IOIO (08:30)

08-22 17:15:53.511: D/BluetoothUtils(20170): 
isSocketAllowedBySecurityPolicy start : device null

08-22 17:15:53.511: D/BluetoothUtils(20170): 
isSocketAllowedBySecurityPolicy start : device null

08-22 17:15:53.511: D/BluetoothUtils(20170): 
isSocketAllowedBySecurityPolicy start : device null

08-22 17:15:53.511: W/BluetoothAdapter(20170): getBluetoothService() called 
with no BluetoothManagerCallback

08-22 17:15:53.526: D/BluetoothSocket(20170): connect(), SocketState: INIT, 
mPfd: {ParcelFileDescriptor: FileDescriptor[109]}

08-22 17:15:58.221: V/BluetoothIOIOConnection(20170): Established 
connection to device IOIO (08:30) address: 00:1F:81:00:08:30

08-22 17:15:58.221: V/IOIOImpl(20170): Waiting for handshake

08-22 17:15:58.226: I/IncomingState(20170): IOIO Connection established. 
Hardware ID: SPRK0020 Bootloader ID: IOIO0400 Firmware ID: IOIO0500

08-22 17:15:58.226: V/IOIOImpl(20170): Querying for required interface ID

08-22 17:15:58.236: V/IOIOImpl(20170): Required interface ID is supported

08-22 17:15:58.236: I/IOIOImpl(20170): IOIO connection established


The app uses fragments to control each different sensor present in the 
device and uses IOIO as a service. Inside the IOIO service I start a 
"Vibration Thread" so that I can control the frequency of the vibPin in a 
loop.

I have no idea what is going on or how to fix it.

Thanks,
Santiago


-- 
You received this message because you are subscribed to the Google Groups 
"ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ioio-users+unsubscr...@googlegroups.com.
To post to this group, send email to ioio-users@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to