NTP server on Raspberry Pi

About to start following the post, http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html, by David Taylor. I emailed David (contact is on his page) thanking him for his post and he replied with a few pointers.  I’ll incorporate his suggestions into this blog post and any challenges.

Hardware purchased:

Hardware Assumed:

  • Keyboard and Mouse
  • Monitor with HDMI Support, (Makes setup of WiFi easier even if you plan to run headless)
  • microUSB power cord
  • Soldering Iron
  • Resistor (220 Ohm)

Raspberry Pi Setup for New Users:

http://www.raspberrypi.org/wp-content/uploads/2012/04/quick-start-guide-v2_1.pdf – Various videos on YouTube show you how to boot up your pi if you are using a NOOB card. The USB WiFi dongle states that the latest versions of Wheezy Raspbian distribution support this module out-of-the-box. Default username is pi and the password is raspberry. When booting your pi, make sure to enable ssh services. In addition, you may want to expand the root partition to fill the entire SD card.

If you are loading your own version, you can follow the steps below:

  1. Download an OS image for the SD card – 2012-09-18-wheezy-raspbian.zip
  2. Unzip the contents of the Zip archive to a .IMG file
  3. Download the SD card writer program: Win32DiskImager
  4. Use the Disk Imager to write the OS image to the SD card

Setting up for Wireless Communication:

Although my end goal is to use my raspberry pi as a direct access point, it’s easier to become familiar with the pi by connecting to it through my home router. My first step was to verify the Internet worked by directly connecting to my router by Ethernet. I switched into the raspbian GUI by typing startx on the command line. To test the Internet connection, I opened the the NetSurf Web browser. Following adafruit’s network setup tutorial, I used the WiFi Config application to connect to my wireless network. If you don’t see any network connections during a network scan, you may need to remove the WiFi dongle from your raspberry pi and connect it back. I should add that I struggled getting the WiFi connection to work and I switched to trying to a command line approach. I admit I’m not certain what sets were necessary in allowing me to finally connect to my network through the WiFi dongle. When I have both the Ethernet and WiFi dongle plugged in, I lost access to the WiFi. I then followed a forum post regarding the ifplugd that caused your pi to only use Ethernet when it was plugged in. To remove ifplugd enter sudo apt-get remove ifplugd on the command line, unplug your pi from the power source to reboot, and then WiFi will work when Ethernet is plugged in, but I wasn’t able to get it to work with both network interfaces. In retrospect, removing ifplugd was a dumb idea, apparently you can modify it’s configuration file to enable both. Go to “/etc/default/ifplugd” and change the file to

INTERFACES=""
HOTPLUG_INTERFACES=""
ARGS="-q -f -u0 -d10 -w -I"
SUSPEND_ACTION="stop"

SSH and Headless Mode:

Since I don’t own a monitor with HDMI, I’ve been using a pico projector with an eye-straining 480×640 screen. SSH allows me to access my pi through my laptop’s command line. If you didn’t enable ssh when you first started your OS, you can enable ssh by typing sudo raspi-config. To get your pi’s IP address, type either ifconfig or access your router’s IP lookup table. Last, from the command line of another computer (my favorite is mobaxterm), type ssh pi@IPADDRESS with the password raspberry.

Raspberry Pi P1 Header and GPIO pins: 

Raspberry Pi P1 Header
Raspberry Pi P1 Header Described by Mosaic Industries

This is the 26 pin I/O P1 Header on the pi. Pin number 1 is closest to the SD card. You can locate the pin 1 copper square by looking at the mirror image on the underside of the raspberry pi.

My next step was to see if I could read an input and an output. Using my jumper cables, I connected Pin 11 to 12 with a 220 Ohm resistor between. (It may be safe, but I just wanted to be careful.)

I then wrote the following code using the command line, creating test.py using the following command:  nano test.py

import RPi.GPIO as GPIO
import time

def toggle(pin1, pin2, input):
GPIO.output(pin1,input)
val = GPIO.input(pin2)
print “%r” % (val)
return

GPIO.setmode(GPIO.BOARD)

outPin = 11
inPin = 12
GPIO.setup(outPin,GPIO.OUT)
GPIO.setup(inPin,GPIO.IN)
toggle(outPin,inPin, True)
toggle(outPin,inPin, False)

GPIO.cleanup()

I then saved the file by typing CTRL-O, then CTRL-X to quit.

From the command line, execute the program by typing sudo python test.py

Adafruit Ultimate GPS Breakout - 66 channel w/10 Hz updates

GPS Board:

The Raspberry Pi outputs 3.3V on pin 1 and 5 V on pin 2 of the P1 Header, while the VIN of the GPS breakout board accepts between 3.3-5 V. In his tutorial, David Taylor connected his GPS board to pin 2, because he wanted to reduce the load on the raspberry pi 3.3 V power regulator.

We’ll be using pins 2, 10, 18, 20 on the raspberry pi to connect to the GPS breakout board.( I’m going to reference pin locations, because I’ve found different naming conventions for GPIOs.) In addition, to make the setup easier, I soldered the break away headers that came with the GPS module into the vias.

CABLE COLOR RASPBERRY PI PIN GPS MODULE PIN
Red 2 +5V 8 VIN
Black 20 Gnd 7 GND
Blue 10 UART RxD 5 TXD
Yellow 24 GPIO 8 9 PPS

I ran into issues trying to install the GPS Daemon, so I updated apt-get with sudo apt-get update && sudo apt-get upgrade

