Tag Archives: Raspberry Pi 3

Post Tweets With Your Raspberry Pi

Raspberry Pi is famous for its great computing strength and ability to run the Linux operating system. In today’s tutorial, you’ll learn how to make your Raspberry Pi tweet. You can add extra features to this project to post tweets autonomously if any specific event occurs. Let’s get started.

Required Parts

You’ll need following parts to make this project.

  • Raspberry Pi running Raspbian OS (Any model)
  • USB Mouse
  • USB Keyboard
  • HDMI Compatible Monitor
  • HDMI Cable
  • USB power supply for Raspberry (5V 2A)
  • Working Internet Connection

Create App In Twitter

You need to create an app in Twitter so that Raspberry Pi can use to make tweets on your behalf. Go here to make a twitter app. The Raspberry Pi will require following parameters to make tweets:

  • Consumer Key (API Key)
  • Consumer Secret (API Secret)
  • Access Token
  • Access Token Secret

You can find all these details from your app.

Creating An App In Twitter
Creating An App In Twitter

Store Keys In Raspberry Pi

In this step, you need to create a python file in your Raspberry Pi and store all the Keys and Tokens there. Create a file named keys.py in your working folder with all information in it.

consumer_key = "Place your consumer key here"
consumer_secret = "Place your consumer secret key here"
access_token = "Place the access token here"
access_token_secret = "place the access token secret here"
Get Access Keys And Access Tokens From App
Get Access Keys And Access Tokens From App

Now, save the file and go the nex step of this tutorial.

Install Twython

Well, what is Twython actually? Twython is the premier Python library providing an easy way to access the Twitter data. It’s been tested by companies, educational institutions and individuals alike. This amazing library will make our job a lot easier and the code much shorter. To install the Twython library, follow the given steps:

 sudo apt-get update sudo apt-get upgrade
 sudo apt-get install python-setuptools
 sudo easy_install pip
 sudo pip install twython
 sudo pip install requests
 sudo pip install requests-oauthlib

pip is required to install Twython, so it’s installed in 3rd step. But if you already have pip installed, just ignore that step.

Write The Python Script & Run It

Open a file in your working directory in your Raspberry Pi and rename it to twitter.py. Make sure that it is in the same directory wit previously created keys.py file. Now, copy-paste the following code using any editor or IDE:

import sys

from twython import Twython
from keys import (
 consumer_key,
 consumer_secret,
 access_token,
 access_token_secret
)
twitter = Twython(
 consumer_key,
 consumer_secret,
 access_token,
 access_token_secret
)
message = "My first tweet using Rapberry Pi! Yeh!"
twitter.update_status(status=message)
print("Raspberry Pi successfully tweeted: %s " % message)

Pretty simple, isn’t it? Actually, the Twython library performs lots of tasks behind the screen keeping the code surprisingly small.

Now, save the file and open terminal in your raspberry pi. Write the following command and hit the Enter key to run this Python script:

python twitter.py

That’s all. Now you can see that is your Raspberry Pi is tweeting successfully.

CM3, Raspberry Pi Compute Module 3

Raspberry Pi launched the new version of its compute module providing twice the RAM and roughly 10x the CPU performance of the original Module. Compute Module 3 (CM3) fits into a standard DDR2 SODIMM socket and provides the same basic processing capabilities as the Raspberry Pi 3. It is designed for professional engineers who would like to develop embedded systems.

CM3 comes in two versions. The first is the “Standard CM3” that features a 64-bit Broadcom BCM2837 application processor, built around an ARM Cortex-A53 quad-core processor running at up to 1.2 GHz, with 1GByte RAM, the same as Pi3, and 4 Gbytes of on-module eMMC flash. The second version is “Compute Module 3 Lite (CM3L)” which still has the same BCM2837 and 1Gbyte of RAM, but brings the SD card interface to the Module pins so a user can wire this up to an eMMC or SD card of their choice.

 

Back side of CM3 (left) and CM3L (right)

 

