background preloader

Code and Life – Arduino and Raspberry Pi Serial Communication

Code and Life – Arduino and Raspberry Pi Serial Communication
Today’s the last day of my summer holiday, and I had some free time on my hands. So I decided to see if I could get my Arduino Uno and Raspberry Pi to talk to each other. It turned out the task was even easier than my previous Pi to RS-232 project – all that was needed between the two devices was some jumper wire and two 1 kOhm resistors to form a voltage divider between Arduino TX pin and Pi RX pin – Arduino understands Pi’s 3.3V signal levels just fine so Pi TX to Arduino RX needed no voltage shifting at all. IMPORTANT UPDATE! It turns out that the RX pin on the Arduino is held at 5V even when that pin is not initialized. I suspect it is due to the fact that the Arduino is programmed via these same pins every time you flash it from Arduino IDE, and there are external (weak) pullups to keep the lines to 5V at other times. Setting Raspberry Pi up for serial communications minicom -b 9600 -o -D /dev/ttyAMA0 Then open Putty or similar serial terminal on PC side. #! import serialimport string Related:  Raspberry Pi - TrucsIoT

Définir une IP statique pour le raspberry pi chez Free Premier Tuto concernant le Raspberry Pi (ou RPi), sur comment lui attribuer une IP statique. Ce tuto concerne aussi bien le Raspberry Pi que n’importe quel équipement. Avoir une IP statique pour le RPi s’avère très utile lorsque vous voulez accéder à celui-ci en SSH ou alors le contrôler avec votre smartphone en tant que télécommande pour un média center. I) Trouver son adresse MAC Pour faire simple, chaque carte réseau a sa propre identité et c’est ce qu’on appelle l’adresse MAC. a) S’assurer que sa box est bien en 2.0 minimum : – Sur votre Freebox il vous faut utiliser les flèches pour descendre jusqu’à Système. – Appuyez sur la flèche de droite et descendez sur Version. – Maintenant vous voyez quelle est la version du Firmware de votre Freebox. – Si vous êtes en dessus de la version 2.0 appuyez sur la flèche de gauche et allez sur redémarrer pour que votre Freebox se mette à jour. b) Votre Freebox maintenant à jour : – Aller sur Paramètre de la Freebox. 2) Donner une IP statique à son RPi

Liam Jackson: Arduino and Raspberry Pi - Talking over UART Serial What are the raspberry Pi and arduino? - Skip this bit if you know that The arduino is a great little board, offering quite a lot of General Purpose input and Output (GPIO) these are pins you can program to be 'High' (usually +5V) or 'Low' (0v). Those are used to turn on or control LED's, motors and anything else electronic in the 'real world'. It has an ATMega micro-controller that runs at 16MHz and runs the code you write (and compile) 'bear metal', that is, the processor starts at the beginning of your code and runs through it. The Raspberry Pi is an 'embedded ARM Linux board' - basically a tiny computer (the size of a credit card)! They are both very cheap, the arduino is about £16 for a 'clone' on ebay - if you get a model with the removable micro-controller you can replace that for about £4 if you kill it! The Raspberry Pi costs about £25 and is really cool! So it seems they both have their pros and cons. Why I got them to "talk"! Using UART void setup() { Serial.begin(9600); .

How to Clone Raspberry Pi SD Cards Using the Command Line in OS X - Tuts+ Mac Computer Skills Article The Raspberry Pi runs from an operating system stored on a Secure Digital (SD) card and many different operating systems may be employed. Storage is relatively inexpensive, can be created (flashed), recreated, written to and overwritten with ease. On the one hand, this is an advantage of the Pi. The Raspberry Pi is somewhat different to the computing, to which most of us have been accustomed, of the last two decades. With almost two and a half million units sold–in little over a year since its launch–and with its focus on getting kids (adults?) Being able to experiment, play and break things is all part of the fun. Before embarking on cloning your SD card, install NOOBS or the OS of your choice, customise it and get it set up exactly how you like to use it. Cloning is the process of making an exact copy. The benefit of having a disk image of your SD card is that you have a backup of your data from which you can easily write a new SD card In my example, my SD Card is /dev/disk2.

Raspberry Pi master controls Arduino UNO slaves via I2C | raspberrypi4dummies #// Arduino I2C Wire master version 0.2 #// Turns the Raspberry Pi into a I2C master device using I2C-tools. #// send commands to the I2C Arduino slave for configuring pins, #// read and write to pins via a simple instruction set. #// the i2c-tools are required use "sudo apt-get install i2c-tools" #// the I2C slave software must be installed on the Arduino #// Supported instructions #// pinMode = setPin(device, pinnumber, INPUT/OUTPUT/INPUT_PULLUP) #// digitalWrite = writePin(device,pinnumber,HIGH/LOW) #// analogWrite (=PWM) = analogWritePin(device,pinnumber,0-255) #// digital/analog read = getStatus(device) reads all the digital/analog pins #// digital/analog read = pinValue gets the value for a single pin #// A0 - analog read / digital write #// A1 - analog read / digital write #// A2 - analog read / digital write #// A3 - analog read / digital write #// A4 - IN USE as SDA #// A5 - IN USE as SCL #// 1 - digital read / write + RX #// 2 - digital read / write + TX + Interrupt #// 4 - digital read / write

