Does communication improve technology ?

Does communication improve technology or does technology improve communication ?

Communication
Communication

That’s a question I have been tossing in my mind for some time now. I came to the conclusion now that it is bi-directional, and that better communication will foster better technology which in turn will be the breeding ground for better communication.

If communication is the key to advances in technology, or at least a major component of it, how come we are still struggling with voip and video phones ? While this helps somewhat, the environment is not suited for most use case of ‘personal communication’

Think about it this way, why do business people travel that much ? Do they like to fly, or leave their family for weeks at a time ? No, the reason is that it is extremely difficult to communicate  complex matters remotely.

Back in 1995 / 1996 when I was briefly working at the ZGDV ( Frauenhofer Institute ) in Mannheim I saw virtual cubed environments which tried to achieve virtual immersion. The goal back then seemed so easy, and the outcome so close. What happened ? Where are the Holo-decks of the 21’th century ?

With the increase of computing power and the availability of technology and the Internet ( the Evernet really ) I am still stuck at looking at a 2D screen to interact with the computer, and with other people. Even though I now enjoy a 30 inch screen with an almost optimal resolution of 2560×1600.

We need better technology thus we need better communication. To get better communication I think we need better tools.

One of the main sticking point in recent computer science is the advance of multi core, multi cpu computers. But beyond that we now have heterogeneous computing environments. Ever wondered how much computing power is in your phone ? Why not leverage the CPU in your tablet together with the horsepower of your Laptop ?

The reason is that the available tools lack. Those tools have been designed decades ago and have not evolved at the speed required. If the programming language would adapt as fast as the web technology we would by now now look at Laptops with 2048 cores and more.

There are a multitude of attempts to invent better tools but their adoption rate is negligible. One prime example of a failed ‘better tool’ is Java. I liken it to the move from CVS to SVN. It does maintain most of the existing features and adds some bits and pieces to it but if you step back and take a look at it from a distance Java and C++ are really not that different. So why bother ?

Others attempt to modify existing languages. For me that is a much better way to go. After all, if it is done properly you can retain the billions of lines of code already written and you add functionality. Or you give a simple means of conversion.

I firmly believe we should look into adding communication into the core language itself. Design the runtime environment such that it can handle high latency or unreliable links and nodes. Maybe add some grains of auto adjustments ( Aka self healing or Learning ) to it and really re-think the paradigm of software developing, away from functional or OO to a distributed or universal ( I don’t like to use the buzz-word cloud ) based paradigm.

I am an optimist, and I see that we will eventually get there. I will try to play my part in it and while I may never get up to the ranks of true visionaries like Vint Cerf or Bjarn Stroustrup, I will never be content with the status-quo and always do what every geek should be doing.

Follow the pursuit of innovation.

Spam-Me-Not

Whow, I just started this blog and not even e week into it I saw my first wordpress spam.

On my article DyGraphs Pie Chart Plotter I received the following comment.

To mitigate errors in throw ratio calculations, projectors with zoom
capabilities and lens shift are highly recommended.
You will find the projector machines in any lead store.
You should also consider something which will support DVDs as well as Blu-rays since
few of you will have gotten around to rebuilding your film collection on Blu-ray.

This seems to be a wordpress spam but what does it mean ?I googled for the first sentence and I found 8 occurrences of the exact same sentence, followed by other sentences, which taken together made no sense.

For example the following nuget from a chinese forum:

