#iot #sensor #raspberry-pi-pico #iot-devices #data #proxy #relay

bin+lib pixy

A multi-target sensor output relay built for secure, efficient IoT. Made for use with the Pimoroni Enviro Pico boards.

3 unstable releases

0.2.1 Aug 24, 2023
0.2.0 Aug 4, 2023
0.1.8 Jul 28, 2023
0.0.0 Jul 26, 2023

#432 in Hardware support

MIT license

65KB
914 lines

Pixy

Build Release Crates.io

Pixy is a web server designed to be used with IoT devices for secure-by-default sensor data relay. It was originally built for use with the Pimoroni Enviro Pico, so you could say it is a Raspberry Pi Pico proxy.

Overview

Pixy is a Rust-based proxy for relaying sensor messages to multiple targets defined within a simple YAML configuration file. It acts as a single write-only entrypoint for IoT devices, reducing configuration overhead and making it easier to distribute data to many independent systems.

Got suggestions for Pixy? Open an issue for a feature request, or start a discussion!

Motivation

After setting up an Enviro Pico and connecting it to my Home Assistant instance with MQTT, I started thinking of some other uses for it. I've been thinking on how I could connect it up to other automation platforms (like IFTTT), how I might transmit data to citizen science initiatives, or how I might wire up more robust alerting systems, improve fault tolerance, etc., which did not feel possible to do when trying to extend battery life on the Pico as much as possible.

Scouring through some forums and github repositories, I found that other people who use this board also had similar thoughts regarding uploads to multiple targets, as well as increasing the list of available targets. However, multiple upload targets = more time spent uploading = more battery used, so doing this from the Pico itself did not seem like a good idea. I decided that I would write some kind of sensor proxy that could handle the multi-target upload, so the Pico would only ever need to upload to one target.

My goals with this proxy were:

  1. The proxy should be fast, so the HTTP server listener should return before finishing the re-exporting of the sensor data.
  2. The proxy should be small, so it could ideally run on a Raspberry Pi Zero.
  3. The proxy should be simple, so writing a configuration file should be straightforward.
  4. The proxy should be flexible, so there should be many ways of installing/running it.
  5. The proxy should be scalable, so it should be able to handle as many or as few boards as you throw at it.

Installation

Pixy can be installed in a number of different ways depending on your preferences and platform. See the installation docs for more info.

If you are hoping to run Pixy in a Raspberry Pi or a Pi Zero, you should prefer using the Debian/Ubuntu/Raspian instructions that set up the systemd service to run in the background.

At this time, Windows & Mac OS support are only available through the Docker installation.

Configuring Pixy

After running through the relevant install steps, read the configuration

License

This project is primarily licensed under the MIT License. For all terms, please see the LICENSE file.

Some scripts in the pkg/debian directory are based off of code licensed under the MPL 2.0, and as such these are also licensed under the MPL 2.0. Any such scripts under the license will:

  1. Include notice that the script is licensed under the MPL 2.0, the full text of which is available in the LICENSE-MPL file
  2. Include a link to the MPL 2.0 FAQ
  3. Include a link to the original script used to create the existing script

Roadmap

For a snapshot of the current plans for Pixy, see the milestones page on GitHub.

Dependencies

~22–40MB
~650K SLoC