Skip to main content

A web connected patio awnings controller on Raspberry Pi

Project description

pi_anwing_webthing

A web connected patio awnings controller on Raspberry Pi

Currently supported are TB6612FNG driven motors such as DGO-3512ADA. The concrete motor configuration(s) are defined by using a config file such s shown below.

# name, gpio_forward, gpio_backward, step_duration_in_sec
lane1, 2, 3, 0.5
lane2, 19, 26, 0.5
lane3, 5, 6, 0.5
lane4, 10, 9, 0.5

For TB6612FNG driven motors the filename has to include the term tb6612fng such as tb6612fng_motors.config. Regarding the hardware setup and wiring please refer example hardware setup

To install this software you may use PIP package manager such as shown below

sudo pip install pi_anwing_webthing

After this installation you may start the webthing http endpoint inside your python code or via command line using

sudo anwing --command listen --port 9500 --filename /etc/anwing/tb6612fng_motors.config 

Here, the webthing API will be bind to the local port 9500

Alternatively to the listen command, you can use the register command to register and start the webthing service as systemd unit. By doing this the webthing service will be started automatically on boot. Starting the server manually using the listen command is no longer necessary.

sudo anwing --command register --port 9500 --filename /etc/anwing/tb6612fng_motors.config 

The anwing service exposes an http webthing endpoint supporting the anwing properties. E.g.

# webthing has been started on host 192.168.0.23

curl http://192.168.0.23:9500/properties 

{
 [
    {
       "id":"urn:dev:ops:anwing-TB6612FNG",
       "title":"AnwingControl",
       "@context":"https://iot.mozilla.org/schemas",
       "properties":{
          "target_position":{
             "@type":"LevelProperty",
             "title":"awning lane1 target position",
             "type":"integer",
             "minimum":0,
             "maximum":100,
             "description":"awning lane1 target position",
             "links":[
                {
                   "rel":"property",
                   "href":"/0/properties/target_position"
                }
             ]
          },
          "current_position":{
             "@type":"LevelProperty",
             "title":"awning lane1 current position",
             "type":"integer",
             "minimum":0,
             "maximum":100,
             "readOnly":true,
             "description":"awning lane1 current position",
             "links":[
                {
                   "rel":"property",
                   "href":"/0/properties/current_position"
                }
             ]
          },
          "retracting":{
             "@type":"OnOffProperty",
             "title":"lane1 is retracting",
             "type":"boolean",
             "readOnly":true,
             "description":"lane1 is retracting",
             "links":[
                {
                   "rel":"property",
                   "href":"/0/properties/retracting"
                }
             ]
          },
          "extending":{
             "@type":"OnOffProperty",
             "title":"lane1 is extending",
             "type":"boolean",
             "readOnly":true,
             "description":"lane1 is extending",
             "links":[
                {
                   "rel":"property",
                   "href":"/0/properties/extending"
                }
             ]
          }
       },
       "actions":{

       },
       "events":{

       },
       "links":[
          {
             "rel":"properties",
             "href":"/0/properties"
          },
          {
             "rel":"actions",
             "href":"/0/actions"
          },
          {
             "rel":"events",
             "href":"/0/events"
          },
          {
             "rel":"alternate",
             "href":"ws://192.168.0.23:9500/0"
          }
       ],
       "description":"A web connected patio awnings controller on Raspberry Pi",
       "@type":[
          "MultiLevelSensor"
       ],
       "href":"/0",
       "base":"http://192.168.0.23:9500/0",
       "securityDefinitions":{
          "nosec_sc":{
             "scheme":"nosec"
          }
       },
       "security":"nosec_sc"
    },
    ...
 ]
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pi_anwing_webthing-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

pi_anwing_webthing-0.1.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file pi_anwing_webthing-0.1.0.tar.gz.

File metadata

  • Download URL: pi_anwing_webthing-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for pi_anwing_webthing-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5ab2e9e44561c204929962e42abdb5f99c3f8faca894ba948a8d79244a64b308
MD5 3c4b5ebc676c0dccf01480cb3751159e
BLAKE2b-256 82f718826761b1b817cb0c5763d98563f8946a353f4f5ecb46e5881d4588a268

See more details on using hashes here.

File details

Details for the file pi_anwing_webthing-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pi_anwing_webthing-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for pi_anwing_webthing-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9afc2f1826add75aa9382f3dcd3a9ca77f6e546395db1d1b4d24587a09d8ba87
MD5 4c3d8661dc5a43d959a8b11bc1aa8a12
BLAKE2b-256 a7339f3579ea7cda2ea6485f977cae71578b09015150c7739df5c1f7e615b768

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page