Tag Archives: Linux

Welcome Arduino Yún – the first member of a series of wifi products combining Arduino with Linux

via Arduino Blog

Arduino Yun - iso

 

Massimo Banzi announced it some minutes ago during his annual “The state of Arduino” presentation at Maker Faire Bay Area:  Arduino Yún  is the first of a revolutionary family of wifi products combining Arduino with Linux.

Yún means “cloud” in chinese language,  as the purpose of this board to make it simple to connect to complex web services directly from Arduino.

ArduinoYun - scheme

Designed in collaboration with Dog Hunter, a company with extensive experience with Linux, the board adopts the Linino distribution which provides signed packages to ensure the authenticity of the software installed on the device.

Historically, interfacing Arduino with complex web services has been quite a challenge due to the limited memory available and they tend to use verbose text based formats like XML that require quite a lot or ram to parse. On the Arduino Yún we have created the Bridge library which delegates all network connections and processing of HTTP transactions to the Linux machine.

Arduino Yún is the combination of a classic Arduino Leonardo (based on the Atmega32U4 processor) with a Wifi system-on-a-chip running Linino (a MIPS GNU/Linux based on OpenWRT). It’s based on the ATMega32u4 microcontroller and on the Atheros AR9331, a system on a chip running Linino, a customized version of OpenWRT, the most used Linux distribution for embedded devices.

Like a Leonardo, it has 14 digital input/output pins (of which 7 can be used as PWM outputs and 12 as analog inputs), a 16 MHz crystal oscillator and a micro USB connector.

Arduino_Yun
Like any modern computer, it’s Wi-Fi enabled, it has a Standard-A type USB connector to which you can connect your USB devices and it has a micro-SD card plug, for additional storage.

The Yún ATMega32u4 can be programmed as a standard Arduino board by plugging it to your computer with the micro USB connector. And you can also program it via Wi-Fi.

When the Yún is turned on for the first time, it becomes an Access Point, creating a Wi-Fi network named “Arduino”. Open your browser and go to the webpanel: configure the board by entering your Wi-Fi network name, type and password. Click the “Configure” button to restart the board and have it join your home network. Opening the IDE, you’ll see it listed in the “Port” sub menu with its IP address instead of the serial port name.

Using the Bridge library in your sketches, you can link the 32u4 to Linux, launching programs and scripts, passing them parameters (sensor readings for example) and reading their output, thus creating a strong integration between the creativity of your sketch and the power of Linux. The Yún supports Shell and Python scripts out-of-the-box but you can install a wide range of open source software and tools.

For the Linux geek in you, Yún can be reached with SSH:  that means you’ll be able to customize it in whatever way. And you’ll always be able to reset it to its factory settings.

On top of that to make it even simpler to create complex applications we’ve partnered with the innovative startup Temboo which provides normalized access to 100+ APIs from a single point of contact allowing developers to mix and match data coming from multiple platforms (for example Twitter, Facebook, Foursquare but even FedEx or PayPal).

Arduino Yún will be available at the end of June at the price of 69$ + taxes.

 

Tiny WiFi Adapter for Raspberry Pi

via Wolf Paulus » Embedded

[Updated on Feb. 2. 2013 for (2012-12-16-wheezy-raspbian) Kernel Version 3.2.27+]

The extremely small EW-7811Un USB wireless adapter looks like the perfect WiFi adapter for the Raspberry Pi. Not only is it tiny and relatively inexpensive, it also seems capable enough to be a great companion device for the Raspi. While elinux still shows that some users report timeouts trying to initialize the module, I cannot verify this with 2012-12-16-wheezy-raspbian.

WiFi is not really necessary for the Raspberry Pi. It already comes with an ethernet port, provides RS-232 (aka serial-) connectivity, and has two USB ports. However, in case you wanted to add WiFi to the Raspi, this little adapter seems to be as good as any. Here is why:

The Edimax EW-7811Un

  • complies with wireless IEEE802.11b/g/n standards
  • adjust transmission output by distance and CPU offload, to reduce power consumption when wireless is idle
  • is currently the smallest wireless adapter
  • currently cost between US$ 9 and US$ 15

