Simon The Pi Man bookstore
Mmmm Raspberry Pi
Simon the Pi Man
To Infinity (probably) and beyond
(A beginners Resource for the Raspberry Pi computer using the Debian distro)
since June 2012

If you are looking for info on the Raspberry Pi computer stay on this site
however
If you are looking for a good cafe in Rye in East Sussex try "Simon the Pie man" near the church.

Peer to Peer Processing Interface


I am hoping to provide a specification for an interface between Raspberry Pi machines to allow Peer to Peer Processing.

The concept behind this idea is that each Raspberry Pi machine will run an interface on either port 80 or port 443 possibly an apache or lightweight webserver to provide the interface and software on the device will provide a result via the post that will be read by the sending device.

Data would be Posted to the server either via a get or post parameter with the data in xml format, with the reply being returned again in the same xml format.

The basic XML structure is proposed as follows:-
XML Tags Opt/Mand Notes
<RaspberryPi Version="1">    
  <FromPi>    
    <FPiRegCode></FPiRegCode>
 
Mandatory
 
FromPi Registration Hash Code
 
    <FPiEmail></FPiEmail>
 
Mandatory
 
FromPi Contact Email
 
    <FPiContactNumber></FPiContactNumber> 
 
Optional
 
FromPi Contact Phone
 
    <FPiId></FPiId>
 
Mandatory
 
A Unique Id To Identify the request
    <ProcStatus></ProcStatus>
 
Optional
 
Mandatory if replying
success or fail
    <ProcErrorMessage></ProcErrorMessage>
 
Optional
 
Mandatory if replying
Description of error in data
    <ProcDeliveryType></ProcDeliveryType>
 
Optional
 
Mandatory if replying
data or ftp or http
    <ProcDeliveryTime></ProcDeliveryTime>

 
Optional

 
Mandatory if replying
0 - 20 minutes 0=returned in <data>
    <ProcDeliveryLocation>
    </ProcDeliveryLocation>

 
Optional
 
Mandatory if replying and delivery type = ftp or http
url to pick up data
  </FromPi>    
  <ToPi>    
    <TPiRegCode></TPiRegCode>
 
Mandatory
 
ToPi Registration Hash Code
 
    <TPiEmail></TPiEmail>
 
Mandatory
 
ToPi Contact Email
 
    <TPiContactNumber></TPiContactNumber> 
 
Optional
 
ToPi Contact Phone
 
    <FPiId></FPiId>
 
Optional
 
Mandatory if replying to processing request - taken from input xml
  </ToPi>    
  <Package>    
    <PackRules></PackRules>
 
Optional
 
Processing Rules
if required by ToPi service
    <PackCompression><PackCompression>
 
Mandatory
 
Zip
 
    <PackEncoding><PackEncoding>
 
Mandatory
 
Base64
 
    <PackContent><PackContent>
 
Mandatory
 
Data to be processed by ToPi
 
   </Package>    
 </Data>    
</RaspberryPi>    

Guidelines
Any data in the <Package><Processing> record should be first zipped and then base64 encoded, this allows any processing rules to be transferred in without causing parser issues - we suggest that any rules should be in ToPi xml format.

Any data in the <Package><Data> record should be first zipped and then base64 encoded, this allows any data whether it is csv,xml,images etc to be transferred in without causing parser issues.

Once the data has been received a reply message must be returned

The data returned should be in the same format as that being sent except that the FromPi and ToPi details are reversed.

The suggested

© simonthepiman.com 2012->2024
email:
simon@villagenet.co.uk

hosted by VillageNetThe Raspberry Pi Foundation is a UK registered charity which exists to promote the study of computer science and related topics, especially at school level, and to put the fun back into learning computing.

Please Note:- any mention of the Raspberry Pi computer on these pages refers to the Raspberry Pi Foundation's product, who also have trademark rights to the term 'Raspberry Pi'.