To setup the GPS I followed a tutorial from adafruit. I’ve copied their steps here, because web pages on the Internet are often ephemeral.

To install gpsd, run: sudo apt-get install gpsd gpsd-clients python-gps

Then enter sudo nano /boot/cmdline.txt

change:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

to:

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Then: sudo nano /etc/inittab

Change:

#Spawn a getty on Raspberry Pi serial line
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

to:

#Spawn a getty on Raspberry Pi serial line
#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

Reboot your Pi: sudo reboot

Point the gps daemon to HW UART: sudo gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock

Test the output with: cgps -s

You may have to wait several minutes to lock onto a GPS signal.

NTP:

David Taylor’s blog gives more of the insight into NTP setup, but I’ve summarized the key points here:

$ mkdir ntp
$ cd ntp
$ sudo apt-get install libcap-dev # once-off, required to prevent later file not found error
$ wget http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-dev/ntp-dev-4.2.7p368.tar.gz # development
$ tar xvfz ntp-dev-4.2.7p368.tar.gz
$ cd ntp-dev-4.2.7p368
$ ./configure –enable-linuxcaps # takes 11-15 minutes
$ make
$ sudo make install
$ sudo /etc/init.d/ntp stop
$ sudo cp /usr/local/bin/ntp* /usr/sbin/
$ sudo /etc/init.d/ntp start
$ ntpq -crv -pn # optional step to check for version and basic function
# To configure gpsd to auto-start, enter: $ sudo dpkg-reconfigure gpsd

Three windows will appear, answer with the following:
(1) Device the GPS is attached to: /dev/ttyAMA0
(2) Options to gpsd: -n
(3) Gpsd control socket path: /var/run/gpsd.sock

PPS:

David Taylor provides methods for both kernel-mode PPS and user-model PPS. In an email, he told me kernel-mode is only needed for synchronization below 3 microsecond average jitter. I’m providing his steps for user-model PPS.

$ wget http://vanheusden.com/time/rpi_gpio_ntp/rpi_gpio_ntp-0.3.tgz
$ tar xvfz rpi_gpio_ntp-0.3.tgz
$ cd rpi_gpio_ntp-0.3
$ sudo make install

#To test that you are receiving a PPS on pin 24, exit with CTRL-C
$ sudo rpi_gpio_ntp -g 8 -d

rpi_gpio_ntp v0.3, (C) 2013 by folkert@vanheusden.com

NTP unit: 0
GPIO pin: 8
Fudge : 0.000000000
“Fork into the background” disabled because of debug mode.
1384662324.539383140] poll() GPIO 8 interrupt occurred
1384662325.016712554] poll() GPIO 8 interrupt occurred

# To set NTP to read the PPS from pin 24 (GPIO 8)
$ sudo rpi_gpio_ntp -N 1 -g 8
# Modify the ntp.conf file to the shared memory for GPSD
sudo nano /etc/ntp.conf

Replace these lines below:
server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst

To:

server 127.127.28.1 minpoll 4 prefer
fudge 127.127.28.1 refid UPPS
pool us.pool.ntp.org iburst # For US ntp pool

CTRL-o to save then CTRL-x

Reboot NTP:
$ sudo /etc/init.d/ntp stop
$ sudo /etc/init.d/ntp start

Check that UPPS now shows values in microseconds:
$ntpq -np
================================================================
*127.127.28.1 .UPPS. 0 l 9 16 77 0.000 4.412 8.684

$ntpq -c rv
Autostart:
$sudo nano /etc/rc.local

The line before “exit 0” enter: /usr/local/bin/rpi_gpio_ntp -N 1 -g 8

For the curious, the section under peers in documentation about ntpq explains what the fields are when sending the command ntpq -np

WiFi Direct Access Point:

As I explained earlier, my current setup requires the pi to communicate through a home router. However, for testing it would be beneficial to have the smallest network delay I can manage.

– Richard Latimer (LinkedIn)

Advertisements

AutoIt, Macro Programming, and Why You Should Learn

If I were the head of a Department of Education, I would make AutoIt a mandatory tool learned in every high school. In terms of computer literacy, I’d rank it the most useful tool after Microsoft Office. In high school, I taught myself how to program using AutoIt and then at Rice University I taught a course, MURT 102, on how to use it.

The vision of the AutoIt authors is to make a simple scripting language designed for automating general computer tasks. Introduced in 1998, AutoIt simplified the complicated code and advanced programming skills needed by a user to configuring thousands of PCs to perform automated tasks for a variety of advance applications. Despite the sophisticated features, the BASIC-like programming syntax makes it a wonderful tool for both beginners and advanced programmers.

AutoIt programmers can simulate key presses, mouse movements, and window commands to automate daily tasks. These scripts have access to some of the low-level aspects of hardware such as the CD ejection tray or automated shutdown of the computer. In addition to automation scripting, AutoIt provides the ability to connect to common applications, such as Excel and FireFox, in addition to more advanced tools like SQL. AutoIt takes advantage of the Window’s operating system internal library commands (DLL) to perform these tasks. As an additional feature, programmed scripts can be compiled into a stand-alone executable for computers without an AutoIt interpreter, permitting programs to be instantly used on any computer and run by clicking a custom icon (very useful if you want to create a one-click button to empower your grandmother when she needs to compose a blank email to her best friend). Beyond simple programming syntax, AutoIt has excellent documentation with numerous examples. This documentation is complemented by the helped of the AutoIt community, which is very vibrant, encompassing tens of thousands of users.  By learning the ability to create automation scripts, individuals can be more effective with their time when performing tasks that are manual and tedious.

