Friday, February 27, 2015

FCC and Net Neutrality: What does it mean to classify ISPs as Common Carriers

Put simply, the FCC wants to make the ISPs dumb pipes for the internet. That is they make no decisions about what a user can access. THIS. IS. A. GOOD. THING.


IF

That is what they do.

The current malestrom of debate around mostly boils down to whether or not folks believe the FCC will truly forbear (waive) the vast majority of Title II regulatory requirements in order to focus on this rather important issue.

But the internet already works, how can this be anything other than a needless government power grab, or Obama over reach etc... ???? Glad you asked.


Let us talk about some examples of poor behavior in the business practices of ISPs with regards to the internet 'working' and this concept of Network Neutrality.

Corporate E-mail vs Private e-mail:

Back in the dark days before smart phones where a 'cool' thing we had an interesting state of affairs when it came to accessing e-mail on your phone. Work e-mail was different from personal e-mail according to mobile internet providers. To access your corporate e-mail you had to sign up for a corporate data plan which was more expensive. The technical differences of accessing Corporate e-mail vs Personal e-mail was.... anyone? anyone? Nadda, zip, zilch, zero, NOTHING. Yet one required a more expensive plan to move bits round between sources and destinations of internet traffic in precisely the same way as the other. This is an example of a non-neutral internet. This is not a post FCC ruling thing folks are worried about. This was, in some cases may still be, a reality of mobile broadband service offerings.

Tethering:

Current business practice of ISPs is that tethering your phone to another device for the purpose of that device to access the internet (ie use your phone as a wifi hotspot for your laptop) requires an additional charge over you basic access charge. This means you as a user cannot decide to use your (insert bandwidth amount of your choice within the limits of your plan) how you like. You MUST pay extra to use those bits to send data to your laptop. Again, in terms of the service provided to you on by the ISP there is ZERO difference between bits that stop at your phone and bits that stop at your laptop. This is a current example of a non-neutral internet. This is not a fear of something to be added post this FCC ruling. It is a fact of life for millions of US smart phone users.

App/File Download Limits:

Ever gotten a message when purchasing an app or downloading a file where it says something like "File to big, you have to connect to WiFi"?. So if you have paid for 5GB of data and you want to download a 500MB  (or 10% of the amount of bandwidth you paid for) why can you not do it? Again this is not a state of affairs people are afraid this move by the FCC will cause. It is a current reality\limitation imposed by Mobile internet providers. Again this is an example of a non-neutral internet.

Service Blocking:

Apple Facetime was not allowed on mobile networks by both Verizon and AT&T at launch. Numerous other services have faced a similar fate. Often terms of service of broadband providers has a clause about 'streaming' content. You know like Netflix video, Pandora Radio or pretty much the most common kinds of things folks use when accessing the internet. Do you know what the technical difference is between download 1GB of data and "streaming" it in terms of the ISP system? If you guessed "nothing" you would be correct. This is another example of how ISPs restrict your ability to utilize data allotments you pay for. This is an example of how we currently do NOT have a neutral internet.

Throttling of Unlimited Bandwidth plans:

Beyond an arbitrary limit it is standard practice to throttle users with unlimited plans to lower rates. That is you pay for a service that says it is unlimited and then they introduce artificial performance reduction once you past a number (5GB is a common threshold). If someone pays for an 'unlimited' plan is it fair to artificially limit their level of service because they actually use it as 'unlimited'? Balancing user load is a core function that must be managed by ISPs. When there are to many users and not enough bandwidth to go around it is ok to reduce service across the board in order to continue providing service to all users. It is not fair to single out users based on how much or how little of their plan they choose to use. This is yet another example of how we have a non-neutral internet now.

How does this move help? 


These examples all have something in common. They are cases the FCC has already been pursuing against broadband providers on the behalf of users. They are all cases at the ISP level and related to ISPs trying to differentiate between the various types of services being used by a customer instead of treating all passage of internet traffic as the same.

