Difference between revisions of "Spacemon"

From Pumping Station One
Jump to navigation Jump to search
(fix spacemon link to work both internal and external)
Line 25: Line 25:
 
== lidless config ==
 
== lidless config ==
  
  [
+
      [
  {
+
      {
    "role" : "work1",
+
        "role" : "work1",
    "type" : "camera",
+
        "type" : "camera",
    "name" : "electronics",
+
        "name" : "electronics",
    "url" : "http://10.100.0.61/mjpg/video.mjpg",
+
        "url" : "http://10.100.0.61/mjpg/video.mjpg",
    "zmq_url" : "tcp://*:7200",
+
        "zmq_url" : "tcp://*:7200",
    "username" : "REDACTED",
+
        "username" : "REDACTED",
    "password" : "REDACTED"
+
        "password" : "REDACTED",
  },
+
        "store" : true,
  {
+
        "store_thr" : 1
    "role" : "work2",
+
      },
    "type" : "camera",
+
      {
    "name" : "shop",
+
        "role" : "work1",
    "url" : "http://10.100.0.62/mjpg/video.mjpg",
+
        "type" : "camera",
    "zmq_url" : "tcp://*:7201",
+
        "name" : "lasercutter",
    "username" : "REDACTED",
+
        "url" : "http://10.100.0.64/mjpg/video.mjpg",
    "password" : "REDACTED"
+
        "zmq_url" : "tcp://*:7206",
  },
+
        "username" : "REDACTED",
  {
+
        "password" : "REDACTED",
    "role" : "work3",
+
        "snapshot" : true,
    "type" : "camera",
+
        "store" : true,
    "name" : "outside",
+
        "store_thr" : 1
    "zmq_url" : "tcp://*:7204",
+
      },
    "url" : "http://zm.pumpingstationone.org/cgi-bin/nph-zms?mode=jpeg&monitor=7&scale=100&maxfps=5&buffer=1000&auth=",
+
      {
    "username" : "REDACTED",
+
        "role" : "work2",
    "password" : "REDACTED",
+
        "type" : "camera",
    "zm_auth_hash_secret" : "REDACTED",
+
        "name" : "shop",
    "snapshot" : true
+
        "url" : "http://10.100.0.62/mjpg/video.mjpg",
  },
+
        "zmq_url" : "tcp://*:7201",
  {
+
        "username" : "REDACTED",
    "role" : "work3",
+
        "password" : "REDACTED",
    "type" : "camera",
+
        "store" : true,
    "name" : "gantry_shop",
+
        "store_thr" : 1
    "description" : "shop from gantry",
+
      },
    "zmq_url" : "tcp://*:7205",
+
      {
    "url" : "http://zm.pumpingstationone.org/cgi-bin/nph-zms?mode=jpeg&monitor=8&scale=100&maxfps=5&buffer=1000&auth=",
+
        "role" : "work1",
    "username" : "REDACTED",
+
        "type" : "camera",
    "password" : "REDACTED",
+
        "name" : "crafts",
    "zm_auth_hash_secret" : "REDACTED",
+
        "url" : "http://10.100.0.63/mjpg/video.mjpg",
    "snapshot" : true
+
        "zmq_url" : "tcp://*:7202",
  },
+
        "username" : "REDACTED",
  {
+
        "password" : "REDACTED",
    "role" : "work1",
+
        "store" : true,
    "type" : "camera",
+
        "store_thr" : 1
    "name" : "crafts",
+
      },
    "url" : "http://10.100.0.63/mjpg/video.mjpg",
+
      {
    "zmq_url" : "tcp://*:7202",
+
        "role" : ["frontend", "announcer"],
    "username" : "REDACTED",
+
        "type" : "alert",
    "password" : "REDACTED"
+
        "mode" : "sustain",
  },
+
        "low_level" : 20,
  {
+
        "duration" : 1800,
    "role" : "work2",
+
        "message" : "There's loads of people working in the shop. Yay, hacking!",
    "type" : "camera",
+
        "camera" : "shop",
    "name" : "mystery",
+
        "throttle" : 9400
    "url" : "http://zm.pumpingstationone.org/cgi-bin/nph-zms?mode=jpeg&monitor=3&scale=100&maxfps=5&buffer=1000&auth=",
+
      },
    "zmq_url" : "tcp://*:7203",
+
      {
    "username" : "REDACTED",
+
        "role" : ["frontend", "announcer"],
    "password" : "REDACTED",
+
        "type" : "alert",
    "zm_auth_hash_secret" : "REDACTED"
+
        "mode" : "sustain",
  },
+
        "high_level" : 10,
  {
+
        "low_level" : 4,
    "role" : ["frontend", "announcer"],
+
        "duration" : 1500,
    "type" : "alert",
+
        "message" : "The people in the electronics shop are being so boring. Break a leg, slackers!",
    "mode" : "sustain",
+
        "camera" : "electronics",
    "low_level" : 20,
+
        "throttle" : 86400
    "duration" : 1800,
+
      },
    "message" : "There's loads of people working in the shop. Yay, hacking!",
+
      {
    "camera" : "shop",
+
        "role" : ["frontend", "announcer"],
    "throttle" : 9400
+
        "type" : "alert",
  },
+
        "mode" : "sustain",
  {
+
        "high_level" : 0,
    "role" : ["frontend", "announcer"],
+
        "duration" : 43200,
    "type" : "alert",
+
        "message" : "I'm so alone.  Nobody wants to hang out with me.",
    "mode" : "sustain",
+
        "camera" : "electronics",
    "high_level" : 10,
+
        "throttle" : 86400
    "low_level" : 4,
+
      },
    "duration" : 1500,
+
      {
    "message" : "The people in the electronics shop are being so boring. Break a leg, slackers!",
+
        "type" : "spaceapi",
    "camera" : "electronics",
+
        "name" : "ps1",
    "throttle" : 86400
+
        "metadata" : {
  },
+
          "space" : "Pumping Station: One",
  {
+
          "url" : "http://pumpingstationone.org",
    "role" : ["frontend", "announcer"],
+
          "contact" : {
    "type" : "alert",
 
    "mode" : "sustain",
 
    "high_level" : 0,
 
    "duration" : 43200,
 
    "message" : "I'm so alone.  Nobody wants to hang out with me.",
 
    "camera" : "electronics",
 
    "throttle" : 86400
 
  },
 
  {
 
    "type" : "spaceapi",
 
    "name" : "ps1",
 
    "metadata" : {
 
      "space" : "Pumping Station: One",
 
      "url" : "http://pumpingstationone.org",
 
      "address" : "3519 N Elston, Chicago IL 60618, USA",
 
      "contact" : {
 
 
         "twitter" : "@pumpingstation1",
 
         "twitter" : "@pumpingstation1",
 
         "irc" : "irc://irc.freenode.net/#pumpingstationone",
 
         "irc" : "irc://irc.freenode.net/#pumpingstationone",
 
         "email" : "[email protected]",
 
         "email" : "[email protected]",
 
         "ml" : "http://groups.google.com/group/pumping-station-one-public"
 
         "ml" : "http://groups.google.com/group/pumping-station-one-public"
 +
          },
 +
          "issue_report_channels": [
 +
        "twitter"
 +
          ],
 +
          "logo" : "http://wiki.pumpingstationone.org/images/pumpingstationone.org.wiki.logo.png",
 +
          "state" : {
 +
        "icon" : {
 +
          "open" : "http://wiki.pumpingstationone.org/images/pumpingstationone.org.wiki.logo.png",
 +
          "closed" : "http://wiki.pumpingstationone.org/images/pumpingstationone.org.wiki.logo.png"
 +
        }
 +
          },
 +
          "location" : {
 +
        "address" : "3519 N Elston, Chicago IL 60618, USA",
 +
        "lat" : 41.945321,
 +
        "lon" : -87.706631
 +
        },
 +
          "cam" : ["http://apps.pumpingstationone.org/space-activity/"]
 +
        },
 +
        "cameras" : {
 +
          "shop" : 7,
 +
          "electronics" : 30,
 +
          "crafts" : 20
 +
        },
 +
        "needed_activity" : 1,
 +
        "status_note" : "Check http://pumpingstationone.org/events/ for public events."
 +
      },
 +
      {
 +
        "role" : "frontend",
 +
        "type" : "irc",
 +
        "server" : "irc.freenode.net",
 +
        "nick" : "spacemon",
 +
        "channel" : "#pumpingstationone"
 +
      },
 +
      {
 +
        "role" : "announcer",
 +
        "type" : "announced",
 +
        "zmq_url" : "tcp://10.100.0.16:4503"
 +
      },
 +
      {
 +
        "role" : "work1",
 +
        "type" : "web",
 +
        "port" : 8001,
 +
        "zmq_url" : "tcp://*:8201"
 +
      },
 +
      {
 +
        "role" : "work2",
 +
        "type" : "web",
 +
        "port" : 8002,
 +
        "zmq_url" : "tcp://*:8202"
 +
      },
 +
      {
 +
        "role" : "work3",
 +
        "type" : "web",
 +
        "port" : 8003,
 +
        "zmq_url" : "tcp://*:8203"
 
       },
 
       },
       "logo" : "http://wiki.pumpingstationone.org/thumb.php?f=Psone-logo-w-name.svg&width=576",
+
       {
      "lat" : 41.945321,
+
        "role" : "frontend",
      "lon" : -87.706631,
+
        "type" : "web",
      "cam" : "http://apps.pumpingstationone.org/space-activity/"
+
        "proxy_mode" : "auto",
    },
+
        "port" : 8000
    "cameras" : {
+
      }
      "shop" : 7,
+
      ]
      "electronics" : 30,
 
      "crafts" : 20
 
    },
 
    "needed_activity" : 1,
 
    "status_note" : "Check http://pumpingstationone.org/events/ for public events."
 
  },
 
  {
 
    "role" : "frontend",
 
    "type" : "irc",
 
    "server" : "irc.freenode.org",
 
    "nick" : "spacemon",
 
    "channel" : "#pumpingstationone"
 
  },
 
  {
 
    "role" : "announcer",
 
    "type" : "announced",
 
    "zmq_url" : "tcp://10.100.0.16:4503"
 
  },
 
  {
 
    "role" : "work1",
 
    "type" : "web",
 
    "port" : 8001,
 
    "zmq_url" : "tcp://*:8201"
 
  },
 
  {
 
    "role" : "work2",
 
    "type" : "web",
 
    "port" : 8002,
 
    "zmq_url" : "tcp://*:8202"
 
  },
 
  {
 
    "role" : "work3",
 
    "type" : "web",
 
    "port" : 8003,
 
    "zmq_url" : "tcp://*:8203"
 
  },
 
  {
 
    "role" : "frontend",
 
    "type" : "web",
 
    "proxy_mode" : "auto",
 
    "port" : 8000
 
  }
 
  ]
 