After learning about AutoIt, I added additional tools to my normal computer routines, which has enabled me to perform certain manual tasks probably 100x faster.  I’ve used it to automate program commands during my internships. I used this language to examine and create logic from text appearing in shipping software, by pixel searching for the text and asking for user-input at a critical decision moment, and then subsequently sending a string of keyboard inputs. I used the language to search 10,000 contacts from different Excel files and merge them together, to a reduced list of 3,000. In addition, this involved Regular Expressions to check for abbreviations and misspellings. I wrote a program that would constantly check the Rice University website for when a student dropped a course and text me so that I could register to enroll. I think these different experiences have provided me with the insight into the important features about AutoIt and why it has gained such as strong and supportive community. Although I own a Mac, I’ve programmed extensively in AutoIt, because the performance I gain from scripting is often too convenient. I’ll continue to buy future versions of the Windows operating system, because AutoIt is a killer application. You won’t know the full power of your PC unless you’ve used AutoIt.

Below I’ve attached the Power Point presentations from my course MURT 102. Although a few computer science students enrolled in my course, my goal was to target students of non-technical majors in a light 1-credit class to teach them programming concepts that would continue to be applicable in a student’s future because the tools learned complemented practical, everyday computer situations. The features I taught students was how one could control mouse movements, open applications, download files, send emails, and manipulate Excel. I hope my course material will provide students with instant gratification and inspire them to dabble in some of the lower-level languages.

Topics Learned:

  1. Week1 – Setup / SciTE Editor – Keyboard Commands: Students will learn to manipulate Excel from the front-end by simulating keyboard commands using the SciTE Editor.
  2. Week2 – For Loops – Mouse Movements: Students will learn to combine mouse movements to read text from the screen and display it in a Msgbox. Students will learn about for-loops and how this enables one to move the mouse in patterns. In addition, students will become familiar with the AutoIT Information Window.
  3. Week3 – Functions and HotKeys: Students will learn how keyboard keys can be tied to commands in a function. In addition, students will learn how to write custom functions used by their programs.
  4. Week4 – If Statements – Opening Applications and Window Manipulation: Students will learn how to request from the operating system different applications and instances of application windows. They will learn to use logic to check if the correct windows were discovered.
  5. Week5 – Debugging, Console Writing, PixelSearching: Due to the complexity of the code, students will learn how to debug their programs using the SciTE editor, Msgbox, and Tabtoolbars. In addition, students will learn a fast way of searching for text that does not involve mouse movements by pixel searching. They will use pixel searching to play an online game.
  6. Week6 – Arrays -String Manipulation: Students will learn how to process text content with a combination of string functions.
  7. Week7 – Using the Forum – Regular Expressions – UDFs and Downloading Web Content: Students will be introduced to the AutoIt community forum and the more advanced topic of string manipulation through Regular Expressions. Students will be introduced to User Defined Functions and the UDF needed for downloading web content.

A list of relevant links for learning more about AutoIt:

– Richard Latimer (LinkedIn)

What is HTML5?

What better way to start this collaborative blog than recap an article I posted to Connexions, the open-license educational content website. I’d say I was 90% correct in my predictions. Smartphone traffic is booming, with Facebook’s recent announcing 41% of revenue comes from mobile ads and 71% of monthly users are mobile users (Marketing Charts Source). I heard that a while back, Facebook posted an article stating that HTML5 allowed them to rapidly enter the mobile market, they decided to rebuild in native code to gain a performance boost. Perhaps an open standard benefits a company more like YouTube, where 40% of YouTube traffic was reported to come from mobile, because a YouTube video can be embedded in various websites, unlike Facebook which exists in a closed environment.

Rather than pointing on my successful predictions, I’ll point out my surprises. I’m surprised we are still using Flash, I couldn’t find statistics, but I have to keep it enabled to make my web experience on a desktop browser work correctly. Although my mother loves her Chromebook, this technology hasn’t really taken off, perhaps the Android OS is simple enough for the needs of tech neophytes and we don’t need a browser based operating system at the moment. Although I had though Adobe might focus purely on their own toolbox for HTML5 applications and built around the IDE used for creating Flash projects, they acquired PhoneGap. Unfortunately, using a cross-platform framework, such as Phonegap, is still too slow for many developer needs, with Adobe warning you that slow performance may get your app rejected from the Apple App store. Despite these surprises, I think we live in a rather exciting, more beautiful web. Has anything surprised you?

-Richard Latimer (LinkedIn)

Original article follows…

Summary: Twenty years ago, few people would have been able to predict the revolutionary and ubiquitous role of the Internet. The Internet evolved from a web of linked documents to an environment with a growing number of online applications. HTML5 is the next jump in this evolution, as the current web is unable to satiate the needs of businesses and consumers. Within the next year, browsers will support, without the aid of plug-ins, internal video players, graphic animations and local storage. Within a few years, browsers will provide support for multi-threaded applications and real-time communications. Because of HTML5, the Internet community will change in a few pivotal ways. Plug-in developers, such as Adobe, will shift their development tools from being closed platforms for plug-ins, to tools for creating a variety of applications from iPhone apps to HTML5 enabled applications. Consumers will increasingly check the web from mobile phones rather than computers. When not accessing the web from a phone, consumers will use their laptop to perform primary tasks, such as typing documents straights through a web application. HTML5 will have a significant impact on the modern world and is playing a major role in the push towards making online the primary personal computing environment.

HTML5: The Era of Rich Internet Applications and Multimedia

HTML5 at a glance on April 18th, 2011.

Introduction

Improved usability of the web is due to many innovative technologies and standards, such as HTML, JavaScript, and AJAX. Perhaps the most exciting buzzword mentioned in today’s news is HTML5, an amalgamation of web concepts being implemented natively in browsers. As the next major revision in the Hyper Text Markup Language family, HTML5 is bringing big changes to online openness, flexibility, and increased computational power. Since the last HTML revision in 1997, demands on the Web have continued to climb, reaching a tipping point in the need for a new standard.

ARPANET, the Advanced Research Projects Agency Network, appeared as the world’s first operational packet switching network in October 1969. The first computer network connected System Development Corporation in Santa Monica, UC Berkeley, and MIT. The first message sent was “login”; however, after sending “l” and “o” the system crashed. Despite this hiccup, ARPANET would lay the foundation for the Internet, an international computer network connecting billions of users. Starting at birth, the Internet was dominated by hypertext documents and email. The origins of the modern Internet began in 1980, when Tim Berners-Lee envisioned and proposed a Hypertext Markup Language for the Internet, because he saw the web as a collection of text documents that could be accessed by clicking links in the document. By 1990, Tim Berners-Lee had created both the client and browser software designed for HTML 1.0. However, the opportunity and advantages of HTML for consumers and businesses were not realized until the first commercial web browser, Mosaic. Mosaic provided the web with new functionality, such as providing a graphical user interface, GUI, and supporting images inline with text instead of a separate window. Future web browsers would adopt these features introduced by Mosaic. Because Mosaic browser’s GUI expanded the web to less technical users and created new flexibility, the demands of the web increased, causing new innovation and syntax improvements with the release of HTML 2.0 towards the end of 1995. During this time, support for Mosaic was dropped in 1997 when the development team released Netscape Navigator packaged with JavaScript, through a partnership with Sun Microsystems. JavaScript allowed client-side scripting, which permitted dynamic interaction with web pages, although it did not have the look and feel of a desktop application.

During this time period, both computer experts and businessmen kept their eye on the growth of the Internet. One technical entrepreneur, Bill Gates, was no exception. On May 26, 1995, Bill Gates sent the “Internet Tidal Wave” memorandum to Microsoft executives, describing the importance of the Internet and Microsoft’s failure to realize the significance. Microsoft had a new product, Internet Explorer browser, and now had a new competitor, Netscape Navigator. Between the time of this memo and the pinnacle of Internet Explorer’s dominance in 2002 with 95 % of the browser share, Microsoft would create many innovations instrumental to the web, albeit outside the traditions standards of the World Wide Web Consortium. In 1996, Microsoft introduced ActiveX controls, which enabled programs written by third parties to be embedded into different applications. In hindsight, ActiveX demonstrated the first attempt at turning the web into an environment of applications. When released, ActiveX was praised for its flexibility and integration between applications. The web now supported executable programs, causing new innovation, such as video chat straight through the browser. Unfortunately, ActiveX faced two criticisms that hampered its adoption into mainstream computing. First, it only provided support for the Windows platform, although this had less of an impact when Windows traditionally had over 90% of the personal PC platform. The second and greater criticism involved new issues regarding security flaws and malicious code. Because ActiveX was extremely flexible and programs executed automatically, Microsoft had inadvertently created a malicious hacker’s playground. Before Microsoft could fix the code (and indirectly its reputation) that would have made ActiveX a critical technology in the web, the online world shifted to new technologies that would replace the role envisioned for ActiveX.

In 1998, the last recent major HTML specification, HTML 4.0, was released. It introduced cascading style sheets, multimedia options, and created a more advanced paradigm for designing web pages. In addition to a new design paradigm, the web would become dynamic when Microsoft introduced the XMLHTTP request as an ActiveX object in 1998. In the past, new content could only be accessed if a web page were refreshed. The XMLHTTP request allowed dynamic delivery of new content, removing unnecessary page reloads. Although originally this request was designed for Internet Explorer, the Mozilla Firefox team recognized the value of this command and reverse engineered the protocol, subsequently releasing their own version, the XMLHttpRequest in 2002. With a method for sharing information dynamically, the web was ready to blossom on top of an amalgamation of web technologies bundled under the collective acronym, AJAX.

AJAX, Asynchronous JavaScript and XML, is a group of web technologies for creating interactive web applications. Previous attempts at web applications, such as Java applets, had not taken off, because of their inability to retrieve information from a server in the background. In AJAX, JavaScript and the XMLHttpRequest object provide a method for retrieving data asynchronously between the browser and client, avoiding page reloads. This first mainstream application to take full advantage of AJAX was Google Maps. Previously, if one went to Map Quest, each map action, such as zooming or panning, required the entire page to load. Through AJAX, Google created a map application that had smooth scrolling, creating an attractive, simple, and popular application. With the power of AJAX clearly demonstrated, many new web applications began to take advantage of the full capabilities of AJAX.

Within a few years, companies were creating web applications that were pushing the outer-limits of browser native technologies. Programmers needed new techniques that provided more flexibility without the complication of merging different technologies. Shifts in consumer behavior caused a huge growth in online multimedia and high bandwidth technologies. For example, YouTube, an online video-sharing platform, in 2007 consumed as much bandwidth as the entire Internet in 2000. New demands are appearing for instant streaming services, such as VOIP, which will soon overtake bit-torrents, a file-sharing protocol.