To boil it all down as far as I know how you have to remember a very fundamental thing. No matter what you are doing with your internet connection, in the end it is all about moving 1's and 0's from one point to another. Net Neutrality is about making sure 1's and 0's move equally regardless of what requests/services etc... are driving them.

To make matters worse in many cases the ISPs have competing services. Take Netflix vs say on demand content provided by Comcast or Comcast partners. Comcast has a vested interest in having customers paying for their on demand content vs Netflix content. There are numerous documented cases where Comcast (and other ISPs) artificially limited customer access to services like Netflix where no similar constraint was placed on access their on demand (or that of a favored provider (read Netflix competitor)). This is a classic conflict of interest where the FCC seems intent on making sure that providers are not allowed to pick which services to support. Without Common Carrier status imposed on them there is no legal reason why Comcast cannot chose to deny a particular service, or worse, sabotage them. The particular case of Netflix is one worth a post on its own as it does a good job bringing up a lot of the complexities involved in this debate. Here is a taste. If Comcast reduces service levels of Netflix traffic at the same time it increases/prioritizes traffic to its own On-Demand content who do you think the customer blames when their netflix stream doesn't work (or works poorly) and the other content runs without a hiccup? Is it fair for Comcast to not inform their customers they chose to intentionally lower Netflix traffic capacity in such a case?

Why do they think they have to regulate it now?

The FCC has been trying to enforce the idea of a neutral net for many years. Had the ISPs made moves and changed practices to uphold a neutral internet service it is likely the FCC would never have passed a rules change to re-classify them as title II common carriers in order to have the necessary legal powers to force them to behave. Put another way, for about a decade now the FCC has been counting to three like a parent trying to get a misbehaving child to correct themselves before more drastic action is required. They didn't, and the FCC reached 3. 

Don't get me wrong. I am not a fool to think more government intervention is a good thing. I am by no means thinking the FCC should be given a blank cheque on this issues. So long as they stick to what they have already been trying to enforce and do not start making Chinese government (or UK for that matter) type of noises about internet content I think this is a good move. I look forward to the release of the full draft of changes so that a more educated debate of its merits (or flaws) can be had. 


Tuesday, February 24, 2015

T'Rex Update: Batteries, Brains and Wires Oh My


Motivation: So I have finally gotten the Arduino to talk to the Orion and the Raspberry Pi. For a long time I was banging my head against a poor documentation issue. The Roboclaw examples all show a setup that only sends two parameters when configuring the comm to the controller. However an error throws when you match the example saying it expects 4 parameters. I couldn't figure out what the additional parameters were being used for going through the .h file so I tossed in a couple of values. Turns out the 3rd parameters was the timeout and setting it to 0 means the damn thing never has a chance to listen to any commands. It also looks like if you use the RoboClaw setup it only uses the UART Tx Rx pins (0 and 1) on the Arduino. Fun times. Right now I have a bastardized solution where the USB serial from the Pi and the RoboClaw comm is happening on these pins. This means I can sit on the terminal window (or serial monitor in the Arduino IDE) on the Pi and send commands to turn the treads. As I am connecting to the Pi via a VNC remote desktop session from my Mac this represents a remote control solution via wireless. Eventually I will probably ditch the VNC portion and build a mac (or possibly iPad) application that receives telemetry rather than using a full on desktop session.

