thingsd

IoT Proxy Daemon for OpenBSD

About thingsd

The thingsd OpenBSD proxy daemon provides a mechanism for clients and client processes to communicate with an array of serial and IoT things. At its core, thingsd is primarily a data aggregator and repeater, in that it waits for packets to swap between subscriber clients and things.

On the client side, thingsd sets up TCP/IP sockets to transmit packets to and from things. On the server side, thingsd can connect to any serial device which has a viable file descriptor, create a persistent connection to the IP address of a device transmitting packets on the same network, or setup a UDP listener on the network to receive broadcasted packets.

Serial Communication

Connect to serial devices with viable file descriptors

Network Connectivity

Create persistent connections to IP addresses and receive UDP broadcasts

Data Aggregation

Act as a data aggregator and repeater between clients and IoT devices

Security Controls

Password control over connections with client limits

View Source (got)

Installation

Compile and install:

make
doas make install
doas groupadd _thingsd
doas useradd -d /var/empty -L daemon -g _thingsd -s /sbin/nologin _thingsd
doas cp examples/etc/rc.d/thingsd /etc/rc.d/
doas chown _thingsd /dev/[thingsd.conf devices]

Edit thingsd.conf according to man thingsd.conf. Your settings will depend on your machine and the things you have setup.

Once the thingsd.conf is edited, run rcctl enable thingsd and rcctl start thingsd. The thingsd daemon can also be run manually from the command line. To keep thingsd from daemonizing, run thingsd -d from the command line.

Usage

To test your setup, connect to your machine running thingsd with netcat:

nc SERVERNAME PORT

Then paste in a subscription packet for your setup:

~~~subscribe{{name,"CLIENT"},{things{thing{"dev","passwd"}}}}

You should start receiving packets from your setup thing.

Further examples can be found in the src/examples directory above.