Need help installing ustreamer
-
Ok I'll read that again
-
@luckyflyer maybe post what ustreamer says when you start it, and run
@bearer said in Need help installing ustreamer:
sudo netstat -lt4np
more usefull for future ref.instead of pgrep?
-
Here ya go.
pi@raspberrypi:~/ustreamer $ ./ustreamer -r 640x480 -d /dev/video0 --host=0.0.0.0 --port=8080
-- INFO [59755.990 main] -- Installing SIGINT handler ...
-- INFO [59755.990 main] -- Installing SIGTERM handler ...
-- INFO [59755.990 main] -- Ignoring SIGPIPE ...
-- INFO [59755.990 main] -- Using internal blank placeholder
-- INFO [59755.991 main] -- Listening HTTP on [0.0.0.0]:8080
-- INFO [59755.991 stream] -- Using V4L2 device: /dev/video0
-- INFO [59755.991 stream] -- Using desired FPS: 0
-- INFO [59755.991 http] -- Starting HTTP eventloop ...
-- INFO [59756.080 stream] -- Device fd=8 opened
-- INFO [59756.080 stream] -- Using input channel: 0
-- INFO [59756.081 stream] -- Using TV standard: DEFAULT
-- INFO [59756.083 stream] -- Using resolution: 640x480
-- INFO [59756.083 stream] -- Using pixelformat: YUYV
-- INFO [59756.085 stream] -- Using HW FPS: 0 -> 15 (coerced)
-- INFO [59756.088 stream] -- Requested 5 HW buffers, got 5
-- INFO [59756.092 stream] -- Capturing started
-- INFO [59756.092 stream] -- Using JPEG quality: 80%
-- INFO [59756.092 stream] -- Creating pool with 4 workers ...
-- INFO [59756.093 stream] -- Capturing ...pi@raspberrypi:~ $ sudo netstat -lt4np
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN 408/vncserver-x11-c
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 419/sshd
pi@raspberrypi:~ $ -
huh, they're contradicting each other unless I'm off my rocks. odd; will see how it behaves here in a bit
-
Well now its refusing to connect @ http://0.0.0.0:8080 on pi's chrome but it did until I stopped ustreamer and then restarted it.
-
So I rebooted pi and now can access ustreamer again on pi chrome http://0.0.0.0:8080
-
I'm now seeing this, it's the last entry in ustreamer's start up, haven't seen it before.
- INFO [142.593 http] -- HTTP: Registered the new stream client: [127.0.0 .1]:59412, id=ca382a3e-c13f-42e9-b247-ab66557943a7; clients now: 1
-
So this is what I'm getting now,
pi@raspberrypi:~/ustreamer $ ./ustreamer -r 640x480 -d /dev/video0 --host=0.0.0.0 --port=8080
-- INFO [764.550 main] -- Installing SIGINT handler ...
-- INFO [764.550 main] -- Installing SIGTERM handler ...
-- INFO [764.550 main] -- Ignoring SIGPIPE ...
-- INFO [764.550 main] -- Using internal blank placeholder
-- INFO [764.551 main] -- Listening HTTP on [0.0.0.0]:8080
-- INFO [764.551 stream] -- Using V4L2 device: /dev/video0
-- INFO [764.552 stream] -- Using desired FPS: 0
-- INFO [764.552 http] -- Starting HTTP eventloop ...
-- INFO [764.640 stream] -- Device fd=8 opened
-- INFO [764.641 stream] -- Using input channel: 0
-- INFO [764.641 stream] -- Using TV standard: DEFAULT
-- INFO [764.643 stream] -- Using resolution: 640x480
-- INFO [764.643 stream] -- Using pixelformat: YUYV
-- INFO [764.645 stream] -- Using HW FPS: 0 -> 15 (coerced)
-- INFO [764.648 stream] -- Requested 5 HW buffers, got 5
-- INFO [764.651 stream] -- Capturing started
-- INFO [764.652 stream] -- Using JPEG quality: 80%
-- INFO [764.652 stream] -- Creating pool with 4 workers ...
-- INFO [764.652 stream] -- Capturing ...
-- INFO [846.050 http] -- HTTP: Registered the new stream client: [127.0.0.1]:59438, id=44691e03-9977-4f8b-a2f8-770bb871c6fe; clients now: 1pi@raspberrypi:~ $ sudo netstat -lt4np
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 419/sshd
tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN 411/vncserver-x11-c
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 1495/./ustreamer
pi@raspberrypi:~ $ -
@luckyflyer said in Need help installing ustreamer:
So this is what I'm getting now,
that looks normal, should be able to connect from your pc to whatever IP address the pi has. confirm the IP addressess of the Pi with
hostname -I
-
Success, I can get into ustreamer from my pc on pi's ip addr.
@bearer, I want to say a big thank you for your help, wouldn't have been able to get there if you hadn't stepped in!!@gtj0 Also thanks!
-
@luckyflyer As a reward are you going put on a show for us???
-
I can sure do that but........ murphy has made another appearance.
I have the standalone pi working good so now its time to load ustreamer onto the Duet pi.
The first thing I do is assign a static ip for eth0 and wlan on Duet pi, thats done new address's work.
Next I run.sudo apt-get install libevent-dev libjpeg8-dev uuid-dev libbsd-dev
I get an error saying cannot reach raspbianraspberrypi.org I try several times thinking that maybe the server is down. I then try one of my pi's that is dhcp and it gets on the server immediately. I don't understand this do a google for this type of problem and come up with nothing. So I disable firewall still no. I then remove the static addresses and Duet pi is now able to reach the server.
So the above command now downloads I proceed with the install/compile with these notes I've made,**Check if make and gcc are already installed, if not installed install with sudo apt-get install
Get these,
sudo apt-get install libevent-dev libjpeg8-dev uuid-dev libbsd-devNow compile ustreamer
$ sudo git clone --depth=1 https://github.com/pikvm/ustreamer
$ mkdir ustreamer
$ cd ustreamer
$ makecheck if working with
$ ./ustreamer --help**When I get to make I get this error,
pi@duet3:~/ustreamer $ make -- CC src/device.c mkdir: cannot create directory ‘build’: Permission denied Assembler messages: Fatal error: can't create build/src/device.o: No such file or directory make: *** [Makefile:92: build/src/device.o] Error 1 pi@duet3:~/ustreamer $
@bearer Can I impose on your expertise one more time.
-
Figured it out need sudo make.
But would still like to know why I can't do updates with a static ip address.
-
@bearer
Can you take a look at this. This is from the Duet pi, same problem I had with the stand alone pi that seemed to correct its self.-- INFO [101.021 main] -- Installing SIGINT handler ...
-- INFO [101.021 main] -- Installing SIGTERM handler ...
-- INFO [101.021 main] -- Ignoring SIGPIPE ...
-- INFO [101.021 main] -- Enabling HTTP file server: /tmp/
-- INFO [101.021 main] -- Using internal blank placeholder
-- INFO [101.022 main] -- Listening HTTP on [0.0.0.0]:8080
-- INFO [101.023 stream] -- Using V4L2 device: /dev/video0
-- INFO [101.023 stream] -- Using desired FPS: 0
-- INFO [101.024 http] -- Starting HTTP eventloop ...
-- INFO [101.110 stream] -- Device fd=8 opened
-- INFO [101.110 stream] -- Using input channel: 0
-- INFO [101.110 stream] -- Using TV standard: DEFAULT
-- INFO [101.112 stream] -- Using resolution: 640x480
-- INFO [101.112 stream] -- Using pixelformat: YUYV
-- INFO [101.114 stream] -- Using HW FPS: 0 -> 15 (coerced)
-- INFO [101.117 stream] -- Requested 5 HW buffers, got 5
-- INFO [101.119 stream] -- Capturing started
-- INFO [101.119 stream] -- Using JPEG quality: 80%
-- INFO [101.119 stream] -- Creating pool with 4 workers ...
-- INFO [101.119 stream] -- Capturing ...pi@duet3:~ $ sudo netstat -lt4np
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN 437/vncserver-x11-c
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 1355/./ustreamer
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 448/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 353/cupsd
pi@duet3:~ $I have rebooted but that doesn't seem to have helped.
-
I've rebooted again and now is working, temperamental little sob, quitting for the night.
-
Also wanted to ask is there a security risk when using 0.0.0.0:8080
-
@luckyflyer re security risk, there is always a risk with opening network services, but if you need to access the stream from a device other than the pi, then you don't have much choice in opening up. you could bind to a specific IP address instead of 0.0.0.0 but imho it won't increase the security of the setup, only reduce the convenience. also 0.0.0.0 will work even with wired and wireless networks on the Pi, and every address a dhcp server may allocate the pi in the future.
re temperamental, using systemd to start and restart it as needed will probably take care of the availability of the process.
-
@gtj0
Can you share your Duetlapse start script with me.
Thanks -
The following 2 files will run ustreamer anytime the camera (/dev/video0) is plugged in.
/etc/udev/rules.d/80-ustreamer.rules:
KERNEL=="video0", SUBSYSTEM=="video4linux", TAG+="systemd", ENV{SYSTEMD_WANTS}+="ustreamer@%k.service"
/etc/systemd/system/ustreamer@.service:
[Unit] Description=UStreamer for video0 [Service] Type=simple ExecStart=/usr/local/bin/ustreamer -r 640x480 --static /tmp/ --encoder=HW -m JPEG -d /dev/%i --host=0.0.0.0 --port=8080 [Install] WantedBy=multi-user.target
Reboot after copying both files to their destinations.
Here's the command line to start DuetLapse and pull from ustreamer:
./DuetLapse.py -camera web -weburl http://localhost:8080/stream -duet localhost -seconds 5 -detect none
Obviously you have to customize that command line. It just captures an image every 5 seconds.
If you need to auto-start it as well, you may have to contact @Danal . I can't seem to get it to run as a systemd service.
-
@gtj0 Thanks for that.