Monday, December 30, 2013

Christmas light fault finding II using binary search

Warning: the following instructions include exposure of hot wire at full voltage of electrical outlets.  The modifications to equipments are non-standard that could expose personals to high voltage who do not know of any modifications. The equipments should be supervised by the installer at all times.

Christmas light fault finding apply mostly to 2.5V incandescent lights bulbs, with 50 bulbs in serious in one strand.  Newer LED's don't blow up easily; they just fade away very gradually.  But in a "few" more years, my lights can be collectables!  Otherwise the nostalgic value is there - your childhood, your child were born, their childhood.

There are non-contact voltage detectors for fault finding.  But their range should be an inch or more for detecting wires behind walls.  Imagine icicles lights when the original neat formation is gone, and strands are hanged over each other to increase the brightness and light density.  Even for one strand, the wires with and without voltage due to faulty bulbs are twisted together.

The faulty bulb finder is an old fashioned high voltage probe, a long single piece of wire, and a plug without polarity so you can swap hot and neutral.

The bending of the probe is incidental and have no relation with the project.  A probe is just a bulb plus a high resistance.  You touch the red end, using human as the electrical return path. It is safe because the current is very small.

DO not touch the red end because it can now be at 120 V.  It is easy to attach a wire to the red end with the screw and spring inside.  You should take off the metal clip too as it is dangerous.  You should not touch any metal part except for the tip part of the probe - the opposite when using a normal probe.  You can tape the end with electrical tapes but after Christmas you can just take the wire out and use the probe again, until next year.

There are probes that looks the same for low voltage as in hobby electronics.  You will burn the bulb if 120 V is applied to it.

I actually keep the pair of wire which can be reused.  But make sure that only one of the wire is used, and insulate any bare wire of the other unused wire.

A full chain of Christmas lights may have several strands of about 50 bulbs each.  For a fully working light, if you take off any one bulb, a section of the light will be off.  That's a strand.

Now assume there is only one faulty strand. Procedure:
  1. plug in the fault finder in any convenient voltage outlet.  Don't touch any bare metal or wire (except for the tip of the probe).
  2. take out about the middle bulb in the strand.
  3. short the two contacts in the bulb housing with the tip of the probe (this is safe)
  4.  if the strand light up, this bulb is the faulty one.
  5. Otherwise, probe the two contacts in the bulb housing in turn and note if the probe lights up in each of the two cases.
  6. Let the state of the probe light be ON (or brighter) and OFF (dimmer).  If the state of the probe is OFF-OFF, you need to change the orientation of the plug, swapping the hot and neutral position.  Then you should get one ON and one OFF.
  7. If you can't get an ON state, there are multiple faulty light bulbs.  You should pick any one side as the faulty side.
  8. The faulty bulb is on the OFF side of the strand.  The wiring into the housing should clearly indicate which is the OFF side.  If not, you can pick one side at random and assume it is the OFF side.  Then see later if your assumption is right.
  9. Put the bulb back.
  10. On the faulty (OFF) side, take off the bulb which is mid-way between the last test bulbs or the end of the strand.
  11. Repeat from 3 until 4 happens, or in case of multiple faults, you will approach the faulty bulb on both sides.
If there are multiple faulty strands, just do one strand at a time if you know the boundary (by looking at the wiring).  The 1st or last bulb at the strand has 3 wires attached to the housing; others has two.  Or do a less aggressive binary search by assuming a short strand.  One strand is usually 50 bulbs.  If your assumptions are wrong, there will be contradictions later.

Happy New Year!

Sunday, December 29, 2013

Android VOIP Landline updates

My totally free VOIP solution worked for a short while until PBX kicked me out of their service.  Sipdroid exists to sell PBX services.  If I pay, I would not be going through so much trouble to use Google Voice for free.

I upgraded to a Wifi firewall router in the hope that I can install Asterisk myself as a server to connect to GV and be independent on anybody else.  But the support is in disarray, in contrast to the impression one gets.  Firstly, they can't keep up with new chipsets and won't work with some.  Then I discovered that my router will probably not support the newer (and lower production cost) USB drives that do not need a power supply.  And they need FAT partition.  So I never tried to install anything to day.

