Apr 282013
 

Wir haben seit heute ein neues Produkt (erstmal nur über Amazon) im Angebot:

Das CooCox “Embedded Pi” wird mit dem GPIO Port des Raspberrys verbunden. Ein Arduino Shield kann auf das Embedded Pi Board gesteckt werden, und vom Raspberry Pi aus mit Hilfe von C++ Bibliotheken angesprochen werden.

embedded-pi redfly

Das CooCox Board ermöglicht einerseits einen Proxybetrieb, in dem der Raspberry direkt mit dem Arduino Shield kommuniziert, einen Controller-Betrieb, bei dem der Raspberry als Webfrontend bzw. High-Level Controller dient, als auch einen Standalone Betrieb als eigenständige ARM 32 bit Mikrocontroller Plattform.

Arduino Shields einfach mit dem Raspberry Pi ansteuern

Dieses Embedded Pi ist eine sehr spannende Erweiterung, da sie dem Raspberry viele für die Arduino Plattform bereits entwickelte Shields auf einfache Art und Weise zugänglich macht.

Weitere Details in Kürze in unserem Blog.

embedded-pi-rotated

embedded-pi-contents

embedded-pi-back

embedded-pi-raspberry

Apr 272013
 

If you have a powerful primary machine (for instance a Dell notebook with an Intel Core i7 processor), it can easily run several Operating Systems and user sessions in / on them side by side – virtualisation is the magic of today’s computing.

The Raspberry Pi, whilst not having enough general purpose power to do really pleasant desktop computing, can very well serve as a “window” to Windows, Linux, MacOS and other more exotic systems running elsewhere. You could run several users off a powerful server machine – all you need is some networking gear, monitors, mice, keyboards, and of course Raspberry Pis.

Your users will enjoy an absolutely silent and energy-efficient client, while the noisy server is hidden away in the basement somewhere (or is in the admin’s room).

Access Windows from the Raspberry Pi

Today we will show you how to access a virtualised Windows desktop from the Raspberry Pi.

VirtualBox

On the host computer which will run the Operating Systems and user sessions for the Raspberry Pi terminals, you should install Oracle’s VirtualBox. (If you are not a fan of Oracle, remember that this was not developed by them but by SUN, and rebranded later on).

The host computer ideally should have hardware virtualisation extensions in the processor, which will allow the guest systems to run much more fluently.

We assume that you run Windows 7+ on the host. VirtualBox also works on Linux, though.

Run VirtualBox, and set up a Windows virtual machine (how to do this is outside the scope of this document).

Networking setup

Here’s the important part to know: initially the virtual network adapters for your virtual machine are set up as “NAT” devices. To be able to access RDP and all other parts freely on your network, the network adapter should be set up as “Bridged Adapter”.

image

This will connect it directly to your network – the machine will be seen outside of the host computer. If you have a DHCP server running, Windows by default will fetch it’s IP address from the DHCP server (e.g. your router).

To be able to access the virtual machine without looking up it’s address first, we recommend to assign a static IP for it ( outside of the area your DHCP server uses to assign IPs).

This is done by right-clicking on the network adapter in Windows, bringing up it’s properties, and editing the IPv4 properties. Whilst being mostly outside of the scope of this short how-to, I’ll share a screenshot with you, which should help you:

image

adjust your settings accordingly.

Note:

The current IP address of your windows computer can be determined by hitting the Windows key, writing “cmd”, pressing Enter (to bring up the command line), and the following command:

ipconfig

image

 

RDP Setup

This part can also be applied to physical machines running Windows.

To allow remote connections to your Windows machine, you have to enable RDP connections first. This is done by hitting the Windows menu, right-clicking on “Computer”, selecting the entry “Properties”.

In Windows 7, you have to click on “Remote settings” in the sidebar of the window which you will see. The dialogue which comes up, will allow you to configure RDP settings.

image

Select “allow connections from computers running any version of Remote Desktop (less secure)”. Click “OK”.

Creating new user

If you do not have a password protected user in your virtual Windows installation yet, you should set one up. You can either create an admin user or a regular Windows user. Using these credentials you will be able to connect to the machine later on. Of course you can also create a new password for the user you already have, if you have decided not to use a password initially.

Raspberry Pi

Start an X session:

startx

