Talend Cache components
Talend component : tSerialInput
Background : ETL suites are normally designed to manage data flows.
Recently we needed to load into a DB some data produced by sensors, such as temperature, current etc sent by microcontroller based devices to the serial port.
TOS makes database related tasks easy, manageable, almost effortless, it just needed to be able to see our microcrontrollers as a normal data source.
Instead of creating a specific component (which is also in the making) we started by creating a generic serial port input as this is an easier way to test our routines and in additin can prove useful to other Talend community members.
Version : 0.1
Release Date : Jan 05 2012
Status : Alpha
The tSerialInput component outputs a single field called "SERIALDATA" and it identifies the records using a strng termination character which can be configured in the parameters.
In this example the input to the serial port was provided by an Arduino uno board (http://www.arduno.cc Arduino is a great open source hardware platform) using a minimalist sketch (it's an arduino source code that is compiled and uploaded to the board), the source code is the following :
Serial.println("This is a line from Arduino!");
The component uses (it must be installed separately!) the RXTX java library for the serial port, it can be downloaded here : http://rxtx.qbang.org/wiki/index.php/Download.
It also uses a simple wrapper we produced for this library, the jar is included in the component. This wrapper class simplifies the concurrency by managing the incoming data in a separate thread.
We might decide to change this approach in the future, or anyway improve the library, should it be the case we will post here the updates.
Technically our library is designed to manage a protocol, meaning it can read AND write to the serial port, these extensions will probably also be added to the new versions of the Talend component.
By default the component keeps waiting for new lines unless one of these 3 conditions are met :
1) A timeout is reached (set a zero value in the parameter to specify no timeout should be issued)
2) The expected number of records has been receaved (set a zero value in the parameter to read unlimited records)
3) The tSerialInpu1_processMore Boolean object is set to false in the globalMap programmatically (code : globalMap.put("tSerialInput1_processMore",new Boolean(false)); // assuming the name of the instance of the compoennt is tSerialInput1)
We will probably update the component in the next days and months with new features, if you have suggestions, please let us know here.
THIS SOFTWARE IS PROVIDED BY POWERUP ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL POWERUP BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.