Difference between revisions of "Spacemon"

From Pumping Station One
Jump to navigation Jump to search
m
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Spacemon is our [[IRC]] bot that watches the [[ip cameras|webcams]] in the space and shows how busy each part of the space is at any time.
+
Spacemon ... isn't being operated right now, is it? Ask [[User:Toba]] if you're interested in the status or functioning of spacemon.
 +
 
 +
Spacemon is our [[IRC]] bot that watches the [[ip cameras|webcams]] in the space and shows how busy each part of the space is at any time. Spacemon is a project of [[User:Toba]].
  
 
IRC commands:
 
IRC commands:
Line 12: Line 14:
 
   <+Toba> !light
 
   <+Toba> !light
 
   < spacemon> garage: 0% lit, electronics: 40% lit, woodshop: 2% lit, space: 27% lit
 
   < spacemon> garage: 0% lit, electronics: 40% lit, woodshop: 2% lit, space: 27% lit
 
Also there is the ability to see a snapshot from each camera:
 
 
  <+Toba> !snapshot lasercutter
 
  < spacemon> sent request, should load at :http://spacemon.pumpingstationone.org/api/lasercutter/snapshot/1439490026540621.jpg
 
( for looking at the shop the command is: !snapshot shop )
 
  
 
From time to time, spacemon will report that the space is unusually busy:
 
From time to time, spacemon will report that the space is unusually busy:
Line 30: Line 26:
 
== lidless config ==
 