As you know, instead of charging for the calls, they dropped the open x??p protocol and integrate GV into hangout.  I come to understand and predict their strategy.  If you charge the calls mobile users are not going to pay twice by using GV.  They never and still aren't interested in landlines.  They are only interested in their own bread and butter.  If you have been using GV, you are very motivated to use Android and Hangout when you consider switching.  The support of x??p protocol is to initially attract compatible standard users to start using and switch.  Now it became a distraction when people using it as free Voip calls, and supporting companies such as OBI.  

SIP VOIP is here to stay.  The service and equipments are there for many years.  It does not need great investment to run a service.  Great phones are very cheap compared to a smartphone, standalone skype phone and in the future, a standalone hangout phone.  Even the main cost for a great sip phone is on the screen and software.  Google and Microsoft will not be interested to go into carrier business, which will be on the mercy of cable and telecom infrastructure companies.

Skype's turns are interesting.  It came on at a time no servers can support that many phone calls, only p2p.  Now you have the clouds.  MS has it's offerings.  Google of course want to move everybody into the clouds. It's good if you don't need to pay extra, using the bandwidth you already brought, a smartphone or the computer.

I can see that Google can take over the whole of telephone and video phone business.  Android phones are already doing that, only needing to integrate with your phone number.  For a dedicated desktop phone? There is already the chrome book selling for $200 dollars, cheaper than the price of top end sip video phones.

I do have a chrome book.  Until then I use Callcentric.  It's great for people who don't use that much of their landline.  If you don't call, you can be just paying the 911 tax and may be some other tax.  I doubt even that you need a 911.  Now when you activate a cell phone you can enter a default address for emergency.  You are probably always closer to a cell phone than to your home phone at any time.  And old cell phones with old sim cards can still cal 911.  Now if you used 3 carriers before you have a lot of redundancy.  You just need to keep all of the antique phone charged.

I never had internet outage or cell phone outage.  So I won't hesitate to switch instead of believing that some old fashioned reliable wire connects me to the local telephone company.

However, Sandy wiped out Callcentric.  To provide the low cost service, they don't have geo redundancy.  If you are serious, you should port to Google so people can always reach your number if your connection to the internet is OK.  You can change SIP provider at an instant.  There's a lot more coming out of Sandy in case you are interested in emergency planning.  BTW Callcentric offers free porting.  You can save $25 and try the service for no investment.  Port cost $20 for google and a sim card + activation for porting to wireless first.  T-mobile has free sim activation kit on a day to day basis.

I was burnt by Sunrocket and so I'm not interested in Oma or Obi.  The Oma business model is doubtful.  Now it's clear that you can still call for free but will be stuck in equipments many years old.  Any the Oma is not for low volume callers and nowadays people are mostly on the cell, except for office.  With GV, the Obi is just an dumb telephone adaptor.  Why you still want to stick with your old analogue telephone?  (Fax?)  If you are locked into a service, you are not getting new techs.  Now the non-HD voice IP phones are dirt cheap.  It doesn't help your business image, and there's no other major reason to go into SIP.

I got hooked on HD voice when I tried once.  As they say, "you sound better than yourself".  Hearing yourself when speaking is different than hearing yourself from the other side of the phone (echo test service or HD voice mail).  It sounds so much better with HD.

My thinking has been correct, just I thought too much, both ways.  First I brought a Gigaset IP phone with DECT, which got me hooked up on HD voice.  The remembrance of a once tech giant adds to it.  The "basestation" need to plug in to the router (or modem) and you can put the handset anywhere.  DECT has a good range, and in no way can be worse than my super analogue cordless.  DECT was developed years ago but HD voice came out of it for sure.  May be they have enough bandwidth or they have updates.

I probably got the last one of the last lot.  It was a huge discount.  I can't anything like it for that price even now.  But sorry that I returned it.  The software is so crappy compared to any smartphone.  They can't be compared as a smartphone cost some $500.  Maybe it's a mistake.  I should have look into ways to integrate with the android phone book.  You can use a smartphone as an extension but do not use it to call. The one reason to keep it is that you don't need wifi for it to work.

