projects:space-state

Space-state

The Space-state concerns the big switch next to the entrance. Normally this switches on the big TDvenlo sign and some lights. This main switch should also inform the rest of the internet that people are present at our space. This pace describes how we do this.

- Serve spaceapi.json file to the internet

- Depending on the state a logo with either “OPEN” or “CLOSED” should be served as well

The space-state uses the main switch next to our entrance. This connects to an ESP8266 via a resistor divider.

The ESP8266 runs on micropython. The ESp connects to our 2.4 GHz. network via DHCP. The space-state serves the spaceapi.json to outside users via our main server: https://spaceapi.tdvenlo.nl/spaceapi.json. You can find a description of the spaceapi API at https://spaceapi.net

You can find Micropython for the ESP8266 here: https://micropython.org/download#esp8266 Install micropython via the tutorial

The spaceapi.json looks like the following:

spaceapi.json
{
  "api": "0.13",
  "space": "TDvenlo",
  "logo": "https://www.tdvenlo.nl/TDvenlo_logo.png",
  "url": "https://www.tdvenlo.nl",
  "location": {
    "address": "Begijnengang 2, 5911 JL, Venlo, The Netherlands",
    "lat": 51.36940,
    "lon": 6.16998
  },
  "contact": {
    "twitter": "@TDvenlo",
    "email": "info@tdvenlo.nl",
    "facebook": "https://www.facebook.com/TDvenlo/"
  },
  "issue_report_channels": [
    "email"
  ],
  "state": {
    "open": false,
    "icon": {
    "open": "https://www.tdvenlo.nl/TDvenlo_logo_open.png",
    "closed": "https://www.tdvenlo.nl/TDvenlo_logo_closed.png"
     },
   "projects": [ "https://tdvenlo.nl/wiki/doku.php?id=start#projecten" ]
  }
}

It should change the key for state to true if the main switch is closed. The “state” key remains false when the switch doesn't conduct.

These two files should be served:

*Logo “OPEN”:

*Logo “CLOSED”:





  • projects/space-state.txt
  • Last modified: 12/04/2024 23:54
  • by ron