Launch the root shell (start menu > Other > X-Terminal as root (GKsu).

Update apt package cache (if you don’t have aptitude, use apt-get):

aptitude update

Install rdesktop package

aptitude install rdesktop

After rdesktop is installed, it is literally just one short command to connect to your virtual Windows desktop:

rdesktop 192.168.1.3

Just replace the IP address with the IP address of your Windows virtual box.

Rdesktop will start a window and allow you to log in to your Windows virtual box. You can click on “Other user” and insert your login credentials here. If another user is logged in at the main machine / via another terminal, Windows might request you to wait for 30 seconds so the other user might allow or disallow your connection.

If you want to launch a full-screen session, you can use the –f switch

rdesktop -f  192.168.1.3

Forwarding sound of the Windows machine to the Raspberry is also possible. Unfortunately it will sound horrible (choppy / barely understandable) – I am not sure what the reason is, as the Raspberry Pi processor is not maxed out (e.g. when streaming Web radio). The sound will sound the same over HDMI and analog output (tested today).

rdesktop -r sound=local 192.168.1.3

Some further options will improve your experience:

rdesktop -z -x lan -P 192.168.1.3

These switches have the following meaning:

-z: enable compression

-x lan: set experience to “LAN” (will show desktop wallpaper, windows while moving them etc.)

-P: enable caching to disk (i.e. the Raspberry Pi’s disk)

Some screenshots

rdesktop-on-raspberry-pi

 

libreoffice-rdesktop-raspberry

Experience

YouTube

YouTube will run, but very choppy – it will max out the Raspberry Pi’s processor. (This is a software problem – rdesktop is probably not using the efficient GPU of the Pi for processing). Sound quality is horrible, actually you can’t really understand it – it’s all chopped up. Sound quality will improve if you minimize YouTube (thereby limiting screen updates which are required, and lowering the load on the Raspberry processor). Sound will still sound choppy, though. All in all not good enough right now.

Sound

As mentioned above, sound quality (if forwarding sound) will be nearly unbearable. Maybe there are some better solutions (i.e. combining a sound streaming server which captures the sound and plays it back on the Pi).

The sound unfortunately will not improve if setting the Group Policy, and forcing sound quality to “high” on Windows. (use gpedit.msc)

Update

The sound problems seem to occur from buffer underruns on the Raspberry Pi side. (see below, xfreerdp).

Desktop experience

Especially with the optimised parameters (-z –x lan –P) the experience is really smooth. For word processing, spreadsheets and web browsing, you will be pleasantly surprised by the reaction speed.

Drawing & photo manipulation will be doable, but in a test with Paint, there was some slugginess.

Actually I see a huge potential in classical desktop / web application workspaces – where you don’t need multimedia, i.e. in a call center where people use web forms and interfaces to access your account with the company.

xfreerdp

xfreerdp is an alternative RDP client. You can install it using

aptitude install freerdp

And use it

xfreerdp -u Wanda -x l -z --plugin rdpsnd --data alsa -- 192.168.1.3

Please note the “x” in front of freerdp here.

This will connect with the user “Wanda”, enable LAN experience, enable compression (-z), and activate sound forwarding through the rdpsnd plugin. The two double dashes after “alsa” and before the IP of the host virtual machine ARE necessary.

Sound will still sound horrible – it will spew out a lot of “underrun occurred” messages on the console. We have tested different options to decrease load, increase latency, use the tsmf option, etc – nothing changed the horrible quality. Right now, the verdict stays the same: great for desktop computing, but not at all for multimedia applications.

There may be some improvement with the current GIT version of freerdp. We have not tested it yet.

Apr 222013
 

Right now, we have launched a Spanish Amazon sales account. We will be using the Fulfillment by Amazon in Spain service. Products will be added in the next couple of days, prices will be set, and we will ship our first batch of stock to Amazon in Spain until the end of next week, if everything works as expected.

Our customers in Spain should be able to profit by much speedier fulfillment & lower shipping charges (2,99 € per default, or free with Amazon Premium account).

What country should we put on our list next? Italy, UK, the US, or something else alltogether?

Apr 222013
 

Habt ihr euch schon gefragt, wie ihr vielleicht etwas mehr Struktur und Übersicht in eure Programme bekommt?

Die Lösung: Unterteilung in mehrere C-Files und Header unterteilen.

Hier habe ich mir von Gordon helfen lassen. Auf der folgenden Seite müsst ihr nach Adam im Browser suchen (Beitrag vom 4. April) https://projects.drogon.net/raspberry-pi/wiringpi/

oder ihr geht in euren Ordner mit euren Projekten/Programmen und kopiert folgendes ein:

git clone git://git.drogon.net/halloweenPi

Anschließend bekommt ihr ein Programm von Gordon geliefert, welches ein Makefile mit einem Beispiel enthällt.

 

Ein dickes Danke an Gordon!

 Posted by at 6:56 pm
Apr 202013
 

Unten findet Ihr einen kleinen Quellcode zum Steuern eurer PWMs mit den “+” und “-“ Tasten auf eurer Tastatur:IMG_0591

//Quellcode:

//ersten 2 LEDs auf dem Board auslassen!!!
//”a”    Abbruch des Programms
//”+”    PWM++
//”-“    PWM–

#include <wiringPi.h>
#include <softPwm.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <termios.h>    //Tasten ohne Return einlesen
#include <unistd.h>

//DEFINES
#define BUTTON1 0
#define BUTTON2 1
#define BUTTON3 2
#define BUTTON4 3
#define LED_AUS 0
#define LED_AN 1
#define LED1 0
#define LED2 1
#define LED3 2
#define LED4 3
#define LED5 4
#define LED6 5
#define LED7 6
#define LED8 7
#define PWM0 0
#define PWM1 10
#define PWM2 20
#define PWM3 30
#define PWM4 40
#define PWM5 50
#define PWM6 60
#define PWM7 70
#define PWM8 80
#define PWM9 90
#define PWM10 100
#define PWM_STEP 10

int main (void)
{
struct termios alt,neu;    //Zeichen einlesen
int i, ipwm_wert=0;
char ch=0;
printf(“PWM\n”) ;

if (wiringPiSetupPiFace()== -1)
exit(1);

for (i=LED1;i<=LED8;++i)
softPwmCreate(i,PWM0,PWM10);

//alles auf 0 setzen
for(i=LED1;i<=LED8;i++);
softPwmWrite(i,PWM0);
printf(“LEDs sind aus\n”);
delay(100);

//a=abbruch des Programms, ansonsten hängt sich Konsole auf (SSH vom MAC)
while(ch!=’a’)
{
//Zeichen direkt einlesen
tcgetattr(fileno(stdin),&alt);
neu=alt;
neu.c_lflag &= ~ICANON;
neu.c_lflag &= ~ECHO;
tcsetattr(fileno(stdin),TCSANOW,&neu);
ch=getc(stdin);
tcsetattr(fileno(stdin),TCSANOW,&alt);

if(ch==’+’)
{
ipwm_wert=ipwm_wert+PWM_STEP;
if(ipwm_wert>=100)
ipwm_wert=100;
for(i=LED3;i<=LED8;i++)
softPwmWrite(i,ipwm_wert);
}
if(ch==’-‘)
{
ipwm_wert=ipwm_wert-PWM_STEP;
if(ipwm_wert<0)
ipwm_wert=0;
for(i=LED3;i<=LED8;i++)
softPwmWrite(i,ipwm_wert);
}
printf(“PWM WERT: %i\n”,ipwm_wert);
}

//meldung beim Programmabbruch
printf(“Programm wurde abgebrochen!\nNeubespielung möglich…\n\n”);

return 0 ;
}

 Posted by at 11:30 am
Apr 182013
 

Kein Scherz – die Jungs von pcextreme bieten kostenlose Raspberry Pi Colocation Services an. D.h. man schickt an sie sein Raspberry Pi samt Zubehör (SD Karte z.B.), und sie schließen es ans Internet an. Man erhält sogar eine IPv6 Adresse zusätzlich!

500 GB fair use traffic sind in dem fabelhaften Preis von 0,00 € enthalten.

Wenn man das Raspberry Pi zurückhaben möchte, muss man ca. 7 € für den Versand zurück zahlen. Raspberry Colocation bietet an, ein Raspberry bei ihnen direkt zu kaufen (für die Colocation). Natürlich ist es aber auch möglich, ein pi3g Raspberry Pi zur Colocation zu schicken. Just saying Smile

Apr 172013
 

Vor kurzem habe ich die Gelegenheit gehabt mich mit Chrono zu treffen, und einen gemeinsamen Nachmittag mit sehr interessanten Gesprächen zu verbringen.

Apollo

Chrono verfolgt mit Apollo die Idee eines weitgehend selbst-erhaltenden, autarken, mobilen Hackerspaces. Er möchte damit auf die Reise gehen, und Leuten die keine Hackerspaces in der Nähe haben die Gelegenheit geben zu basteln, neue Techniken zu lernen und Ideen auszutauschen. Dabei versorgen sich z.B. die zwei Apollo Module über Solarzellen und möglicherweise auch Windenergie mit Strom, es sind Schlafplätze vorhanden, die tagsüber zu Softwarearbeitsplätzen umgerüstet werden, etc.

An Bord von dem Apollo-Projekt soll unter anderem z.B. eine CNC Fräse sein – Chrono überlegt aktuell einen Controller auf Basis des Raspberrys mit dem Realtime Kernel Xenomai zu bauen.

CNC stellt besonders hohe Anforderungen an harte Realtime-Fähigkeiten, um ein präzises Stepping hinzukriegen. Ein Litmus Test für den Raspberry – sollte sich das damit realisieren lassen, sind eine große Reihe anderer Anwendungen unproblematisch möglich, da weniger aufwendig.

Um Chrono und das Apollo Projekt zu unterstützen, haben wir zwei pi3g Raspberry Pis für diesen mobilen Hackerspace gestiftet. Bon voyage!

Dronen-Tracker Antenne und Proxy

Chrono hat für eine Drohne einen Proof Of Concept Tracker mit dem Raspberry Pi aufgebaut. Ebenfalls auf dem Xenomai Realtime Kernel basierend, werden von dem Raspberry Pi direkt über den GPIO Servos angesteuert, die die Antenne (im Testaufbau erstmal nur aus Pappe) positionieren. Das fahren der Antenne funktioniert auch über Stunden hinweg sehr zuverlässig – Chrono hatte mir sie demonstrieren können. (Sie hat für eine zusätzliche Geräuschkulisse zu Chronos’ Workstation und der angenehmen Musik im Hintergrund gesorgt).

Gleichzeitig wird über MAVLINK mit der Drone Kontakt gehalten, das Pi dient hier als MAVLINK Proxy. MAVLINK ist ein kompaktes Protokoll für die Kommunikation mit “Micro Air Vehicles”, d.h. auch besagten Dronen. Da über das MAVLINK Positionsinformationen übergeben werden, kann daraus die Antenne nachgeführt werden, um so optimale Reichweiten der Drone erzielen zu können.

Angedacht sind mehrere Basisstationen die jeweils den Aktionsradius der Drone erweitern können.

Diese Drone könnte auch optimal dazu eingesetzt werden um Kommunikationskanäle offen zu halten, indem sie z.B: WLAN Access Points boosted / ausfindig macht / mesh networks aufbaut …

Der Proof of Concept Code ist leider noch nicht releasebereit. Falls Chrono in dieser Richtung etwas releasen wird / einen Write Up machen wird, werden wir ihn natürlich verlinken. (Chrono stellt üblicherweise sehr hochwertige Step-by-step Anleitungen für ein weites Themengebiet ins Netz).

Xenomai

Xenomai ist wie bereits gesagt ein Realtime-Kernel-Ersatz (Framework) für den stock Linux Kernel. Damit ist hartes Realtime auf dem Raspberry Pi möglich, unter anderem auch stabiles PWM über die GPIO Pins in Software.

Weitere Informationen:

Apr 112013
 

As we have posted earlier, we own an old CanoScan LiDE 30. We are very satisfied with this scanner – but unfortunately it does not work on newer versions of Windows (e.g. Windows 7 64 bit, Windows 8) – Canon “forgot” to release updated drivers.

Raspberry Pi networked scanner sharing

A Raspberry Pi is perfect for a small, low volume server application. Today, we have put together all the pieces necessary to use it to attach the Canon scanner to our network, and scan from Windows once again.

BTW: It looks as though the Fujitsu ScanSnap 1300i might also be supported by SANE. This is the replacement scanner for the Canon flatbed scanner we bought – but it can’t scan books, for instance.

Step by step setup guide:

This guide is written for Raspbian. We have tested it with the latest Raspbian version currently available (2013-02-09).

Get the required packages:

sudo su
aptitude update
aptitude install xinetd sane-utils

xinetd is the Internet superdaemon which will start saned, the “Scanner Easy Access Now” daemon when a network connection to it’s port is opened (saned can’t do that on it’s own).

sane-utils contains the saned. (On Archlinux the package is called simply “sane”)

Raspbian automatically sets up the group saned and the user saned for you. It also adds the user saned to the group scanner.

Configure /etc/default/saned so it will start automatically (RUN=yes):

# Defaults for the saned initscript, from sane-utils

# Set to yes to start saned
RUN=yes

# Set to the user saned should run as
RUN_AS_USER=saned

Start saned, and test whether the scanner is recognized. Ideally you should do this as user saned, to see if all access rights for saned are setup correctly. Your scanner should naturally be attached to the Raspberry Pi. If it draws its power through USB, we recommend to use a powered USB hub.

root@raspberrypi:/home/pi# /etc/init.d/saned start

root@raspberrypi:/home/pi# su -s /bin/sh - saned
No directory, logging in with HOME=/

$ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 008: ID 04a9:220e Canon, Inc. CanoScan N1240U/LiDE 30
Bus 001 Device 007: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 001 Device 006: ID 046d:c31c Logitech, Inc. Keyboard K120 for Business

$ scanimage -L
device `plustek:libusb:001:008' is a Canon CanoScan N1240U/LiDE30 flatbed scanner

$ exit

root@raspberrypi:/home/pi#

I have included the # and $ prompt in this listing, so you can distinguish between commands the root user (#) issues and the saned user issues ($)

If you see your scanner here, great. If not – have a look at the documentation and further reading links we will provide at the end of this article.

The USB scanner itself is plug & play – you can attach it to the Raspberry Pi when you feel like scanning, and remove it after you have finished.

Prepare network sharing of the scanner

root@raspberrypi:/etc/xinetd.d# cat /etc/services | grep sane
sane-port       6566/tcp        sane saned      # SANE network scanner daemon

You should see the sane-port line as in the listing. If it is not in there, add it.

root@raspberrypi:/# cd /etc/xinetd.d

root@raspberrypi:/etc/xinetd.d# touch sane-daemon

root@raspberrypi:/etc/xinetd.d# which saned
/usr/sbin/saned

root@raspberrypi:/etc/xinetd.d# nano sane-daemon

This will set up the XInet configuration. Please use the following configuration for the /etc/xinetd.d/sane-daemon file:

service sane-port
            {
              socket_type = stream
              server = /usr/sbin/saned
              protocol = tcp
              user = saned
              group = saned
              wait = no
              disable = no
            }

Note that we used the output from “which saned” in the configuration above. If it is different for you – e.g. on Archlinux – adjust accordingly.

Set up saned to accept connections from your network by editing /etc/sane.d/saned.conf:

# saned.conf
# Configuration for the saned daemon

## Daemon options
# [...]
# data_portrange = 10000 - 10100


## Access list
# [...]
# The hostname matching is not case-sensitive.

#scan-client.somedomain.firm
192.168.1.0/24

#192.168.0.1
#192.168.0.1/29
#[2001:7a8:185e::42:12]
#[2001:7a8:185e::42:12]/64

# [...]

Please adjust the subnet specification 192.168.1.0/24 to your network architecture. You can also explicitly specify single IPs. If you do not edit this file, SaneTwain will hang when contacting your Raspberry Pi scanner server.

Now you can reboot the Raspberry Pi (sudo reboot), and continue to the set up on the Windows side.

Setting up Windows to access the SANE network scanner

We have tested with Windows 7 64 bit & Windows 8 64 bit.

Windows users use “TWAIN” drivers. Luckily, there is an application, which will create a bridge between TWAIN and SANE on the network. The author claims it does not work for 64 bit Windows, but it did work for us. Please report back in the comments about your success / failure stories on different Windows versions.

Download SaneTwain here.

SaneTwain Setup

image

Just enter your Raspberry Pi IP (if you do not know it, “ip addr show” will show you it’s network setup) as the hostname. Port and Username can stay the way they are. Look through the other settings, if you want to. The Mail tab, for instance, offers the possibility to set up an Evernote account you want to scan to.

Before you try to use the TWAIN driver SaneTwain offers, you should set up the hostname using the way we just described (by starting ScanImage.exe).

Scan

Now you’re set up for scanning. Use the “preview” button to acquire a preview, and the “scan” button to save the selected area to a PNG (it will be scanned with better quality, of course). The resolution can be set, also other options.

Wait until the scanner is finished with the preview and has repositioned itself, before you hit the “scan” button.

image

The TWAIN driver works for us, too. (Tested with IrfanView) – this is Windows 8 64 bit. No special tweaks were applied.

Setting up Linux to scan from the network scanner

If you have a Linux box, you can use basically any SANE Frontend to scan using the network.

You need to add the network scanner to a local SANE installation.

Edit /etc/sane.d/net.conf and add the IP of your server. You can specify multiple servers.

image

Test with scanimage –L once again, and after a while you will see your network scanner showing up.

Frontends

Try XSane. Noteworthy is also gscan2pdf which will convert scanned pages to multipage PDFs, and even OCR them for you!

Of course you should be able to scan from another Raspberry Pi on your network, or even the Internet.

simple-scan is a frontend for SANE.

Further Reading & Links

SANE

SaneTwain

How-Tos

We used the following how-tos in building this tutorial. Thanks, guys!

Optimization WordPress Plugins & Solutions by W3 EDGE