I also have the camera streaming data directly to the mac via netcat that I finally got working (Thanks to This example). Back to motion. I built in a function that takes a power input and then steps to it based on an interval (currently 100 milliseconds) This makes for much smoother speed transitions. If the power number is higher than current it ramps up and down if it is lower. This is also setup doing a clock watch rather than delay so it does not interfere with doing other tasks. Right now I only have it doing forward so I still need to build in similar functions for reverse and the turns. If you are interested in doing the clock watch solution as opposed to using Delay then check out the Arduino multitasking lesson on adafruit.com. At heart it is just watching the return value from millis() and setting up a couple of variables to watch the gap since the last time you checked. When the delta is greater than your desired interval, do something. Pretty easy to do and I wish most of the examples out there for arduino used this methodology rather than the rampant delay usage you see out there. The end of that lesson also starts you down the path of classes which is also a good thing to learn here. It isn't that the Arduino is multi tasking, it is just that it can run through a LOT of instructions if you let it. 16Mhz is FAST. Each clock cycle is 1/16,000,000ths of a second. A 1000ms delay wastes 16,000,000 clock cycles that you could be doing something useful.

Anyway, If you saw my Facebook post (ITS ALIVE) you may have noticed the tracks were not in sync. Out of a valid range of 1-127 it was taking till 35 to get both treads moving, one started around 30. I had to take them apart and figured out one of the bogies was pretty gummed up from my RC track initial run. I ended up using some moly dry lube that I have for my road bike to lube up all the bogies, drive wheel and gearboxes. The result was that I can now get consistent tread rotation at around 12 and they now seem in sync.

In addition to motivation I also finally got my pan/tilt servos situated/calibrated to center and wrote a couple of routines for moving them through their respective 180 degree arcs of motion also from the serial connection from the pi. Next... need to figure out how to mount the camera, ping sensor and maybe the microphone as a pan/tiltable sensor head. The Arduino sketch is up to 10k of 32... well really 28k available (using a trinket from Adadfruit in the final build). Should be able to handle the rest of the movement and sensors in that.



Another bone head lesson (and why I am overloaded on serial comm via the 1,0 pins) was that BMSerial.h and softwareserial.h were conflicting.... because they do the same damn thing. If anyone else runs across this trying to setup a separate serial line than the one being used to communicate with the Orion Roboclaw motor controller then you just need to make a second serial setup with BMserial... the example is always myserial(tx,rx), just make myserial2(tx,rx) or whatever name you want to use. Or if you are using the roboclaw (tx,rx, timeout, ?) call you can do an independent BMserial creation, just don't use the 1,0 pins. Cleaning that up and implementing the multiple serial comm lines is probably the next thing on my to do list.

Power: I learned a lot about power on this thing recently... almost fried my UNO board in the process. I found a couple of projects online showing how to do a voltage divider circuit that let me monitor the cell voltages of the lipo battery I was using via the balancer connector. This way I could not just rely on the RoboClaw shutoff or a lipo monitor widget, I could actually send back the pack, and individual cell voltages via telemetry. Well this worked great for one lipo pack. I am planning to run this via two 2S 7.4 5000Mah packs wired in series (14-16v or so). So after I had it working for one pack I wrote the routines for monitoring two packs at once then wired (make that tried) the second pack in. Well I found out the hard way that when wiring the second ground from the balancer connection to the common ground I created a mismatched parallel configuration.... *sparks, pop, SHIT*.  Basically this created a wiring equivalent of division by zero where infinite current tries to flow between the two batteries (and through anything they are wired through) to get them to match. This also blew a hole in my theory that the balancer wiring was protected from full current from the batteries... um NOT. Anyway it seems I only did some minor damage to the UNO board. It now reads a bit high on the analog inputs but so far so good.