Because of the need for multimedia and graphics not addressed by HTML, plug-ins, such as Flash and Silverlight, became the solution. Introduced in 1996, Flash captured 99% market penetration by June 2010, mainly by providing the backbone for sharing video content and displaying banner advertisements. In response to Flash, Microsoft created its own plug-in solution, Silverlight, which was less bloated and more secure compared to Flash. Both Adobe and Microsoft created sophisticated design tools for creating web applications that provided a graphical approach to designing animation and web apps.

Despite the capabilities of plug-ins, the web community desires to become less reliant on plug-ins. This is due partially to an online culture that prefers to support open-source technologies and depend on standards not controlled by companies like Adobe or Microsoft. Because plug-ins act as a layer on-top of browsers, an environment in an environment, they cannot fully integrate seamlessly into a web application. As a precaution against security vulnerabilities, plug-ins are allocated particular sections of a web-page and cannot interact outside that box. Because the environments are enclosed, two separate plug-in sessions cannot easily communicate and can only due so through a roundabout method for sharing data. In addition, due to the closed environment nature, plug-ins cannot easily interact with core data displayed in the rest of the web page. Finally, plug-ins theoretical performance is poorer than native code, since they are an abstraction above the core browser. For example, until recently, Flash was unable to perform hardware acceleration, because Apple did not allow third-party systems to gain complete access to the GPU until the release of Mac OS X 10.6.3. After Apple released the upgrade, Adobe announced Flash would be 30 times more efficient due to hardware acceleration.

For the above reasons, major leaders of web technologies are hoping to reduce the role of plug-ins, because plug-ins have a limitation to their efficiency and are a main cause of browser crashes and vulnerabilities. Realizing the need for a major upgrade to web standards, the W3C, led by Tim Berners-Lee, began working on a new draft for the next generation of HTML. Looking back, he saw how the web had performed many things well and others poorly. With the best intentions of improving the web for the future, Berners-Lee decided it was time to cease development of HTML and transition to a new robust, efficient, and more secure mark-up language, XHTML. XHTML promised many things, such as being more “future-proof” for future revisions, increase data-transfer, and more structure for programmers, preventing bad code. Unfortunately, because XHTML was not backwards compatible and not forgiving of programming mistakes, it proved to be a nightmare for web developers, who had already invested heavily in HTML.

The pedantic and ridge nature of XHTML caused disagreement among members of the W3C and its industry partners. This division was made apparent when programmer Ian Hickson proposed the W3C bring back ordinary HTML in 2004. Although the measure was voted down 11 to 8, it showed that individuals who backed Hickson’s proposal had one thing in common; they represented the companies Apple, Microsoft, and Mozilla that created web browsers. While the W3C continued to work on XHTML, the Mozilla, Apple, and Opera announced two days later that they would begin working on their own web standard, HTML5. By the end of 2006, Tim Berners-Lee, admitting defeat, agreed to collaborate with the rebels to create “one of the crown jewels of Web technology.”

Present

HTML4, AJAX, and plug-ins set the precedent and answered what industry and consumers desired from the web. HTML5, on the other hand, is about to simplify many complex methods of the past, creating a new foundation for innovation. Although the standard is extremely verbose, the details can be reduced to five categories: video and audio, graphics, local storage, threads, and communication.

Audio/Video Formats:

Previously, displaying audio or video online was a complex process, possible only with plug-ins. If one wanted to embed video on a site with Flash, one needed an FLV, MP4, or F4V file that contained the content of the video. The player module for interacting with the video was programmed with a SWF file. Both files had to be uploaded and embedded into the website. In HTML5, the player module is pre-built, allowing a programmer to access the player module directly. If a different element, such as automatic play, needs to be added to the player module, this can by specified by a control in the HTML5 video tag. More advanced features can be implemented using JavaScript. This saves considerable time in comparison to modifying the Action Script in an SWF file, because the code needed for a player module is simple and efficient. In addition, HTML5 supports open video and audio formats such as Ogg. This is important, because in the future videos may not need to be converted to propriety standards for sharing.

Graphics:

Besides video and audio formats, HTML5 is about to capture the limelight for animation with the introduction of the canvas element. This element will expand HTML’s ability to provide games, utility tools, and applications through scriptable 2D shapes and bitmap images. Similar to how images are included on a webpage, a canvas element is allocated a location, specified by its width, height, and ID. Each canvas element, specified by its ID, is designed with a grid layout, where the top right corner is the origin, moving to the right is the positive x offset, and moving down is the positive y offset. All drawings are created and modified using JavaScript. A prime example of the new capabilities provided by the canvas element is the Bouncing Browser Ball from Chrome Experiments. This example demonstrates the ability for separate sessions in different browser windows to act seamlessly as a ball is drag, dropped, and thrown through separate browser windows. The native integration of the graphics, removes the environment in an environment predicament, which caused unique session interaction to be difficult and slow when performed by plug-ins.

Local Storage:

With new graphics capabilities, applications will need new methods for storing information locally. Previously, local information was stored in a cookie, a piece of text file with a maximum size of 4 kilobytes. Cookies were passed on every request to the server, making it very slow and inefficient for large amounts of data. With HTML5, data can now be organized as tables, stored without limitations on size, and passed only when requested. For those unfamiliar with databases, this change is similar to the difference between storing data in a text file versus storing data in Excel Spreadsheets. Similar to cookies, data can be stored either without a time limit or just within a session. In HTML5, data can be accessed by two methods. Data can be stored either by its particular variable name or through SQL statements, allowing different variables and variations to be grabbed at once.