“The idea of the Compute Module was to provide an easy and cost-effective route to producing customised products based on the Pi hardware and software platform. The thought was to provide the ‘team in a garage’ with easy access to the same technology as the big guys.”

Raspberry Pi also released an updated version of the Compute Module IO Board V3 (CMIO3). This board provides the necessary power to the module and gives you the ability to program the module’s flash memory or use an SD card for the lite version, to access the processor interfaces through pin headers and flexi connectors. In addition, it provides the necessary HDMI and USB connectors.

This board provides both a starting template for those who want to design with the Compute Module and a quick way to start experimenting with the hardware, and building and testing a system, before going to the expense of fabricating a custom board. The CMIO3 can accept an original Compute Module, CM3, or CM3L.

CM3 and CM3L are priced at $30 and $25 respectively, and this price applies to any order size. The original Compute Module is also reduced to $25. You can order your own from Raspberry Pi partners, element14 (or Farnell UK) and RS Components. The partners are also providing full development kits, which include all you need to get started designing with the Compute Module 3.

ASUS Tinker Board Competing Raspberry Pi

Raspberry Pi has been the household name for many years now, and many other companies have tried to replace it with their offering, but no one sussed to replace Raspberry Pi by performance and low-cost. Though, that might change as ASUS are entering the arena with their 90MB0QY1-M0EAY0 Tinker Board, which have better components across the board.

According to Hexus.net, ASUS believes the capabilities of the Tinker Board will make possible projects that were too much to ask of even for the newest Raspberry Pi revision. Discussing the reasoning behind the creation of the ‘ASUS Pi’, the Taiwanese computer firm said:

“Raspberry Pi has been in the market for so long, we’re here to expand users’ choices with more options. And this board has 4K support, higher SoC performance, faster Ethernet transmission, and flexibility for the memory size.”

The ASUS Tinker Board (90MB0QY1-M0EAY0) features Rockchip RK3288 quad-core SOC running at 1.8GHz with 2GB of RAM, which gives almost two times faster that Raspberry Pi 3’s Broadcom chip. The Tinker Board also comes with H.264 4K decode abilities and SDIO 3.0. Below you can see the specification diffraction between ASUS Tinker Board and Raspberry Pi 3.

The Raspberry Pi 3 is available at a price of around £34, with the ASUS Tinker board coming with a slightly higher price around £45-55 depending on the retailer.

Source: TECKKNOW

Android Things, Google’s IoT Platform

Google had launched Android Things,  a new comprehensive IoT platform for building smart devices on top of Android APIs and Google’s own services. Android Things is now available as a developer preview.

Android Things was basically launched as an enhancement for Brillo, Android based OS used for embedded development in particular for low-power IoT devices, and it is based on its feedback and best practices. Google had announced Android Things as re-branding of Brillo to solve many issues like the security of IoT devices.

Platform Architecture

Both work in conjunction with Weave, an open, standardized communications protocol that supports various discovery, provisioning, and authentication functions. Weave enables device setup, phone-to-device-to-cloud communication, and user interaction from mobile devices and the web. The chief benefit is allowing a “standardized” way for consumers to set up devices. Belkin WeMo, LiFX, Honeywell, Wink, TP-Link and First Alert will adopt Weave to make their devices able to interact with some Google products like Google Assistant.

One of the great things about Brillo was the security issue with IoT applications solved by choosing to use secure boot and signed over-the-air updates and providing timely patches at the OS level. Partnered with hardware manufacturers to build new devices based on Intel Edison, NXP Pico and the Raspberry Pi 3, Google will build the needed infrastructure to run the OS updates and fix security issues respectively on these devices.

Android Things makes developing connected embedded devices easy by providing the same Android development tools, best-in-class Android framework, and Google APIs that make developers successful on mobile. For more details about Android Things you can check the documentation provided here, where you can find also the developer’s preview.

Orange Pi PC2 $20 Quad core Linux Computer

Shenzhen Xunlong Software CO., Limited is now offering  a new addition to the community of single board computers. The latest edition of Orange Pi is the $20 Orange Pi PC 2.
Even though this 85mm×55mm board isn’t as cheap as the $4 VoCore2 Lite, its $20 price tag is justified by the hardware it packs inside. And, it also saves you $15 if you don’t want to go for the $35 Raspberry Pi 3. Orange Pi PC 2 is a single-board quad-core 64-bit computer capable of running Android 4.4, Ubuntu, Debian, Banana Pi, and Raspberry Pi images.

best-seller-orange-pi-pc-h3-support-the-lubuntu-linux-and-android-mini-pc-beyond-raspberry

The board includes an Ethernet port and three USB ports. It has 1GB of memory, H5 High Performance Quad-core 64-bit Cortex-A53, and a standalone graphics chip. It supports camera input as well as HDMI out and even has a physical power switch and IR blaster. It takes power using a separate power connector despite the fact that it has a micro-USB port. The absence of WiFi and Bluetooth is a slight turn-down but USB 2.0 ports can be used to add these things.

orangepipc2_info

Full hardware specifications

CPU: Allwinner H5 64-bit Quadcore (Cortex-A53).
RAM: 1GB DDR3.
GPU: Mali-450.
Storage: 2MB NOR Flash, up to 64GB via MicroSD card.
Connectivity: 2xUSB 2.0, 1xUSB 2.0 OTG, HDMI, 10/1000 RJ45, IR receiver, camera interface, 40-pin header.
Audio: 3.5mm jack, inbuilt mic.
Operating System: Ubuntu Debian, Raspbian, Android.
This board is an advanced edition of the recent Orange Pi PC with different CPU, GPU and Ethernet connection.

Getting Started with Orange Pi PC 2

  1. You need to get these accessories to start using your Orange Pi:
    TF card (minimum 8 GB), HDMI to HDMI lead or HDMI to DVI lead (for monitors with DVI input), AV video lead, DC power adapter, keyboard and mouse, plus Ethernet cable/USB WiFi and Audio lead as an option.rms
  2. Prepare your TF card
    1. Insert your TF card into your computer. The size of TF should be larger than the OS image size, generally 8GB or greater.
    2. Format the TF card. (using this tool for Windows, and some commands for Linux)
      1. Run fdisk –l  /dev/sdx command to check the TF card node.
      2. Run umount /dev/sdxx to unmount all the partitions of the TF card.
      3. Run sudo fdisk /dev/sdx command to configure TF card. Use o command to delete all partition of TF card and use n command to add one new partition. Use w command to save change.
      4. Run sudo mkfs.vfat /dev/sdx1 command to format the new created partition of TF card as FAT32.
        (x should be replaced according to your TF card node)
    3. Download the OS image from the Downloads webpage.
    4. Unzip the download file to get the OS image
    5. Write the image file to the TF card using this software on Windows and this command on Linux: sudo dd bs=4M if=[path]/[imagename] of=/dev/sdx (x should be replaced according to your TF card node)
  3. Set up your Orange Pi PC following the steps in the diagram
    sketch_map_pipc_en
    Note : Avoid using the micro-usb power connector, because micro-usb power does not supply power.
  4. Shut down your board
    You can use the GUI to shut down the Orange Pi PC2 safely or just run this command in the terminal:  sudo halt or  sudo shutdown –h now
    This will shutdown the PI safely, (just use the power key to turn off might damage the TF-cards file system). After that you can press the power key for 5 seconds to turn it off. Full guide and any updates on the OS image will be available here.

This open source SBC (single board computer) is a great option to start building IoT devices, DIY projects and for development purposes. You can use it as a mini-computer, a wireless server, music and video player,etc. You should remember that the limit is the sky when it comes to open source boards.

The Orange Pi PC 2 is up for sale on AliExpress and you can get it now for $20. You can apply for free products from Orange Pi through this application by defining your purpose of using the product and following the steps mentioned here.

You can check the official website to find more details and updates about Orange Pi PC2 and other boards from Orange Pi. Codes and source files are available at Github.

PiOSCBOX: A Raspberry Pi based audio processor and synthesizer

Raspberry Pi carries a lot of horsepower inside to handle the realtime audio and add some effects to it. The only limitation is it does not have a built-in sound card, but it is manageable using an external USB soundcard. PiOSCBOX is an attempt to make a low-cost, stand-alone audio effects processor and synthesizer using Raspberry Pi 3. It provides a very nice and interactive user interface using a 128×64 graphic LCD and six rotary encoders. As with all other audio processors based on Raspberry Pi, PiOSCBOX also requires an external USB audio adapter.

Raspberry Pi based audio processor
Raspberry Pi based audio processor

The audio processing and synthesizing involves heavy Fast-Fourier transform computations and other DSP capabilities. PiOSCBox utilizes Pure Data for all of the DSP implementations. If you are unfamiliar with Pure Data, it is an open source visual programming language that allows musicians and artists to develop a software graphically (without writing a single line of code) to process and generate audio, video, and 2D/3D graphics along with interface external sensors and other input devices.

The software required for the PiOSCBox can be downloaded from the following location: https://github.com/star-fs/PiOSCBox

Once it is cloned to the /home/pi/PiOSCBox/ location on your Raspberry Pi, you need to run the build script, which will compile the rotary encoder components. The project also requires some external dependencies like WiringPI and Liblo, which are both embedded into NOOBS operating system for Pi.

Collecting GPS Data Using GPS Module With Windows IoT

Bardaan A published a guide on hackster.io showing full instructions for developing a Windows IoT application that receives and extracts essential GPS data from a connected serial GPS module.

To follow this guide, you have to use Raspberry Pi 3 model B with Andoer NEO-6M GPS module, and also have Microsoft Visual Studio 2015 installed on your computer.

Application Interface
Application Interface

The Raspberry Pi 3 model B is a $35 single board computer with the size of a credit card. It is an improved version of Raspberry Pi 2 Model B and it features a 1.2 GHz 64-bit quad-core CPU,1GB RAM, integrated Wireless LAN, and Bluetooth 4.1 supporting Bluetooth Low Energy (BLE). The main board contains 4 USB ports, 40 I/O pins, HDMI port, Ethernet port, 3.5mm audio jack, and microSD card slot.

Raspberry Pi 3 model B
Raspberry Pi 3 model B

Andoer NEO-6M is a standalone GPS receiver module that implements the NEO-6M position engine developed by u-blox. It supports UART, USB, DDC (I2C compliant) and SPI interfaces and has low power consumption with high performance capabilities. NEO-6M’s strength point is that one of the received NMEA sentences is the GPGGA sentence, Global Positioning System Fix Data, which provides essential fix data.

Andoer NEO-6M GPS Module
Andoer NEO-6M GPS Module

The received GPGGA sentence will be send by Raspberry Pi to the application which processes it and extracts the essential information such as time, geographic coordinates, and altitude, and eventually displays them on a GUI with the connection status .

The GPS receiver must be connected to the Raspberry Pi as shown in the figure:

schematic

The source code with the detailed tutorial can be reached here.

Touch Weather Station using a DHT22 Sensor and a Raspberry Pi 3 with TKInter

educ8s.tv tests the new Raspberry Pi 3 board, by building a simple but useful project.

A few months back, the Raspberry Pi 3 board was released. It is a great new board because it now offers WiFi and Bluetooth connectivity out of the box! It uses a quad core processor which operates at 1.2Ghz and it has 1GB of RAM available. From the benchmarks I have seen, this board is at least 3 times faster than the original Raspberry Pi. It can run Linux and offers 40 GPIO pins for our projects. The impressive thing is its price. It costs around 40$ and Gearbest.com was kind enough to send me a sample unit in order to test it and build projects with it.

Touch Weather Station using a DHT22 Sensor and a Raspberry Pi 3 with TKInter [Link]

Time Machine – A Smart Clock That Does What You Say Using Alexa Voice Service

With a controller and a seven segment display, showing the time is not a so special feature, but when this clock can listen to the user and do what they want, that’s what worth highlighting a “Time Machine”.

Analysing human voice and take action based on that is not so simple. That’s why using a ready made solution is needed.
Intelligent personal assistant (IPA) is a software designed to perform tasks specified by user voice instructions. Alexa from Amazon, Google Now and Siri from Apple are examples of intelligent personal assistant software.

Some IPAs are designed to be integrated within IoT devices and Alexa is one of them. Amazon has an intelligent cloud service that allows developers to voice-enable any connected product only using a microphone and speaker, it’s called Alexa Voice Service (AVS).

Nick Triantafillou in his project, “Time Machine” used AVS to take the voice command.
The project contains Raspberry Pi 3, 1.2″ 4-Digit 7-Segment Display, wireless speaker and a push button switch.

TimeMachine

Nick followed the steps to enable Alexa Voice Service (AVS) for his Raspberry Pi 3 using this tutorial. To make the project more exciting he used IFTTT service so he can make any conditional action using Alexa’s voice orders with IFTTT.

TimeMachineVUI

To see the full instructions and details of getting all hardware to work with Raspberry, please go to the project page on hackster.io.

Nick demonstrates the project in the video below:

The New OS From Google “Fuchsia” – What is it ?

FuchsiaOS

Last year Google announced “Brillo” an operating system for IoT devices with a communication protocol called “Weave”. Today, most of the technical websites are talking about the new operating system “Fuchsia” which is, according to Google brief description, a “Pink + Purple == Fuchsia (a new Operating System)”.

Fuchsia Inside

LinuxInsider website asked Google spokesperson Joshua Cruzthe about Fuchsia. His answer was: “it is a new open source project that is not at all related to Android or Chrome OS”.

Fuchsia is built on the Magenta kernel, which is based on Google’s LittleKernel project. Developers of Fuchsia described the differences between LittleKernel and Magenta in a ReadMe file.

“LK is a Kernel designed for small systems typically used in embedded applications. It is good alternative to commercial offerings like FreeRTOS or ThreadX. Such systems often have a very limited amount of ram, a fixed set of peripherals and a bounded set of tasks.  On the other hand, Magenta targets modern phones and modern personal computers with fast processors, non-trivial amounts of ram with arbitrary peripherals doing open ended computation.”. So Fuchsia is not using Linux kernel like Android.

Supported Architectures

ARM32, ARM64, and x86-64 are the current supported architectures.

One of Fuchsia developers, Brian Swetland who worked on Android, BeOS and Danger, stated in one of discussion thread on Y Combinator’s Hacker News, that Fuchia soon will support the Raspberry Pi 3.

You can see the current supported targets here which are Acer Switch Alpha 12, Intel NUC (Skylake and Broadwell) and Raspberry Pi3. You can read the document for booting Fuchsia on Raspberry Pi 3 from the SDCard.

Brian Swetland showed a shot of virtual console 0 with the tail end of the boot log on an Acer Switch Alpha 12.

Image courtesy of Brian Swetland
Image courtesy of Brian Swetland

Is It For IoT and Embedded Systems Devices?

Sascha Wolter asked in Brillo and Weave Google group, “Should we stop with Brillo and get our hands in #Fuchsia?”, and the answer was: “Sorry for not providing any updates on the progress of Brillo and Weave for a while. Don’t worry though, we are still hard at work on both of them! We want to make sure everything is finalized before releasing an update, but you will be hearing from me soon with more detailed information”.

So I think until now Fuchia is not the Brillo killer while a lot of speculations are around the target market of this new OS from Google.
According to some folks the new OS has a Flutter-based UI and run Dart programming language (I can see Dart content handler in the Git repo), and that supports the point of view saying that “Fuchisa” is not another RTOS like Brillo, it’s maybe the next Android.

References:

[Fuchsia Git Repository]

Getting Started

Linuxinsider

Hackerboards