1. Introduction
This project, WebServiceSerialRPC, uses Arduino and Ethernet Shield to implement a WebService to provide RPC (Remote Procedure Call) to a device attached to serial port. You can attach serial port to a Cisco Router console port RS-232.
2. Project
2.1. Deploy Diagram
//
// +--------------+ Cosole DB-9 Serial +-----------------+
// | | Port RS232 Port | Arduino with |
// | Cisco Router |---o <- - - - - --> o---| Ethernet Shield |
// | | | |
// +--------------+ +-----------------+
// | HTTP
// | Port
// o
// :
// :
// +-+ Ethernet Network : +-+
// | +-----------+----------------------------------+------------------+ |
// +-+ : +-+
// :
// o
// |
// +--------------+
// +-+ Client Device|
// +-+ HTTP Request |
// +--------------+
2.2. Sequence Diagram
// Client Device Arduino Cisco Router
// ------------- ------------- -------------
// | http request | |
// |---------------->| |
// | | send command |
// | |-------------------->|
// | | buffer read #1 |
// | |<------------------- |
// | | : |
// | |<------------------- |
// | http response | buffer read #n |
// |<----------------| |
// | | |
// | | |
2.3. State Chart Diagram
// o
// | startup
// V
// +---------+ HTTP
// | | response
// | idle |<---------------+
// | | |
// +---------+ |
// | |
// | HTTP request | +----+
// V | V | buffer
// +---------+ command +---------+ | read
// | | line sent | | |
// | prompt |----------->|executing|--+
// | | | |
// +---------+ +---------+
3. Source Code
// ////////////////////////////////////////////////////////////////////////////
// file: WebServiceSerialRPC.ino
// description: This project, WebServiceSerialRPC, uses Arduino and Ethernet
// Shield to implement a WebService to provide RPC (Remote Procedure
// Call) to a device attached to serial port. You can attach serial
// port to a Cisco Router console port RS-232
// author: Josemar Furegatti de Abreu Silva
// author-blog: http://josemarfuregattideabreusilva.blogspot.com.br/
// requirement: (Arduino Uno or Arduino Duemilanove) and Arduino Ethernet Shield
// Includes
#include <SPI.h>
#include <Ethernet.h>
4. References
- http://www.cisco.com/en/US/products/hw/routers/ps332/products_tech_note09186a0080094ce6.shtml#topic9
- http://www.computerhope.com/jargon/s/seriport.htm
- http://www.youtube.com/watch?v=r4U9CNALo-M&list=PLORrDfZD1hkHV2qj8G1OrH2228DlQjoSj&index=9&feature=plpp_video
- http://www.youtube.com/watch?v=qjbME2FhL5E&list=PLORrDfZD1hkHV2qj8G1OrH2228DlQjoSj&index=29&feature=plpp_video
- http://www.youtube.com/watch?v=gMYBoMO4bmM&list=PLORrDfZD1hkHV2qj8G1OrH2228DlQjoSj&index=18&feature=plpp_video
Nenhum comentário:
Postar um comentário