The benefits of local storage are particularly relevant as the world migrates more and more to wireless and mobile communications. A popular scenario shared among HTML aficionados is about an individual, named Alice, composing an email from her smartphone on a train. During the trip from one point to another point, the train enters multiple wireless dead zones. Unknowingly, Alice clicks to send her email when the train enters a wireless dead zone and her email is not sent. Luckily, behind-the-scenes, this email is kept in local storage and sent during the next area of connection. This success story doesn’t end yet. During the trip, the email client intelligently downloaded in the background the contents of other emails Alice might want to check. Alice has the ability to access her inbox and send multiple emails, despite being in a dead zone. This is just one possible future application of local storage and undoubtedly many innovative solutions will leverage local storage.

Threads:

Web workers is the Internet’s answer to multi-threaded client-side scripts. Web Workers permit JavaScript to run in parallel in the background, without blocking the user interface. Previously, in order to achieve any sort of computation using JavaScript, a programmer would have to break jobs up into tiny chunks and split their execution apart using timers. With web workers, a worker is a script that is loaded and executed in the background. Workers have many interesting applications, such as new methods for changing dynamic content, processing data, and uploading files.

Communication:

HTML5 will introduce efficient data transfer algorithms, providing the backbone for real-time communication. The main innovation for improved data transfer is web sockets. Web sockets provides bi-directional communication with less overhead. Overhead is reduced, because the HTTP header is not sent every time data is request. Initially, the browser and server have a handshake that creates a connection. Once a connection is made, data can now be transferred with minimal overhead.

Ever vigilant about security, the latest implementation of web sockets in browsers has been scratched, because of a security issue in the protocol for web sockets. However, web sockets will be included once a stable secure version is designed. In addition, the W3C should soon provide a definition for how HTML5 will facilitate real time communications. Browsers will have native support for live audio and video capture without having to rely on plug-ins. This will require the standards committee to address the protocols for interactive with device drivers such as a webcam.

Future

All major industry leaders are supporting HTML5 and its features are being quickly adopted into web browsers. Originally forecasted to be finished in 2022, industry has accelerated this timeline and recently announced a new completion date circa 2014. Advancing the date by eight years demonstrates the desire, commitment, and enthusiasm for the technologies of HTML5.

In a few years, the major browser will implement 99% of the HTML5 standard. At the present, the majority of browsers support 80% of this standard. In addition, because of new web capabilities, the major browsers may introduce features not originally envisioned for the standard. For example, almost all future browsers will include geolocation. The impact of smartphones has created a new need for different technologies. Geolocation uses a combination of the GPS built in smartphones or IP address to determine the physical location of an individual within a range of accuracy. New technologies are the genesis of newer technologies. HTML5 is motivating the developers of web browsers to create new technologies outside the HTML specification.

Impact on Smartphones:

Due to the lack of plug-in support on certain smartphones such as the iPhone, HTML5 is filling in the void for consumer desires for Flash-like applications. Due to demand, many media content websites have already switched to HTML5 video formats. Future versions of HTML may create pressure towards replacing the role of mobile apps. App developers, faced with the daunting task of creating compatible programs for a diversification of smartphone operating systems, such as Android, Windows Phone 7, iOS (iPhone OS), Blackberry OS, may turn to the web for creating applications.

Plug-in Developers:

Besides impacting the future of the role of PCs and smartphones developers, HTML5 will cause plug-in developers to shift strategy. At first glance, one might assume that Adobe and Microsoft should worry, because HTML5 means the days of Flash and Silverlight are numbered. Fortunately for Adobe, many consumers of mobile technology can still be accessed due to support for Flash through the Android operating system. Despite limited mobile support, in the near term, we are more likely to see a hybridization of HTML5 and plug-ins. Both Flash and Silverlight provide interesting advanced features that may not appear for another generation or two of the HTML standard. This includes P2P support, deep zoom technology, and some limited DRM support. However, these advanced features may be created natively by combining the technologies of HTML5.

Despite the strong support for Flash on both computer and mobile browsers, Flash’s days may be numbered. This is not necessarily a disadvantage for Adobe and Microsoft, because the tools for developing their plug-ins are extremely sophisticated and if these tools were expanded to HTML5, these companies would still have exciting economic opportunity. New tools from Adobe appear to demonstrate their openness to this option. Adobe announced their next release of Adobe Creative Suite (which encompasses Photoshop, Acrobat, and InDesign) will enable designers to create content using HTML5 and CSS3. Perhaps with the next release, Photoshop will have an export ability for images to be shared as canvas elements, in addition to scalable vector graphics. Beyond tools for image creation, Adobe is hinting at stronger support for HTML animation, which may one day be included in their Flash Professional Developer application. Adobe just released a beta application, Wallaby, the name for Adobe’s experimental Flash to HTML5 converter. Although not all aspects of the FLA file are converted, users get the benefits of graphics and overall design converted to HTML. Subsequently, they can connect the pieces using JavaScript.

Web Operating System:

HTML5 hints at the possibility of a time when the web may be the primary computing environment for everyday consumers. With new capabilities and constant Internet connection, computers will merge the personal computer and web computing. Although never advancing past the concept stage, WebOS was a 1999 start-up, which contained a talented team of HTML and JavaScript programmers. WebOS was the first operating system to create desktop-like web apps. The WebOS API worked at fast speeds by caching large amounts of code in the local browser.

