Package: pi-anwing-webthing
pi_anwing_webthingA web connected patio awnings controller on Raspberry PiCurrently supported areTB6612FNG drivenmotors such
asDGO-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.5For TB6612FNG driven motors the filename has to include the termtb6612fngsuch as tb6612fng_motors.config. Regarding the
hardware setup and wiring please referexample hardware setupTo install this software you may usePIPpackage manager such as shown belowsudo pip install pi-anwing-webthingAfter this installation you may start the webthing http endpoint inside your python code or via command line usingsudo anwing --command listen --hostname 192.168.0.23 --port 9500 --filename /etc/anwing/tb6612fng_motors.configHere, the webthing API will be bind to hostname 192.168.0.23 on the local port 9500Alternatively to thelistencommand, you can use theregistercommand 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 thelistencommand is no longer necessary.sudo anwing --command register --hostname 192.168.0.23 --port 9500 --filename /etc/anwing/tb6612fng_motors.configThe 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"
    },
    ...
 ]
}