Skip to content
glop102 edited this page Dec 14, 2015 · 3 revisions

There are 2 protocolls in use, TCP and UDP. TCP is to handle directed traffic such as sending the file to the admin, while UDP is to have general messages such as take a picture. For legacy and redundancy reasons, all functionality of UDP (except admin polling) is replicated in the TCP section.

TCP Headers

This page documents the entirety of the header sections of the communications with the system. Since this system is meant to work with a person's browser, the custom headers follow a similar style to HTTP. There are 2 types of headers, the standard HTTP header and the RASPI header.

HTTP

This header is very trimmed down in terms of what is looked at. The first line is usually all we need to see to make decisions on. Additional functionality may be added later, but for now we only care about a few things. Below are some examples for reference. (note: \r\n is used to distinguish lines)

Client Request

  • GET / HTTP/1.1
  • GET /images HTTP/1.1

Client Commands

  • GET /images/001/delete HTTP/1.1
  • GET /capturePicture HTTP/1.1

Server Response

  • HTTP/1.1 200 OK
  • HTTP/1.1 404 Not Found

RASPI

This is very similar to a stripped down version of HTTP. It starts out with an identification of being a PI and what job it is doing. This is for either Admin->Camera or vice versa. This is intended for inter-system communications on TCP only.

First Line Description
RASPI CAMERA This is a PI with the camera role
RASPI PROJECTOR This is a PI with the projector role
RASPI ADMIN this is a PI with the admin role - there should only be 1 of these

Afterwards on the next line it will send the command that the connection is being made for. Look at the commands section of the special URLs page.

Command Description
IMAGE SEND The PI Camera is sending the image back to the admin
IMAGE TAKE The admin is telling the camera to take a picture
VIDEO RESTART Admin telling the Camera to restart the video stream
REBOOT Admin telling the PI to reboot
REPORTING The PI just reporting in to the Admin - this does nothing else
GROUP SET CAMERA Sets the group that a client device belongs to
PROJECTOR ON Turn on the projection
PROJECTOR OFF Turn off the projection

UDP

This is a 'connection-less' protocol that is good at broadcast messages. As such it is used for things intended for all PIs and is time critical (eg take picture).

Message Description
ADMIN ANNOUNCE The admin sends this out to poll for new clients. This lets new clients know where the admin is. If a PI doesn't report back after 3 times, it is removed from the list of known PIs
IMAGE CAPTURE Take the image and then send it back
Clone this wiki locally