RPi SD cards SD cards The SD card is a key part of the Raspberry Pi; it provides the initial storage for the Operating System and files. Storage can be extended through many types of USB connected peripherals. When the Raspberry Pi is 'switched on', i.e. connected to a power supply, a special piece of code called the bootloader is executed, which reads more special code from the SD card that is used to start up the Raspberry Pi. The SD card must be formatted, or written to, in a special way that means the Raspberry Pi can read the data it needs to start properly. One advantage to using an SD card like this is that you can have several SD cards, each with a different operating system, or a different purpose. Please bear in mind that the maximum throughput of the card reader of the Raspberry Pi is 25 MB/s and that most likely read and write speed won't exceed 22 MB/s. Which SD card? SD cards come in three physical sizes (see picture). SD cards come in a range of storage sizes. Other SD card content

RasP.iO | Introducing RasPiO<sup>®</sup> The day has finally arrived for me to launch my first three products in the RasPiO® range. What’s RasPiO®? I hear you ask? It’s a family of add-on boards for the Raspberry Pi®. We’re starting small and simple, and will grow in size and complexity with time. RasPiO® Port labels, RasPiO® Breakout & RasPiO® Breakout Pro Here’s a Video Explaining the Boards What are they? RasPiO® port labels board A simple port labels board with large, clear labels, with GPIO numbers on one side and Alt functions on the other. RasPiO® Breakout A Breakout board with large, clear labels, that breaks out each port twice, giving you the opportunity to connect either male or female wires to any port. RasPiO® Breakout on the Pi RasPiO® Breakout Pro RasPiO® Breakout pro does everything RasPiO® Breakout can do, but also has protection circuitry on every port, to help protect your Pi from wiring errors. RasPiO® Breakout Pro protection circuitry Further Information – Where To Buy?

