OK, I had a major snafu as I was redoing the setup. I cracked the SD card for the camera. I got that rebuilt. There was a November update for the Raspberry pi operating system for Stretch (code name for the operating system.) There were also updates to VLC, OMXPLAYER as well. Some reading indicating the newer versions had created some stability issues. To resolve I had to change the setup slightly.
First off, I found that after you make the network changes, reboot. But first after booting up I run sudo iwconfig wlan0 essid test on both devices. Then I ping the respective device addresses. If you get response good. The updated operating system update really helped with the network portion, but unless you run a specific version, you will have to build the wireless interface as I am running it.
You can comment out lines with # or pound as it is called so as in my case I cheated and mirrored by wifi setup but set to adhoc. Thinking things through since I am using a statically set channel for stability reasons so I switched to a non conflicting channel. Channel 1 is the default channel for most devices which is why for home I set on channel 6, so in this case I switched to channel 11. If you are in Japan channel 12 and 13 are an option, just do not try to run on those channels here in the states as you can run afoul of some officials if they get really fired up about conflicts and interference.
That did not help with omxplayer crashing out. Now to test the stream for omxplayer on the client you can run:
omxplayer -i
http://x.x.x.x:xxxx and it will displayer information on the stream or give you a connection error with which you can troubleshoot further.
I tried implementing RTSP, but for simplicity sake I wanted to avoid complicating the setup in case others, less able, wanted to do the same. You apparently require a different way of launching the camera stream and a few extra program installs.
Now since I updated everything as part of the troubleshooting process:
running:
sudo apt-get update
sudo apt-get upgrade
sudo rpi-update
sudo apt-get omxplayer
sudo apt-get vlc
I partially gave myself a few issues doing this.
I kept getting a 1wire error message on the client pi so I ended turning off all the additional protocols on it which alleviated the issue. (run: sudo raspi-config)
Now to finally get the client to stream without crashing I launched it this way:
omxplayer -o hdmi --live
http://x.x.x.x:xxxxAnd it seems to be stable now.
I was also now getting a permissions error when trying to invoke launching of the script from /etc/rc.local (a file that launches things on startup that are not services)(crontab is setup for services, but this setup did not require that amount of monkeying to implement as of yet)
So I had to add before exit 0:
su pi -c "nohup /boot/camera.sh &"
Then it launches fine.
The other issue I had was that I had to rotate my screen
To do that I had to edit /boot/config.txt and add the line:
display_hdmi_rotate=2
this flips the display 180 degrees. There are some different ways to do this but they are all screen dependent and some of the command are deprecated or removed/discontinued, but may still work depending on your specific setup.
Now in the camera script I add a delay of 30 seconds by adding the line:
sleep 30
in the player I add a delay of 90 seconds.
I specifically place the scripts in /boot as that folder is visible when you mount the sd card on your computer. This allows you to rename or delete the file if you are unable to kill the process after boot up.
To kill a process you have set to launch in /etc/rc.local run:
sudo killall script.sh
where script.sh is the name of your script. In my case camera.sh and player.sh depending upon the raspberry pi you are running.
To see if the script is running, run the command again and it will say it can not find it or:
run:
ps -aux | grep script.sh
If nothing comes up it is not running you are good, if you see a line you can run:
sudo kill pid
where pid is the process id or process number of the script that is running. killall searches for any related instances of the named process and kills/quits/terminates all of them.
Now the other issue that I had not mentioned is getting your keyboard to work right. With Linux, the bane is getting your specific keyboard to work right. The linux community to a greater extent are computer experts, hackers (ethical and otherwise), security experts. so computer manufacturers have a vested interest in ensuring that a device has drivers for linux as there has been more than one case where a site was brought down for lack of drivers, or the drivers were magically given, or sold to the manufacturer. (One of my former coworkers spent a weekend reverse engineering a device driver and sold a built linux driver to the manufacturer for 40k, so yes ethical hacking does have a positive use.)
All that said, stick to name brand keyboards, and research the Hardware Compatibility List (HCL) for Linux and get a keyboard you will be comfortable using. I have had the occasional cheap junk bite me in this regards.
To set or customize your computer after doing all the updates run:
sudo raspi-config
go to localization
select keyboard, and select your options. Sometimes the close fit is best. Regional language and keyboard layout are what you really need to pay attention to.