So after getting a clean pair of shorts (2S 30C Lipo's on a mission to discharge are no joke) and doing some belated googling I learned a couple of important things. The first was that bit about the stupidity of the wiring I tried. The second is that RC LiPo's are more dangerous than I was already aware as they typically lack any kind of built in protections for the lipo cells. This lets them pack the punch they do for those little remote controlled rockets. But it also puts them at a much higher risk of a failure scenario where fire or worse happens. In the voice of Tom Hanks in Polar Express " Lesson.... Learned". I hadn't been planning to try and do this. I ordered a couple of voltage monitors that beep when the cells get low as plan A. However the great deal I got meant waiting on an order and I got bored waiting for them to show up ad thus plan B was born. Anyway, I do still want to try and figure out how to do this. I am sure I could do it with a relay but that is probably overkill. For now I will probably be happy with just figuring out how to get the pack voltage from the two way packet mode from the Orion RoboClaw controller.

Brains: Move over Raspberry Pi B+ and make room for Raspberry Pi 2. Got one through Adafruit for I think 40ish something + shipping. It will be nice once the launch fuss settles down and you can reliably get these for the advertised 35$ price. I may load up everything on the B+ once I button it all up. But the Pi 2 has really been able to speed up all the Arduino coding I am doing on board the Pi. I think my end configuration will be using one of the HAT prototyping boards from Adafruit with a pro trinket mounted. haven't decided yet if the trinket will be the 3.3v (direct comm to Pi) or the 5v version (will require a logic level shifter which I already have).

Wednesday, February 18, 2015

Raspberry Pi 2: Tomorrow has come while no-one was looking

The future is here. Is it the Apple Watch? Apple Car? Flying Car? Google Glass? Oculus Rift? Hololens? Project Loon? Google Fiber? Tesla Model 3, Hyperloop, SpaceX Falcon Heavy with resusab reusable boosters?

No.... it is the Raspberry Pi 2.



Surely I am being over sensational. Surely this is an overstatement of the importance of a not-for profit educational geek toy that even now most people probably have not heard of even though it may well be the most successful computer ever made in the UK, or if they have heard of it, they have no real idea just what the heck a raspberry pi is.

Ok, perhaps it is. However, I ask you to bear with me me for a minute as I explain. The Raspberry Pi 2 and its kin like Intel Edison, Beaglebone etc... are all in this very interesting space. Truly inexpensive computing. The Raspberry Pi 2 is the first one 'across the line' so to speak in my opinion.


  • $35 - one computer board with 40 GPIO pins, quad core 900mhz Arm 7 chip, HDMI input, 4 USB, Wired Ethernet port, 1GB of RAM. 
  • $20 - one 16GB top of the line SD card, you don't need to speed more than $10
  • $10 - wireless USB adaptor
  • $10 - Pi Case
  • $6* - Amazon basics HDMI cable
  • $23* - Amazon Basics wireless keyboard and mouse (14 for wired)
  • $150* - Basic HD Monitor
  • $10* - 2amp 5volt usb micro power supply
*lots of folks have these laying around from older systems/phones/tablets etc...

Total cost if you have none of the * - $264
Total cost if you have the * stuff already or plan to use it "headless" - $75

In 1993 my mother took out a loan against our savings account to buy a 486 desktop computer. I am talking around $2000 of VGA and CD ROM goodness. In today's money that would be a computer costing over $3,000 dollars. 12x the cost of the pi system I laid out above. 

A 66mhz 486 was a 16bit system with in theory 66million instructions per second and boasted a 'massive' 32MB of RAM if memory doesn't fail me. Graphics were impressive at VGA (640x480). 

The Pi 2 clocks 900Mhz on 4 cores. Simple math says 900 million instructions * 4, or 3.2 billion 32bit instructions per second. Granted multi core performance is a much more nuanced issue. but hey lets go on the conservative side and say 1billion 32bit instructions per second vs 66 million instructions at 16 bits. That is 32billion bits being pushed per second vs ~1 billion.  

1/12th the cost. 32:1 performance increase in terms of a rough bit pushing metric. That is before you go into things like increased storage (16GB was  LOT of space in 93, 1GB of RAM was just silly talk), graphics capability, wireless communication and power usage. Or built in software like wolfram alpha, mathmatica (worth more than this whole system if bought independently) and built in development tools  with an ease of use and freely accessible tutorial information that was simply unthinkable in 93. 

But hey, super powered computing in a small inexpensive packages are not really new. Afterall, odds are good if you are reading this you have a smart phone, possibly you have had several. If it is a current top of the line phone it is quite a bit more powerful than this board I am describing. It isn't just the low cost and computing power that makes this board (and others like it) special. It is those 40GPIO pins, camera connector, USB ports, display connector (HDMI and another more special purpose one). Why are those so important that I would make such a grandiose s statement above? 

Let us fast forward a few years to 1999. I am in college studying computer science and I take a class in what I remember as physical computing (can't remember the actual title). That is taking these abstract calculators and using them to do real things in the real world like recognise a picture, or turn a motor, read a button push etc... To say I was interested is a mild understatement. But I was truly disappointed to discover how freaking expensive and yet crude it all was. You could spend as much on controller boards and interface cables as you could on the computer. And if you were not very careful you could easily fry your multi-thousand dollar system.  The main component we used that semester was a board that amounted to a microprocessor tied to a serial port for the bargain price of $500 (you can get a better version in an Arduino Uno for less than a 10th of that today). $500 dollars + say a $500 old used 386/486 system plus periphials (keyboard, mouse etc...) was a lot of money for someone to throw at an adventure that could very easily lead to letting the 'magic smoke' out of all the expensive electronics. In some ways the cost was good as it taught us all caution. Looking back on it I think it was the worst element of the class, as that same experience with painful experimentation cost of any physical computing interface was occurring all across the nation, hell the world, at that same time. 

That

Has

Completely

Changed

Granted this is not a crisp line. This change has been in work for a few years. Physical computer experimentation via cheap SBCs like the Pi and microcontrollers like Basic Stamp, Arduino etc... has been steadily ramping up on what looks to be the early part of an exponential curve collectively being referred to as the Internet of Things or IOT. I mark this spot as the point where the curve starts really taking off where before long people will be aware of technology like the raspberry pi or similar technology just as they are smart-phones. I point to the Raspberry Pi 2 as the IOT equivalent of the original iPhone in the smart phone world. Makerbots replicator is probably the IOTs Apple 1/Macintosh. Basic Stamp and Arduino both fit in the picture as prominent players as well. Remember Apple didn't invent the smart phone or the personal computer, it got the world to fall in love with them and start buying them in mass. 

Why do I think the Pi 2 is so special?

Because the Pi 2 marries both practical understood computing and the IOT. In doing so it transects the world most of us live in where a computer has to work, and the burgeoning maker\IOT movement where a computer has to interact via more than just a keyboard\mouse\touchscreen and internet connection. The previous Pi B+ board that came out last year was a marvellous headless linux system for things. It was a curiosity as a computer you would use in general. Running the x11 desktop was akin to running quake on (insert some random highly inappropriate hardware) just to show that you could. You could do it, you could sort of run Minecraft, dev tools, a web browser or Mathmatica etc.... But it was a masochistic exercise in patience to do anything resembling real work. Compared to that... I am writing this post in a browser on my Pi 2. I did all my research in additional tabs. I have multiple Arduino development windows up in the background. TOP is running in one of several SSH sessions logged into the box and utilization is rarely peaking above about 20% and load times are a mild annoyance similar to web browsing circa 2000->2002 or so vs impossible obstacle. In other words, It. Is. A. Computer. And unlike most computers it is designed from the outset to be friendly to interfacing with the real world rather than just cyberspace. Now you can access all that wonderful educational content directly on the device while working with it. With a Pi and an Arduino you have the IOT equivalent of Duct Tape and Bailing wire. You could in theory take $1000 in stuff and create the next big IOT thing. Sell it to the world via Kickstarter and be a massive successful company in almost no time at all relative to history if you have the right idea and present it the right way. That is an investment of 1/3 of what my Mother had to spend to get us a working early internet era system. I am pretty confident that someone is out there doing it right now and in 5-10 years time you will think of them like you think of Jobs, Gates, Musk etc... and when you read their history you will read how they got started with this kind of device. Guess I will have to check back in on this post in a few years and see if I was nuts or not :-)