LATEST RELEASE:  FPP 6.3 - Download from here -



Welcome, Guest.
Please login or register.
Forgot your password?

+-Site Stats

Total Members: 15659
Latest: PaulDzRGB
New This Month: 9
New This Week: 3
New Today: 1
Total Posts: 128431
Total Topics: 15791
Most Online Today: 68
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 4
Guests: 31
Total: 35

Serial output

Started by gdyrdave, September 17, 2014, 08:24:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


 Would this be a viable idea? Connect a serial dongle to a usb port and issue a serial (hex) command to a projector ie: on/off via script. This might help some that have rs232 control over their projectors. Just another of my cockamammy thoughts again.


Shouldn't be too difficult.

Instead of configuring FPPD to use /dev/ttyUSBX (where X is the 0-based number of the dongle) for Renard, DMX, etc. somebody could write a script/program that uses the dongle.

Do you know what kind of data needs to be sent to such a projector?


Yup. Here tis:

• Control command Syntax (From PC to Projector)
• Example: power on the projector
Enter the following code: 0xBE 0xEF 0x10 0x05 0x00 0xC6 0xFF 0x11
0x11 0x01 0x00 0x01
NOTE: Send least significant bytes first.

Or off:

• Control command Syntax (From PC to Projector)
• Example: power on the projector
Enter the following code: 0xBE 0xEF 0x10 0x05 0x00 0x03 0x3E 0x11
0x11 0x01 0x00 0x18
NOTE: Send least significant bytes first.

Its at 19200,8,n,1.


You might get away with something like this to turn on:


stty -F /dev/ttyUSB0 speed 19200 cs8 -cstopb -parenb
echo -en '\xBE\xEF\x10\x05\x00\xC6\xFF\x11\x11\x01\x00\x01' > /dev/ttyUSB0

And off:


stty -F /dev/ttyUSB0 speed 19200 cs8 -cstopb -parenb
echo -en '\xBE\xEF\x10\x05\x00\x03\x3E\x11\x11\x01\x00\x18' > /dev/ttyUSB0

Or wrap it in a conditional so you can tell the script off or on:


stty -F /dev/ttyUSB0 speed 19200 cs8 -cstopb -parenb

case $1 in
    echo -en '\xBE\xEF\x10\x05\x00\xC6\xFF\x11\x11\x01\x00\x01' > /dev/ttyUSB0
    echo -en '\xBE\xEF\x10\x05\x00\x03\x3E\x11\x11\x01\x00\x18' > /dev/ttyUSB0
    echo "Error, need argument of On/Off" >&2
    exit 1


Will that work on a generic rs232 usb converter? I have an older Radio Snack one. I will give that a shot anyway. Thanks Mat.


If that doesn't work, I have some Perl code I can post.  I gave it to Pat as an example a while back to control his external HDMI switcher.  It does pretty much the same thing as the bash script but uses Device::SerialPort to setup the serial port.


Chris, is that the serial port on board the pi or an external Usb device. not that it matters, I'll just have to do some signal conditioning between the pi and projector. Either way would like to see your code too.


He used a USB serial dongle with the perl script.  I will post tonight after I dig it up.



Mat, is that a python script or something else. I would like to explore different script languages. You guys have other more grander priorities than to teach me script. So do I but my mind is racing like a


It's a bash script.  The first line of scripts in linux (often called the "shebang" for the #!) tells the shell which interpreter to use for the script.

To write a shell script, you typically start with "#!/bin/sh", or if you want to use bourne again shell (more options, newer, etc.) you'd use /bin/bash for the interpreter.

Usually for python scripts, they'd start with "#!/usr/bin/env python" which starts the default python interpreter for the script.

In addition, I'd probably attach python scripts instead of having them in-line in posts because they don't use brackets and keywords for code blocks, they use indentation, so any copy/pasting (especially when somebody's using windows) would create tons of problems.

Hope that helps.  If you have other questions, post up and we can point you at some links.

Potentially helpful links:


Here is the hack perl script that I threw together for Pat to control his HDMI switcher via the serial port.  It could use a little cleanup and could be done differently.  Instead of putting the hex characters in a string and writing the string, I put them in an array of arrays.  The command line parameter is used as the index into the main associative array.  The value of that element is an indexed array of the values that need to be written.  If someone wants to clean this up, add comments, etc., and make it more generic as an example, we could put it in the new script repository that is now browsable in v0.4.0.

# Device::SerialPort must be installed first, on the PI, this can be done via "sudo apt-get install libdevice-serialport-perl"
use Device::SerialPort;

my $port = "/dev/ttyUSB0";  # change to /dev/ttyS0 if on a real DB9 serial port
my $hexCodes = {
    "1" => [0x20, 0x02, 0x01, 0x01, 0xA5, 0x20, 0x08, 0x01, 0x00, 0x91, 0x20, 0x01, 0x01, 0x01, 0x41, 0x20, 0x07, 0x01, 0x00, 0xCE],
    "2" => [0x20, 0x02, 0x01, 0x02, 0x47, 0x20, 0x08, 0x01, 0x00, 0x91, 0x20, 0x01, 0x01, 0x02, 0xA3, 0x20, 0x07, 0x01, 0x00, 0xCE],
    "3" => [0x20, 0x02, 0x01, 0x03, 0x19, 0x20, 0x08, 0x01, 0x00, 0x91, 0x20, 0x01, 0x01, 0x03, 0xFD, 0x20, 0x07, 0x01, 0x00, 0xCE],
    "4" => [0x20, 0x02, 0x01, 0x04, 0x9A, 0x20, 0x08, 0x01, 0x00, 0x91, 0x20, 0x01, 0x01, 0x04, 0x7E, 0x20, 0x07, 0x01, 0x00, 0xCE],

my $input = "1";
if ((defined($ARGV[0])) && (defined($hexCodes->{$ARGV[0]}))) {
    $input = $ARGV[0];

my $codes = $hexCodes->{$input};
my $port = new Device::SerialPort($port) || die "Can't open $port: $!";;


foreach my $code (@{$codes}) {

Support FPP

+- Recent Topics

Warning/Error: Network incomplete frames hit 250. by JonD
Today at 04:10:22 PM

F16V3 with 2 expansion boards at 40 fps MAX PIXELS per output? by tbone321
Today at 10:51:55 AM

F48V4-NS at 40 fps using all 48 pixel output ports? by Poporacer
Today at 10:27:09 AM

Unable to update RPi 5.5 to latest version by JonB256
February 05, 2023, 07:23:16 PM

help getting started, next step? by rayster
February 05, 2023, 04:24:09 PM

F48v4NS - Pi or No Pi? by joeyblasko
February 05, 2023, 09:15:33 AM

Huidu Controllers LED matrix by CaptainMurdoch
February 04, 2023, 10:18:47 AM

FPP6.2 universes by darylc
February 03, 2023, 08:48:57 PM

F16v4 Ports vs Universe Configuration Question by k6ccc
February 03, 2023, 09:32:48 AM

Need Expert Advise on F16v4 Ports vs Universe Configuration by Kairus
February 03, 2023, 09:32:33 AM

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod