Monday, July 4, 2016

Why the Internet of Things Still Has a Long Way to Go

The Internet of Things (IoT) doesn't exactly boast a reassuring name. Especially the "Things" part. That sounds to me as if we still haven't completely figured out what IoT is all about. Even though we have made good progress on this journey compared to 2 years ago, I still have a hard time explaining to non-technical people what the Internet of Things is.

However, far more problematic is the fact that many people do believe they understand what the IoT is about, yet they miss the bigger picture. The Internet of Things is not something to be compared with emerging technologies like virtual or augmented reality. The IoT is real. Any bugs in this technology can have serious implications in the real world. Together with the rise of artificial intelligence, this duo could bring about a dangerous combination.

There are many reasons we should not treat the IoT like any other emerging technology. While Terminator has brought the dangers of AI into pop culture, it will not be surprising if the same happens with the IoT very soon.

Before getting overly enthusiastic about the vast possibilities of the IoT space, let's have a closer look at the dangers of it.

Internet of Unsecure Things

While bugs can break software and render it useless in a worst case scenario, implications in the IoT space are far more serious. What if a flaw in your new shiny connected thermostat accidentally drops your home's temperatures rather than increasing them in winter, bursting water pipes in your home? How about connected IoT light bulbs turning on in the middle of the night awakening you from your well-deserved sleep? These scenarios might sound absurd, but they are real possibilities.

Medicine is sensitive territory here. Where medicine and bleeding edge tech meets it is hard not to see the potential dangers. A woman who receives a heart pacemaker with wireless capabilities could create a vulnerability in her very own body for hackers to access and misuse — hackers could hold her life in their hands.

