N80 API

N80 camera phone will serve as an eye of the roomba. To get the 640x480 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 application program that runs in the same computer as the server process, communicates with server using two named pipes, cmdpipe and signalpipe, that are created by the server. The user writes a line "PIC" to the command pipe and as soon as it receives a line "done" from the signalpipe, the picture should be ready in the picturefile, that was specified when the desktop side server was started.

It seems that the final rate of pictures will be about one picture per second. Furthermore, 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-136. Phone 1 communicates with dop-49.

To get picture taking running

  1. Start desktop side server
    1. Save this server
    2. Make it executable:
      chmod u+x eyesrvr.py
    3. Run it:
      ./eyesrvr.py cmdpipe signalpipe picturefile
  2. Start your application
  3. Start eyesrvr.py in N80 Also, 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:eyesrvr.py
    5. The phone may ask the permission to connect. Yes, make it connect using "RoombeyeX".

Pseudocode of the program that runs in N80

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

cmd = "START"
connect to server
while True:
    pic = take new picture
    if cmd == "PIC":
        send to server the picture length + \n as a string
        send to server picture contents
    elif cmd == "QUIT":
         exit
    send to server "NEXT\n"
    cmd = read line from server