I didn't know what I was thinking.  I brought a cordless DECT phone.  May be I was going to get an ATA and use the DECT for a start, and then as a backup without the need for wifi.  The selling point is that you can pair cell phones with it and use it at home, which is much more comfortable.  It's a Panasonic, same as my super analogue cordless, which like Siemens, is winding down it's gadget consumer electronics division.  I could have kept it but I didn't.  It was a special straight from factory.  If I return it I have to pay a heavy restocking charge.  But I managed to sell it at Amazon at zero lost because my phone is discounted.  However, the postage Amazon asked for is a bag, I upgraded for a box big enough to put the phone in.

Now my solution to Android SIP VOIP WIFI is almost completed when I had some time.  First you have to the check the wifi coverage and signal strength in your house and yard.  There are Android apps for that.

I upgraded my wifi router.  If you need a reason to upgrade, this is it.  While the spectrum congestion of cell phone and analogue cordless never came to me, the wifi spectrum is very congested.  You can beat your neighbours easily by upgrading to a dual band one.  But your phone have to support that.  The iWhatever's do.  I also turned the old router into a repeater for the far away rooms.  Wifi is a totally different animal from cell and DECT signals, which are not sensitive to the number of walls and what materials are in them.  It is only then I understand why the HDX transmission from VDU isn't always successful even though the test is fine.

It turns out to be well known that wifi is tricky for voice and the android audio latency is also well known.  But I think these may be non-matters.  But it doesn't hurt to do the best and the obvious.  You don't want to lose calls when all your kids are playing online games or streaming HDX movies.

First you need to activate quality of service (QoS) on your router to give priority to the SIP protocol.  And give priority to the phones you are using via MAC, which you can find it on info on your phone along with IMEI, etc.  Failing all that, put your phone on the DMZ zone, straight through the firewall without checking and processing.  If it depends on IP and port range, you may be limited to one phone.  But you can use other phones for caller ID, ring tones, etc.

I don't think it matters much but you can create a virtual AP without security encryption.  You should isolate it from other AP's so any hacking is limited to the phones and there's no much to loose in them.

For Csipsimple the SIP app, you can enter expert mode to improve the latency.  But I think it didn't work or there's no more margin to improve that way.  There's another app known to tackle the latency aggressively but they don't have the option anymore as I see it.

The critical issue is the echo at the dumb phone end.  Since my telephone company is still charging $30 for all the modern conveniences such as caller ID, call waiting, etc, I am sure there's still millions and millions of dumb phone around.

All mobile phones have good echo cancellation, they have to be, so that's a non-issue.  But the issue is created by the smart phone end.  The sensitive mic will pickup from the ear piece.  So the caller's voice come out from the earpiece, went into the mic, and back to the caller's earpiece.  If you are lucky, you can reduce the echo by reducing the volume on the earpiece and the sensitivity of the mic.  For Csipsimple you can adjust those during a call.  Some phones it can't be done unless you have trouble hearing the caller or the caller can't hear you properly.

The complete solution is really a ear plug.  Completely no echo.  You have your ear and head to absorb all the sound wave and there's nothing hard to carry the wave from the earpiece to the mic - just a flexible wire.

I also think that the echo is also the culprit for a large latency.  Echo cancellation is software.  And if the software is trying to cancel a long echo, the buffer has to be larger, hence more delay.

Now an earplug is really inconvenient.  How to get kids who are not old enough to use a cell phone to get use it it?  You just can't pick up the dam phone.

I was thinking to get the cheapest ATA at $15 so all my lovely analogue equipment are still usable as a backup.  No learning curve.  And that I can keep my talking caller ID answering machine.  To date no talking caller ID works for SIP in Android.  If I like to sound HD I would go to the Android or my computer.

While talking caller ID can't be replaced, because you don't need to get up to see who is calling, you can achieve the same with assigned ring tones.  You just need any numbers of Android phones to attach as extension to assign ring tones.  Android can also read the name from your phone book.  The phone you actually talk on can be dumb.