Raspbian on SD card + USB memory stick Raspbian is a Debian based Linux distribution, specifically for use with the Raspberry Pi. The Raspberry Pi requires that the system is initially booted of SD. Because of this, a default install of Raspbian requires an SD card of at least 2gb. I received my Raspberry Pi the other day, and didn’t have a spare 2gb SD card that wasn’t already being used, but I had a few smaller ones around the place (128mb, 256mb, etc). It turns out that the Raspbian image contains a boot partition, and as long as you can copy this to a SD card (and modify the cmdline.txt file to point to the root partition on the USB memory stick), you will be able to initially boot of a small SD card, then load the rest of the system off a larger USB memory stick. Requirements: A linux PC (Only required for this guide. Determining device names: Find the device names for both your USB device, and your SD device. Eg: This shows the dmesg output after plugging in a USB memory stick. Obtaining Raspbian: Preparing the SD card: eg:

RasP.iO | range | Raspberry Pi Interfacing made easy Raspberry Pi - Dynamic DNS on Raspbian Greetings all, So as I’ve been setting up my Pi as a home server I thought it might be nice to be able to access it from the outside world. Unfortunately I only have a dynamically assigned IP address from my ISP so it’s therefore subject to change from time to time. Dynamic DNS will allow me to have a static (non-changing) domain name that will resolve to my occasionally changing home IP address. This works by having a script or daemon in our case running on the internal machine that talks to the DNS server updating the IP resolution address. In this article I won’t cover any services that can be accessed from the outside such as an HTTP daemon or SSH but I will hopefully discuss these in later posts. I’ll assume that to test all this you have an HTTP client such as Apache2 running on the Pi and can get it’s stock standard “It Works” page from hitting the Pi’s internal IP from another computer in the internal network. To get dynamic resolution from outside you’ll need: Now the fun part!

Arduino Vs. Raspberry Pi: Which Is The Right DIY Platform For You? If you’re at all familiar with do-it-yourself (DIY) electronics, you’ve probably heard about the comparable merits of Arduino and Raspberry Pi. You may have even, like I did, assumed they were competing hardware platforms solving similar problems. Actually, Arduino and Raspberry Pi are quite different. Here’s a primer to differentiating Arduino and Raspberry Pi, and to determining which of the two DIY hacking devices best fits your needs as a maker. Overview Raspberry Pi and Arduino were both originally designed to be teaching tools, which is why they’ve become so popular—both devices are very easy to learn to use. See also: 12 Cool Projects For Your Raspberry Pi Raspberry Pi hails from the United Kingdom. Arduino, on the other hand, was born in Italy. As teaching tools, both Arduino and Raspberry Pi suitable for beginners. Hardware And Software Here’s an overview of some of the specs that show the biggest differences between the two: Working Together “They work great together,” Fried said.

BerryBoot - The simplest way to install and load multiple operating systems on a Raspberry Pi | Megaleecher.Net The revolutionary cheap and small Raspberry Pi mini computer is so popular now it hardly needs an introduction. After assembling all the bits and pieces needed to run an RPi, you will need to format and load the SD card with an compatible linux operating system of your choice. Here is easy and fast way to get this done. While you can always use the Raspbmc GUI installer to format and install the RPi optimized raspbmc OS, BerryBoot is something I would recommend if you plan to have more power, options and choices. Raspbmc GUI Installer for Windows BerryBoot Setup and Multi-OS Loader

Programming, electronics and other cool tech stuff RssLibraries Articles: Libraries: the Universal Feed Parser - Reads 9 RSS versions and Atom - reads most RSS versions, produces RSS 1.0 SpycyRoll - I don't know much about - this is an aggregator, and perhaps other stuff as well PyRSS2Gen - produces RSS 2.0 Feed Parser Feed Parser is an awesome RSS reader. Universal Feed Parser documentation. Download it, and then start a Python prompt in the same directory. Toggle line numbers 1 import feedparser 2 3 python_wiki_rss_url = " \ 4 "RecentChanges? You now have the RSS feed data for the PythonInfo wiki! Take a look at it; There's a lot of data there. Of particular interest: For each item in feed["items"], we have: Aggregating Feeds with Feed Parser If you're pulling down a lot of feeds, and aggregating them: First, you may want to use Future threads to pull down your feeds. 1 from future import Future 2 3 hit_list = [ " Now that you have your feeds, extract all the entries. Congratulations! Contributors LionKimbro

科學月刊: 物物相聯的龐大網路—物聯網 物聯網是一個由物物相聯而構成的巨大網路。在物聯網中,智慧物件透過感測、辨識及聯網的能力,進而提供更加值的應用服務。 作者/張志勇(任教淡江大學資訊工程學系)、陳正昌(就讀淡江大學資訊工程學系博士班) 網際網路的技術發展與應用快速成長,改變了人類的生活與溝通方式,而隨著網路與通訊技術的創新以及微機電技術的進步,感知與物件聯網技術已可將感測器與無線通訊晶片嵌入於實體物質或與其高度整合。在食、衣、住、行、育、樂各方面的電子產品也漸漸地植入感測及無線通訊的晶片,各式各樣的智慧物件亦漸漸地問市,如智慧手機、智慧插座、具紅外線感應能力及無線傳輸能力的LED照明燈、機器人、智慧冰箱、智慧藥盒、智慧血糖機、智慧血壓計、智慧跑步機、聯網電視、智慧家電等,提升了人們生活中的便利性與即時性,也因此,物聯網(Internet of Things, IoT)的時代已悄悄來臨。 物聯網的概念起源於比爾蓋茲1995年《未來之路》一書,在《未來之路》中,比爾蓋茲已經提及IoT的概念,只是當時受限於無線網路、硬體及感測設備的發展,因此並未引起重視。 IoT透過在物體上植入各種微型感應晶片使其智能化,然後藉助無線網路連結上網,使物體的資訊得以分享,實現人和物體對話、人和人對話以及物體和物體之間交流,使人們生活中所接觸的物體變得更有智慧,能夠自動回報狀態、自動與物溝通、與人溝通、更易與人互動以及更聰明地被人們使用。 手機便是眾多智慧物件中的模範生。 IoT 的架構 根據歐洲電信標準協會(European Telecommunications Standards Institute, ETSI)之定義,IoT 可依照不同的工作內容劃分為感知層、網路層及應用層(圖一)。 圖一:IoT架構及關鍵技術。 (一)感知層 就感知層而言,具感測或辨識能力的元件可嵌入各種真實物體,使其更具智慧。 (二)網路層 就網路層而言,IoT中的智慧物件具有聯網能力,能夠將感測資訊傳遞至網際網路,除了分享這些即時且重要的資訊給適當的使用者外,亦能提供使用者遠端互動功能。 (三)應用層 透過上述的「感知」與「聯網」技術,可使人們在任意時間,不論在何處,對任何周遭感興趣的物件,透過任何一種網路存取的形式,來享受與該物件相關的應用服務。 或許大家覺得IoT離我們仍很遙遠,但其實現在已有許多IoT實際應用於我們日常生活中。 圖二:手機是IoT 中的智慧物件。