Revision as of 06:43, 16 September 2013

Spacemon is our IRC bot that watches the webcams in the space and shows how busy each part of the space is at any time.

IRC commands:

 <+Toba> !space
 <+spacemon> garage: 0% busy, electronics: 34% busy, woodshop: 0% busy, space: 26% busy

This shows that the electronics area and the main hangout space are busy but the rest of PS1 is empty. There is no camera in the classroom or the front lounge or the loft lounge.

Another command, !light, lets you check if the lights are on. This is a good indication that someone is either rude, present, or planning to come back...

 <+Toba> !light
 < spacemon> garage: 0% lit, electronics: 40% lit, woodshop: 2% lit, space: 27% lit

From time to time, spacemon will report that the space is unusually busy:

 <+spacemon> I see PS:One is packed with people. Time to release the neurotoxin into the enrichment center.

This alert is based on the "space" camera.

There is also a web interface, a SpaceAPI endpoint and the software, lidless is open source and is available on github.


lidless config

     [
     {
       "role" : "work1",
       "type" : "camera",
       "name" : "electronics",
       "url" : "http://10.100.0.61/mjpg/video.mjpg",
       "zmq_url" : "tcp://*:7200",
       "username" : "REDACTED",
       "password" : "REDACTED",
       "store" : true,
       "store_thr" : 1
     },
     {
       "role" : "work1",
       "type" : "camera",
       "name" : "lasercutter",
       "url" : "http://10.100.0.64/mjpg/video.mjpg",
       "zmq_url" : "tcp://*:7206",
       "username" : "REDACTED",
       "password" : "REDACTED",
       "snapshot" : true,
       "store" : true,
       "store_thr" : 1
     },
     {
       "role" : "work2",
       "type" : "camera",
       "name" : "shop",
       "url" : "http://10.100.0.62/mjpg/video.mjpg",
       "zmq_url" : "tcp://*:7201",
       "username" : "REDACTED",
       "password" : "REDACTED",
       "store" : true,
       "store_thr" : 1
     },
     {
       "role" : "work1",
       "type" : "camera",
       "name" : "crafts",
       "url" : "http://10.100.0.63/mjpg/video.mjpg",
       "zmq_url" : "tcp://*:7202",
       "username" : "REDACTED",
       "password" : "REDACTED",
       "store" : true,
       "store_thr" : 1
     },
     {
       "role" : ["frontend", "announcer"],
       "type" : "alert",
       "mode" : "sustain",
       "low_level" : 20,
       "duration" : 1800,
       "message" : "There's loads of people working in the shop. Yay, hacking!",
       "camera" : "shop",
       "throttle" : 9400
     },
     {
       "role" : ["frontend", "announcer"],
       "type" : "alert",
       "mode" : "sustain",
       "high_level" : 10,
       "low_level" : 4,
       "duration" : 1500,
       "message" : "The people in the electronics shop are being so boring. Break a leg, slackers!",
       "camera" : "electronics",
       "throttle" : 86400
     },
     {
       "role" : ["frontend", "announcer"],
       "type" : "alert",
       "mode" : "sustain",
       "high_level" : 0,
       "duration" : 43200,
       "message" : "I'm so alone.  Nobody wants to hang out with me.",
       "camera" : "electronics",
       "throttle" : 86400
     },
     {
       "type" : "spaceapi",
       "name" : "ps1",
       "metadata" : {
         "space" : "Pumping Station: One",
         "url" : "http://pumpingstationone.org",
         "contact" : {
       "twitter" : "@pumpingstation1",
       "irc" : "irc://irc.freenode.net/#pumpingstationone",
       "email" : "[email protected]",
       "ml" : "http://groups.google.com/group/pumping-station-one-public"
         },
         "issue_report_channels": [
       "twitter"
         ],
         "logo" : "http://wiki.pumpingstationone.org/images/pumpingstationone.org.wiki.logo.png",
         "state" : {
       "icon" : {
         "open" : "http://wiki.pumpingstationone.org/images/pumpingstationone.org.wiki.logo.png",
         "closed" : "http://wiki.pumpingstationone.org/images/pumpingstationone.org.wiki.logo.png"
       }
         },
         "location" : {
       "address" : "3519 N Elston, Chicago IL 60618, USA",
       "lat" : 41.945321,
       "lon" : -87.706631
        },
         "cam" : ["http://apps.pumpingstationone.org/space-activity/"]
       },
       "cameras" : {
         "shop" : 7,
         "electronics" : 30,
         "crafts" : 20
       },
       "needed_activity" : 1,
       "status_note" : "Check http://pumpingstationone.org/events/ for public events."
     },
     {
       "role" : "frontend",
       "type" : "irc",
       "server" : "irc.freenode.net",
       "nick" : "spacemon",
       "channel" : "#pumpingstationone"
     },
     {
       "role" : "announcer",
       "type" : "announced",
       "zmq_url" : "tcp://10.100.0.16:4503"
     },
     {
       "role" : "work1",
       "type" : "web",
       "port" : 8001,
       "zmq_url" : "tcp://*:8201"
     },
     {
       "role" : "work2",
       "type" : "web",
       "port" : 8002,
       "zmq_url" : "tcp://*:8202"
     },
     {
       "role" : "work3",
       "type" : "web",
       "port" : 8003,
       "zmq_url" : "tcp://*:8203"
     },
     {
       "role" : "frontend",
       "type" : "web",
       "proxy_mode" : "auto",
       "port" : 8000
     }
     ]