more than enough reasons to cut the cord and add WiFi connectivity to the Raspberry Pi.

After performing the usual initial configuration in raspi-config, using WiFi Config (a GUI tool sitting at the desktop when starting LXDE with startx) is by far the easiest way to get the Edimax EW-7811Un configured.

But let’s quickly run through the steps of creating that bootable SDCard before dealing with the actual WiFi issues:

Creating that bootable SDCard

  1. Download the image file from http://www.raspberrypi.org/downloads
  2. Unzip the file to get to the image file.
  3. df -h to determine which drive is used for the sdcard, e.g. integrated SDCard Reader turned out to be disk2 for me.
  4. sudo diskutil unmount /dev/disk2s1
  5. sudo dd bs=1m if=/Users/wolf/Downloads/2012-12-16-wheezy-raspbian.img of=/dev/rdisk2
  6. sync
  7. sudo diskutil eject /dev/rdisk2

On a class 10 SD Card, the whole process shouldn’t take much longer than 70 seconds maybe. Insert the SDCard into the Raspi, power up, boot, and use the on screen menu:

In case you need to do this over a network, the Raspberry Pi’s default hostname is raspberrypi. I.e.
ssh pi@raspberrypi .. the pasword is raspberry

sudo raspi-config
to:

  • Expand root_fs
  • Change password
  • Change locale to EN_US.UTF-8 UTF-8 (un-select english UK and select select in long list)
  • Set Time zone (America / Los_Angeles)
  • Change memory split to 128:128
  • Enable ssh

Finally reboot: sudo shutdown -r now
Running the raspi-config again to execute update feature, reboot and login.
Now finding more updates and upgrades like so:

sudo apt-get update
sudo apt-get upgrade

Changing the PI’s hostname

Edit the host name in these two locations:

  • sudo nano /etc/hostname
  • sudo nano /etc/hosts

Adding WiFi support / EW-7811Un

With previous wheezy builds, I had to install the realtek firmware, blacklist the already installed 8192cu driver and install a new one. Not this time. ifconfig shows the wlan0 interface and iwlist wlan0 scan can be used to scan for available Wifi access-points, without any firmware installation or driver updates.

/etc/wpa_supplicant/wpa_supplicant.conf

All what’s needed to do to connect the Raspberry Pi to a Wifi Network, is to add a network configuration to /etc/wpa_supplicant/wpa_supplicant.conf.

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

The network configuration depends very much on your network, SSID, Password Security etc. However, here is what I have added, to make the EW-7811Un connect to my WiFi network:


network={
ssid="MY_SSID"
psk="******"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}

With the correct WiFi network configuration added to the wpa_supplicant.conf file, the ethernet cable can be removed and the Raspberry Pi will automatically switch over to WiFi.
This behavior is pre-configured in /etc/network/interfaces, which looks something like this:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp


Raspberry Pi – WiFi (Edimax EW-7811Un)

Backup the SD Card

Once done with setting up Raspian, I usually create an backup image that later can be copied onto the same or a different SD Card (of equal size).

Backup

Insert the perfect SDCard into the Card Reader and find out how to address it. Again, for me that usually is disk2s1.

sudo diskutil unmount /dev/disk2s1
sudo dd bs=1m if=/dev/rdisk2 of=~/RASP_3_2_27.img
sync
sudo diskutil eject /dev/rdisk2

Depending on the size of the SDCard, this will create a huge file (like 16GB) an may take a while (like 7min).

Restore or Copy

Insert am empty SDCard into the Card Reader and find out how to address it. Once again, for me that usually is disk2s1.

sudo diskutil unmount /dev/disk2s1
sudo dd bs=1m if=~/RASP_3_2_27.img of=/dev/rdisk2
sync
sudo diskutil eject /dev/rdisk2

Practical System-on-Chip (Program your own open source FPGA SoC)

via OSHUG

