Skip to content

Kegboard firmware for the Particle Photon/Electron devices

License

Notifications You must be signed in to change notification settings

Kegbot/kegboard-particle

Repository files navigation

kegboard-particle

Flow sensor controller firmware for Particle Photon and Electron hardware. Provides meter readings over serial port and Wifi (Photon) or cellular (Electron) network connections.

Build and Flash

To build and flash your particle device, load the main.ino file into the Particle IDE and flash it to your device. That's it!

Wiring

The following pins are configured (all optional):

  • D1 - Flow meter meter0
  • D2 - Flow meter meter1
  • D3 - Flow meter meter2
  • D4 - Flow meter meter3
  • D5 - OneWire DS1820 temperature sensor.

Most flow meters, along with DS1820 temperature sensors, require a pull-up resistor for proper operation. Consult hardware documentation.

Reading Data

There are three ways to read meter data from the device:

  • Serial interface: Connect directly to the serial port. This interface is always running.
  • TCP interface: Connect to the device on a TCP port.
  • Cloud interface: Publishes a message to the Particle cloud using Particle.publish(). This interface is active when no TCP clients are connected.

TCP Interface

The firmware runs a TCP server on port 8321 where meter readings are published. A single client at a time can connect to this port.

Example:

$ telnet 192.168.1.7 8321
info: kegboard-particle device_id=1234abcd1234abcd00001111 version=0.1.0
kb-status: meter0.ticks=0 meter1.ticks=0 meter2.ticks=0 meter3.ticks=0
kb-status: meter0.ticks=16 meter1.ticks=0 meter2.ticks=0 meter3.ticks=0

Service Discovery with mDNS (Bonjour)

The device will broadcast the mDNS hostname kegboard. On Mac OS X, you can typically locate the device with the hostname kegboard.local rather than by IP:

$ telnet kegboard.local 8321
Trying 192.168.86.100...
Connected to kegboard.local.
Escape character is '^]'.
info: kegboard-particle device_id=3f0000000000000000000001 version=0.1.0

Serial Interface

Meter updates are also published on the serial port, in the same message format as the TCP server.

Cloud Interface

If there is no TCP client connected, the device will instead report status, up to once a second, to the Particle Cloud.

Log in to the Particle logs console to see events.

License

Offered free and open source under the MIT license. See LICENSE.txt.

About

Kegboard firmware for the Particle Photon/Electron devices

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages