<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Yoovant</title>
	<atom:link href="http://www.yoovant.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yoovant.com</link>
	<description>Brilliant ideas for your life</description>
	<lastBuildDate>Tue, 07 May 2013 09:21:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>RFID</title>
		<link>http://www.yoovant.com/rfid/</link>
		<comments>http://www.yoovant.com/rfid/#comments</comments>
		<pubDate>Tue, 07 May 2013 06:19:51 +0000</pubDate>
		<dc:creator>Marcello Gesmundo</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.yoovant.com/?p=1834</guid>
		<description><![CDATA[<p>In this post I will show how to read RFID TAG in Node.js using an Acme Systems board and an RFID reader.
To accomplish this task you need:</p>

One Acme Systems Terra board or 
One Acme Systems Fox board with one Daisy-1  … <a class="more-link" href="http://www.yoovant.com/rfid/"><img class="imgreadmore" height="24" width="24" alt="Read more" title="Read more" src="http://www.yoovant.com/wp-content/themes/CleanSpace/images/next.png"></img></a>]]></description>
				<content:encoded><![CDATA[<p>In this post I will show how to read RFID TAG in Node.js using an <a href="www.acmesystems.it">Acme Systems</a> board and an <a href="http://en.wikipedia.org/wiki/Rfid">RFID</a> reader.<br />
To accomplish this task you need:</p>
<ul>
<li>One <a href="http://www.acmesystems.it/terra/">Acme Systems Terra board</a> or </li>
<li>One <a href="http://www.acmesystems.it/FOXG20/">Acme Systems Fox board</a> with one <a href="http://www.acmesystems.it/DAISY-1">Daisy-1 Daisy adapter for Fox board G20</a></li>
<li>One <a href="http://www.acmesystems.it/DAISY-12">Daisy-12 protoboard</a></li>
<li>One <a href="http://www.acmesystems.it/index_daisy">20cm flat cable with sockets for Acme Daisy Cabling System (FLAT-20CM)</a></li>
<li>One <a href="https://www.sparkfun.com/products/8419">Innovations ID-12 RFID reader</a></li>
<li>One <a href="https://www.sparkfun.com/products/8310">RFID TAG</a></li>
<li>One <a href="http://it.rs-online.com/web/p/diodi-rettificatori-e-schottky/7159689">Panasonic Schottky diode</a> (or other similar diode)</li>
<li>One 10K resistor</li>
</ul>
<p><strong>NOTE</strong>: if you use the new <a href="https://www.sparkfun.com/products/11827">Innovations ID-12LA RFID reader</a> you don&#8217;t need the schottky diode and the 10K resistor and you must connect your reader to a 3V3 pin.</p>
<h4>Create your Daisy module</h4>
<p>To read your tags in Node you must create a new simple Daisy module. To easy connect your Innovations RFID reader you can use a breadboard like this:</p>
<p><a href="http://www.yoovant.com/rfid/id-12breakout/" rel="attachment wp-att-1831"><img src="http://www.yoovant.com/wp-content/uploads/2013/05/ID-12breakout.png" alt="ID-12breakout" width="300" height="300" class="alignnone size-full wp-image-1831" /></a></p>
<p>See below the simple schema:</p>
<p>
<div class="one_half"><a href="http://www.yoovant.com/rfid-read-tag-in-node-js/id-12_schema/" rel="attachment wp-att-1857"><img src="http://www.yoovant.com/wp-content/uploads/2013/05/ID-12_schema.png" alt="ID-12_schema" width="423" height="342" class="alignnone size-full wp-image-1857" /></a></p>
<p><a href="http://www.yoovant.com/rfid/daisy-12-id-12/" rel="attachment wp-att-1830"><img src="http://www.yoovant.com/wp-content/uploads/2013/05/DAISY-12-ID-12.png" alt="DAISY-12-ID-12" width="400" height="301" class="alignnone size-full wp-image-1830" /></a></p>
<p><strong>NOTE</strong>: the diode represented has another package to simplify the drawing.</p>
</div>
<div class="one_half last">
<table>
<thead>
<tr>
<th>Pin ID</th>
<th>Pin name</th>
<th>Signal</th>
<th>Board</th>
</tr>
</thead>
<tbody>
<tr>
<td>D10.1</td>
<td>3V3</td>
<td>Power supply</td>
<td>Terra</td>
</tr>
<tr>
<td>D10.3</td>
<td>PC23/RXD3</td>
<td>/dev/ttyS4 RXD</td>
<td>Terra</td>
</tr>
<tr>
<td>D10.9</td>
<td>5V0</td>
<td>Power supply</td>
<td>Terra</td>
</tr>
<tr>
<td>D10.10</td>
<td>GND</td>
<td>Power supply</td>
<td>Terra</td>
</tr>
<tr>
<td>D10.10</td>
<td>GND</td>
<td>Power supply</td>
<td>Terra</td>
</tr>
<tr>
<td>D13.3</td>
<td>PA6/RXD1</td>
<td>/dev/ttyS2 RXD</td>
<td>Terra</td>
</tr>
<tr>
<td>D13.9</td>
<td>5V0</td>
<td>Power supply</td>
<td>Terra</td>
</tr>
<tr>
<td>D13.10</td>
<td>GND</td>
<td>Power supply</td>
<td>Terra</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>D17.1</td>
<td>3V3</td>
<td>Power supply</td>
<td>Terra base</td>
</tr>
<tr>
<td>D17.3</td>
<td>PA1/RXD0</td>
<td>/dev/ttyS1 RXD</td>
<td>Terra base</td>
</tr>
<tr>
<td>D17.9</td>
<td>5V0</td>
<td>Power supply</td>
<td>Terra base</td>
</tr>
<tr>
<td>D17.10</td>
<td>GND</td>
<td>Power supply</td>
<td>Terra base</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>D1.1</td>
<td>3V3</td>
<td>Power supply</td>
<td>Fox G20</td>
</tr>
<tr>
<td>D1.3</td>
<td>PB7/RXD</td>
<td>/dev/ttyS2 RXD</td>
<td>Fox G20</td>
</tr>
<tr>
<td>D1.9</td>
<td>5V0</td>
<td>Power supply</td>
<td>Fox G20</td>
</tr>
<tr>
<td>D1.10</td>
<td>GND</td>
<td>Power supply</td>
<td>Fox G20</td>
</tr>
<tr>
<td>D6.1</td>
<td>3V3</td>
<td>Power supply</td>
<td>Fox G20</td>
</tr>
<tr>
<td>D6.3</td>
<td>PB11/RXD</td>
<td>/dev/ttyS4 RXD</td>
<td>Fox G20</td>
</tr>
<tr>
<td>D6.9</td>
<td>5V0</td>
<td>Power supply</td>
<td>Fox G20</td>
</tr>
<tr>
<td>D6.10</td>
<td>GND</td>
<td>Power supply</td>
<td>Fox G20</td>
</tr>
<tr>
<td>D8.1</td>
<td>3V3</td>
<td>Power supply</td>
<td>Fox G20</td>
</tr>
<tr>
<td>D8.3</td>
<td>PB9/RXD2</td>
<td>/dev/ttyS3 RXD</td>
<td>Fox G20</td>
</tr>
<tr>
<td>D8.9</td>
<td>5V0</td>
<td>Power supply</td>
<td>Fox G20</td>
</tr>
<tr>
<td>D8.10</td>
<td>GND</td>
<td>Power supply</td>
<td>Fox G20</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p></div>
<div class="clearboth"></div>
<p>Now you can connect your custom Daisy module to your Terra board (of Fox G20 board) using a flat cable. You can use D10 or D13 connector on Terra board (or D17 in Terra board base) or also D1, D6 or D8 on Fox G20 board.</p>
<h4>Install software on Terra board</h4>
<p>Your Terra board must have <a href="http://nodejs.org">Node.js</a> installed: use <a href="/install-node-0-10-on-arm-based-board/">this instructions</a> for this task. Now install <a href="http://npmjs.org/rfid">rfid</a> Node module opening your terminal and typing:</p>
<p></p><pre class="crayon-plain-tag">mac: ~$ ssh root@debarm-ip

Linux debarm 2.6.39 #9 Sat May 7 10:19:20 UTC 2013 armv5tejl

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

debarm:~# mkdir rfid
debarm:~# cd rfid
debarm:~/rfid# npm install rfid</pre><p></p>
<p>Run your test program:</p>
<p></p><pre class="crayon-plain-tag">debarm:~rfid# node node_modules/example/example.js</pre><p></p>
<p>After a few seconds you see in your terminal:</p>
<p></p><pre class="crayon-plain-tag">RFID info: using /dev/ttyS2 port on D13 connector
RFID debug: serial /dev/ttyS2 opened
init</pre><p></p>
<p>and when you place your TAG near the ID-12, you can see:</p>
<p></p><pre class="crayon-plain-tag">RFID debug: read TAG 47007650A8C9
TAG 47007650A8C9
err: undefined</pre><p></p>
<p>Well: now you can manage your TAGs as you want.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yoovant.com/rfid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wireless UART: how to connect your ARM based linux board</title>
		<link>http://www.yoovant.com/wireless-uart/</link>
		<comments>http://www.yoovant.com/wireless-uart/#comments</comments>
		<pubDate>Mon, 22 Apr 2013 12:49:29 +0000</pubDate>
		<dc:creator>Marcello Gesmundo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.yoovant.com/?p=1766</guid>
		<description><![CDATA[<p>The microcontrollers almost always have one UART port, but haven&#8217;t (by default) the hardware needed to connect in wireless to other devices: to do this you can make a wireless UART. Using a couple of RF transceiver you can easy  … <a class="more-link" href="http://www.yoovant.com/wireless-uart/"><img class="imgreadmore" height="24" width="24" alt="Read more" title="Read more" src="http://www.yoovant.com/wp-content/themes/CleanSpace/images/next.png"></img></a>]]></description>
				<content:encoded><![CDATA[<p>The microcontrollers almost always have one UART port, but haven&#8217;t (by default) the hardware needed to connect in wireless to other devices: to do this you can make a wireless UART. Using a couple of RF transceiver you can easy connect your <a href="http://www.acmesystems.it/terra">Acme Systems Terra board</a> to a PC or another device using a RF serial connection and <a href="http://nodejs.org">Node</a>. The Acme System Terra is a complete device based on the <a href="http://www.acmesystems.it/aria">Aria G25 module</a> System On Module (SOM) equipped with an <a href="http://www.at91.com/component/resource/article/Products/9-SAM9/1204-sam9g25.html">Atmel AT91SAMG25</a>.</p>
<h4>What you need</h4>
<p>To accomplish this task you need this components:</p>
<ul>
<li>One <a href="http://www.acmesystems.it/terra">Acme Systems Terra board</a></li>
<li>Two <a href="http://www.iqrf.org/weben/index.php?sekce=products&amp;id=tr-52d&amp;ot=transceivers&amp;ot2=tr-52d">IQRF modules (TR-52D)</a></li>
<li>One <a href="http://www.iqrf.org/weben/index.php?sekce=products&amp;id=ck-usb-04&amp;ot=development-tools&amp;ot2=development-kits">IQRF programmer and debugger (CK-USB-04)</a></li>
<li>One <a href="http://www.iqrf.org/weben/index.php?sekce=products&amp;id=kon-sim-01&amp;ot=accessories&amp;ot2=connectors">SIM card connector</a></li>
<li>One <a href="http://www.acmesystems.it/DAISY-12">Daisy-12 protoboard</a></li>
<li>One <a href="http://www.acmesystems.it/index_daisy">20cm flat cable with sockets for Acme Daisy Cabling System (FLAT-20CM)</a></li>
</ul>
<h4>Prepare your hardware</h4>
<p>Before to start you must prepare a simple Daisy board to connect an RF module to your Terra board. This is a very easy step: follow the table and the figure below.</p>
<p>
<div class="one_half"><a href="http://www.yoovant.com/wireless-uart/daisy-12-sim/" rel="attachment wp-att-1797"><img src="http://www.yoovant.com/wp-content/uploads/2013/04/DAISY-12-SIM.png" alt="DAISY-12-SIM" width="320" height="301" class="alignnone size-full wp-image-1797" /></a></div>
<div class="one_half last">
<table>
<thead>
<tr>
<th>Pin ID</th>
<th>Pin name</th>
<th>Signal</th>
<th>RF module</th>
</tr>
</thead>
<tbody>
<tr>
<td>D10.1</td>
<td>3V3</td>
<td>Power supply</td>
<td>C3</td>
</tr>
<tr>
<td>D10.2</td>
<td>PC22/TXD3</td>
<td>/dev/ttyS4 TXD</td>
<td>C8</td>
</tr>
<tr>
<td>D10.3</td>
<td>PC23/RXD3</td>
<td>/dev/ttyS4 RXD</td>
<td>C5</td>
</tr>
<tr>
<td>D10.10</td>
<td>GND</td>
<td>Power supply</td>
<td>C4</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p></div>
<div class="clearboth"></div>
<h4>Install RF development environment</h4>
<p>To load a firmware into an RF module you need the IQRF IDE: download from the <a href="http://www.iqrf.org/weben/index.php?sekce=support&amp;id=download&amp;kat=36&amp;ids=191">official site</a> and install in your PC.</p>
<p><em>NOTE</em>: install IQRF IDE <em>before</em> connect your CK-USB-04 programmer.</p>
<h4>Install firmware on RF module</h4>
<p>The first RF module can be connected to the ttyS4 (or ttyS2) of the Terra board and must have a simple firmware that forward all data read from the serial port into RF buffer to transmit and viceversa. Microrisc provide an example with source code that implement this functionality (UART_LINK.c example). Edit this file as follow:</p>
<p></p><pre class="crayon-plain-tag">// *********************************************************************
//                            Aria UART Link
// *********************************************************************
//
// Intended for:
//   HW: - TR-52D
//   OS: - v3.02D
//
// Description:
//   This example works as UART (RS232) link. Received RF packet
//   is sent via UART and vice versa. UART receiving and transmiting use
//   MCU interrupt.
//   The bufferCOM is divided into two 32 B parts. First one works as a TX buffer
//   and second one as a circular RX buffer for UART data.
//   If the delay between RX UART data bytes is greater than 20 ms,
//   it it recognized as the end of the packet and then the packet is forwarded via RF.
//   This delay is measured by the Timer6. 
//
// File:     AriaUartLink.c
// Version:  v1.06                                   
// Revision: 20/04/2013
//
// Revision history:
//   v1.06: 20/04/2013  Added blinking led: the application is running
//   v1.05: 28/08/2012  Modified for OS 3.02D. Interrupt and Timer6 used.
//   v1.04: 19/06/2012  Comments slightly changed.
//   v1.03: 02/04/2012  Tested for baud rate 19200
//   v1.02: 26/03/2012  Modified for OS 3.01D, not tested for baud rate 19200
//   v1.01: 16/03/2011  Modified for OS 3.00.
//   v1.00: 02/06/2010  First release.
//
// *********************************************************************
#include "../../includes/template-basic.h"     // System header files

// *********************************************************************
                                            // Set UART baudrate
#define BD_19200                            // BD_19200, BD_9600, BD_4800
#define BUFFER_SIZE     32                  // DO NOT CHANGE! .. works only with 32

// *********************************************************************

// UART function prototypes
void openUART(void);
void closeUART(void);
void restartUART(void);
uns8 getTxStatusUART(void);
void sendDataUART(uns8 length);
uns8 getRxStatusUART(void);
uns8 getRxByteUART(void);
void copyRxDataUART(uns16 to, uns8 length);
void errorsRecoveryUART(void);
void userIntRoutine(void);
// *********************************************************************

// UART variables
uns8 TxData;                // Number of bytes to transmit
uns8 TxBytePtr;             // Pointer to the byte to be send
uns8 RxData;                // Number of received bytes
uns8 RxBufStartPtr;         // Circular buffer pointers
uns8 RxBufEndPtr;       
bit RxBufOverflow;          // RX buffer overflow flag
// *********************************************************************

void APPLICATION() {    
    openUART();
    
    startCapture();                 // Resets counter of ticks
    startDelay(50);                 // Start a delay (500ms in background)
    pulseLEDG();
    
    while(1) {
        if (!isDelay()) {
            pulseLEDG();
            startDelay(50);
        }
        
        toutRF = 5;

        if (TMR6IF) {                           // Gap between UART bytes was recognized
            TMR6ON = 0;                         // Timer off
            TMR6IF = 0;
            
            if (RxBufOverflow) {
                restartUART();
                continue;
            }
            
            DLEN = getRxStatusUART();
            copyRxDataUART(bufferRF, DLEN);
            pulseLEDR();
            PIN = 0;
            RFTXpacket();
        }
        
        if (checkRF(0)) {
            if (RFRXpacket()) {
                if (DLEN &gt; BUFFER_SIZE)          // TX UART buffer has 32 B
                    DLEN = BUFFER_SIZE;
                    
                while (getTxStatusUART());      // Wait until previous packet is sent
                pulseLEDG();
                copyMemoryBlock(bufferRF, bufferCOM, DLEN);
                sendDataUART(DLEN);             // Send DLEN bytes from UART TX buffer
            }   
        }
    }    
}
// *************************************************************************

void openUART() {                       // Baudrate, 8N1
    TRISC.5 = 1;                        // Pin connected with RX
    TRISC.7 = 1;                        // RX input
    TRISC.6 = 0;                        // TX output
    BAUDCON = 0;                        // Baudrate control setup
                                        // Baudrate @ 8MHz, high speed
#ifdef BD_19200
    SPBRGL = 25;
#elif defined BD_9600
    SPBRGL = 51;
#elif defined BD_4800
    SPBRGL = 103;
#else
    SPBRGL = 51;                        // Default baudrate 9600 bd
#endif
    
    TXSTA = 0b00100100;                 // Async UART, high speed, 8 bit, TX enabled
    RCSTA = 0b10010000;                 // Continuous receiving, enable port, 8 bits
        
    RxData = 0;
    TxData = 0;
    TxBytePtr = 0;
    RxBufEndPtr = 0;
    RxBufStartPtr = 0;
    RxBufOverflow = 0;
                                        // Timer6 setting
    T6CON = 0x7B;                       // Prescaler: x64, Postscaler: x16, Timer: off
    PR6 = 39;                           // Period: cca 20ms for 8 MHz MCU clock
    TMR6IF = 0;
    
    RCIE = 1;                           // UART RX interrupt enable
    _enableUserInterrupt = 1;
}
//-------------------------------------------------------------------------

void closeUART(void) {                  
    _enableUserInterrupt = 0;
    TXEN = 0;
    CREN = 0;
    TXIE = 0;
    RCIE = 0;
}
//-------------------------------------------------------------------------

void restartUART(void) {
    _enableUserInterrupt = 0;
    CREN = 0;
    TXEN = 0;
    TXIE = 0;
    RCIE = 0;
    TxData = 0;
    RxData = 0;
    TxBytePtr = 0;
    RxBufEndPtr = 0;
    RxBufStartPtr = 0;
    RxBufOverflow = 0;
    CREN = 1;
    TXEN = 1;
    RCIE = 1;
    _enableUserInterrupt = 1;
}
//-----------------------------------------------------------------------------

void sendDataUART(uns8 length) {        // Starts sending data in background
    if (length &gt; BUFFER_SIZE)
        length = BUFFER_SIZE;           // UART TX buffer has 32 B
    
    TxData = length;
    TxBytePtr = 0;
    TXIE = 1;                           // UART TX interrupt enable
}
//---------------------------------------------------------------------------

uns8 getTxStatusUART(void) {            // Returns number of bytes waiting to be send
    return TxData; 
}
//-------------------------------------------------------------------------

uns8 getRxStatusUART(void) {            // Returns number of received bytes
    return RxData; 
}
//-------------------------------------------------------------------------

uns8 getRxByteUART() {                  // Get first unread byte from circular RX buffer
    uns8 tmp;

    if (RxData) {
        GIE=0;
        tmp = readFromRAM(bufferCOM + RxBufStartPtr + BUFFER_SIZE);
        RxBufStartPtr = (RxBufStartPtr + 1) % BUFFER_SIZE;
        --RxData;
        RxBufOverflow = 0;
        GIE=1;
        return tmp;
    } else {
        return 0;
    }
}
//-------------------------------------------------------------------------

void copyRxDataUART(uns16 to, uns8 length) {
uns8 i, tmp;

    if (length &gt; BUFFER_SIZE) {
        length = BUFFER_SIZE;
    }

    for (i = 0; i &lt; length; i++) {
        tmp = getRxByteUART();
        writeToRAM(to + i, tmp);
    }
}
//-------------------------------------------------------------------------

void errorsRecoveryUART() {             // OERR and FERR bits recovery - see PIC datasheet
    if (OERR) {                         // Overrun recovery
        CREN = 0;
        CREN = 1;
    }

    if (FERR) {                         // Framing error recovery
        FERR = 0;
    }
}
// ***********************************************************************

#pragma origin 0x3F00                   // This address must not be changed
void userIntRoutine() {                 // User interrupt service routine
    if (RCIF) {                         // Something was received via UART
        errorsRecoveryUART();
        FSR0 = bufferCOM;
        FSR0 = FSR0 + (RxBufEndPtr + BUFFER_SIZE);
        setINDF0(RCREG);
        RxBufEndPtr = (RxBufEndPtr + 1) % BUFFER_SIZE;
        
        if (RxData &lt; BUFFER_SIZE) {
            ++RxData;
        } else {                        // Buffer overflow
            RxBufStartPtr = (RxBufStartPtr + 1) % BUFFER_SIZE;
            RxBufOverflow = 1;
        }
        
        TMR6 = 0;                       // Timer reset
        TMR6ON = 1;                     // Timer on
    }   
    
    if (TXIF &amp;&amp; TxData) {               // There is still data to send and UART peripheral is free
        FSR0 = bufferCOM + TxBytePtr;
        TXREG = getINDF0();             // Copies data from bufferCOM to TXREG
        ++TxBytePtr;
        
        if (--TxData == 0) {
            TXIE = 0;                   // No more data to send, clear interrupt flag
        }
    }
}
// *********************************************************************</pre><p></p>
<p>Now put your first RF module into the programmer and connect it to your PC, open your IQRF IDE and follow the instruction below (see official IQRF help for a detailed instructions):</p>
<ul>
<li>create a new project</li>
<li>edit the module settings according your module</li>
<li>attach the file above</li>
<li>compile</li>
<li>upload</li>
</ul>
<p>Now remove the RF module and put it into the homemade Daisy module and connect it to your Terra board using the D10 connector (remember to insert the RF module <em>before</em> connect Daisy module).</p>
<p>The second RF module must have a firmware that send an RF packet with desired data to the RF module connected to the Terra board and/or viceversa according your needs. To easy test the functionality, you can use another firmware example (E03-TR.c) and edit it as follow:</p>
<p></p><pre class="crayon-plain-tag">// *********************************************************************
// *                       Aria Remote Link                            *
// *                        RF transceiver                             *
// *********************************************************************
// Example of RF transmiter/receiver. Suitable for a PC link.
//
// Intended for:
//   HW: - TR-52D
//   OS: - v3.02D
//  
// Description:
//   - This program applied in two kits is a bidirectional RF-SPI interface.
//   - Received RF data is sent via SPI and vice versa. For sending and
//     receiving SPI data e.g. the IQRF IDE Terminal can be used
//     (See IQRF IDE Help).
//   - Received SPI data is sent via RF.
//   - PIN should be updated in case of bidirectional RF communication
//     before every RF transmission.
//
// File:    AriaRemoteLink.c
// Version: v1.03                                   Revision: 20/04/2013
//
// Revision history:
//   v1.03: 20/04/2013  Added blinking led: the application is running
//   v1.02: 28/08/2012  Tested for OS 3.02D
//   v1.01: 14/06/2012  Tested with TR-54D
//   v1.00: 07/03/2012  First release
//
// *********************************************************************
#include "../includes/template-basic.h"

// *********************************************************************
void APPLICATION() {
    enableSPI();                    
    toutRF = 5;

    startCapture();                 // Resets counter of ticks
    startDelay(200);                // Start a delay (2s in background)
    pulseLEDG();
    
    while (1) {                     // Main cycle (perpetually repeated)
        if (!isDelay()) {
            pulseLEDG();
            startDelay(200);
        }

        if (checkRF(5)) {           // RF signal detection (takes 1ms)
            if (RFRXpacket()) {     // If anything was received
                pulseLEDG();        // LED indication
                copyBufferRF2COM(); // Copy received RF data from bufferRF to bufferCOM
                startSPI(DLEN);     //  and send it via SPI
            }
        }
        
        if (getStatusSPI()) {       // Update SPIstatus, check SPI busy
                                    // SPIpacketLength: data length
             continue;              // Wait until message is picked up
        }
        
        if (_SPIRX) {               // Anything received?
                                    // Yes:
            if (_SPICRCok) {        // CRCM matched?
                                    // Yes:
                DLEN = SPIpacketLength;
                copyBufferCOM2RF(); // Copy received SPI data from bufferCOM to bufferRF
                PIN = 0;
                RFTXpacket();
                pulseLEDG();        // LED indication
            }

            startSPI(0);            // Restart SPI communication
        }
    }
}

// *********************************************************************</pre><p></p>
<p>Now put this RF module into the programmer and connect it to your PC, open your IQRF IDE and follow the instruction below (see official IQRF help for a detailed instructions):</p>
<ul>
<li>create a new project</li>
<li>edit the module settings according your module</li>
<li>attach the file above</li>
<li>compile</li>
<li>upload</li>
</ul>
<p>Leave this module plugged into the programmer and see the results into the terminal window.</p>
<h4>Install software on Terra board</h4>
<p>Last task: install <a href="http://nodejs.org">Node.js</a> using <a href="/install-node-0-10-on-arm-based-board/">this instructions</a>. Open your terminal and type:</p>
<p></p><pre class="crayon-plain-tag">mac: ~$ ssh root@debarm-ip

Linux debarm 2.6.39 #9 Sat Apr 13 09:59:50 UTC 2013 armv5tejl

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

debarm:~# mkdir serial
debarm:~# cd serial
debarm:~/serial# touch serial.js
debarm:~/serial# npm install serialport</pre><p></p>
<p>Edit the created serial.js file:</p>
<p></p><pre class="crayon-plain-tag">var SerialPort = require('serialport').SerialPort;
/**
 * /dev/ttyS4 -&gt; Terra D10 connector
 * /dev/ttyS2 -&gt; Terra D13 connector
 */
var serialPort = new SerialPort('/dev/ttyS4', {
    baudrate: 19200,
    databits: 8,
    stopbits: 1,
    parity: 'none'
});
serialPort.on('open', function() {
    console.log('open');
    serialPort.on('data', function(data) {
        console.log('data received: ' + data);
    });
    serialPort.write("Welcome Aria UART RF connected!", function(err, results) {
        console.log('total written bytes ' + results);
        console.log('err ' + err);
    });  
});</pre><p></p>
<p>Run your test program:</p>
<p></p><pre class="crayon-plain-tag">debarm:~# node serial.js</pre><p></p>
<p>After a few seconds you see in your terminal:</p>
<p></p><pre class="crayon-plain-tag">open
total written bytes 31
err undefined</pre><p></p>
<p>and your IQRF IDE shows the sent message (Welcome Aria UART RF connected!).<br />
Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yoovant.com/wireless-uart/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Install Node 0.10 on ARM based board</title>
		<link>http://www.yoovant.com/install-node-0-10-on-arm-based-board/</link>
		<comments>http://www.yoovant.com/install-node-0-10-on-arm-based-board/#comments</comments>
		<pubDate>Mon, 25 Mar 2013 16:33:20 +0000</pubDate>
		<dc:creator>Marcello Gesmundo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Arm]]></category>
		<category><![CDATA[Node.js]]></category>

		<guid isPermaLink="false">http://www.yoovant.com/?p=1721</guid>
		<description><![CDATA[<p>Node is now updated to 0.10.1 version: following this simple guide you can easy install the latest Node version into your Acme Systems Aria G25 board. Let&#8217;s go to see how to install Node 0.10 on ARM based board.</p>
1. Update  … <a class="more-link" href="http://www.yoovant.com/install-node-0-10-on-arm-based-board/"><img class="imgreadmore" height="24" width="24" alt="Read more" title="Read more" src="http://www.yoovant.com/wp-content/themes/CleanSpace/images/next.png"></img></a>]]></description>
				<content:encoded><![CDATA[<p>Node is now updated to 0.10.1 version: following this simple guide you can easy install the latest Node version into your <a href="http://www.acmesystems.it/aria">Acme Systems Aria G25</a> board. Let&#8217;s go to see how to install Node 0.10 on ARM based board.</p>
<h4>1. Update Debian</h4>
<p>The first step is the Debian updating to use new gcc compiler: see <a href="/safe-upgrade-debian-squeeze-to-wheezy/">my guide</a> to upgrade Debian Squeeze to Wheeze on your Aria G25 board.</p>
<h4>2. Install prerequisites</h4>
<p>Follow the steps from 1 to 3 on <a href="/how-to-install-node-js-on-arm-based-sbc-fox-board-g20/">my previous guide</a>.</p>
<h4>3. Customize nvm</h4>
<p>Edit <em>nvm.sh</em>:</p>
<p></p><pre class="crayon-plain-tag">debarm:~# nano nvm.sh</pre><p></p>
<p></p><pre class="crayon-plain-tag">if (
        [ ! -z $tarball ] &amp;&amp; \
        mkdir -p "$NVM_DIR/src" &amp;&amp; \
        cd "$NVM_DIR/src" &amp;&amp; \
        curl --progress-bar $tarball -o "node-$VERSION.tar.gz" &amp;&amp; \
        if [ "$sum" = "" ]; then : ; else nvm_checksum `${shasum} node-$VERSION.tar.gz | awk '{print $1}'` $sum; fi &amp;&amp; \
        tar -xzf "node-$VERSION.tar.gz" &amp;&amp; \
        cd "node-$VERSION" &amp;&amp; \
        ./configure --prefix="$NVM_DIR/$VERSION" $ADDITIONAL_PARAMETERS &amp;&amp; \
        make &amp;&amp; \
        rm -f "$NVM_DIR/$VERSION" 2&gt;/dev/null &amp;&amp; \
        make install
        )
      then</pre><p></p>
<p>adding the highlighted line:</p>
<p></p><pre class="crayon-plain-tag">if (
        [ ! -z $tarball ] &amp;&amp; \
        mkdir -p "$NVM_DIR/src" &amp;&amp; \
        cd "$NVM_DIR/src" &amp;&amp; \
        curl --progress-bar $tarball -o "node-$VERSION.tar.gz" &amp;&amp; \
        if [ "$sum" = "" ]; then : ; else nvm_checksum `${shasum} node-$VERSION.tar.gz | awk '{print $1}'` $sum; fi &amp;&amp; \
        tar -xzf "node-$VERSION.tar.gz" &amp;&amp; \
        read -p "Please customize $NVM_DIR/src/node-$VERSION/deps/v8/src/arm/macro-assembler-arm.cc and press [Enter]..." &amp;&amp; \
        cd "node-$VERSION" &amp;&amp; \
        ./configure --prefix="$NVM_DIR/$VERSION" $ADDITIONAL_PARAMETERS &amp;&amp; \
        make &amp;&amp; \
        rm -f "$NVM_DIR/$VERSION" 2&gt;/dev/null &amp;&amp; \
        make install
        )
      then</pre><p></p>
<h4>4. Install Node from source code</h4>
<p>If you have customized your <em>nvm.sh</em> file open your terminal and type:</p>
<p></p><pre class="crayon-plain-tag">debarm:~# nvm install v0.10.1
######################################################################## 100.0%
Checksums do not match.
Binary download failed, trying source.
Additional options while compiling: 
######################################################################## 100.0%
Please customize /root/.nvm/src/node-v0.10.1/deps/v8/src/arm/macro-assembler-arm.cc and press [Enter]...</pre><p></p>
<p>Customize now the <em>macro-assembler-arm.cc</em> file:</p>
<p></p><pre class="crayon-plain-tag">debarm:~# nano .nvm/src/node-v0.10.1/deps/v8/src/arm/macro-assembler-arm.cc</pre><p></p>
<p>adding the highlighted lines:</p>
<p></p><pre class="crayon-plain-tag">// We always generate arm code, never thumb code, even if V8 is compiled to
// thumb, so we require inter-working support
#if defined(__thumb__) && !defined(USE_THUMB_INTERWORK)
#error "flag -mthumb-interwork missing"
#endif

#if !defined(CAN_USE_THUMB_INSTRUCTIONS)
# define CAN_USE_THUMB_INSTRUCTIONS 1
#endif

// We do not support thumb inter-working with an arm architecture not supporting
// the blx instruction (below v5t).  If you know what CPU you are compiling for
// you can use -march=armv7 or similar.
#if defined(USE_THUMB_INTERWORK) && !defined(CAN_USE_THUMB_INSTRUCTIONS)
# error "For thumb inter-working we require an architecture which supports blx"
#endif</pre><p></p>
<p>Now press <em>Enter</em> and wait. After a few hours (be patient!) you have compiled the latest Node version and you must use it:</p>
<p></p><pre class="crayon-plain-tag">debarm:~# nvm use v0.10.1</pre><p></p>
<p>Done! Now you can verify all:</p>
<p></p><pre class="crayon-plain-tag">debarm:~$ node -v
debarm:~$ npm -v</pre><p></p>
<p>If all versions appear, you can install your desired Node packages using npm as you know:</p>
<p></p><pre class="crayon-plain-tag">debarm:~$ npm install express</pre><p></p>
<p>You can also set the default Node version as follow:</p>
<p></p><pre class="crayon-plain-tag">debarm:~$ nvm alias default v0.10.1</pre><p></p>
<p>Good programming with Node!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yoovant.com/install-node-0-10-on-arm-based-board/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy compile Linux Kernel on Acme Systems Aria G25 SoM</title>
		<link>http://www.yoovant.com/easy-compile-linux-kernel-on-acme-systems-aria-g25-som/</link>
		<comments>http://www.yoovant.com/easy-compile-linux-kernel-on-acme-systems-aria-g25-som/#comments</comments>
		<pubDate>Fri, 22 Mar 2013 17:00:12 +0000</pubDate>
		<dc:creator>Marcello Gesmundo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://www.yoovant.com/?p=1602</guid>
		<description><![CDATA[<p>The awesome Acme Systems Aria G25 SoM use a bootable image with Linux Kernel 2.6.39. If you want customize your kernel, you can follow the detailed steps provided by the official website. If you want a ready to use development  … <a class="more-link" href="http://www.yoovant.com/easy-compile-linux-kernel-on-acme-systems-aria-g25-som/"><img class="imgreadmore" height="24" width="24" alt="Read more" title="Read more" src="http://www.yoovant.com/wp-content/themes/CleanSpace/images/next.png"></img></a>]]></description>
				<content:encoded><![CDATA[<p>The awesome <a href="http://www.acmesystems.it/aria">Acme Systems Aria G25 SoM</a> use a bootable image with Linux Kernel 2.6.39. If you want customize your kernel, you can follow the detailed steps provided by the <a href="http://www.acmesystems.it/aria">official website</a>. If you want a ready to use development environment to build your kernel, you can use <a href="http://www.vagrantup.com">Vagrant</a>, that can (from the official site):</p>
<blockquote><p>
  create and configure lightweight, reproducible, and portable development environments.
</p></blockquote>
<p>Vagrant works on Mac OS X, Linux and Windows using the power of virtualization provided by VirtualBox, VMware, AWS, or any other provider. Using Vagrant I&#8217;ve build a template (for VirtualBox) with all tools needed to cross-compile the Linux Kernel. To use this template follow this simple steps (I&#8217;ve used my Mac OS X Mountain Lion, but you can use your preferred operating system).</p>
<h4>1. Install Vagrant</h4>
<p>To install Vagrant simply follow the steps on the official <a href="http://docs.vagrantup.com/v2/installation/index.html">Vagrant website</a>.</p>
<h4>2. Create your environment</h4>
<p><em>sqeezecross32</em> is a development environment build on top of a Debian 6.0 Squeeze distribution and equipped with ARM9 cross toolchain (see <a href="http://www.acmesystems.it/arm9_toolchain">this</a>). To create your environment using this box simply open your terminal window and type:</p>
<p></p><pre class="crayon-plain-tag">Mac:~ Dev$ mkdir acme
Mac:~ Dev$ cd acme
Mac:~ Dev$ vagrant init squeezecross32 http://www.yoovant.com/downloads/squeezecross32.box

A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.</pre><p></p>
<h4>3. Start your VM</h4>
<p>To start your VM simply type:</p>
<p></p><pre class="crayon-plain-tag">Mac:~ Dev$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Box 'squeezecross32' was not found. Fetching box from specified URL for
the provider 'virtualbox'. Note that if the URL does not have
a box for this provider, you should interrupt Vagrant now and add
the box yourself. Otherwise Vagrant will attempt to download the
full box prior to discovering this error.
Downloading with Vagrant::Downloaders::HTTP...
Downloading box: http://www.yoovant.com/downloads/squeezecross32.box
Progress: 1% (22062944 / 1348847160)
...
Extracting box...
Cleaning up downloaded box...
Successfully added box 'squeezecross32' with provider 'virtualbox'!
[default] Importing base box 'squeezecross32'...
[default] No guest additions were detected on the base box for this VM! Guest
additions are required for forwarded ports, shared folders, host only
networking, and more. If SSH fails on this machine, please install
the guest additions and repackage the box to continue.

This is not an error message; everything may continue to work properly,
in which case you may ignore this message.
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Configuring and enabling network interfaces...
[default] Mounting shared folders...
[default] -- /vagrant
Mac:~ Dev$</pre><p></p>
<p><strong>NOTE</strong>: on the first boot the vbox is downloaded. The vbox is very large (~1.3 GB): be patient!</p>
<p>Now connect to console in SSH:</p>
<p></p><pre class="crayon-plain-tag">Mac:~ Dev$ vagrant ssh

Linux squeeze32 2.6.32-5-686 #1 SMP Mon Feb 25 01:04:36 UTC 2013 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Mar 22 11:33:16 2013 from 10.0.2.2

vagrant@squeeze32:~$</pre><p></p>
<p>After running the above two commands, you&#8217;ll have a fully running virtual machine in VirtualBox and you can manage file in your host computer using the shared folder <em>/vagrant</em>: all file that you put in this folder is visible both in your host computer and your VM.</p>
<h4>4. Compile Linux Kernel</h4>
<p>As you can see in your <em>/home/vagrant/</em> folder there is a folder named <em>linux-2.6.39</em> (and also a <em>fox20-linux-2.6.38</em> folder for Fox): now simple read the <a href="http://www.acmesystems.it/ariag25_compile_linux_2_6_39">Build the bootable Linux Kernel image for Aria G25</a> section into the official Acme Systems guide.</p>
<h4>5. Turn off your environment</h4>
<p>When you have finished your work, you can turn off your VM typing:</p>
<p></p><pre class="crayon-plain-tag">Mac:~ Dev$ vagrant halt
[default] Attempting graceful shutdown of VM...</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.yoovant.com/easy-compile-linux-kernel-on-acme-systems-aria-g25-som/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Safe upgrade Debian Squeeze to Wheezy</title>
		<link>http://www.yoovant.com/safe-upgrade-debian-squeeze-to-wheezy/</link>
		<comments>http://www.yoovant.com/safe-upgrade-debian-squeeze-to-wheezy/#comments</comments>
		<pubDate>Fri, 22 Mar 2013 15:44:57 +0000</pubDate>
		<dc:creator>Marcello Gesmundo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.yoovant.com/?p=1578</guid>
		<description><![CDATA[<p>Debian Wheezy is now in RC: it&#8217;s time to safe upgrade Debian Squeeze to Wheezy on your Acme System Aria G25 SoM board! In the official Acme Systems website you can see a detailed instruction to migrate Debian 6.0 Squeeze  … <a class="more-link" href="http://www.yoovant.com/safe-upgrade-debian-squeeze-to-wheezy/"><img class="imgreadmore" height="24" width="24" alt="Read more" title="Read more" src="http://www.yoovant.com/wp-content/themes/CleanSpace/images/next.png"></img></a>]]></description>
				<content:encoded><![CDATA[<p>Debian Wheezy is now in RC: it&#8217;s time to safe upgrade Debian Squeeze to Wheezy on your <a href="http://www.acmesystems.it/aria">Acme System Aria G25 SoM</a> board! In the official <a href="http://www.acmesystems.it/squeeze2wheezy">Acme Systems website</a> you can see a detailed instruction to migrate Debian 6.0 Squeeze to Debian 7.0 for a <a href="http://www.acmesystems.it/FOXG20">FOX</a> board, but in Aria I&#8217;ve some problem to complete the upgrade due the python error. To avoid any issue I&#8217;ve followed this steps:</p>
<h4>1. Enable swap</h4>
<p>Connect to your Aria board console using a SSH connection and open the file /etc/fstab and remove the # char from this line:</p><pre class="crayon-plain-tag">#/dev/mmcblk0p4 none swap sw 0 0</pre><p>Save and reboot the FOX by typing:</p><pre class="crayon-plain-tag">debarm:~# reboot</pre><p></p>
<h4>2. Set new repositories</h4>
<p>Edit the file /etc/apt/sources.list and replace all the words <em>squeeze</em> in <em>wheezy</em>.</p>
<p>This is the old contents of /etc/apt/sources.list:</p><pre class="crayon-plain-tag">deb http://ftp.it.debian.org/debian squeeze main                                
deb-src http://ftp.it.debian.org/debian squeeze main                            
deb http://security.debian.org/ squeeze/updates main                            
deb-src http://security.debian.org/ squeeze/updates main</pre><p>This is the new content:</p><pre class="crayon-plain-tag">deb http://ftp.it.debian.org/debian wheezy main                                
deb-src http://ftp.it.debian.org/debian wheezy main                            
deb http://security.debian.org/ wheezy/updates main                            
deb-src http://security.debian.org/ wheezy/updates main</pre><p>Note that the .it. in the urls within the /etc/apt/sources.list file stand for Italy so it might change to your own country&#8217;s two letter abbreviation.</p>
<h4>3. Launch the upgrading</h4>
<p>In your console type:</p><pre class="crayon-plain-tag">debarm:~# apt-get update</pre><p>and update python to new 2.7 version that is the default python interpreter in Wheezy:</p><pre class="crayon-plain-tag">debarm:~# apt-get install python</pre><p>Now you can upgrade your distribution:</p><pre class="crayon-plain-tag">debarm:~# apt-get dist-upgrade --force-yes</pre><p>Accept all the default option.<br />
When finished (be patient!) remove the file /etc/udev/rules.d/70-persistent-net.rules and reboot the board:</p><pre class="crayon-plain-tag">debarm:~# rm /etc/udev/rules.d/70-persistent-net.rules
debarm:~# reboot</pre><p>Connect again to your Aria console using SSH and type:</p><pre class="crayon-plain-tag">debarm:~# lsb_release -a

No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 7.0 (wheezy)
Release:    7.0
Codename:   wheezy</pre><p>Your brand new Debian Wheezy is ready on your Aria G25 board!</p>
<p>If you want to have a ready to use <em>rootfs</em> archive, you can download the archive below and use it as the substitute of the <em>rootfs</em> archive indicated in the <a href="http://www.acmesystems.it/microsd_create">official instruction</a> to make bootable your microSD card with Debian Wheeze.</p>
<div class="prettyFileList"><a class="prettylink zip" href="http://www.yoovant.com/wp-content/uploads/2013/03/rootfs.tar.bz2">Debian Wheezy rootfs (MD5: ba6a1714d1ec0663520006c0fc893277)</a></div>
<p>Remember to check MD5:</p>
<p></p><pre class="crayon-plain-tag">debarm:~# openssl md5 rootfs.tar.bz2</pre><p></p>
<p>Now follow the <a href="http://www.acmesystems.it/microsd_create">official instructions</a> to create your bootable microSD.</p>
<p><strong>NOTE</strong> This archive is made using the official Acme System rootfs archive with Debian 6.0 Squeeze updated to Debian 7.0 Wheeze using the previous steps. Note also that the default language is set to en_US.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yoovant.com/safe-upgrade-debian-squeeze-to-wheezy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to manage GPIO on ARM based SBC Aria and Fox G20</title>
		<link>http://www.yoovant.com/how-to-manage-gpio-on-arm-based-sbc-aria-and-fox-g20/</link>
		<comments>http://www.yoovant.com/how-to-manage-gpio-on-arm-based-sbc-aria-and-fox-g20/#comments</comments>
		<pubDate>Tue, 12 Mar 2013 16:57:11 +0000</pubDate>
		<dc:creator>Marcello Gesmundo</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Arm]]></category>
		<category><![CDATA[Node.js]]></category>

		<guid isPermaLink="false">http://www.yoovant.com/?p=1407</guid>
		<description><![CDATA[<p>If you have a new amazing Acme Systems Aria board or a FoxBoad G20, you can easy manage GPIO using Node.js and my last aria_fox_gpio node module and also the daisy_gpio to manage Daisy board for fast prototyping. The aria_fox_gpio  … <a class="more-link" href="http://www.yoovant.com/how-to-manage-gpio-on-arm-based-sbc-aria-and-fox-g20/"><img class="imgreadmore" height="24" width="24" alt="Read more" title="Read more" src="http://www.yoovant.com/wp-content/themes/CleanSpace/images/next.png"></img></a>]]></description>
				<content:encoded><![CDATA[<p>If you have a new amazing <a href="http://www.acmesystems.it">Acme Systems</a> <a href="http://www.acmesystems.it/aria">Aria board</a> or a <a href="http://www.acmesystems.it/FOXG20">FoxBoad G20</a>, you can easy manage GPIO using <a href="http://nodejs.org">Node.js</a> and my last <a href="https://npmjs.org/package/aria_fox_gpio">aria_fox_gpio</a> node module and also the <a href="https://npmjs.org/package/daisy_gpio">daisy_gpio</a> to manage Daisy board for fast prototyping. The <a href="https://npmjs.org/package/aria_fox_gpio">aria_fox_gpio</a> package is a full asynchronous module that handle all GPIO using hardware interrupt to notify all GPIO changes without waste your cpu. To debounce your input you can define a debounce time to avoid incorrect reports of change of state.<br />
Let&#8217;s see how.</p>
<p>First you must install Node.js on your board following <a href="http://www.yoovant.com/how-install-node-js-0-8-arm-based-sbc-fox-board-g20/">this</a> instructions (tested with v0.8.14). Now you can install <a href="https://npmjs.org/package/daisy_gpio">daisy_gpio</a> as usual:</p>
<p></p><pre class="crayon-plain-tag">debarm:~# npm install daisy_gpio</pre><p></p>
<p>Done! Now you can write a simple program to turn on a led when push a button using two prototype boards: <a href="http://www.acmesystems.it/DAISY-5">Daisy5</a> and <a href="http://www.acmesystems.it/DAISY-11">Daisy11</a>. Assuming you connect Daisy5 to D5 connector and Daisy11 to D2 connector of your FoxBoard, your first program seems like this:</p>
<p></p><pre class="crayon-plain-tag">var daisy = require('daisy')({
    model: 'fox',   // set to aria if you have this board
    test: false,    // set true if you want use a fake gpio path.
                    // Note that the change, falling and rising events can't fires
    debug: false    // set true if you want see debug messages into terminal window
});
// create a new Daisy5 instance (8 buttons array)
var daisy5 = new daisy.Daisy5();
// attach the init event (fired when ALL buttons are ready)
daisy5.attach('init', function(event) {
    console.log('init daisy5');
});
// create a new Daisy11 instance (8 leds array)
var daisy11 = new daisy.Daisy11();
// attach the init event (fired when ALL leds are ready)
daisy11.attach('init', function(event) {
    console.log('init daisy11');
});
// attach the rising event fired for EVERY button when pressed
daisy5.attach('rising', function(event) {
    daisy11.instances[event.data.sender.index].setHigh();
});
// attach the falling event fired for EVERY button when released
daisy5.attach('falling', function(event) {
    daisy11.instances[event.data.sender.index].setLow();
});
// attach the rising event fired for EVERY led is turned on
daisy11.attach('rising', function(event) {
    console.log('turned on led #' + event.data.sender.index);
});
// attach the falling event fired for EVERY led is turned off
daisy11.attach('falling', function(event) {
    console.log('turned off led #' + event.data.sender.index);
});</pre><p></p>
<p>Save your file as <em>presstolight.js</em> and run in your terminal:</p>
<p></p><pre class="crayon-plain-tag">debarm:~# node presstolight.js</pre><p></p>
<p>Now if you push a button, the corresponding led is turned on. Easy, right? Note that the <em>init</em> and <em>free</em> events are fired only when ALL leds (buttons) of Daisy11 (Daisy5) are ready to use and available respectively, whereas the <em>rising</em> and <em>falling</em> events are fired by every led (button). Note also that all events have a data property that contains two properties:</p>
<ul>
<li>err: the error if occurred</li>
<li>sender: the Gpio instance that has fired the event</li>
</ul>
<p>The <em>event.data</em> for a <em>change</em> event has also a <em>value</em> property with the last value.</p>
<p>In general if you want manage your GPIO as input or output without a daisy prototype board, you can use the generic <a href="https://npmjs.org/package/aria_fox_gpio">aria_fox_gpio</a> module. Install it:</p>
<p></p><pre class="crayon-plain-tag">debarm:~# npm install aria_fox_gpio</pre><p></p>
<p>and write a simple program:</p>
<p></p><pre class="crayon-plain-tag">// define the OutGpio class from the aria_fox_gpio module
var Led = require('aria_fox_gpio')({
    model: 'fox',
    debug: true
}).OutGpio;
// create a new Led instance
var led = new Led('D2', 2, function() {
    // use callback to handle the init
    console.log('init callback button #1');
    var isOn = false;
    setInterval(function(){
        isOn = !isOn;
        if (isOn) {
            led.setHigh();
        } else {
            led.setLow();
        }
    }, 500);
});
// attach the init event fired (after the callback) when the led is ready 
led.attach('init', function(event) {
    console.log('init event button #1');
});
// attach the rising event fired when the led is turned on
led.attach('rising', function(event) {
    console.log('led is turned on');
});
// attach the rising event fired when the led is turned off
led.attach('falling', function(event) {
    console.log('led is turned off');
});</pre><p></p>
<p>Save your file as <em>blinking.js</em> and run in your terminal:</p>
<p></p><pre class="crayon-plain-tag">debarm:~# node blinking.js</pre><p></p>
<p>Your led is blinking.</p>
<p>See full documentation <a href="http://www.yoovant.com/documentation/">online</a> or into <em>doc</em> folder and some examples into <em>test</em> folder within the <a href="https://npmjs.org/package/aria_fox_gpio">aria_fox_gpio</a> package and <a href="https://npmjs.org/package/daisy_gpio">daisy_gpio</a> package</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yoovant.com/how-to-manage-gpio-on-arm-based-sbc-aria-and-fox-g20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL remote access using SSH tunnel from remote machine</title>
		<link>http://www.yoovant.com/mysql-remote-access-using-ssh-tunnel-from-remote-machine/</link>
		<comments>http://www.yoovant.com/mysql-remote-access-using-ssh-tunnel-from-remote-machine/#comments</comments>
		<pubDate>Wed, 07 Nov 2012 09:45:21 +0000</pubDate>
		<dc:creator>Marcello Gesmundo</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.yoovant.com/?p=1347</guid>
		<description><![CDATA[<p>Scenario:</p>

you have a Linux remote host with your MySQL database server
you have enabled SSH server on your Linux Server
you want manipulate your MySQL server using a remote machine (in this case I use a Mac).

<p>To manipulate your MySQL you could  … <a class="more-link" href="http://www.yoovant.com/mysql-remote-access-using-ssh-tunnel-from-remote-machine/"><img class="imgreadmore" height="24" width="24" alt="Read more" title="Read more" src="http://www.yoovant.com/wp-content/themes/CleanSpace/images/next.png"></img></a>]]></description>
				<content:encoded><![CDATA[<p>Scenario:</p>
<ul>
<li>you have a Linux remote host with your MySQL database server</li>
<li>you have enabled SSH server on your Linux Server</li>
<li>you want manipulate your MySQL server using a remote machine (in this case I use a Mac).</li>
</ul>
<p>To manipulate your MySQL you could use PhPMyAdmin, but I prefer to use a client application on my Mac without installing other software on remote Linux server (more secure!).</p>
<p>Well! To do this follow this steps on your Linux server:</p>
<ol>
<li>edit your /etc/hosts.allow file and add this line (if missing):<br />
<pre class="crayon-plain-tag">ALL:127.0.0.1</pre></li>
<li>edit your /etc/ssh/sshd_config file and ensure that there is a line like this:<br />
<pre class="crayon-plain-tag">AllowTCPForwarding yes</pre></li>
<li>restart sshd daemon:<br />
<pre class="crayon-plain-tag">linux:~# /etc/init.d/sshd restart</pre></li>
<li>download Sequel Pro (or your preferred application) and add new connection using SSH tab on Connection Properties.</li>
<li>Done.</li>
</ol>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yoovant.com/mysql-remote-access-using-ssh-tunnel-from-remote-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A new product is coming</title>
		<link>http://www.yoovant.com/a-new-product-is-coming/</link>
		<comments>http://www.yoovant.com/a-new-product-is-coming/#comments</comments>
		<pubDate>Wed, 31 Oct 2012 08:00:18 +0000</pubDate>
		<dc:creator>Marcello Gesmundo</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.yoovant.com/?p=1337</guid>
		<description><![CDATA[<p>Do you remember our announcement of 11 november 2011? The first prototype of our new product for security (with a lot of home and industrial applications) had begun to work. Today I&#8217;m happy to announce that this product is close  … <a class="more-link" href="http://www.yoovant.com/a-new-product-is-coming/"><img class="imgreadmore" height="24" width="24" alt="Read more" title="Read more" src="http://www.yoovant.com/wp-content/themes/CleanSpace/images/next.png"></img></a>]]></description>
				<content:encoded><![CDATA[<p>Do you remember our announcement of 11 november 2011? The first prototype of our new product for security (with a lot of home and industrial applications) had begun to work. Today I&#8217;m happy to announce that this product is close to born! It will be available on the second half of 2013. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yoovant.com/a-new-product-is-coming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install Node.js 0.8 on ARM based SBC Fox Board G20</title>
		<link>http://www.yoovant.com/how-install-node-js-0-8-arm-based-sbc-fox-board-g20/</link>
		<comments>http://www.yoovant.com/how-install-node-js-0-8-arm-based-sbc-fox-board-g20/#comments</comments>
		<pubDate>Thu, 28 Jun 2012 07:48:56 +0000</pubDate>
		<dc:creator>Marcello Gesmundo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Arm]]></category>
		<category><![CDATA[Node.js]]></category>

		<guid isPermaLink="false">http://www.yoovant.com/?p=1268</guid>
		<description><![CDATA[<p><strong>NOTE:</strong> This post refers to Node v0.8.x. For new v0.10.x please visit this.</p>
<p>In my previous post I&#8217;ve described how to install Node v.0.6.19 into your Fox Board G20. Now I will show how to install the &#8220;fresh&#8221; 0.8 release of  … <a class="more-link" href="http://www.yoovant.com/how-install-node-js-0-8-arm-based-sbc-fox-board-g20/"><img class="imgreadmore" height="24" width="24" alt="Read more" title="Read more" src="http://www.yoovant.com/wp-content/themes/CleanSpace/images/next.png"></img></a>]]></description>
				<content:encoded><![CDATA[<p><strong>NOTE:</strong> This post refers to Node v0.8.x. For new v0.10.x please visit <a href="install-node-0-10-on-arm-based-board/">this</a>.</p>
<p>In my previous <a href="how-to-install-node-js-on-arm-based-sbc-fox-board-g20">post</a> I&#8217;ve described how to install Node v.0.6.19 into your Fox Board G20. Now I will show how to install the &#8220;fresh&#8221; 0.8 release of Node. For the identical steps please visit <a href="how-to-install-node-js-on-arm-based-sbc-fox-board-g20">this</a>.</p>
<ol>
<li>
<h4>Step 1 to step 4</h4>
<p>The same as <a href="how-to-install-node-js-on-arm-based-sbc-fox-board-g20">this</a>.</li>
<li>
<h4>Step 5: download Node source code</h4>
<p>To download Node source code simply use customized nvm:</p>
<p></p><pre class="crayon-plain-tag">debarm:~$ nvm download v0.8.0</pre><p></li>
<li>
<h4>Step 6: customize SConstruct file</h4>
<p>After a while you have the Node source code and you must customize the v8 script:</p>
<p></p><pre class="crayon-plain-tag">debarm:~$ nano ~/nvm/src/node-v0.8.0/deps/v8/SConstruct</pre><p></p>
<p></p><pre class="crayon-plain-tag">'gcc': {
    'all': {
      'CCFLAGS':      ['$DIALECTFLAGS', '$WARNINGFLAGS'],
      'CXXFLAGS':     ['-fno-rtti', '-fno-exceptions'],
    },
    'visibility:hidden': {
      # Use visibility=default to disable this.
      'CXXFLAGS':     ['-fvisibility=hidden']
    },</pre><p></p>
<p>and modify as follow:</p>
<p></p><pre class="crayon-plain-tag">'gcc': {
    'all': {
      'CCFLAGS':      ['$DIALECTFLAGS', '$WARNINGFLAGS', '-march=armv5tej', '-mthumb-interwork'],
      'CXXFLAGS':     ['-fno-rtti', '-fno-exceptions', '-march=armv5tej', '-mthumb-interwork'],
    },
    'visibility:hidden': {
      # Use visibility=default to disable this.
      'CXXFLAGS':     ['-fvisibility=hidden']
    },</pre><p></p>
<p>and finally this:</p>
<p></p><pre class="crayon-plain-tag">'armeabi:softfp' : {
        'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
        'vfp3:on': {
          'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
        },
        'simulator:none': {
          'CCFLAGS':     ['-mfloat-abi=softfp'],
        }
      },</pre><p></p>
<p>in this one:</p>
<p></p><pre class="crayon-plain-tag">'armeabi:softfp' : {
        'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
        # 'vfp3:on': {
        #   'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
        # },
        'simulator:none': {
          'CCFLAGS':     ['-mfloat-abi=soft'],
        }
      },</pre><p></li>
<li>
<h4>Step 7: customize common.gypi</h4>
<p>By default the v8 installer recognize the Fox Board as an armv7, but isn&#8217;t right (see <a href="how-to-install-node-js-on-arm-based-sbc-fox-board-g20">this</a>).</p>
<p>Edit common.gypi:</p>
<p></p><pre class="crayon-plain-tag">debarm:~$ nano ~/nvm/src/node-v0.8.0/deps/v8/build/common.gypy</pre><p></p>
<p>and change this:</p>
<p></p><pre class="crayon-plain-tag">{
  'variables': {
    'use_system_v8%': 0,
    'msvs_use_common_release': 0,
    'gcc_version%': 'unknown',
    'v8_compress_startup_data%': 'off',
    'v8_target_arch%': '&lt;(target_arch)',</pre><p></p>
<p>as follow:</p>
<p></p><pre class="crayon-plain-tag">{
  'variables': {
    'armv7%': 0,
    'arm_neon%': 0,
    'use_system_v8%': 0,
    'msvs_use_common_release': 0,
    'gcc_version%': 'unknown',
    'v8_compress_startup_data%': 'off',
    'v8_target_arch%': '&lt;(target_arch)',</pre><p></li>
<li>
<h4>Step 8: customize macro-assembler-arm.cc</h4>
<p>As workaround for <em>&#8220;For thumb inter-working we require an architecture which supports blx&#8221;</em> error message during v8 compilation, you must customize macro-assembler-arm.cc source code:</p>
<p></p><pre class="crayon-plain-tag">debarm:~$ nano ~/nvm/src/node-v0.8.0/deps/v8/src/arm/macro-assembler-arm.cc</pre><p></p>
<p>from this:</p>
<p></p><pre class="crayon-plain-tag">// We do not support thumb inter-working with an arm architecture not supporting
// the blx instruction (below v5t).  If you know what CPU you are compiling for
// you can use -march=armv7 or similar.
#if defined(USE_THUMB_INTERWORK) &amp;&amp; !defined(CAN_USE_THUMB_INSTRUCTIONS)
# error 'For thumb inter-working we require an architecture which supports blx'
#endif</pre><p></p>
<p>to this:</p>
<p></p><pre class="crayon-plain-tag">// We do not support thumb inter-working with an arm architecture not supporting
// the blx instruction (below v5t).  If you know what CPU you are compiling for
// you can use -march=armv7 or similar.
// #if defined(USE_THUMB_INTERWORK) &amp;&amp; !defined(CAN_USE_THUMB_INSTRUCTIONS)
// # error 'For thumb inter-working we require an architecture which supports blx';
// #endif</pre><p></li>
<li>
<h4>Step 9: install Node</h4>
<p>Now use again nvm:</p>
<p></p><pre class="crayon-plain-tag">debarm:~$ nvm foxinstall v0.8.0</pre><p></p>
<p>After a few hours (be patient!) you have compiled the latest Node version and you must use it:</p>
<p></p><pre class="crayon-plain-tag">debarm:~$ nvm use v0.8.0</pre><p></p>
<p>Done! Now you can verify all:</p>
<p></p><pre class="crayon-plain-tag">debarm:~$ node -v
debarm:~$ npm -v</pre><p></p>
<p>If all versions appear, you can install your desired Node packages using npm as you know:</p>
<p></p><pre class="crayon-plain-tag">debarm:~$ npm install express</pre><p></p>
<p>You can also set the default Node version as follow:</p>
<p></p><pre class="crayon-plain-tag">debarm:~$ nvm alias default v0.8.0</pre><p></li>
</ol>
<p>Good programming with Node!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yoovant.com/how-install-node-js-0-8-arm-based-sbc-fox-board-g20/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Useful Node.js modules</title>
		<link>http://www.yoovant.com/useful-node-js-modules/</link>
		<comments>http://www.yoovant.com/useful-node-js-modules/#comments</comments>
		<pubDate>Wed, 20 Jun 2012 08:10:41 +0000</pubDate>
		<dc:creator>Marcello Gesmundo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Node.js]]></category>

		<guid isPermaLink="false">http://www.yoovant.com/?p=1230</guid>
		<description><![CDATA[<p>This is my personal list of useful Node.js modules. This list may grow over time, so check often!</p>


Express
<p>Simply the best Node framework. It enhances development speed.

Expres-load
<p>This very useful module provides the ability to load scripts into an Express instance from  … <a class="more-link" href="http://www.yoovant.com/useful-node-js-modules/"><img class="imgreadmore" height="24" width="24" alt="Read more" title="Read more" src="http://www.yoovant.com/wp-content/themes/CleanSpace/images/next.png"></img></a>]]></description>
				<content:encoded><![CDATA[<p>This is my personal list of useful Node.js modules. This list may grow over time, so check often!</p>
<ul>
<li>
<h4>Express</h4>
<p>Simply the best <a href="http://expressjs.com/">Node framework</a>. It enhances development speed.</li>
<li>
<h4>Expres-load</h4>
<p><a href="https://github.com/jarradseers/express-load">This</a> very useful module provides the ability to load scripts into an Express instance from specified directories or files. Make large express MVC applications easier to develop by allowing a logical file separation without having to require your scripts.</li>
<li>
<h4>Jade &#8211; Template engine</h4>
<p><a href="http://jade-lang.com/">Jade</a> is the favored templating engine of the Express.js core team.</li>
<li>
<h4>Connect</h4>
<p><a href="https://github.com/senchalabs/connect">Connect</a> is an extensible HTTP server framework for Node.js, providing high performance &#8220;plugins&#8221; known as <em>middleware</em>. Made by Sencha team.</li>
<li>
<h4>Socket.io</h4>
<p><a href="http://socket.io/">Socket.IO</a> aims to make realtime apps possible in every browser and mobile device, blurring the differences between the different transport mechanisms. It&#8217;s care-free realtime 100% in JavaScript.</li>
<li>
<h4>Mocha</h4>
<p><a href="http://visionmedia.github.com/mocha">Mocha</a> is a feature-rich JavaScript test framework running on Node and the browser.</li>
<li>
<h4>Vows &#8211; Asynchronous BDD</h4>
<p><a href="http://vowsjs.org/">Vows</a> (Asynchronous Behavior Driven Development) is another module for test your Node application.</li>
<li>
<h4>Node-inspector</h4>
<p><a href="https://github.com/dannycoates/node-inspector">Node-inspector</a> is a debugger interface for Node.js using the WebKit Web console. To debug a Node app simply type:</p>
<p></p><pre class="crayon-plain-tag">$ node-inspector &amp; node --debug your-node-app.js</pre><p></p>
<p>and open your WebKit based browser (Chrome, Safari) to:</p>
<p></p><pre class="crayon-plain-tag">http://localhost:8080/debug?port=5858</pre><p></p>
<p>and you will use the web console to inspect your source code.<br />
To change default 8080 port start node-inspector as follow:</p>
<p><pre class="crayon-plain-tag">$ node-inspector --web-port=8000 (or other desired port)</pre></li>
<li>
<h4>Cradle &#8211; CouchDB client</h4>
<p><a href="https://github.com/cloudhead/cradle">Cradle</a> is a high-level CouchDB client for Node.js. It offer also a cache system.</li>
<li>
<h4>Nano &#8211; Minimalistic driver for CouchDB</h4>
<p>As Cradle, <a href="https://github.com/dscape/nano">Nano</a> is another driver for CouchDB, but more minimalistic than Cradle.</li>
<li>
<h4>Node http proxy</h4>
<p><a href="https://github.com/nodejitsu/node-http-proxy">Node http proxy</a> is a Reverse or Forward Proxy based on simple JSON-based configuration that supports WebSockets and HTTPS.</li>
<li>
<h4>Request</h4>
<p><a href="https://github.com/mikeal/request">Request</a> is the best HTTP client for Node.</li>
<li>
<h4>Nodemailer</h4>
<p><a href="https://github.com/andris9/Nodemailer">Nodemailer</a> is a very useful module to send email from a Node application.</li>
<li>
<h4>Passport</h4>
<p><a href="http://passportjs.org/">Passport</a> is a simple, unobtrusive authentication for Node.js.</li>
<li>
<h4>Everyauth</h4>
<p><a href="https://github.com/bnoguchi/everyauth">Everyauth</a> provides authentication and authorization (password, facebook, &amp; more) for your node.js Connect and Express apps.</li>
<li>
<h4>Optimist</h4>
<p><a href="https://github.com/substack/node-optimist">Optimist</a> is a node.js library for option parsing for people who hate option parsing.</li>
<li>
<h4>ShellJS</h4>
<p><a href="https://github.com/arturadib/shelljs">ShellJS</a> is a portable implementation of Unix shell commands on top of the Node.js API. You can use it to eliminate your shell script&#8217;s dependency on Unix while still keeping its familiar and powerful commands. You can also install it globally so you can run it from outside Node projects &#8211; say goodbye to those gnarly Bash scripts!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.yoovant.com/useful-node-js-modules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