At the ninth OSHUG meeting we were given an introduction to FPGA development, and to the OpenCores community and the OpenRISC 1000 open source processor family. At the seventeenth OSHUG meeting we will be given a comprehensive introduction to the practicalities of programming your own open source FPGA system-on-chip.

How to Program Your Own Open Source FPGA System-on-Chip

It is possible to buy a FPGA prototyping board like the Terasic DE0-nano, capable of running a complete 32-bit System-on-Chip for around £50. Even larger boards with the memory capacity to bring up a full Linux system on the design cost a few hundred pounds.

In this talk Julius Baxter and Jeremy Bennett will present the OpenRISC architecture and OpenRISC Reference Platform SoC (ORPSoC), and show how to take this open source design and get it running on an FPGA board.

This is a practical evening, aimed at users who have never done any chip design. Using a Xilinx ML501 prototyping board, Julius Baxter will demonstrate all the steps from obtaining the initial hardware design through to bringing up the board and booting a full Linux system.

The following topics will be covered:

  • an overview of OpenCores and the OpenRISC project
  • an introduction to the Verilog Hardware Design Language
  • how to synthesize the design into a FPGA bitstream
  • what needs modifying to run on different boards
  • how to get software running
  • porting a simple (newlib) library to the board
  • demonstration of Linux booting

Note that this will be an interactive session, and participants are encouraged to bring along their own FPGA dev boards and laptops and to join in, should they wish. If you have a board that is not listed as having a preconfigured ORPSoC build, or you have any other questions concerning the practicalities of this, you should direct your question to the OSHUG discussion list.

Julius Baxter has been involved with the OpenRISC project for 4 years, and during that time he's worked on everything from processor Verilog RTL to the Linux kernel port. After finishing undergraduate studies in his native Australia, he then studied a System-on-Chip design Master's at KTH in Stockholm, Sweden, while working at ORSoC AB - the owners and operators of OpenCores.org. Now living and working Cambridge, Julius maintains a role as an active developer and maintainer on the OpenRISC project, largely dealing with RTL, toolchain and architecture work.

Dr Jeremy Bennett is Chief Executive of Embecosm which provides open source services, tools and models to facilitate embedded software development with complex systems-on-chip. He has been involved with OpenCores for the past decade, and is responsible for much of the software tool chain. Contact him at jeremy.bennett@embecosm.com.

Note: Please aim to arrive for 18:00 - 18:20 as the event will start at 18:30 prompt.

Sponsored by:

Practical System-on-Chip (Program your own open source FPGA SoC)

via OSHUG

At the ninth OSHUG meeting we were given an introduction to FPGA development, and to the OpenCores community and the OpenRISC 1000 open source processor family. At the seventeenth OSHUG meeting we will be given a comprehensive introduction to the practicalities of programming your own open source FPGA system-on-chip.

How to Program Your Own Open Source FPGA System-on-Chip

It is possible to buy a FPGA prototyping board like the Terasic DE0-nano, capable of running a complete 32-bit System-on-Chip for around £50. Even larger boards with the memory capacity to bring up a full Linux system on the design cost a few hundred pounds.

In this talk Julius Baxter and Jeremy Bennett will present the OpenRISC architecture and OpenRISC Reference Platform SoC (ORPSoC), and show how to take this open source design and get it running on an FPGA board.

This is a practical evening, aimed at users who have never done any chip design. Using a Xilinx ML501 prototyping board, Julius Baxter will demonstrate all the steps from obtaining the initial hardware design through to bringing up the board and booting a full Linux system.

The following topics will be covered:

  • an overview of OpenCores and the OpenRISC project
  • an introduction to the Verilog Hardware Design Language
  • how to synthesize the design into a FPGA bitstream
  • what needs modifying to run on different boards
  • how to get software running
  • porting a simple (newlib) library to the board
  • demonstration of Linux booting

Note that this will be an interactive session, and participants are encouraged to bring along their own FPGA dev boards and laptops and to join in, should they wish. If you have a board that is not listed as having a preconfigured ORPSoC build, or you have any other questions concerning the practicalities of this, you should direct your question to the OSHUG discussion list.

