Master Controller Details

Master: if studio not active mute red/blue/white.
Change the way green works.

studio active
on: master connected, sql connected, a2 connected
flash: master connected, sql or a2 not connected
double: master not connected
off: slave not running

studio inactive
on: master connected
off: master not connected
also red/blue/white off

todo:
switch lights
motion/light box
add switches to bench box
sump pump switch

bench box
7 lights
7 switches & 7 lights

aux box
motion sensor
light sensor

goal:

pin desc
0 ADC0
1 ADC1
2 Relay0 white
3 Relay1 yellow
4 Relay2 red
5 Relay3 blue
6 Relay4 green
7 Relay5 yellow bottom
8 Relay6 blue bottom buzzer
9 SW0 t1 broadcast
10 SW1 p1 applause
11 SW2 p2 laughter
12 SW3 p3 jukebox
13 SW4 p4
14 SW5 t2 motion
15 SW6 t3 sump pump

2 ADC inputs
photocell IO0
POT IO1

7 relays
7 lights red/green/yellow/blue/white/unk

7 switches w/ lights?
toggle broadcast
push random applause
push random laugh
push jukebox silent
motion sensor
sump pump IO15
one more

hardware bit definition:
2 adc (0-1) 7 lights (2-8) 7 switches (9-15)

iodirMask 1111 1111 1111 1111
iodirValue 1111 1110 0000 0011
light mask 0000 0001 1111 1100
switch mask 1111 1110 0000 0000

gpio lights 20mA
color changing: 3.2V
@ 5V
2.0-2.2V red, yellow @ 2.2V = 140Ω (150Ω)
3.0-3.2V white,blue,green @ 3.2V = 90Ω (100Ω)
@ 12V
2.0-2.2V red, yellow @ 2.2V = 490Ω (510Ω)
3.0-3.2V white,blue,green @ 3.2V = 440Ω (470Ω)
3.4V white 3mm = 430Ω (470Ω)

Maximum current drawn by digital circuitry 300mA
Maximum IO source current : IO0 – IO7 2mA
Maximum IO sink current : IO0 – IO7 2mA
Maximum IO source current : IO8 – IO15 8mA
Maximum IO sink current : IO8 – IO15 8mA
Recommended Impedance of Analog Voltage Source 2.5KΩ

Switch
DD: Pin No.2 of the header marked as ICSP. This pin has VDD always available and can source more current compared to an IO port. VDD=3.3V. Using this recommendation uses 33 mA

Ohm’s Law
E = I x R
I = E / R
R = E / I
E=Volts
I=Current
R=Resistance

 

Voltage Divider

LED Resistance Calculator

Thermistor
00C = 273.15 Kelvin
(C × 9/5) + 32
10KΩ @ 25°C @ 77°F
12.6KΩ @ 20°C @ 68°F
8KΩ @ 30°C @ 86°F

float steinhart;
steinhart = average / THERMISTORNOMINAL; // (R/Ro)
steinhart = log(steinhart); // ln(R/Ro)
steinhart /= BCOEFFICIENT; // 1/B * ln(R/Ro)
steinhart += 1.0 / (TEMPERATURENOMINAL + 273.15); // + (1/To)
steinhart = 1.0 / steinhart; // Invert
steinhart -= 273.15; // convert to C

Motion sensor
off:
on:

Solar Led lights

solar panel

Allnice Mini Submersible Water Pump(240L/H, 4.8W) 12v Electric Brushless Submersible Fountain Pump with 9.8ft High Lift Outdoor Water Pump with 1.4ft Power Cord for Aquarium, Pond, Hydroponics

2.2V LED: 0.044 Watts, 20MA
3.3V LED: 0.066 Watts, 20MA

https://www.renogy.com/

Master Controller

The master controller is a hardware/software combination that controls and monitors physical devices.  Using a USB device switch states are detected and lights/relays are activated.

Original Design

Parallel Port controlled
Check out that huge power supply.

Parallel Port controlled