== lidless config ==
  
      [
+
    [
 
       {
 
       {
         "role" : "work1",
+
         "username": "REDACTED",  
        "type" : "camera",
+
         "name": "electronics",  
         "name" : "electronics",
+
         "url": "http://10.100.0.30/mjpg/video.mjpg",  
         "url" : "http://10.100.0.61/mjpg/video.mjpg",
+
         "zmq_url": "tcp://*:7200",  
         "zmq_url" : "tcp://*:7200",
+
         "role": "work1",  
         "username" : "REDACTED",
+
         "password": "REDACTED",  
         "password" : "REDACTED",
+
         "type": "camera",  
         "store" : true,
+
         "store": false
         "store_thr" : 1
+
       },  
       },
 
 
       {
 
       {
         "role" : "work1",
+
         "username": "REDACTED",  
        "type" : "camera",
+
         "name": "lasercutter",  
         "name" : "lasercutter",
+
         "url": "http://10.100.0.31/mjpg/video.mjpg",  
         "url" : "http://10.100.0.64/mjpg/video.mjpg",
+
         "zmq_url": "tcp://*:7206",  
         "zmq_url" : "tcp://*:7206",
+
         "role": "work2",
         "username" : "REDACTED",
+
        "snapshot": false,  
         "password" : "REDACTED",
+
         "password": "REDACTED",  
         "snapshot" : true,
+
         "type": "camera",  
         "store" : true,
+
         "store": false,  
         "store_thr" : 1
+
         "snapshot_base_url": "http://spacemon.pumpingstationone.org"
       },
+
       },  
 
       {
 
       {
         "role" : "work2",
+
         "username": "REDACTED",  
        "type" : "camera",
+
         "name": "kitchen",  
         "name" : "shop",
+
         "url": "http://10.100.15.149/goform/capture",  
         "url" : "http://10.100.0.62/mjpg/video.mjpg",
+
         "zmq_url": "tcp://*:7207",
         "zmq_url" : "tcp://*:7201",
+
        "role": "work3",  
         "username" : "REDACTED",
+
         "mode": "jpegpoll",
         "password" : "REDACTED",
+
        "snapshot": false,  
         "store" : true,
+
         "password": "REDACTED",
         "store_thr" : 1
+
        "type": "camera",  
       },
+
         "store": false,  
 +
         "snapshot_base_url": "http://spacemon.pumpingstationone.org"
 +
       },  
 
       {
 
       {
         "role" : "work1",
+
         "username": "REDACTED",  
        "type" : "camera",
+
         "name": "shop",  
         "name" : "crafts",
+
         "url": "http://10.100.0.32/mjpg/video.mjpg",  
         "url" : "http://10.100.0.63/mjpg/video.mjpg",
+
         "zmq_url": "tcp://*:7201",  
         "zmq_url" : "tcp://*:7202",
+
         "role": "work3",
         "username" : "REDACTED",
+
        "snapshot": false,  
         "password" : "REDACTED",
+
         "password": "REDACTED",
         "store" : true,
+
        "type": "camera",  
         "store_thr" : 1
+
         "store": false,  
       },
+
         "snapshot_base_url": "http://spacemon.pumpingstationone.org"
 +
       },  
 
       {
 
       {
         "role" : ["frontend", "announcer"],
+
         "username": "REDACTED",  
         "type" : "alert",
+
         "name": "crafts",  
         "mode" : "sustain",
+
         "url": "http://10.100.0.33/mjpg/video.mjpg",  
         "low_level" : 20,
+
         "zmq_url": "tcp://*:7202",  
         "duration" : 1800,
+
         "role": "work2",  
         "message" : "There's loads of people working in the shop. Yay, hacking!",
+
         "password": "REDACTED",  
         "camera" : "shop",
+
         "type": "camera",  
         "throttle" : 9400
+
         "store": false
       },
+
       },  
 
       {
 
       {
         "role" : ["frontend", "announcer"],
+
         "throttle": 9400,
         "type" : "alert",
+
        "camera": "shop",  
         "mode" : "sustain",
+
         "low_level": 20,  
         "high_level" : 10,
+
         "mode": "sustain",  
         "low_level" : 4,
+
         "duration": 1800,  
        "duration" : 1500,
+
         "role": [
         "message" : "The people in the electronics shop are being so boring. Break a leg, slackers!",
+
          "frontend",  
         "camera" : "electronics",
+
          "announcer"
        "throttle" : 86400
+
        ],  
       },
+
         "message": "There's loads of people working in the shop. Yay, hacking!",  
 +
         "type": "alert"
 +
       },  
 
       {
 
       {
         "role" : ["frontend", "announcer"],
+
         "throttle": 86400,
         "type" : "alert",
+
        "high_level": 10,  
         "mode" : "sustain",
+
        "camera": "electronics",  
         "high_level" : 0,
+
         "low_level": 4,  
         "duration" : 43200,
+
         "mode": "sustain",  
        "message" : "I'm so alone.  Nobody wants to hang out with me.",
+
         "duration": 1500,  
         "camera" : "electronics",
+
         "role": [
         "throttle" : 86400
+
          "frontend",
       },
+
          "announcer"
 +
        ],  
 +
         "message": "The people in the electronics shop are being so boring. Break a leg, slackers!",  
 +
         "type": "alert"
 +
       },  
 
       {
 
       {
         "type" : "spaceapi",
+
         "throttle": 86400,
         "name" : "ps1",
+
        "high_level": 0,  
         "metadata" : {
+
         "camera": "electronics",  
           "space" : "Pumping Station: One",
+
         "role": [
          "url" : "http://pumpingstationone.org",
+
          "frontend",
          "contact" : {
+
           "announcer"
         "twitter" : "@pumpingstation1",
+
        ],
         "irc" : "irc://irc.freenode.net/#pumpingstationone",
+
        "mode": "sustain",  
         "email" : "[email protected]",
+
        "duration": 43200,
         "ml" : "http://groups.google.com/group/pumping-station-one-public"
+
        "message": "I'm so alone.  Nobody wants to hang out with me.",  
          },
+
        "type": "alert"
 +
      },
 +
      {
 +
         "name": "ps1",  
 +
         "cameras": {
 +
          "shop": 7,
 +
          "electronics": 30,
 +
          "crafts": 20
 +
        },
 +
        "status_note": "Only members have access 24/7. If you are not a member, check http://pumpingstationone.org/events/ for public events.",  
 +
         "type": "spaceapi",
 +
        "needed_activity": 1,  
 +
         "metadata": {
 +
          "space": "Pumping Station: One",
 +
          "url": "http://pumpingstationone.org",  
 
           "issue_report_channels": [
 
           "issue_report_channels": [
 
         "twitter"
 
         "twitter"
           ],
+
           ],  
           "logo" : "http://wiki.pumpingstationone.org/images/pumpingstationone.org.wiki.logo.png",
+
           "state": {
           "state" : {
+
        "icon": {
         "icon" : {
+
          "open": "https://wiki.pumpingstationone.org/images/pumpingstationone.org.wiki.logo.png",  
          "open" : "http://wiki.pumpingstationone.org/images/pumpingstationone.org.wiki.logo.png",
+
           "closed": "https://wiki.pumpingstationone.org/images/pumpingstationone.org.wiki.logo.png"
           "closed" : "http://wiki.pumpingstationone.org/images/pumpingstationone.org.wiki.logo.png"
+
         }
 +
          },
 +
          "contact": {
 +
        "ml": "http://groups.google.com/group/pumping-station-one-public",
 +
        "twitter": "@pumpingstation1",
 +
        "irc": "irc://irc.freenode.net/#pumpingstationone",
 +
        "email": "info@pumpingstationone.org"
 +
          },
 +
          "location": {
 +
        "lat": 41.945321,
 +
        "lon": -87.706631,
 +
        "address": "3519 N Elston, Chicago IL 60618, USA"
 +
          },
 +
          "cam": [
 +
        "https://spacemon.pumpingstationone.org/"
 +
          ],  
 +
           "logo": "https://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",  
         "type" : "irc",
+
         "nick": "spacemon",  
         "server" : "irc.freenode.net",
+
         "role": "frontend",  
         "nick" : "spacemon",
+
         "channel": "#pumpingstationone",  
         "channel" : "#pumpingstationone"
+
         "server": "irc.freenode.net"
       },
+
       },  
 
       {
 
       {
         "role" : "announcer",
+
         "type": "announced",  
         "type" : "announced",
+
         "role": "announcer",  
         "zmq_url" : "tcp://10.100.0.16:4503"
+
         "zmq_url": "tcp://10.100.0.16:4503"
       },
+
       },  
 
       {
 
       {
         "role" : "work1",
+
         "type": "web",  
         "type" : "web",
+
         "role": "work1",  
         "port" : 8001,
+
         "port": 8001,  
         "zmq_url" : "tcp://*:8201"
+
         "zmq_url": "tcp://*:8201"
       },
+
       },  
 
       {
 
       {
         "role" : "work2",
+
         "type": "web",  
         "type" : "web",
+
         "role": "work2",  
         "port" : 8002,
+
         "port": 8002,  
         "zmq_url" : "tcp://*:8202"
+
         "zmq_url": "tcp://*:8202"
       },
+
       },  
 
       {
 
       {
         "role" : "work3",
+
         "type": "web",  
         "type" : "web",
+
         "role": "work3",  
         "port" : 8003,
+
         "port": 8003,  
         "zmq_url" : "tcp://*:8203"
+
         "zmq_url": "tcp://*:8203"
       },
+
       },  
 
       {
 
       {
         "role" : "frontend",
+
         "type": "web",  
         "type" : "web",
+
         "proxy_mode": "auto",  
         "proxy_mode" : "auto",
+
         "role": "frontend",  
         "port" : 8000
+
         "port": 8000
 
       }
 
       }
      ]
+
    ]
  
 
== Things Bus ==
 
== Things Bus ==

Latest revision as of 01:55, 26 September 2017

Spacemon ... isn't being operated right now, is it? Ask User:Toba if you're interested in the status or functioning of spacemon.

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. Spacemon is a project of User:Toba.

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

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

Things Bus

Fields:

  • ratio_busy (0.0 -> 1.0) float, how busy the room is
  • luminance (0.0 -> 255.0) float, average pixel brightness of camera source