Thursday, November 19, 2015

Video on the Pi, and over the Network (with WebRTC)

It'd be nice to have the Pi able to:

  • Operate a camera (webcam)
  • Relay the video over the network
Thinking about this, I'd like to do as little work as possible on the video.  I don't know much about encoding/decoding, but I do know it's CPU intensive (something I don't have much of on the Pi).

Therefore I'd like to do minimal work but be able to kick a video stream out over the network.

It made me think of WebRTC, a web-standard peer-to-peer media transfer mechanism.  Used in several places include Google Hangouts.  I didn't know much about it so I researched it.



In short, a WebRTC endpoint (like a web browser) will want to establish a peer-to-peer connection with another endpoint.  This entails:
  • Discovering another endpoint (not part of the standard, you implement this)
  • Exchanging details about media capabilities, and network / NAT details (details acquired by API, but still up to you to implement the transfer.
  • Attempt direct-connection (API handles this, but you need to provide STUN server details)
  • Javascript (or other language) then is provided with a stream of media content (like video) which can be directed to the screen (like a <video> tag 'src' attribute in a browser).

This seems promising on the Pi side if there is a non-browser implementation.  And there is.

Hunting around there appears to be several mentions of WebRTC and Python and Pi, including OpenWebRTC, and others.

However, the most successful path I could find online appeared to be message boards discussing the UV4L (Userspace Video 4 Linux) implementation of WebRTC and interface via a WebServer.


Another post will include detail on attempts to set up and use.


Resources about WebRTC:
  • WebRTC Demo (link)
  • WebRTC Tutorial - Infrastructure (link)
  • WebRTC Basics (link)

Resources about UV4L:
  • UV4L Announcement about supporting WebRTC (link)
  • UV4L Instructions on use (link)

Wednesday, November 18, 2015

Raspberry Pi 2 Setup Notes

Took a micro SD, not a regular SD.  Had to buy a few of those.

The raspbian OS install wasn't so bad.

Keyboard is in UK setup, which took a googling to figure out how to change.  Various utilities don't seem to be there, such as telnet.

I bought the wifi dongle to go with it (since my intention is to try to operate it over the network, and subsequently the internet).

Setting up the wifi wasn't too bad but involved setting up a config file with my network and password.  Despite the dongle being 2.4GHz and 5GHz capable, my 5GHz network wasn't detected.

Setup details can be found (here).




Sunday, November 15, 2015

Prototyping Platform

For controlling electronic devices, I've decided to try to use a Raspberry Pi.

I had tried an Arduino in the past and found it was a bit annoying to deal with having to re-program regularly with their flashing device and the serial/usb monitor, etc.

Raspberry Pi I believe is a much more powerful device that you can run Python (interpreted, no compile, lots of modules), and even a monitor on it.

Overall, I am not looking to challenge myself regarding the platform, I want to learn the electronics.

In the end I have purchased a Raspberry Pi 2, which is a quad-core Arm 7 processor with 1G RAM.

If I later think it's overkill, I can get other control systems.



Saturday, November 14, 2015

Getting Started

I read about some of the Google and Amazon package delivery drones a few weeks ago and I've been interested in learning more about what drones are and why they're in the news so much.

I spent a weekend reading up about hobby fliers, what they fly, and what technology they use to it.

Seems that the hobby breaks down in a few dimensions such as:

  • Fixed-wing versus quad copter.
  • FPV or not.
  • Long distance or not.

Some of the technology behind these systems is very impressive.

High-end radio control systems can operate these craft 100km away.  The video systems can transmit real-time video back to the operator to control at those distances.  Notably the video the operator sees in real-time isn't what gets published online, that's a HD camera strapped to the nose, what they see is fairly grainy.

Quad copters and even fixed-wing seem to have a number of sensors which assist with balance and control in-range, as well as auto-pilot systems and fail-safes which return the craft home if it goes out of range.


I think controlling these devices at long-range is interesting.  Some of the articles I read about Google and Amazon indicate that control over the internet may be the way those systems operate.

Control over the internet at long-distance seems plausible provided they're staying at an altitude which still receives service, which the 500ft ceiling seems likely to.

I'd like to play around with some of the technology at use here so this blog was created to keep notes and mark progress.

My aim is to learn to control various related electronics, locally and remotely over the internet.  Hopefully in learning these devices I will increase my familiarity with circuits and control systems, and interesting or useful ideas will come to mind about how to apply them.

This blog was created Nov 28, 2015, when I had actually started reading around Nov 14, 2015.