Parallel Port controlled
Figuring out where all the wires went.
Lights/Switches
Some wires went to the studio lights & switches

New Equipment

Motion, Temperature, Light sensors
Sump Pump relay
Sump Pump relay
Sump Pump relay
Sump Pump relay

New Design

mounted slave

Zone Minder

Upgrade cameras

IP cameras w/ POE $1000

Ethernet cable
$109 500′ outdoor

16 port (8 w/POE) Ethernet switch
$115 Linksys LGS116P 80 Watts

Computer $1000
2 ethernet
32 meg ram
loads of HD space

matomo

Server Version: Apache/2.4.39 (Unix) OpenSSL/1.1.1c mod_fcgid/2.3.9 PHP/7.3.7
Matomo version: 3.11.0
MySQL version: 10.3.15-MariaDB-1
WP-Matomo 1.0.22 is successfully connected to Matomo 3.11.0. You are running a WordPress 5.2.2 blog network (WPMU). WP-Matomo will handle your sites as different websites.

ffmpeg->rtp

Having trouble with the swarm & choppy video.

Starting at the top, we throw this to janus:
/opt/ffmpeg/bin/ffmpeg -ss 00:00:00 -re -i file:///usr4/mydetv/webm/archive.org/Drive-inIntermission2/Drive-inIntermission2.ogv.vp8-opus.webm -vcodec copy -an -f rtp rtp://10.11.1.96:5024 -acodec copy -vn -f rtp rtp://10.11.1.96:5022

on mac, play file:
ffplay -protocol_whitelist “file,rtp,udp” -i /private/nfs/a6/usr6/mydetv/webm/clips/fireworks.mp4.vp8-opus.webm -strict -2
not choppy

/opt/ffmpeg/bin/ffmpeg -re -i /usr4/mydetv/webm/archive.org/TarzanoftheApes1918AndyDivx_512kb.mp4.vp8-opus.webm -vcodec copy -an -f rtp rtp://10.11.1.96:5124 -acodec copy -vn -f rtp rtp://10.11.1.96:5122

swarm – lowest common denominator

I’m looking to feed all those fringe devices.
https://caniuse.com/#feat=webm

Once again, I give up. Seems the only way to do it is create fragmented mp4’s and send them so the browser can play the current live piece instead of playing from the beginning. We’ll just wait for webm to be supported everywhere.

wait wait, maybe DashCast.

sudo apt-get install make pkg-config g++ zlib1g-dev firefox-dev libfreetype6-dev libjpeg62-dev libpng12-dev libopenjpeg-dev libmad0-dev libfaad-dev libogg-dev libvorbis-dev libtheora-dev liba52-0.7.4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libavresample-dev libxv-dev x11proto-video-dev libgl1-mesa-dev x11proto-gl-dev linux-sound-base libxvidcore-dev libssl-dev libjack-dev libasound2-dev libpulse-dev libsdl1.2-dev dvb-apps libavcodec-extra-53 libavdevice-dev libmozjs185-dev

DashCast -vf video4linux2 -v4l2f mjpeg -vfr 30 -vres 1280×720 -v /dev/video0 -af alsa -a plughw:2,0 -conf dashcast.conf -live
DashCast -vf video4linux2 -v4l2f yuyv422 -vfr 30 -vres 720×480 -v /dev/video0 -af alsa -a plughw:2,0 -conf dashcast.conf -live

DashCast -av out.mpg -seg-dur 500 -live-media

*** I did try… Did the conversions fine but then had no way to live stream it to the browser.

Steps: decide on the container (mp4) and codecs, perhaps h264 and aac
janus can’t ‘do’ aac, le’s try opus

ffmpeg -i input.mov  -acodec aac -strict -2 output.mp4

ffmpeg -i people -c:v libx264 -preset slow -crf 22
ffmpeg -y -i /private/nfs/a6/usr4/mydetv/videos/clips/people.mp4 -c:v libx264 -b:v 512k -c:a libfdk_aac -b:a 128k -pass 1 -f mp4 out.mpg
ffmpeg -y -i /private/nfs/a6/usr4/mydetv/videos/clips/people.mp4 -c:v libx264 -b:v 512k -c:a libfdk_aac -b:a 128k -pass 2 -f mp4 out.mpg

