WebService Serial disposes the WebService communication via TCP Serial communication.
With it, is possible:
- Use DisplayView, a Android application that provides pedalboard data for live presentations. Your focus is a speed management in live performances.
Like described in Application documentation, create a start.py
and register AndroidController component.
import sys
import tornado
# DEPRECATED
sys.path.append('application')
sys.path.append('android_controller')
from application.Application import Application
from android_controller.android_controller import AndroidController
address = 'localhost'
port = 3000
application = Application(path_data="data/", address=address, test=True)
application.register(AndroidController(application, "adb"))
application.start()
tornado.ioloop.IOLoop.current().start()
WebService Serial requires Tornado >= 4.2
for TCP connection.
For communication with Android (over USB), also needs adb
.
If you uses in a ARM architecture, maybe will be necessary compile adb. In these cases, the project https://github.com/PedalPi/adb-arm can help you. adb-arm PedalPi fork already contains some binaries for RaspberryPi.
The communication are described here. For the possible command lists, see the WebService documentation.
<METHOD> <URL>\n
<DATA>\n
EOF\n
<METHOD>
:GET
,POST
,PUT
,DELETE
,SYSTEM
<DATA>
: Json data. If none, send'{}'
<URL>
: http://pedalpi.github.io/WebService/EOF
: The string "EOF".
Example:
PUT /current/bank/1/pedalboard/3
{}
EOF
RESPONSE <DATA>
RESPONSE
: StringRESPONSE
;<DATA>
: Json data. If none, send'{}'
This corresponds the websocket data notifications
EVENT <DATA>
EVENT
: StringEVENT
<DATA>
: Json data. If none, send'{}'
After the connection has been realized,
- Application send
SYSTEM /
{"message": "connected"}
EOF
The connected device can be request thinks, like:
- The current pedalboard number
GET /v1/current
{}
EOF
- Response
RESPONSE { "bank": 1, "pedalboard": 0 }
- The pedalboard data
GET /v1/bank/1/pedalboard/0
{}
EOF
- Response
RESPONSE { "name": "My pedalboard", "effects": [], "connections": [], "data": {} }