An Analysis Of Foot Streaming Advice
Learn about Some of the Best Home Theater Seating Manufacturers
The late NFL Playoffs 2015 live stream and TV game time on Saturday will feature the first in the NFC Divisional matchups because Panthers vs. Seahawks is featured. Cam Newton attempt to steer his team to a major upset over Russell Wilson and also the defending Super Bowl champions. The winner moves on to experience either Dallas or Green Bay in the NFC Championship round. Which team are able to advance past this matchup within the latest live streaming and televised NFL playoff game?
Netflix was originally conceived like a DVD delivery and rental service that permitted you to order DVDs web you can keep them shipped to your property. You could easily mail them back, get more from your specified Queus list within a couple days, and make them being released and in a cycle. Then Netflix developed their Instant Watch feature, that has been a lot more movies and television shows that might be watched \"On Demand\" through their site as streaming video. Not only was the Netflix Instant Watch great for watching films from the computer, it could even be integrated on to your TV with gaming consoles and Apple TV and in many cases in your iPhone while using Netflix iPhone app. The Netflix service doesn't only have to watched through the website in any way and now you can even integrate it while using Windows Media Center as Microsoft has included it like a built in option.
BYU features Tanner Magnum, who spent his last two years with a mission in Chile. The 22-year-old stepped looking for injured starter Taysom Hill, when the quarterback suffered a season-ending foot injury. Magnum was the hero in the game, tossing a last-second touchdown to help you give his team the 33-28 miracle conquer Nebraska. Magnum delivered more magic last weekend against No. 20 Boise State, throwing a 'go-ahead scoring' pass to Mitchell Juergens with just 45 seconds to go. That pushed BY on the 35-24 victory over then-ranked Boise State.

The critical aspect in a ceiling mount video projector is positioning. Different projector designs include unique throw ratios, which is the relationship between projector distance and the width with the screen. Throw ratios are usually 1.8 or 2.1 to, which suggests 1.8 feet of throw distance for each foot of screen width. To mitigate errors in throw ratio calculations, projectors with zoom capabilities and lens shift are highly recommended.
1. Enroll yourself in an affiliate program determined by what you need. Affiliate marketers are among the high earners in terms of work from home jobs. You can earn approximately $5,000 to $10,000 or maybe more every month; you may want some serious working out for this. There's a lot of techinicality using this type of kind of position, but a great deal of risk of online marketing. There are training programs that you can enroll to online, with this particular you are able to enrich your understanding on your own niche and creating your blog post or site. Thus type of business is very technical, you have to learn SEO and increase your online skills to produce your website competitive; there isnrrrt a real have to devote to it. Before enrolling yourself into just as one online marketer, you must research about the companies; ask around for it's reputation if they are promptly whe it comes to paying. Analyze if your offers are reasonable or if it's too good really was.
Should you adored this article along with you would like to acquire guidance with regards to voir le match kindly go to our site

I believe the reason these comments are sent is so that the original poster creates a higher visibility to the search engines. I am not 100% certain but I may do some more research on this at some later point in time.

Custom Video Doorbell box

When I first <a href=”http://www.softwaresamurai.org/2017/10/10/raspberry-pi-video-doorbell/”>looked into adding a Video Doorbell</a> I was surprised by the lack of available choices ( thus far )

Our doorbell had to be slender which meant less than 2″ ( 50mm ) and could be 4.8″ tall ( 123mm ). None of the ones I saw met this criteria. I also required a little 5mm shim to handle the uneven surface.

Anyways long story short I decided to do a custom build of the chassis for the Doorbell.

Rough drawing of the chassis
Rough drawing of the chassis

Creating the Custom Video Doorbell:

To convert this image into a physical reality I had to use some tools and then see if all eventually fits in. To screw the top and the bottom together will be the very last step before painting, after I have places, screwed, soldered and glued all the pieces into their final place. This will allow me to adjust the height if needs be.

From the pictures below you can see that it is a tight fit with all the pieces in place. Unfortunately I can’t use the USB plugs. If I would connect them, then the PI Zero would no longer fit inside the box.

Since the PI Zero exposes the usb contacts on the bottom and I have to remove the USB plug from the soundcard anyways.

  • All pieces put tgether
    All pieces put tgether
    This is the assembled Raspberry PI with camera, the New doorbell button, the sound card, loudspeaker, as well as the original wireless doorbell button.
  • Side View
    Side View
    The assembled pieces from the side
  • top and bottom part of the doorbell
    top and bottom part of the doorbell
    Please note that the tape is just a temporary holder until I create all required holes, brakets etc.
  • The sound card fits in sidewards
    The sound card fits in sidewards
    After removing the USB plug and soldering on the wires, The sound card does now fit sidewards into the chassis.
  • Wireless Doorbell button
    Wireless Doorbell button
    Before cutting out the back to place the current wireless Doorbell Button into its socket.
  • Wireless Button integrated into back of Doorbell
    Wireless Button integrated into back of Doorbell
    All fits snug into their place.

 

