MenuToggle Menu

Bridge Apps

Bridge apps facilitate communication between any hardware, APIs, or app—supporting Socket.IO—and ProtoPie Connect. A bridge app can catch events, receive data from a server, and sometimes work as a single application. Through Socket.IO messages, ProtoPie Connect can interpret events and data.

Use and/or adjust our example bridge apps, or make your own bridge app (coding required).

Find our example bridge apps on GitHub.

Connecting Hardware via Bridge App

When connecting hardware to ProtoPie Connect via bridge apps, their main role is to convert signals from the hardware to Socket.IO messages, and/or vice versa.

  1. Connect the bridge app directly to ProtoPie Connect its Socket.IO server. The server is indicated using the IP address with port number 9981.
  2. The bridge app converts hardware signals into Socket.IO messages for ProtoPie to interpret. Usually, messages will have the following format:
    {messageId: "HwEventName", value: "ValueAssociatedWithEvent"}
  3. All Socket.IO messages sent, ProtoPie Connect will relay them to the prototypes.
  4. Prototypes receiving these messages can respond to them. Some hardware supports bidirectional communication, meaning that prototypes can send messages to the hardware. This is only possible if the bridge app can convert Socket.IO messages into signals the hardware can interpret.

Connecting APIs with Bridge Apps

When connecting to APIs via bridge apps, the bridge app should convert the API response (e.g., JSON) into individual Socket.IO messages.

For example, if a prototype needs to retrieve weather data dynamically from an API, the bridge app would do the following:

  1. Convert the JSON response into Socket.IO messages.
    ◦ E.g., {"weather": "sunny", "temperature-celsius": 30.5}
  2. Send individual Socket.IO messages to ProtoPie Connect that, in its turn,
    relays them to any prototypes.
    {messageId: "weather", value: "sunny"},
    {messageId: "temperature", value: 30.5}

In a prototype, you should use Receive triggers to receive both messages “weather” and “temperature”. Learn more about the Receive trigger.

Running the Bridge App on the Same Machine

By default, most example bridge apps default to address http://localhost:9981 as it is assumed that the bridge app and ProtoPie Connect run on the same computer or machine.

Simply connect the bridge app to ProtoPie Connect at http://localhost:9981.

[object Object]

Running the Bridge App on a Different Machine

If the bridge app and ProtoPie Connect run on different machines, then set the address to ProtoPie Connect its Socket.IO server. This server is indicated using the IP address with port number 9981 (and different from http://localhost:9981).

  • ProtoPie Connect for Desktop: find the server address in the Manage tab.
[object Object]
  • ProtoPie Connect for Embedded Systems: find the server address right after launching in the terminal.
[object Object]

Back To Top