Julius Baxter has been involved with the OpenRISC project for 4 years, and during that time he's worked on everything from processor Verilog RTL to the Linux kernel port. After finishing undergraduate studies in his native Australia, he then studied a System-on-Chip design Master's at KTH in Stockholm, Sweden, while working at ORSoC AB - the owners and operators of OpenCores.org. Now living and working Cambridge, Julius maintains a role as an active developer and maintainer on the OpenRISC project, largely dealing with RTL, toolchain and architecture work.

Dr Jeremy Bennett is Chief Executive of Embecosm which provides open source services, tools and models to facilitate embedded software development with complex systems-on-chip. He has been involved with OpenCores for the past decade, and is responsible for much of the software tool chain. Contact him at jeremy.bennett@embecosm.com.

Note: Please aim to arrive for 18:00 - 18:20 as the event will start at 18:30 prompt.

Sponsored by:

TTL Bluetooth Transceiver with Linux

via Brewbot Mk2

I recently got one of these cheap chinese TTL to Bluetooth transceivers.

http://gb.suntekstore.com/wireless-bluetooth-transceiver-module-rs232-||-ttl.html

I got mine off ebay delivered for under US$7. The seller unfortunately didn't have a pinout diagram or any real info about the module (or maybe couldn't understand enough English to work out what I was asking).

I figured that all of them on the market are probably the same design so it shouldn't be a big deal.

Luckily I was right. The best resource I found was this:

http://www.egochina.net.cn/e-shop/ebay/datasheet/Bluetooth_Module_L6.rar

A number of diagrams, manuals and pieces of software in that archive.

The only problem is they are all windows specific.

The Ubuntu Bluetooth applet let me see and pair with the device, but no clue on how to use it.

Time to learn a little more about the Linux bluetooth stack.

hcitool scan
Scanning ...
00:19:5D:24:B7:63 OBDII

Ok so we can see it from the command line and see it's address, it's the only thing found.

Most of the other diag tools didn't return any useful info.

Eventually I found the following to work.

sudo rfcomm bind /dev/rfcomm0 00:19:5D:24:B7:63

picocom -b 38400 /dev/rfcomm0

At that point I could talk to my MCU over bluetooth!

Renesas RDK bring up

via Brewbot Mk2

I'm a free software junky. Have been since the late 1990's. I run Linux on all my machines. I wouldn't have it any other way.

Which can pose a problem in the embedded space. Nearly all tools are highly Windows centric.

With the RDK, things are even worse, in that they are pushing a proprietary RTOS, Toolchain, and Debug environment. I think as also is typical, most are restricted in some way. A drug dealer approach to getting you to cough up some cash. Just a taste.

As as Engineer and tinkerer, I like to understand how things work, to have a chance to be able to fix bugs.

"If you can't change it, you don't own it." - DJ Delorie

What I find incredible that so many hackers types, who like to dismantle, re-purpose and build things, are happy to be closed off to this whole world by using highly restricted OSes and tools. It seems like a contradiction.

Anyway, there is no coincidence with the above quote, luckily for the RDK, free software hero DJ Delorie has done a lot of the heavy lifting for us Linux users.

I started here: http://www.renesasrulz.com/thread/3137

To shortcut bring up a little, I went and got the precompiled GCC binaries from kpitgnutools

The blinky example worked first go, yay!

For my application, I was initially planning on skipping using an OS entirely (due to the proprietary nature of the one that comes with the kit) and just coding to the hardware directly.

First step would be to get an on board timer running and generating interrupts... the heart beat of the application.

Plus blinking LEDs are pretty boring when you have an LCD sitting there.

So I set about modifying the blinky example from DJ to be timer and interrupt driven and also use the LCD.

The result is here: https://github.com/Zizzle/blinky2

Since getting that running I discovered that FreeRTOS looks good and is easy to build under Linux and run thanks again DJ.

http://www.renesasrulz.com/thread/3109

http://interactive.freertos.org/entries/308741-makefile-for-linux-hosted-demo-build-on-144-pin-rx-62n-board

So I may end up using FreeRTOS for my brewbot. Subject of another post I guess.