You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a Processing-for-Android library offering the serial communication.
4
8
5
-
This library works on Android 3.1 or later since it uses Android USB Host API.
9
+
This library works on Android 5.0 or later since it uses Android USB Host API.
6
10
7
-
This library also includes [usb-serial-for-android](https://code.google.com/p/usb-serial-for-android/downloads/list) containing FTDI serial driver and USB CDC/ACM serial driver (for Arduino). The library still has some issues and also has bunch of improvements according to the google code site. I will update the library when the newer version is released.
11
+
This library also includes [usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android) containing FTDI serial driver and USB CDC/ACM serial driver working on Android. Since the project creates only AAR file by default, there is a shell script, `update_libs.sh`, to extract a jar file from the built AAR file. Use the script when you require the other revision of the project binary.
8
12
9
13
Note that this version is alpha release.
10
14
11
15
## How to use
12
16
13
-
Build the source code (see below) or download a binary from [our SourceForge project page](https://sourceforge.net/projects/procandser/).
17
+
Build the source code (see below) or download a binary from [the release page](https://github.com/inventit/processing-android-serial/releases).
18
+
19
+
Unzip `AndroidSerial-distribution.zip` and copy all files including `AndroidSerial` directory to your `libraries` folder (e.g. `~/Documents/Processing/libraries`).
14
20
15
-
Unzip `AndroidSerial-distribution.zip` and copy all files including `AndroidSerial`directory to your `library` folder (e.g. `~/Documents/Processing/library`).
21
+
If you already install the older version of `AndroidSerial`library, remove it prior to copying the new one.
16
22
17
23
The usage of the library is almost same as [processing.serial.Serial](http://processing.org/reference/libraries/serial/Serial.html) library.
18
24
@@ -32,33 +38,40 @@ Other methods in processing.serial.Serial class should work without any changes.
32
38
33
39
You can get a working example from the [sparkfun's pulse sensor SEN-11574](https://www.sparkfun.com/products/11574).
34
40
35
-
1. Install Android SDK Platform 10 as well as Android 3.1 or later (I tried Android SDK Platform 16 Rev. 4, SDK Platform Tools Rev. 16.0.2, SDK Tools Rev. 22, and Processing 2.0)
41
+
1. Install Android SDK Platform 23 or higher as well as Android SDK Tools and Android SDK Platform-tools or later (I tried Android SDK Platform 23/24, SDK Platform Tools 24.0.3, SDK Tools 25.2.2, and Processing 3.2.1)
36
42
1. Install Android mode on your Processing environment
43
+
1. Install this library (Unzip `AndroidSerial-distribution.zip` and copy all files including `AndroidSerial` directory to your `libraries` folder (e.g. `~/Documents/Processing/libraries`))
37
44
1. Go to the [page](https://www.sparkfun.com/products/11574)
38
45
1. Download the Processing sketch from `Documents` section
39
-
1. Open the downloaded sketch
40
-
1. Modify the code as below
46
+
1. Open the downloaded Processing sketch (not Arduino)
47
+
1. On the Processing IDE, choose `Sketch` -> `Import Library` -> `Android Serial Library for Processing` (This will insert `import io.inventit.processing.android.serial.*;`)
48
+
1. Modify the code as below (see [here](https://github.com/WorldFamousElectronics/PulseSensor_Amped_Processing_Visualizer/blob/pr/1/PulseSensorAmpd_Processing_1dot1/PulseSensorAmpd_Processing_1dot1.pde) for the source code available at the sparkfun site)
41
49
42
-
L60: println(Serial.list()); // print a list of available serial ports
50
+
L9: // import processing.serial.*; // comment out
51
+
L57: println(Serial.list()); // print a list of available serial ports
43
52
| (add `this`)
44
53
v
45
-
L60: println(Serial.list(this)); // print a list of available serial ports
54
+
L57: println(Serial.list(this)); // print a list of available serial ports
46
55
47
-
L62: port = new Serial(this, Serial.list()[0], 19200); // make sure Arduino is talking serial at this baud rate
56
+
L61: port = new Serial(this, Serial.list()[0], 115200); // make sure Arduino is talking serial at this baud rate
48
57
| (add `this`)
49
58
v
50
-
L62: port = new Serial(this, Serial.list(this)[0], 19200); // make sure Arduino is talking serial at this baud rate
59
+
L61: port = new Serial(this, Serial.list(this)[0], 115200); // make sure Arduino is talking serial at this baud rate
51
60
52
-
1. Please make sure that you need to check and modigy the index of `Serial.list(this)` at the line 62 in order to specify the valid port name
61
+
1. Please make sure that you need to check and modify the index of `Serial.list(this)` at the line 62 in order to specify the valid port name
53
62
1. Create `res/xml` directories under the opened sketch directory (e.g. `~/Documents/Processing/PulseSensorAmpd_Processing_1dot1`)
54
63
1. Copy `examples/PulseSensor11574/res/xml/device_fileter.xml` to the created directory (e.g. `~/Documents/Processing/PulseSensorAmpd_Processing_1dot1/res/xml`)
55
64
1. Copy `examples/PulseSensor11574/AndroidManifest.xml` to the opened sketch directory (e.g. `~/Documents/Processing/PulseSensorAmpd_Processing_1dot1`)
56
-
1. Connect your Android 3.1+ device to your computer and Run the code
65
+
1. Connect your Android device to your computer and Run the code
57
66
1. The application may report `Unexpected error` on your Android screen but you can ignore it (tap `OK`)
58
67
1. Disconnect the Android device from the computer and connect your FTDI device or Arduino to the Android device with USB cable
59
68
1. Android asks you to choose an application to launch, then choose your application (e.g. `PulseSensorAmpd_Processing_1dot1`)
60
69
1. Finally, you will see the same screen as your computer!
You can build the project source code though you can download the built binary from [our SourceForge project page](https://sourceforge.net/projects/procandser/).
@@ -67,6 +80,7 @@ Prior to building the project, you need to install the following software:
67
80
68
81
1. JDK 6+ (Any JDK will be available)
69
82
1.[Apache Maven](http://maven.apache.org/) (Choose the latest one if possible)
83
+
1.[Gradle](https://gradle.org) is required if you run `update_libs.sh`, which downloads and builds the other revision of `usb-serial-for-android` source code than `b96f9ca`
70
84
71
85
Then run the following command under the root of the project:
72
86
@@ -77,15 +91,15 @@ And you can find the artifact file named `AndroidSerial-distribution.zip` at `ta
77
91
## Directory Structure
78
92
The directory structure of this application is as follows:
79
93
80
-
|-- .settings (E)
94
+
|-- images
81
95
|-- libs
82
96
| |-- processing
83
97
| | `-- android-core
84
-
| | `-- 2.0
98
+
| | `-- android-mode-0252
85
99
| `-- com
86
100
| `-- hoho
87
101
| `-- usb-serial-for-android
88
-
| `-- v010
102
+
| `-- b96f9ca
89
103
|-- src
90
104
| |-- main
91
105
| | |-- assembly
@@ -99,14 +113,13 @@ The directory structure of this application is as follows:
99
113
| |-- java
100
114
| `-- resources
101
115
102
-
(E) Eclipse specific setting files
103
116
(X) is a working example for Sparkfun's Pulse Sensor SEN-11574
104
117
105
118
## Source Code License
106
119
107
120
All program source codes are available under the MIT style License.
108
121
109
-
Copyright (c) 2013 Inventit Inc.
122
+
Copyright (c) 2016 Inventit Inc.
110
123
111
124
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
112
125
@@ -123,12 +136,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
123
136
*[Robolectric](https://github.com/robolectric/robolectric/) ... Android testing library (TEST USE ONLY)
124
137
*[Mockito](https://code.google.com/p/mockito/) ... Mock testing library (TEST USE ONLY)
125
138
126
-
## Known Issues
139
+
## Change History
127
140
128
-
* Unexpected error occurs when the sketch is compiled and installed into a device
129
-
* The current version of [usb-serial-for-android](https://code.google.com/p/usb-serial-for-android/) has several issues regarding data reading. If `java.io.IOException: Expected at least 2 bytes` is observed, please wait a moment or try to re-connect the cable though the trunk version of the driver is already fixed
141
+
0.2.0 : September 23, 2016
130
142
131
-
## Change History
143
+
* Rename package to `io.inventit.processing.android.serial`
144
+
* Processing 3.2 support
145
+
* Use the latest version of [usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android)
0 commit comments