With IFTTT already offering many IoT features to the masses (we've covered IFTTT a few times here at SitePoint!), the digital world and the physical world are already moving much closer together. Under such circumstances, it makes sense to raise concerns for security measures on connected devices, as implications could be way more severe than any old fashioned software bug.

Continue reading %Why the Internet of Things Still Has a Long Way to Go%


by Elio Qoshi via SitePoint

An Introduction to Android Firmware

Android phones and tablets are generally a lot more open than their counterparts running operating systems such as iOS, Tizen, or Windows 10 Mobile. If you don't like the firmware the device manufacturer has installed on your Android device, you are free to replace it with your own custom firmware. CyanogenMod, Paranoid Android, and the Pure Nexus Project are examples of custom firmware that enjoy a lot of popularity among Android users.

Custom firmware is also the only way you can install newer versions of Android on devices that are no longer supported by their manufacturers. Unless you own a device that belongs to the Nexus or Android One series, I'm sure you knew that already.

In this article, I help you understand what Android firmware really is and how an Android device uses it. I also introduce you to the tools you can use to replace a device's firmware.

A Word of Caution

Replacing firmware is a risky operation that can potentially make your device unusable. In most cases it also voids your device's warranty. Make sure that you have a backup of your data and a copy of your device's factory image handy before you go ahead and experiment with flashing custom firmware.

1. What Is Android Firmware?

Originally, firmware was a term used to refer to tiny, mission-critical programs installed in the read-only memory, or ROM, of an electronic device. Modifying firmware was either impossible or required special equipment that was usually out of the reach of ordinary end users.

Android firmware, however, is very different. It includes the entire Android operating system and it is stored in a writable form of memory called NAND flash memory, the same type of memory that is used in storage devices, such as USB sticks and SD cards. The word firmware is used only because device manufacturers didn't bother to come up with a new word for it.

Android firmware is also often referred to as Android ROM because, by default, it is not possible for users to directly write to it.

2. What Does Android Firmware Contain?

Firmware installed on an Android device by its manufacturer contains a build of the Android operating system and two additional closed source programs that are usually irreplaceable, a bootloader and radio firmware.

Understanding Bootloaders

An Android bootloader is a small piece of proprietary code that is responsible for starting the Android operating system when an Android device is powered on. However, the bootloader almost always performs one more task. It checks if the operating system it is starting is authentic.

How does it decide what is authentic? It checks if the boot partition has been signed using a unique OEM key, which is short for Original Equipment Manufacturer key. The OEM key, of course, belongs to the device manufacturer, is private, and there is no way you can know what it is.

Because of the authenticity check, you cannot directly install a custom ROM on an Android device. Thankfully, these days, most device manufacturers allow users to disable the check. In Android jargon, they allow users to unlock the bootloader.

The exact procedure you need to follow in order to unlock the bootloader depends on your device. Some manufacturers, such as Sony and HTC, expect you to provide a secret unlock token. Others just expect you to run a fixed set of commands using a terminal.

Usually, a tool called fastboot, which is a part of the Android SDK, is used to run the unlock commands. For example, if you own a Nexus device, you can unlock its bootloader by running the following command:

You learn more about fastboot later in this article. Note that, if you own a device that has a bootloader that cannot be unlocked, there is no easy way for you to modify or replace its firmware.

Understanding Radio Firmware

It might come as a surprise to you, but your Android smartphone actually runs another operating system on an independent processor called a baseband processor. Radio firmware refers to the operating system that runs on the baseband processor.

Usually, it is an RTOS, which short for real-time operating system, and is responsible for managing the cellular radio capabilities of the device. In other words, it is what allows your device to make calls and connect to the internet using wireless technologies such 2G, 3G, and 4G LTE.

The RTOS is a proprietary piece of code and popular baseband processor manufacturers, such as Qualcomm, MediaTek, and Spreadtrum, make sure that its internal workings stay a secret. The Android operating system usually communicates with the RTOS using sockets and callbacks.

Generally, it is not a good idea to replace the radio firmware of your device.

Understanding Android Builds

The Android build is the only part of the firmware that is created from open source code. Consequently, this is the only part that you can modify and extend. When you hear Android enthusiasts say "I flashed a new ROM on my device", you can be sure that they are talking about a new Android build.

An Android build is usually shared in the form of a ZIP file that can be used by fastboot. It has the following contents:

android-info.txt is a text file specifying the prerequisites of the build. For example, it could specify the version numbers of the bootloader and the radio firmware that the build needs. Here is a sample android-info.txt file:

boot.img is a binary file that contains both a Linux kernel and a ramdisk in the form of a GZIP archive. The kernel is a boot executable zImage that can be used by the bootloader.

The ramdisk, on the other hand, is a read-only filesystem that is mounted by the kernel during the boot process. It contains the well known init process, the first process started by any Linux-based operating system. It also contains various daemons such as adbd and healthd, which are started by the init process. Here is what the directory tree of the ramdisk looks like:

system.img is the partition image that will be mounted on the empty system directory you can see in the above tree. It contains the binaries required for the Android operating system to run. It includes the system apps, fonts, framework JAR files, libraries, media codecs, and more. Obviously, this is the file Android users are most interested in when they flash a new ROM.

The system image is also the file that makes most Android users develop an interest in flashing custom firmware. System image files provided by device manufacturers are often full of unnecessary apps and customizations, informally called bloatware. The only way to remove the bloatware is to replace the manufacturer's system image with a more desirable system image.

userdata.img is a partition image that will be mounted on the empty data directory you can see in the ramdisk directory tree. When you download a custom ROM, this image is usually blank and it is used to reset the contents of the data directory.

recovery.img is very similar to boot.img. It has a boot executable kernel file the bootloader can use and a ramdisk. Consequently, the recovery image too can be used to start an Android device. When it is used, instead of Android, a very limited operating system is started that allows the user to perform administrative operations, such as resetting the device's user data, installing new firmware, and creating backups.

The procedure you need to follow in order to boot up using the recovery image is device specific. Usually, it involves entering the bootloader mode, also called fastboot mode, by pressing a combination of hardware keys present on the device, and then selecting the Recovery option. For example, on a Nexus device you need to press and hold the power button in combination with the volume down button.

Alternatively, you can use adb, a tool included in the Android SDK, to directly enter recovery mode.

3. Using fastboot

The easiest way to flash new firmware on your device is to use the fastboot tool. fastboot follows the fastboot protocol to communicate with an Android device. However, it can only do this when the device has been started in fastboot mode. The quickest way to enter fastboot mode is by using adb:

To flash a custom ROM that is available in the form of a ZIP file containing all the image files I mentioned in the previous section, you can use the fastboot update command. For example, here is how you would flash a ROM present in a file called update.zip:

If you want to flash only a specific image, you can do so using the fastboot flash command. For example, here is how you would flash only the system image:

Similarly, if you want to replace only the boot image, you would use the following command:

It is always a good idea to test if a boot or recovery image is working before actually flashing it to your device. To do so, you can use the fastboot boot command. For example, here is how you would check if a custom recovery image called twrp.img is compatible with your device:

Note that none of the fastboot commands I mentioned in this section will work if the bootloader of your device has not been unlocked.

Conclusion

You now know what Android firmware is and how to replace it. I want you to understand that replacing firmware is a risky operation that can potentially make your device unusable. In most cases it also voids your device's warranty. Make sure that you have a backup of your data and a copy of your device's factory image handy before you go ahead and experiment with flashing custom firmware.



by Ashraff Hathibelagal via Envato Tuts+ Code

Do PHP and IoT have a future together?

IoTWeek_Gray

It's IoT Week at SitePoint! All week we're publishing articles focused on the intersection of the internet and the physical world, so keep checking the IoT tag for the latest updates.

A whole week of mostly IoT resources on every channel and, yes, that includes PHP. What? "PHP and IoT!? Surely you're mistaken!", you must be thinking. No, dear reader. PHP and IoT go well together - better than one might expect.

Robot elephant

In this post, we'll list some getting started resources. Throughout the remainder of the week, we'll have some amazing hands on posts for you - everything from creating a drinks machine with PHP, to a real life alarm when a door in Minecraft opens (yes, really!) - and that's just on our channel. Be sure to check out the others, too!

Without further ado, here's some introductory material for you if you feel like dabbling before we dive in properly!

Hardware

  • Electronic Components

    • When starting out, it's sometimes difficult to know how to use electronic components, or how to plug them into a circuit. This little guide by the excellent Christopher Pitt is helpful for figuring out a handful of common components.
  • Arduino

    • Arduino is a neat hobbyist development platform. It abstracts the steps from resisters and wires to functional computation. You program Arduino boards using C/C++, and this guide will fill in the details to get you started...

Continue reading %Do PHP and IoT have a future together?%


by Bruno Skvorc via SitePoint

R.Gen – Agency Landing Page Collection

R.Gen - Agency & Portfolio Landing Page Collection

The 'R.Gen Agency Landing Page Collection' features a ton of different One Page template layout options to construct a slick agency portfolio. There are dark & light schemes, 6 pre-made layout variations, AJAX sending contact forms, MailChimp integration and good to know it's built with Bootstrap 3. Make sure you look at all the demos, there really are loads of layouts.

by Rob Hope via One Page Love

20 Useful PHP Frameworks Available on CodeCanyon

S P E N T

opl-small

Arty One Pager for Florida based painter and artist, Keith Burnson. Lots of flavour and slick e-commerce integration for his paintings. Good work.

by Rob Hope via One Page Love

Medea JSON manager : jQuery plugin to converts JSON objects to HTML Forms

JSON manager: jQuery plug-in that converts JS & JSON objects to HTML forms and back again.

Medea loves JSON. Give Medea a JSON object, even one with nested objects, and it will be converted into an HTML form. The form allows fields in the object to be edited, or deleted, or for new ones to be created. The modified object is returned via the submit event.

The post Medea JSON manager : jQuery plugin to converts JSON objects to HTML Forms appeared first on jQuery Rain.


by Admin via jQuery Rain