Giter VIP home page Giter VIP logo

msmute's Introduction

MS Mute

A macro pad to control Microsoft Teams (via WebSocket) while you are on-call.

MS Mute - Opened MS Mute - Closed

Bill of material

Build a MS Mute device

Assembly

"MS Mute Shield Front" "MS Mute Shield back"

Warning

This is still under development

"Wiring"

"MS Mute connected"

Flashing MicroPython

For more information on flashing MicroPython to the microcontroller take a look here: https://www.wemos.cc/en/latest/tutorials/d1/get_started_with_micropython_d1.html

Buttons

pin color action description
14 white toggle-hand Raise or lower hand
12 green toggle-mute Toggle mute on/off
13 blue toggle-video Toggle camera on/off
15 red leave-call Leave the meeting

Copy project files

You can use adafruit-ampy to copy the files to your board. Checkout the tutorial here: https://learn.adafruit.com/micropython-basics-load-files-and-run-code/overview.

# switch working directory to `src`
cd src
# copy all files to the microcontroller
ampy --port /dev/ttyUSB1 put ./ /

Configuration

{
  []
  "WS_TOKEN": "49e618ec-b17e-4129-98fd-4d8c266e0041",
  "WS_URI": "ws://192.168.0.100:8123"
}

The value for WS_TOKEN is generated by Microsoft Teams once the third-party device pairing was successful. See General Setup for more information.

WS_URI consists of the prefix ws:// for a WebSocket connection, your computers IP address (e.g 192.168.0.101) and the exposed port 8123. See Exposing the port externally for more information.

General Setup (macOS)

Enable Third-party app API

In Microsoft Teams go to Settings > Privacy > Third-party app API > check enable. This will start the WebSocket-Server on port 8124.

You can validate this by running lsof in Terminal.app:

# check if Teams opened the port on localhost
lsof | grep 8124

The output should show a line with something like TCP localhost:8124 (LISTEN).

For more information refer to Microsofts documentation.

Aquiring a refresh token

In the Developer Console of your browser switch to the Network tab and make sure can see the Console below:

"Screenshot from Developer Console"

Lets connect to the Teams WebSocket-Server:

const ws = new WebSocket(
  "ws://127.0.0.1:8124/?manufacturer=jalmeroth&device=wemos-d1-mini&app=msmute&app-version=1.0&protocol-version=2.0.0&token=",
);

Now join a Teams meeting and issue the following command in Developer Console:

ws.send('{"action":"toggle-hand","parameters":{},"requestId":1}');

"Screenshot from New connection request"

You will see a window to Allow or Block a new connection request. Tapping Allow means the third-party device will pair and can interact with Teams; it will be added to the Allowed apps and devices list.

Pairing the device will issue a tokenRefresh as seen in the screenshot above.

The tokenRefresh value must be copied as WS_TOKEN in your config.json.

Exposing the port externally

Since the WebSocket-Server port is bound to localhost we need to expose it externally. We can use socat for this:

# Install `socat` via `brew` first
brew install socat
# Export local-bound port (8124) on different port (e.g. 8123)
socat -4 TCP-Listen:8123,reuseaddr,fork TCP:localhost:8124

CAD

The 3D-files for the enclosure can be found in cad

Further reading

msmute's People

Contributors

jalmeroth avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

mirrejensen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.