Skip to content
ox edited this page Jul 26, 2023 · 7 revisions

Preparation

Before you get started, determine the proper context for this implementation. Ask questions such as:

  • What devices need to be connected?
  • Who is developing and/or maintaining this network?
  • What is their preferred medium for programming? Text-based or visual?
  • Do you prioritise ease of setup or customisability?

Steps

Connect devices

Make sure all devices are connected to the same network, either wirelessly or through an ethernet cable, ideally to a single router. Simplifying the network will save on possible networking drama.

Set static IP addresses (optional, but recommended)

When devices connect to a router, the router usually assigns them an IP address based on what open slots it has available. Think air traffic controllers assigning runways to airplanes. This process is known as DHCP.

However, the router can change IP addresses on a whim if it deems it necessary. Usually, this doesn't make much of a difference.

When dealing with OSC, these changes can make it hard for our devices to find each other. To avoid this, we set a static IP address, one that the router knows to never change.

Follow these guides for your OS:

To choose a new address:

  1. Take note of your current IP address
  2. Keep the first three numbers
  3. Change the final number to something of your choice in the range of 1-255.

Find IP addresses

If you didn't manually set an IP address, open a terminal/command prompt and run the command for the associated operating system.

Linux

# If the device is only connected to one network
hostname -I 

macOS

# If connecting via wifi
ipconfig getifaddr en0 

# If connecting via ethernet
ipconfig getifaddr en1

Windows

Follow instructions here.

Set up OSC implementations

Follow these guides for your specific devices/programs.

Alternatives

While OSC is useful for many cases, sometimes you need other tools for the job.

MQTT

A messaging protocol with a similar address/message structure.

  • higher latency
  • lower message bandwidth
  • better energy efficiency
  • requires a separate server running
  • good for IoT devices running on battery power