I'm writing to announce flat3/revpi, a brand new PHP package for Revolution Pi, bringing the flexibility and power of PHP to your industrial automation projects.
https://github.com/flat3/revpi
If you've worked with revpimodio in Python, you'll know how handy it is having simple, object-oriented access to process image variables, IO, LEDs, serial devices, and more. flat3/revpi brings this same style of straightforward, expressive control—but for PHP!
flat3/revpi is an open-source, MIT licenced package that lets you interact with Revolution Pi hardware directly from your PHP applications. It provides:
- Easy reading/writing of IO variables (process image access)
- LED control (including color & position)
- Powerful, non-blocking serial port interface
- Built-in change monitors/observers for IOs
- IDE-friendly auto-generated classes from PiCtory exports
- Full remote control over WebSockets
No extra PHP extensions needed: Runs on your Pi out-of-the-box with PHP 8.2+ on Debian Bookworm.
Install with Composer:
Code: Select all
composer require flat3/revpi
Code: Select all
php artisan revpi:generate pictory.rsc MyDevice
Code: Select all
use Flat3\RevPi\Interfaces\Module;
use Flat3\RevPi\Led\LedColour;
use Flat3\RevPi\Led\LedPosition;
$pi = app(Module::class);
$pi->led(LedPosition::A1)->set(LedColour::Red);
print_r($pi->led(LedPosition::A1)->get());
PHP Developers wanting to build industrial automation, SCADA, or data logging solutions around Revolution Pi.
Teams familiar with Laravel, Laravel Zero, or plain PHP apps wishing to easily add Revolution Pi support.
Anyone who loves how revpimodio makes Python easy for RevPi—and wants the same experience in PHP.
This is a new project so any feedback is appreciated!
- Chris