And for a little more, you have have a very good new non-HD IP phone.  They can be plugin before the router so one less failure point.  It's really just "pickup the phone".  There will be no echo issue, a totally different animal from a squar rigid glass and metal frame good for conducting sound wave.   However, they are huge and totally unsuitable for home.

And for some $40 you can get an HD phone.  But the screen may be too poor from an Android and that some are big.  I spotted one that is suitable and did a "best offer" on ebay.  The listing ended before the offer was considered.

I was thinking that a bluetooth headset will ease the inconvenience.  There's no wire so you just pick up the headset instead of the phone.  You can put the phone in some convenient place attached to the charger all the time.  You can even hide it if you have a cracked screen.

A bluetooth headset may or may not have the same echo problem.  The usual ones are tiny that hangs on your ear.  There are some with a stick to put the mic closer to your mouth.  I would think a conventional headphone with a stick mic will have absolutely no echo problem.  But, how can a kid answer the phone or make a call?

It dawned on me that I needed a handset (as opposed to a headset).   I remembered handsets that looked like my dad's phone's handset.  Dad will be happy to use it.  I found a low cost handset that doesn't resemble my dad's phone.  But the design is basically the same, with earpiece on the ear, the mic by the mouth and something soud absorbing in the middle.

Bluetooth or not isn't the point.  One more piece of wire isn't critical and BT isn't espensive.  But usually nowadays you can do voice command on the handset (or headset for that matter).  How about "call dady" ?   Or "momy called".  The handset has only about one 4 way rocker switch to work with.  Can't be simpler than that.

I should have found one that docks and charges.  Now this one charges with USB.  But that's not a problem.  Even the smallest kid have a USB charger by her bed.  She use it for playing games on ipad, android and whatever.  She knows to keep all her electronics fully charged or she cannot play.

I don't know if BT can carry HD voice.  There are BT that certified for that.  In any case the cheap handset will be useful for many things, if only as a backup.

Now I don't have anything specific for SIP only.  If they doesn't work as intended I have nothing to return.  Let see how it goes.

VPN service updates

I have been using paid VPN service for over a year now.  Now it's about $6/7 a month so that's not bad compared to some dedicated service.  VPN is flexible that meet my several needs.

I tried Kryptotel for a month, then three, then a year.  It's that good.  But recently the service was unreliable.  The server may becomes slow, that's when I switch to another random server.  It usually works great but it seems that all the servers are busy.

When my subscription ended, I was surprised that they don't sell openvpn anymore!  The company's business is all about encryption, and I have been taking it seriously because it is an offshore company setup for that purpose.

Maybe they are pressured not to sell something that is not crackable?  They still sell other VPN's.  May be openvpn is too difficult to support?  Their local techs do seem not to know what they are doing, but very responsive.  Maybe they can't compete with Openvpn itself, selling VPN by bandwidth.  That's a very good deal if you just want to protect you IP and privacy from coffee shops.

I changed to Mullvad and so far so good.  The servers are not as fast as when I used Kryptotel a year ago.  But much better than the last days of Kryptotel Openvpn.  Their advantage is that for random servers they have some in Eastern Europe.  That seemed to be popular for some p2p applications.  But your bank and facebook will be very suspicious.   You can also use servers only from some countries if you change the server address.  I have a script for that to switch servers developed for Kryptotel.

They have the same "bug" or feature that couldn't make it work out of the box for linux.  It's the pushed option from the server:

redirect gateway def1 bypass-dhcp

They have to bypass dhcp for Windows but it's an illegal option in Linux.  So the whole option is discarded.  So in your client config file you need to add:

redirect gateway def1

And my lesson learned - never pay for the whole year.

Openvpn works on a lot of my platforms now.  Ubuntu insists on separate certificate files.  Ipad works if you email the single config file to yourself and open it.  Android works if you just drop the separate files to the phone.  But it doesn't work for some stick computers because they don't include a kernel module.  But you can root and upgrade.  DD-wrt accept separate files pasted into dialog boxes.  Chrome OS the same.  But I didn't try the latter two.  I will be surprised if they don't work.