-
Notifications
You must be signed in to change notification settings - Fork 35
JS Python Communication
-
User Tornado main handler
WeioHandler()
is called every time something comes over /api route https://github.com/nodesign/weio/blob/next/weioRunner.py#L415 -
This handler liver in
./handlers/weioJSPYHandler.py
, and it is just parsing the RPC and putting it in queue -
When PLAY is pressed, separate thread called launcher is started (https://github.com/nodesign/weio/blob/next/weioRunner.py#L168), and it starts all other user processes and then loops in while True, reading this queue to get info from
weioJSPYHandler.py
-
When it gets this info, it executed the function directly in Python (for example
digitalWrite()
): https://github.com/nodesign/weio/blob/next/weioRunner.py#L285 -
Result is put in the other queue, because there is one more thread dedicated to send everything back to JS
-
This thread gets result from this other queue here: https://github.com/nodesign/weio/blob/next/weioRunner.py#L312 and shoots it back to WebSocket connection
- Home
- WeIO Recovery - Manual Update
- Supported Hardware
- How-to extend WeIO flash space
- WeIO Super Starter Kit Components
- OTA Updates
- Troubleshooting
- Misc
- Developer Pages