Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property LoadBalancer::$mWriteIndex is deprecated in /home3/draginoo/public_html/wiki/includes/db/LoadBalancer.php on line 83

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Return type of ResultWrapper::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/draginoo/public_html/wiki/includes/db/DatabaseUtility.php on line 174

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Return type of ResultWrapper::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/draginoo/public_html/wiki/includes/db/DatabaseUtility.php on line 192

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Return type of ResultWrapper::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/draginoo/public_html/wiki/includes/db/DatabaseUtility.php on line 185

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Return type of ResultWrapper::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/draginoo/public_html/wiki/includes/db/DatabaseUtility.php on line 202

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Return type of ResultWrapper::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home3/draginoo/public_html/wiki/includes/db/DatabaseUtility.php on line 163

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property Revision::$mUnpatrolled is deprecated in /home3/draginoo/public_html/wiki/includes/Revision.php on line 707

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property Revision::$mUnpatrolled is deprecated in /home3/draginoo/public_html/wiki/includes/Revision.php on line 707

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property WikitextContentHandler::$mModelName is deprecated in /home3/draginoo/public_html/wiki/includes/content/ContentHandler.php on line 416

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property Revision::$mUnpatrolled is deprecated in /home3/draginoo/public_html/wiki/includes/Revision.php on line 707

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Warning: Trying to access array offset on value of type bool in /home3/draginoo/public_html/wiki/includes/libs/IPSet.php on line 243

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Warning: Trying to access array offset on value of type bool in /home3/draginoo/public_html/wiki/includes/libs/IPSet.php on line 246

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Warning: Trying to access array offset on value of type bool in /home3/draginoo/public_html/wiki/includes/libs/IPSet.php on line 243

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Warning: Trying to access array offset on value of type bool in /home3/draginoo/public_html/wiki/includes/libs/IPSet.php on line 246

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property WikitextContent::$mText is deprecated in /home3/draginoo/public_html/wiki/includes/content/TextContent.php on line 56

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property Revision::$mUnpatrolled is deprecated in /home3/draginoo/public_html/wiki/includes/Revision.php on line 707

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property Revision::$mUnpatrolled is deprecated in /home3/draginoo/public_html/wiki/includes/Revision.php on line 707

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property RequestContext::$recursion is deprecated in /home3/draginoo/public_html/wiki/includes/context/RequestContext.php on line 332

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property MessageCache::$mMemc is deprecated in /home3/draginoo/public_html/wiki/includes/cache/MessageCache.php on line 136

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property LoadBalancer::$mWriteIndex is deprecated in /home3/draginoo/public_html/wiki/includes/db/LoadBalancer.php on line 83

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property Parser::$mPreprocessorClass is deprecated in /home3/draginoo/public_html/wiki/includes/parser/Parser.php on line 255

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property PPDStack::$accum is deprecated in /home3/draginoo/public_html/wiki/includes/parser/Preprocessor_DOM.php on line 778

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property Revision::$mUnpatrolled is deprecated in /home3/draginoo/public_html/wiki/includes/Revision.php on line 707

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /home3/draginoo/public_html/wiki/languages/Language.php on line 2104

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /home3/draginoo/public_html/wiki/languages/Language.php on line 2104

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /home3/draginoo/public_html/wiki/languages/Language.php on line 2104

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /home3/draginoo/public_html/wiki/languages/Language.php on line 2104

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /home3/draginoo/public_html/wiki/languages/Language.php on line 2104

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /home3/draginoo/public_html/wiki/languages/Language.php on line 2104

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property WikitextContent::$mText is deprecated in /home3/draginoo/public_html/wiki/includes/content/TextContent.php on line 56

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property WikitextContent::$mText is deprecated in /home3/draginoo/public_html/wiki/includes/content/TextContent.php on line 56
 
  GPIO2  <---> MISO
 
  GPIO2  <---> MISO
 
  GPIO3  <---> SCK
 
  GPIO3  <---> SCK
 +
 +
=Libraries=
 +
Arduino requires below libraries when talking to Dragino via SPI.  They can be found [http://svn.dragino.com/examples/libraries/ here]
 +
*SPI: SPI Master/Slave library, this library is different from the default lib when install with Arduino. the default one support master only and we need the arduino to work as slave here. when install this SPI lib, please remove the default one from Arduino.
 +
*buffer: in SPI communication, we transfer data char by char use buffer. so don't miss every interupts.
 +
 +
To install above libraries, copy them to the arduino/libraries.
    
=Send message to Arduino via SPI=
 
=Send message to Arduino via SPI=
 +
 +
 +
==How does it work?==
 
example codes are available for download in http://www.dragino.com/downloads/examples/spi_incoming/
 
example codes are available for download in http://www.dragino.com/downloads/examples/spi_incoming/
 +
 +
In this example, Dragino runs as a SPI master device. The Arduino runs as a SPI slave device.  the example codes include below parts:
 +
*'''SPI_Test.lua''': This code is running in the Dragino, after run "lua SPI_Test.lua" in Dragino, Dragino will keep sending message to its SPI interface.
 +
*'''SPI_Incoming_example.pde''': Codes running in Arduino. it will receive incoming message from its SPI interface and print back to the serial terminal.
 +
*'''spi.c''' and '''spi.h''' : spi driver for Arduino.
 +
 +
 
==Connection with Arduino Duemilanove==
 
==Connection with Arduino Duemilanove==

Fatal error: Uncaught TypeError: MWExceptionHandler::handleException(): Argument #1 ($e) must be of type Exception, Error given in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php:153 Stack trace: #0 [internal function]: MWExceptionHandler::handleException(Object(Error)) #1 {main} thrown in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 153

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344

Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /home3/draginoo/public_html/wiki/includes/exception/MWExceptionHandler.php on line 344