Learning from research on the WebOS, many industrial giants began working on their own web operating systems. From a study on web operating systems, Palm, later acquired by HP, would replace the Palm OS with a web-based operating system now branded as the HP WebOS. In February of 2011, HP released smartphones based on the HP WebOS. The WebOS has been praised for its integration with web technologies, which includes advanced syncing capabilities. A major feature is their Synergy service, which is a basic account manager originally for email or instant messaging. Synergy is now open to third parties by a new API, enabling connections to Photobucket, YouTube, and LinkedIn accounts. Another interesting feature is “Just Type”, which creates a merged search of multiple search engines. HP plans to integrate device drivers with all their future products connecting printing from the web to other devices.

Although some in industry are working on merging the web and the desktop experience, some industry experts believe is it possible to make the Internet the only operating system. Google has developed the Chromium OS, which takes a minimalist approach to the operating system, resembling the Google Chrome web browser without a desktop environment. Due to the minimalist style in both hardware design and software, the laptop is able to boot up extremely fast. Although some argue a pure web based OS may not yet be ready for mobile primetime, because cloud computing is a painful experience at current cellular speeds, the introduction of LTE will permit 5- 12 Mbit/s connection, which is 10x the rate of 3G connections and satisfies the need of online streaming. Theoretically, LTE can be made to go 10x faster. In the near-term, Google Chromium OS may be marketed as a secondary devices for connecting to the web, rather than a user’s primary PC. As the capabilities of the web become more advanced, a web-based operating system may become the main primary laptop of the average user. Similar to HP’s plans to provide printing support, Google plans to create a service called Google Cloud, which will allow any web application to connect to any printer.

Conclusion

Twenty years ago, few people would have been able to predict the revolutionary and ubiquitous role of the Internet. The Internet evolved from a web of linked documents to an environment with a growing number of online applications. HTML5 is the next jump in this evolution, as the current web is unable to satiate the needs of businesses and consumers. Within the next year, browsers will support, without the aid of plug-ins, internal video players, graphic animations and local storage. Within a few years, browsers will provide support for multi-threaded applications and real-time communications. Because of HTML5, the Internet community will change in a few pivotal ways. Plug-in developers, such as Adobe, will shift their development tools from being closed platforms for plug-ins, to tools for creating a variety of applications from iPhone apps to HTML5 enabled applications. Consumers will increasingly check the web from mobile phones rather than computers. When not accessing the web from a phone, consumers will use their laptop to perform primary tasks, such as typing documents straights through a web application. HTML5 will have a significant impact on the modern world and is playing a major role in the push towards making online the primary personal computing environment.

Work Cited:

Johnson, Bobbie. “The Web is Reborn.” Nov 2010: n. pag. Web. <www.technologyreview.com/web/26565/>.

“Answers for Young People.” W3C. N.p., n.d. Web.

<http://www.w3.org/People/Berners-Lee/Kids&gt;.

Longman, Wesley. “Answers for Young People.” W3C. Web. <http://www.w3.org/People/Raggett/book4/ch02.html&gt;.

Bellis, Mary. “ARPAnet – The First Internet.”About.com. Web. <http://inventors.about.com/library/weekly/aa091598.htm&gt;.

Tomlinson, Ray. “The First Network Email.” Web. <http://openmap.bbn.com/~tomlinso/ray/firstemailframe.html&gt;.

Berners-Lee, Tim. “A Brief History of the Web .” Web. <http://www.w3.org/DesignIssues/TimBook-old/History.html&gt;.

Berners-Lee, Tim. “Frequently asked questions.” Web.

<http://www.w3.org/People/Berners-Lee/FAQ.html&gt;.

“The History of Netscape Navigator.” Web.

<http://www.webhostingreport.com/learn/netscape-navigator.html&gt;.

Gates, Bill. “The Internet Tidal Wave.” Message to Executive Staff. 25 May 1995. E-mail.

“A history of Internet Explorer.” Web.

<http://windows.microsoft.com/en-US/internet-explorer/products/history&gt;.

“Microsoft’s Internet Explorer global market share .” 2002. Web. <http://www.onestat.com/html/aboutus_pressbox15.html&gt;.

“ActiveX.” Web. <http://www.techiwarehouse.com/engine/ab5ce018/ActiveX-Tutorial&gt;.

“Google to Challenge Microsoft With Operating System.” Web. <http://www.bloomberg.com/apps/news?pid=newsarchive&sid=aTd2k.YdQZ.Y&gt;.

“HTML 4.0 Specification.” Web. <http://www.w3.org/TR/1998/REC-html40-19980424/&gt;.

“Ajax Tutorial (Asynchronous Javascript + XML).” Web. <http://www.xul.fr/en-xml-ajax.html&gt;.

Garrett, Jesse. “Ajax: A New Approach to Web Applications.” 18 Feb 2005. Web. <http://www.adaptivepath.com/ideas/e000385&gt;.

Friesen, Jeff. “Are applets making a comeback?.” 5 May 2008. Web. <http://www.javaworld.com/javaworld/jw-05-2008/jw-05-applets.html&gt;.

Carter, Lewis. “Web could collapse as video demand soars.” 07 Apr 2008. Web. <http://www.telegraph.co.uk/news/uknews/1584230/Web-could-collapse-as-video-demand-soars.html&gt;.

Waldron, Rick. “The Flash History.” 20 Nov 2000. Web. <http://www.flashmagazine.com/news/detail/the_flash_history/&gt;.

“Flash Player Version Penetration.” Web. <http://www.adobe.com/products/player_census/flashplayer/version_penetration.html&gt;.

