N80 API

N80 camera phone will serve as an eye of the roomba. To get the 320x240 jpg-picture from the camera, the desktop must run a tcp/ip server process. The phone has a client process (since servers are hard to implement in a phone) that sends pictures to the server over the CS department wlan.

The picture is rotated 90 degrees clockwise - a command "jpegtran -rot 270 -outfile pic-90 pic" solves the problem by rotating "pic" to "pic-90".

Phone 2, as labelled on the backside of the phone, communicates with desktop dop-49. Phone 1 communicates with dop-48.

To get picture taking running

  1. Start desktop side server
    1. Save this server
    2. Make it executable:
      chmod u+x jpgserver.py
    3. Run it:
       ./jpgserver.py picturefile.jpg 
  2. Start reyeserver.py in N80 (It is called server, since it delivers the pictures, even if technically it is a client.)
    1. Start the phone (black button on top)
    2. Wait, wait, it is slow to boot
    3. Press blue ying-yang symbol bottom left to get to the menu
    4. Then go My own - Python - Options - Run script - e:reyesrvr.py
    5. The phone may ask for permission to connect. Better say Yes.

Pseudocode of the program that runs in N80

This is provided so you can bypass the jpgserver.py running in the desktop if you wish.


while True:
   try:
      send to server the picture length + \n as a string
      send to server picture contents
   except:
      connect to server