ffmpeg -i people -c:v libx264 -preset slow -crf 22
ffmpeg -y -i /private/nfs/a6/usr4/mydetv/videos/clips/people.mp4 -c:v libx264 -b:v 512k -c:a libfdk_aac -b:a 128k -pass 1 -f mp4 out.mpg
ffmpeg -y -i /private/nfs/a6/usr4/mydetv/videos/clips/people.mp4 -c:v libx264 -b:v 512k -c:a libfdk_aac -b:a 128k -pass 2 -f mp4 out.mpg

ffmpeg -y -i /usr4/mydetv/videos/clips/people.mp4 -c:v libx264 -b:v 512k -c:a aac -b:a 128k -pass 2 -f mp4 out.mp4

gstreamer

https://gstreamer.freedesktop.org/
https://github.com/GStreamer/gstreamer

for mac:
brew install gstreamer

debian

Goal: swarm can use
tried:
apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio

failed!

tried
apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-pulseaudio

******
apt-get install automake autopoint libtool bison flex
apt-get install gtk-doc-tools liborc-0.4-0 liborc-0.4-dev libvorbis-dev libcdparanoia-dev libcdparanoia0 cdparanoia libvisual-0.4-0 libvisual-0.4-dev libvisual-0.4-plugins libvisual-projectm vorbis-tools vorbisgain libopus-dev libopus-doc libopus0 libopusfile-dev libopusfile0 libtheora-bin libtheora-dev libtheora-doc libflac++-dev libavc1394-dev libraw1394-dev libraw1394-tools libraw1394-doc libraw1394-tools libtag1-dev libtagc0-dev libwavpack-dev wavpack

for linux roll your own:
https://gstreamer.freedesktop.org/documentation/frequently-asked-questions/git.html

a6 Ubuntu 16.04.5 LTS \n \l

what a pain, the doc’s first line to install dependencies tries to install gstreamer! I don’t want to install it, I just want to build it. alk about the chicken and the egg!

so here is what I did:
sudo apt-get install gtk-doc-tools liborc-0.4-0 liborc-0.4-dev libvorbis-dev libcdparanoia-dev libcdparanoia0 cdparanoia libvisual-0.4-0 libvisual-0.4-dev libvisual-0.4-plugins libvisual-projectm vorbis-tools vorbisgain libopus-dev libopus-doc libopus0 libopusfile-dev libopusfile0 libtheora-bin libtheora-dev libtheora-doc libflac++-dev libavc1394-dev libraw1394-dev libraw1394-tools libraw1394-doc libraw1394-tools libtag1-dev libtagc0-dev libwavpack-dev wavpack
and I did this:
sudo apt-get install libasound2-dev libavcodec-dev libavformat-dev libswscale-dev

but still no joy, so I admitted defeat and
sudo apt-get install libgstreamer1.0-0

and then the same crap with the plugins, gave up for now

revisited 12/21/2018
I gave up on not installing gstreamer from packages. So a gstreamer exists in /usr/local/bin and another one I copiled myself in /opt/gstreamer

apt-get install gstreamer1.0-0
apt-get install gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad

export PKG_CONFIG_PATH=/opt/gstreamer/lib/pkgconfig
./autogen.sh –prefix=/opt/gstreamer –enable-gtk-doc –enable-iso-codes –enable-orc
./autogen.sh –prefix=/opt/gstreamer –disable-gtk-doc
my version is shit, had to change /opt/gstreamer/lib/pkgconfig/gstreamer-1.0.pc
from
prefix=/opt/gstreamer
libexecdir=${exec_prefix}/libexec
exec_prefix=${prefix}
to
prefix=/opt/gstreamer
exec_prefix=${prefix}
libexecdir=${exec_prefix}/libexec