# Ayva WebSocket Hub

# Overview

[![awh suggestive.PNG](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/awh-suggestive.PNG)](https://osr.wiki/uploads/images/gallery/2023-11/awh-suggestive.PNG)

Ayva WebSocket Hub is an open source *desktop* application that can stream [TCode](https://osr.wiki/books/communication-protocols/page/tcode) from *web* applications to any number of outputs (such as serial and network outputs) via a [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API). This is to bypass the limitations of web browser technologies that prevent making unsecure connections to devices over WiFi and/or streaming data into desktop applications.

The most common use cases are:

- Streaming TCode into a [Virt-a-mate](https://osr.wiki/books/glossary/page/virt-a-mate) scene (requires the [BusDriver](https://osr.wiki/books/busdriver) plugin).
- Streaming TCode to a WiFi-enabled device.
- Streaming TCode to multiple devices and/or outputs at once.

It works with [Ayva Software](https://osr.wiki/books/glossary/page/ayva) applications such as [Ayva Stroker Lite](https://ayva-stroker-lite.io) and [Ayva Remote](https://remote.ayvasoftware.io/about). However, it can stream data from any application that can connect to a WebSocket.

---

**Demos:** [https://drive.google.com/file/d/1MM\_YowIbsuETLv051WsqQs38sVMGvJZS/view](https://drive.google.com/file/d/1MM_YowIbsuETLv051WsqQs38sVMGvJZS/view)  
[https://drive.google.com/file/d/1FOQllbYSnlJoBqvN3TjJSsV6DI5dRlyg/view](https://drive.google.com/file/d/1FOQllbYSnlJoBqvN3TjJSsV6DI5dRlyg/view)

**Latest Release** (**Windows** and **macOS**):   
[https://github.com/ayvasoftware/ayva-websocket-hub/releases](https://github.com/ayvasoftware/ayva-websocket-hub/releases)  
  
**How to Install**:   
[https://osr.wiki/books/ayva-websocket-hub/chapter/installation](https://osr.wiki/books/ayva-websocket-hub/chapter/installation)  
  
**Github Repository**:  
[https://github.com/ayvasoftware/ayva-websocket-hub](https://github.com/ayvasoftware/ayva-websocket-hub)

# Installation

Installation steps for Windows and macOS.

# Installing on Windows

1. **Download** and unzip **[Ayva WebSocket Hub (Windows).zip](https://github.com/ayvasoftware/ayva-websocket-hub/releases)** into a directory of your choosing.
2. (Optional) **Certificate Installation.** Install the certificate for Certera by double-clicking on the **Certera\_CABundle.crt** in the unzipped folder. *Note: This step is not required, but may prevent "Unknown Publisher" messages when running the application. Certera is the Certificate Authority (CA) that was used to digitally sign the application.*  
     *[![certera certificate.PNG](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/certera-certificate.PNG)](https://osr.wiki/uploads/images/gallery/2023-11/certera-certificate.PNG)* Click **Install Certificate** and keep the default settings in the installation wizard. *[![install certificate.PNG](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/install-certificate.PNG)](https://osr.wiki/uploads/images/gallery/2023-11/install-certificate.PNG)*
3. Double-click **Ayva WebSocket Hub.exe** to run the application.  
      
    [![click awh2.png](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/click-awh2.png)](https://osr.wiki/uploads/images/gallery/2023-11/click-awh2.png)  
       
    You may see the following warning message:  
      
    [![awh_smartscreen_1.PNG](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/awh-smartscreen-1.PNG)](https://osr.wiki/uploads/images/gallery/2023-11/awh-smartscreen-1.PNG)  
      
    This is because the kind of certificate Ayva WebSocket Hub was signed with builds reputation over time.   
    Eventually this will stop appearing after enough users have installed the application (or enough time has passed).   
      
    If you click "More info" you can verify that the Publisher is [Ayva Software LLC](https://osr.wiki/books/glossary/page/ayva "Ayva")*.*  
      
    [![awh_smartscreen_2.PNG](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/STdawh-smartscreen-2.PNG)](https://osr.wiki/uploads/images/gallery/2023-11/STdawh-smartscreen-2.PNG)  
      
    Click "Run anyway" and the application should open:  
      
    [![awh_win.PNG](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/awh-win.PNG)](https://osr.wiki/uploads/images/gallery/2023-11/awh-win.PNG)
4. Consult the [Guide ](https://osr.wiki/books/ayva-websocket-hub/page/appendix)for information about how to use it.

# Installing on macOS

1. **Download** and unzip **[Ayva WebSocket Hub (macOS).zip](https://github.com/ayvasoftware/ayva-websocket-hub/releases)** into a directory of your choosing (your **Application**s folder is recommended).
2. Double-click **Ayva WebSocket Hub.app** and the application should open.  
      
    [![Screenshot 2023-11-09 at 1.51.58 PM.png](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/screenshot-2023-11-09-at-1-51-58-pm.png)](https://osr.wiki/uploads/images/gallery/2023-11/screenshot-2023-11-09-at-1-51-58-pm.png)
3. Consult the [Guide](https://osr.wiki/books/ayva-websocket-hub/page/appendix) for information about how to use it.

# Guide



# Interface Overview

[![awh-guide-overview.png](https://osr.wiki/uploads/images/gallery/2024-02/scaled-1680-/awh-guide-overview.png)](https://osr.wiki/uploads/images/gallery/2024-02/awh-guide-overview.png)

1. **Listening Port** - Specify the port for Ayva WebSocket Hub to monitor incoming connections. Any [TCode](https://osr.wiki/books/communication-protocols/page/tcode "TCode") received on this port will be routed to the connected outputs. Click the *Start* button to begin monitoring for incoming connections. Data forwarding will commence immediately upon establishing a connection.
2. **Add Output** - Use this dropdown menu to select and add output streams.
3. **Outputs** - This table lists all configured outputs—which are saved across sessions—along with their connection status. You can enable or disable streaming to any listed output by using the checkbox in the *Enabled* column.
4. **Incoming Connection State** - This indicates the status of the incoming connection, which can be *Disconnected*, *Listening* or *Connected.*
5. **Patreon Link** - Ayva Software is supported by the community. This is a link to the [Patreon](https://patreon.com/soritesparadox).

# Output Types

[![awh-guide-outputs.png](https://osr.wiki/uploads/images/gallery/2024-02/scaled-1680-/awh-guide-outputs.png)](https://osr.wiki/uploads/images/gallery/2024-02/awh-guide-outputs.png)

There are two main types of outputs: **Network** and **Serial**.

##### **Network**

[![add-buss-driver-serial.PNG](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/add-buss-driver-serial.PNG)](https://osr.wiki/uploads/images/gallery/2023-11/add-buss-driver-serial.PNG)

Network outputs enable connections to devices or software via [TCP](https://en.wikipedia.org/wiki/Transmission_Control_Protocol) or [UDP](https://en.wikipedia.org/wiki/User_Datagram_Protocol) protocols. In TCP mode, Ayva WebSocket Hub attempts to establish a connection to a WebSocket at the `/ws` endpoint on the specified host and port. In UDP mode, packets are sent directly to the designated host and port. Note that because UDP is *connectionless*, a UDP output will always be displayed as *Connected*, even if no application or device is actively listening at the specified host and port.

TCP is typically used to connect to WiFi-enabled devices, while UDP is typically used to stream to a [Virt-a-mate](https://osr.wiki/books/glossary/page/virt-a-mate) plugin such as [BusDriver](https://osr.wiki/books/busdriver) (though it can also be used for WiFi-enabled devices that support UDP).

##### **Serial**

**[![awh-guide-3.PNG](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/awh-guide-3.PNG)](https://osr.wiki/uploads/images/gallery/2023-11/awh-guide-3.PNG)**

**[![awh-guide-4.PNG](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/awh-guide-4.PNG)](https://osr.wiki/uploads/images/gallery/2023-11/awh-guide-4.PNG)**

Serial outputs facilitate device connections via the Serial protocol, typically through USB. However, they can also operate over [virtual serial ports](https://en.wikipedia.org/wiki/Virtual_COM_port) that emulate physical connections for other protocols, including Bluetooth Classic.

# Appendix

##### **To be incorporated into the Guide**

[![awh-guide-5.PNG](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/awh-guide-5.PNG)](https://osr.wiki/uploads/images/gallery/2023-11/awh-guide-5.PNG)

[![awh-guide-6.PNG](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/awh-guide-6.PNG)](https://osr.wiki/uploads/images/gallery/2023-11/awh-guide-6.PNG)

[![add-buss-driver-serial.PNG](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/add-buss-driver-serial.PNG)](https://osr.wiki/uploads/images/gallery/2023-11/add-buss-driver-serial.PNG)

[![virt-a-mate bus driver.png](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/virt-a-mate-bus-driver.png)](https://osr.wiki/uploads/images/gallery/2023-11/virt-a-mate-bus-driver.png)

[![serial-bus-driver-streaming.PNG](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/serial-bus-driver-streaming.PNG)](https://osr.wiki/uploads/images/gallery/2023-11/serial-bus-driver-streaming.PNG)

##### **Example**: Streaming from Ayva Stroker Lite

[![ayva-stroker-awh-1.png](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/ayva-stroker-awh-1.png)](https://osr.wiki/uploads/images/gallery/2023-11/ayva-stroker-awh-1.png)

[![ayva-stroker-awh.png](https://osr.wiki/uploads/images/gallery/2023-11/scaled-1680-/ayva-stroker-awh.png)](https://osr.wiki/uploads/images/gallery/2023-11/ayva-stroker-awh.png)

# Troubleshooting

##### **I see this error in BusDriver. What's wrong?**

`Exception caught: System.FormatException: Input string was not in the correct format ...`

This is from a bug that was fixed in [BusDriver](https://osr.wiki/books/busdriver "BusDriver"). Download and install the [latest version](https://github.com/Yoooi0/BusDriver/releases/tag/v4) and it will go away.