Power

As power source we do have 24V AC coming out of the doorframe, which require a small power converter. Using the standard 7805 regulator brings this down to a few small pieces. Alternatively I can find the source fo the wiring and feed it directly with 5V DC to the door.

7805 voltage regulator
7805 voltage regulator schematic

Things are starting to come together. I still have to connect the loudspeaker, the microphone, and make sure that the original doorbell button gets some protection before connecting it up and closing the case.

Rpi WebRTC Streamer to Android WebRTC streaming

In this article I will setup Android WebRTC streaming to RPI-WebRTC-Streamer running on my Raspberry PI Zero W, to talk to each other.

Here is the architecture of RPI-WebRTC-Streamer.

Now why do we use WebRTC instead of directly streaming audio/video through a socket from the Raspberry PI to the Android device ?

It is helpful to understand how WebRTC works under the hood and how a connection is established.

The magic in WebRTC is the probing of the connection to allow two clients to talk P2P ( Peer-to-Peer ), even if they are behind a firewall or using NAT. There are plenty of online resources devoted to this complex topic ( E.g. https://www.html5rocks.com/en/tutorials/webrtc/infrastructure/ )

The basic steps in establishing a WebRTC connection are:

  • Step 1: Signaling: both peers connect to a signaling server (using websockets over 80/443, comet, SIP,etc..) and exchange information (about their media capabilities, public IP:port pairs when they become available, etc.)
  • Step 2: Discovery: Devices connected to LAN or mobile networks are not aware of their public IP (and port) where they can be reached at so they use STUN servers located on the public Internet to discover their ip:port pair (ICE candidates). In the process they punch a hole through the NAT/router which is used in step3:
  • Step 3: P2P connection: once the ICE candidates are exchanged through the initial signaling channel each peer is aware of each other’s ip:port (and holes have been punched in NATs/routers) so a peer to peer UDP connection can be established.
  • Step 4: If a P2P connection can’t be established ( maybe through firewall rules or the usage of Symmetric NAT ) then TURN servers can be used, which will relay the data between the peers. Please note that this will require the TURN server to receive and send all video and audio and is the last resort in WebRTC.

Under normal circumstances you would establish the connection between two web-browser. However in this case I need to establish Android WebRTC streaming to the Raspberry PI Zero W. Fortunately we have the required tools and libraries available on both platforms and can take full advantage of this technology stack. This allows us to basically build a video conference similar to skype between the Raspberry PI and Android. As an aside, iOS can also handle WebRTC, which may be a project for later.

Android WebRTC Streaming:

  1. Lets first make sure you have the RPI WebRTC Streamer setup, as explained in my previous post.
  2. Then you have to install ADB onto your computer to be able to transfer the App to your Android phone.
  3. Connect your Android phone to your computer and make sure you have the developer option enabled
  4. Next get the source code for RPI WebRTC Streamer from github and install it onto your phone, like so.
    bash> git clone https://github.com/kclyu/rpi-webrtc-streamer.git
    bash> cd rpi-webrtc-streamer/misc
    bash> adb install AppRTCMobile.apk
    
  5. Next open the app on your Android phone
  6. Change settings of the Video encoder to H264 High
  7. Change the resolution to VGA(640 x 480)
  8. And then simply enter the IP address of your raspberry PI as the room number
Android WebRTC streaming in action
Android WebRTC streaming in action

Finally, here is the article from mpromonet if you ever feel like compiling rpi-webrtc-streamer https://www.raspberrypi.org/forums/viewtopic.php?t=186271.
You can even use docker containers to make things easier: https://hub.docker.com/r/mpromonet/webrtc-streamer/

As an aside, I found multiple Android app templates to use WebRTC

uv4l WebRTC vs rpi-webrtc-streamer

I have spent the past two days working with the uv4l driver to get WebRTC working. I eventually got everything to work with three major issues

  1. I could not get the transmitted quality to anything close to what I needed
  2. I could not get rid of the the watermark which was put over the video
  3. The complete CPU utilization for 640×480 was above 90% and caused issues.

Another slightly annoying issue was that I had to re-install Jessie after I found out that uv4l is currently not available for Raspbian stretch lite. I could only find the full version for Jessie, which requires at least a 8GB microSD card. And off I went to replace my 4GB microSD card.

On the positive side I installed rpi-webrtc-streamer from github and was able to look at the results in realtime right away.

Unlike uv4l, which is based off OpenWebRTC from Ericson, rpi-webrtc-streamer is based off the Native Code from www.WebRTC.org which seems to be a bit more responsive than uv4l.

Here are the steps I had to do to get things to work.

bash>  # First create a home for the code
bash>  mkdir utils && cd utils
bash>  git clone https://github.com/kclyu/rpi-webrtc-streamer.git

You can find the Android App under rpi-webrtc-streamer/misc/AppRTCMobile.apk
But first lets avoid the work and go straight to installing the software.

Go to https://github.com/kclyu/rpi-webrtc-streamer-deb and download the appropriate deb-package.

bash>  dpkg -i rws_xxx_armhf.deb
bash>  sudo systemctl start rws

Then simply point your browser at http://<IP Address>:8889/native-peerconnection/

Raspberry PI camera
Raspberry PI camera

I will be going through the setup and usage of the Android App which is part of rpi-webrtc-sstreamer in one of my next blog entries.

Cheap $7,- external usb sound card

I bought the following external usb sound card from Amazon for $7,- to integrate into my Video Doorbell project.

 

External USB sound card
External USB sound card

So why did I chose to go this route. Simple, I was looking at some audio pHATs  for the Raspberry PI and found that they will cost about $4,- a pop, then of course you also need a microphone, and bang you are at around $9,- to $10,-. So paying $7,- for a audio I/O ( 7.1 sound card ) is a smart choice. Another thing I saw which won me over was that the setup is quit simple.

Note: This link above will point to the same sound card for only $4,-.

In order to do the setup I connected a micro-USB male to USB female adapter to my PI zero and made two small changes.
Please note though that I do intend to remove the USB plug all together and solder things together in the final setup.

1: Find the US sound card number ( in my case the USB card is card # 1 )

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

2: create a file /etc/asound.conf with the following contents

pcm.!default {
        type hw
        card 1
}

ctl.!default {
        type hw
        card 1
}

3: and finally test the speaker :

  speaker-test -c2 -twav

This concluded the setup and testing. To use this external USB sound card in my project it had to fit tightly into the chassis which I built from scratch. So the USB plug had to come off and I had to solder some wires onto the card to connect t up to the Raspberry PI.

Video Doorbell assembly
external USB soundcard after removal of USB plug

Raspberry PI Zero W as Chromecast

So one of the thing which I tried out was to see if the PI Zero can handle video streaming to our TV.

In order to setup the Raspberry PI Zero W as Chromecast, I followed the series of 7 videos below and plugged it into our large TV. However the result was unusable. The video did only play for a second or two before the whole thing stopped and tried to continue playing.

This is not too surprising considering that the PI Zero has only a single core 1GHz CPU while the instructions assume the PI 2 or 3 which has a quad core CPU to handle the stress.

Step 1 : Raspbian Jessie Lite Install Guide

Step 2: Raspbian Jessie Lite wifi config

Step 3 : Raspbian update upgrade omxplayer

Step 4 : Install youtube download video and python

Step 5 : Raspbian Jessie Lite Golang

Step 6 : Raspberry pi as Youtube TV

Please feel free to sign up or follow my home made hardware projects here …

AstraNOS for the stars

So I have not written anything about AstraNOS, my web desktop, for a while. That was for a good reason, as I was busy doing a batch of other things the past months.

However I have never give up on it and I am still using it heavily all the time to store pics, ideas, notes, videos and other things.

Progress

I recently fixed my AWS instance and re-enabled Conference, my WebRTC based video conferencing tool. Also since I always have a multitude of windows open I added a virtual desktop feature to the mix.

 

The number of virtual desktops is currently hardcoded to 4 however I believe that this will be plenty. The current version of AstraNOS is now grown up enough to handle a lot of the everyday tasks. It provides a central place online to -feel-at-home.

Feel free to sign up for a free account <a href=”https://www.AstraNOS.org/virtual”>Here</a>, connect your DropBox account and link some youtube videos to your folders.

Raspberry PI Video Doorbell

I recently went to a Microcenter near by and bought an Raspberry PI Zero W

Raspberry Pi Zero W
Raspberry Pi Zero W

For $5,- I could simply not resist. Not only is this a full blown computer with micro-hdmi out, it also can be used to connect other hardware to it with ease. The connector on the right is there to connect a camera to the PI Zero.
Well, after installing raspbian onto a micro-SD card, I went ahead and bought a camera as open-box item for only $12,- and got the combo to work in no time flat.

That is all well and good but what can you truly do with this hardware ? The answer for me is/was

Home Automation.

I have looked into

Ring Video Doorbell
Ring Video Doorbell

However my issue was not so much the price of these devices, after all it takes a lot of effort and money to develop a great product, it was the physical shape and size which made any of the available products unusabe for me.

So I thought I would simply add a few pieces together and create my own Video Doorbell from scratch using the PI and a few other software and hardware parts, which can be found online.

It is of course very helpful, that there is such a huge community behind the PI and that almost everything you can come up with has been attempted before. So googling around I found a bunch of sites with similar goals, like this one here.

Raspberry Pi Security System

Here are the next steps to get from idea to finished project.

  1. Building the chassis ( and BOM )
  2. Connecting the camera
  3. Adding microphone and speaker
  4. Installing a notification server ( pushd )
  5. Writing a cross platform app ( iOS / Android )
  6. Connecting all the pieces

Feel free to subscribe to my blog

DyGraphs Pie Chart Plotter

DyGraphs is a decent Javascript library to plot time series data points.

DyGraphs plotter
DyGrpahs

I chose DyGraphs a long time ago mainly due to its small footprint of 123530 bytes for dygraph.2.0.0.min.js

One of the things it allows you to do now is to add a different plotter algorithm to plot data. One such example can be found on the demo page is that of a BarChart plotter. If you look at the code it is a fairly small addition.

One of the possible plots missing though is a PieChart. It happened that I needed a PieChart for my project and I did not want to switch to E.g. ChartJS [ Release 2.5.0 ] so I wrote my own little PieChart function for DyGraphs.

function pieChartPlotter ( e ) {
        var ctx  = e.drawingContext;
        var self = e.dygraph.user_attrs_.myCtx;
        var itm, nme, data = self._pieData;
        if ( ! data )  {
          var t, i, y, all, total = 0;
          data = {};
          all = e.allSeriesPoints; // array of array
          for ( t=0; t

The one thing you will see in this code is that I calculate the required PieChart data once and then check for its existance each time I enter this function. This is requried beause DyGraph does currently not call the plotter function in a context but rather in the global browser context ( I.e. the this object is the browser Window ).

So instead I ‘added’ ( read hacked ) myCtx to the dygraphs – plotter options to gain access to my local JavaScript object where I buffer the _pieData.

DyGraphs Pie Chart plotter
DyGraphs Pie Chart plotter

While this may not be the nicest pie chart around, it is a small, basic function which can be expanded on fairly easily.

Addendum: Here is how to use this code

    this._options  = {
      labels: ["Date","Count"],
      legend: 'always',
      title:  "  ",
      myCtx: this,
      animatedZooms: true,
      hideOverlayOnMouseOut: false,
      stackedGraph: false,
      clickCallback    : this.onGraphClicked,
      showRangeSelector: true,
      underlayCallback : this.highlightWeekend,
      legendFormatter  : this.legendFormatter,
      highlightSeriesOpts : {
        strokeWidth: 3,
        strokeBorderWidth: 1,
        highlightCircleSize: 5
      }
    };
    this._chart = new Dygraph ( dom, this._data.data, this._options );
    ...