Naone, Erica. “Steve Jobs Unleashes Harsh Criticism of Flash.” 29 Apr 2010. Web. <http://technologyreview.com/blog/editors/25119/&gt;.

Lawson, Bruce, and Remy Sharp. Introducing HTML5. Berkeley, CA: New Riders, 2011. Print.

David, Matthew. HTML5 : designing rich Internet applications. Boston: Focal Press, 2010. Print.

“Adobe CEO dismisses Steve Jobs’ comments on Flash as a ‘smokescreen’.” 29 Apr 2010. Web. <http://www.appleinsider.com/articles/10/04/29/adobe_ceo_dismisses_steve_jobs_comments_on_flash_as_a_smokescreen.html&gt;.

“Adobe Flash Player 10.2 offers improved hardware acceleration for Mac.” 09 Feb 2011. Web. <http://www.appleinsider.com/articles/11/02/09/adobe_flash_player_10_2_offers_improved_hardware_acceleration_for_mac.html&gt;.

“Apple opens hardware acceleration for Flash, other third party software.” Web. <http://www.neowin.net/news/apple-opens-hardware-acceleration-for-flash-other-third-party-software&gt;.

“Creating and Playing FLV Videos in Flash.” Web. <http://www.republicofcode.com/tutorials/flash/video_flvplayback/&gt;.

Pilgrim, Mark. “No 5 Video on the Web.” Web. <http://diveintohtml5.org/video.html&gt;.

Niemann, Christoph. “20 Things I Learned About Browsers and the Web.” Web. <www.20thingsilearned.com>.

Mahoney, Mark. “Browser Ball.” 4 Mar 2009. Web. <http://experiments.instrum3nt.com/markmahoney/ball/&gt;.

“Canvas tutorial.” Web. <https://developer.mozilla.org/en/canvas_tutorial&gt;.

Fleeting, James. “Working with HTML5 localStorage().” May 2010. Web. <http://html5tutorial.net/tutorials/working-with-html5-localstorage.html&gt;.

Resig, John. “Computing with JavaScript Web Workers.” 21 Jul 2009. Web. <http://ejohn.org/blog/web-workers/&gt;.

“What is WebSocket?.” Web. <http://websocket.org/&gt;.

Heilmann, Chris. “WebSocket disabled in Firefox 4.” 8 Dec 2010. Web. <http://hacks.mozilla.org/2010/12/websockets-disabled-in-firefox-4/&gt;.

Web. <http://slides.html5rocks.com/&gt;.

Mani, Aditya. “Video Conferencing with the HTML5 Device Element.” 20 Sep 2010. Web. <http://ajaxian.com/archives/video-conferencing-with-the-html5-device-element&gt;.

Block, Steve, and Noam Ben Haim. “The Blue Circle Comes to Your Desktop.” 09 Jul 2009. Web. <http://google-latlong.blogspot.com/2009/07/blue-circle-comes-to-your-desktop.html&gt;.

“Top Silverlight Features.” Web. <http://www.microsoft.com/silverlight/features/&gt;.

James, Justin. “HTML 5 Editor Ian Hickson discusses features, pain points, adoption rate, and more.” 27 Aug 2008. Web. <http://www.techrepublic.com/blog/programming-and-development/html-5-editor-ian-hickson-discusses-features-pain-points-adoption-rate-and-more/718&gt;.

“W3C Confirms May 2011 for HTML5 Last Call, Targets 2014 for HTML5 Standard.” 14 Feb 2011. Web. <http://www.w3.org/2011/02/htmlwg-pr.html&gt;.

Fenton, William. “Adobe Creative Suite 6 to Include New HTML5 Tool, Survey Says.” 24 Jan 2011. Web. <http://www.pcmag.com/article2/0,2817,2376164,00.asp&gt;.

Dove, Jackie. “Adobe Launches Flash-to-HTML5 Conversion Tool.” 24 Jan 2011. Web. <http://www.pcworld.com/businesscenter/article/221578/adobe_launches_flashtohtml5_conversion_tool.html&gt;.

Battelle, John. “All the world’s a platform.” 29 Sep 2005. Web. <http://www.guardian.co.uk/media/2005/sep/29/digitalmedia.technology1&gt;.

Business Wire, “Veteran Netscape Exec Joins My Web.” Print.

“Overview of HP webOS.” Web. <https://developer.palm.com/content/index.php?id=4292&gt;.

Topolsky, Joshua. “webOS 2.0 review.” 19 Oct 2010. Web. <http://www.engadget.com/2010/10/19/webos-2-0-review/&gt;.

Sullivan, Danny. “First Day Review: The Google Chrome OS Cr-48 Notebook.” 09 Dec 2010. Web. <http://searchengineland.com/first-day-review-the-google-chrome-os-cr-48-notebook-58322&gt;.

Stokes, Jon. “Google talks Chrome OS, HTML5, and the future of software.” Jan 2010. Web. <http://arstechnica.com/business/news/2010/01/chrome-os-interview-1.ars&gt;.

Womack, Brian. “Google to Challenge Microsoft With Operating System.” 08 Jul 2009. Web. <http://www.bloomberg.com/apps/news?pid=newsarchive&sid=aTd2k.YdQZ.Y&gt;.

Goldman, David. “4G won’t solve 3G’s problems.” 29 Mar 2011. Web. <http://money.cnn.com/2011/03/29/technology/4g_lte/&gt;.

Odean, Tyler. “Cloud Printing on the Go.” 24 Jan 2011. Web. <http://googlemobile.blogspot.com/2011/01/cloud-printing-on-go.html&gt;.