Go Premium for a chance to win a PS4. Enter to Win


Raspberry Pi





The Raspberry Pi Foundation works to put the power of digital making into the hands of people all over the world, so they are capable of understanding and shaping our increasingly digital world, able to solve the problems that matter to them, and equipped for the jobs of the future.

We provide low-cost, high-performance computers that people use to learn, solve problems and have fun. We provide outreach and education to help more people access computing and digital making. We develop free resources to help people learn about computing and how to make things with computers, and train educators who can guide other people to learn.

Share tech news, updates, or what's on your mind.

Sign up to Post

Python Script will not run because sshtunnel import to Python 3 does not seem import properly to the Pi.
I am thinking we are using the wrong version of ssh module python script for the Pi but I am struggling.  

 Hardware :
Raspberry Pi 3 Model B -  V 1.2  2015

OS Software :
pi@raspberrypi:~ $ cat /etc/*-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION="8 (jessie)"

import sshtunnel #import SSHTunnelForwarder
import mysql.connector

ID_String_Last = ["0"]

sshtunnel.SSH_TIMEOUT = 5.0
sshtunnel.TUNNEL_TIMEOUT = 5.0

with sshtunnel.SSHTunnelForwarder(
    ('**********this is the host in here **********'),
    ssh_username='', ssh_password='**********************',
    remote_bind_address=(',', 3306)
) as tunnel:
    connection = mysql.connector.connect(
        user='*********username**********', password='*****************',
        host='', port=tunnel.local_bind_port,

Python 3.4.2 (/usr/bin/python3)
>>> %Run '17-10- 15 V6.1 Pi mySQL to Ash server.py'
Traceback (most recent call last):
  File "/home/pi/Desktop/17-10- 15 V6.1 Pi mySQL to Ash server.py", line 3, in <module>
    import sshtunnel #import SSHTunnelForwarder
ImportError: No module named 'sshtunnel'

Does anybody know what version of module is required for this platform so that it …
Hello All

I am saying sorry in advance because I know less than zero about the capabilities of the Raspberry Pi, so if my question sounds stupid, take it from where it is coming from :D

Can a Pi run a pre-made GUI interface like windows or do I have to program my own?  If it can run a windows-looking OS can it connect to the internet? If the Pi loses power, when power returns can it be setup (like in windows there is an area for programs to begin at startup) so that the GUI comes back up and the internet automatically reconnects to a site?


I have a Raspberry Pi 3 Model B that a supplier gave me for a demo unit. It runs their OS for their demo software.

I want to try another application today using the Raspian OS. I have a 2nd new formatted SD Card.

Can I just swap the SD Cards in the Pi and install Raspian on the new card or could there be some files/configs from the original OS&app that are stored on some local storage (ie not purely on the SD Card)?

In other words, by swapping the new SD Card into the Pi and installing Raspbian on it, could I damage the original OS or is it 100% contained on the original SD Card? After this new test, I need to go back to the original OS (by inserting the original SD Card).

And yes, I know that Rapsberry Pi's are really cheap, but I can't get one until tomorrow and need to test something today.

Thank you for your time to read & answer this question.

So, the project I am currently doing is a child car alert system using RPi 3 Model B. The RPi would be able to detect the temperature, sound and presence of the child (PIR Sensor) from a child car seat in a vehicle then the Android app through BLE will be able to receive and display data from the RPi & send alert through app when sensors in RPi is triggered (i.e. high temperature in car).

So far, I have managed to build the RPi board with all sensors attached using Adafruit IDE in Raspbian. The problem now is building an Android app that could connect to my RPi board. I have researched some viable options and mostly suggested App Inventor. Is this true?

I am hopeful if anyone could guide me through any webpage or video tutorial on how to execute my project as I am very inexperienced in using RPi.

P.S: I am very new to RPi (~ 3 months) and learn solely from the Net so I appreciate any comments or tips from other experienced users on how to carry on with this project.
I am trying to install wordpress on my Raspberry Pi. I can install apache2 and php without a problem
When I try and install MySQL I dont get asked to change the Password after the install
Also when I try to install php5-mysql I get an error saying dependency is missing

How do I fix this so I can continue the Wordpress install
USB GPS Detection on Raspberry PI

I have some python code that scans WIFI packets and in my receiver code I have an instance of a GPSPoller class.

The issue I am having is that withing the gps library gpscommon.read() blocks when there is no GPS dongle connected to the Pi.

I couldn't seem to find an elegant way to check to see if gpds has any devices added to its device pool so I could skip my code that starts polling gpsd for position data.

I don't want to write code to check for /dev/ttyUSB0 as that does not seem like a very elegant solution.

Can anyone provide advice?

Author Comment

lsusb would list my device but then I would have to write software that looks for the specific device. If I swapped out the receiver for a different kind I would have to change the code to take that into account.

I hope there is a better way to do it that lsusb.

Expert Comment

by:Mark Wieder
Yeah, if you want the code to be more generic (how often do you intend to swap out a different gps dongle?) then lsusb probably won't help here. You might try setting up a socket connection to port 2947 and trap the error, but you'll have to do this before instantiating the gps class because the class initializer does that as well.
pip install twilio
works perfectly on a Pi2.   Just bought a new Pi3 with the latest NOOB.  
same version of python (2.7.9), same version of pip (1.5.6).  I keep getting the error:

TypeError: __str__ returned non-string (type Error)

Googling around, I checked and verified that
- no network issue, Chromium connects to https://pypi.python.org/simple/twilio/
- my date/time on the computer is correct
- some talk about --trusted-host=http://pypi.python.org/simple/ but that parameter is not valid on pip
- some talk about creating an /etc/pip.conf file and adding trusted-host=pypi.python.org but that makes no difference (assuming pip every reads that file...)

My guess is that it has something to do with the SSL certificates... but I have no idea how to solve it.  
sudo apt-get install libssl-dev did not help

Hi all,

I am using Backuppc, installed on a Linux server, to backup one of my Raspberry Pi.

I've configured the host as you see here:
But, when I run my full backup, I can still see the /mnt folder and its files into it:
What am I doing wrong?
My son has set up a Raspberry Pi in the home to display images. He enabled FTP and told me to connect via WinSCP. I have done this, and I see all the folders on the Raspberry Pi. However, I cannot upload images or do anymodifications on the raspberry pi due to a permissions problem.

Any ideas what could be the cause of this?

I am logging in with his username and password, which has full rights to the Pi.

Thank you.
I have about 80 desktop users. Each has an APC SmartUPS.  We've never bothered connecting them via USB to the computers because we didn't want to contend with the PowerChute management software.  But this is no good. As it is, the way I usually find out that a battery is no good is when we have a power outage and someone's UPS fails. I need to get a better system than that :-)

Has anyone found a centralized UPS management solution? APC has a business edition of PowerChute, but it's limited to just 25 devices. What's up with that? I need a that could monitor and manage all of our UPS devices.

Someone should build a Raspberry Pi solution for this that connects to the UPS via USB and the network via WiFi.
How do I embed VideoLan VLC player in a HTML webpage on Raspbian on RPi3?
I would like a script to change audio output from HDMI to Bluetooth (and vice versa) for a Raspberry Pi 3. Not knowing scripting on linux (Raspbian). I have the bluetooth enabled.

Also would like to run this script from a remote computer.

Any assistance appreciated.
Hi everyone,

So I've spent the past week reading and trying to understand the python language and more importantly the CherryPy web framework.
To be honest Im getting no-where quickly...

What I'm trying to do is simply build a frontend to a Raspberry Pi project I've been developing.
The CherryPy web framework seems perfect for this as it is small and contains its own web server that would suite my needs perfectly.

An admin user attaches to the Raspberry PI AP and is immediately directed to a webpage (This I have solved quite easily).
The webpage is presented by the CherryPy web server.

I have an index.html which it returned from my CherryPy script.

import os, os.path, sys
import cherrypy

# Configuration file to access server over network and define ports

class menu(object):
    def index(self):
        return open('index.html')

(Fairly simply until now I know)

What I would like to do is have buttons on my index.html that can be pressed and return os.system('mkdir boom')  (obviously my system commands will be a little more than this.. They will start and stop services.

The buttons will eventually be toggle switches, so going to the page will need to return the current status of the running process. Red if the process is not running and Green if it is running. I think I need to be interacting with jquery on my index.html page to achieve this...

This whole area is new to me and …
Which is the best handheld device for learning programming and later also developing programs on the go anywhere?

So that I can write a few lines of code on the metro, bus, when waiting for a flight etc.

I was thinking of this Raspberry Pi, but some don't recommend it for learning programming.

Is there any other alternative, something with long battery life in the size of a big smartphone (or maybe 9 inches display)?

Recently I used the Retropie emulation software for Raspberry Pi. It is a really cool software and is very handy and attractive. So, I was wondering whether I could replicate these softwares on sd cards, install them on pis and start selling them for some small scale business. I would like to know, if doing such a thing would be legal. Actually, there are quite few ideas about using pis as portable media centers, portable game consoles, a simple portable desktops or just a cheap monitoring cameras. It can be customized to the very end for users and can be an attention grabber in certain circles. But what would be my legal position and what, if any, licensing would it require to start such a business?

Thanks in advance.
Is it possible to program the Raspberry PI camera to do OCR?
Need it to recognize a list of characters and when seen, write the info to a file.  
Need the following info with each entry;
Captured data
Date and time (down to the second)
Location (can be GPS or user entry)

And once a day (or at user request) upload data to a online database.
I need a code in Embedded C for making call andi sending SMS by using Raspberry pi 3 and GSM SIM 900. Please help me. I am new to Raspberry pi

Configuration Raspberry Pi 3 with camera
QNAP TS-453 Pro

I have a Raspberry Pi 3 up and running with the help of this image: http://ronnyvdbr.github.io/RaspberryIPCamera/
The guy who developed the image has a blog where he describes how to connect the Raspberry to Survellance Station:

I tried it and can connect to Surveillance Station, using these settings:

Camerabrand:       Generic Model
CameraModel:      Generic RSTP
Cameraname:        Camera 1
HTTP URL:              /
IP address:   
Port:                        80
RSTP Port:              8554
Username:             <empty>
Password:              <empty>

When I use the rstp url in VLC, it works great: rtsp://
On Surveillance Station, every now and then the connection works, the camera in connected and I can see what it's filming.
After less than a minute the camera is disconnected.

For now it looks like the only times I had a successful connection when I played the stream in VLC as well....
But I can not reproduce that, because it's not working this way every time....

What could be the cause of this ?
I have FreeRadius installed on a Raspberry Pi and would like to know how to enable Accounting.

I have FreeRadius installed on a Raspberry Pi and everything seems to be working fine.

I would like to implement a limit on the number of logins per identity and was hoping someone could share with me how to achieve this.

My only goal is to provide some control of people sharing access credentials among those that shouldn't have them.

I have an analog door opener system in my building, this is the phone which opens the door: http://pasteboard.co/4JgctXi4x.jpg
I have a raspberri pi 3 model b, and a Pcf8591 ADC/DAC converter: http://articulo.mercadolibre.com.ar/MLA-641278286-modulo-pcf8591-conversor-4-ad-da-i2c-arduino-raspberry-_JM

What I want to do, is to connect the wires that goes to the analog door opener phone system into Raspberri PI, so I can hear/speak from a sip softphone installed in the raspberry pi.

Is this possible? I measured the voltage in the mic phone/speaker, it's shown in the picture. Not sure how to proceed with this.

Anyone? Thank you!!
hi everyone,
i'm trying to start a project for a box storage facility, i know thing allready have been done but i would like to do mine :)

the code is not the problem but the electronics yes. The problem is not U = Ri :) but how can i mux the doors sensors ? If some one open the door very fast and then close what would happen ... is important not to miss the change of state ...

So any idea is really welcome

Thanks very much

I have been trying to set up I2C communication between my Raspberry Pi and two arduino pro minis using this tutorial:

I have done all the steps correctly, installed all the required dependencies and modified all the required files, yet "sudo i2cdetect -y 1" does not detect the arduinos. I have two PCF8591 AD/DA converter modules, and when I connect them to the RPi using the SCL and SDA ports, they are detected and shown by "sudo i2cdetect -y 1". But the arduinos do not show up. This is How I have connected the RPi and the Arduino Minis:
RPi                -> Arduino
3.3V               -> Vin
GND               -> GND
SDA(GPIO2)  -> SDA(A4)
SCL(GPIO3)   -> SCL(A5)

I would like to know what is going wrong here. Please suggest.

Have you worked with a Pinbook for surfing or other?
LVL 10

Expert Comment

by:Brandon Lyon
I thought about getting one back when they announced it. I decided to wait for reviews mainly because I was unsure how good (or bad) the screen and keyboard might be. That and other options are getting ridiculously cheap.
LVL 51

Expert Comment

by:Jackie Man
According to its spec, PINEBOOK is similar to a Raspberry Pi 3 and it may be the reason why it can be made so cheaply.
Hi experts.

I have been trying to automate some infrared command through my Raspberry Pi, using the IRDroid-Rpi infrared transceiver (http://www.irdroid.com/2016/10/discover-how-to-turn-raspberry-pi-into-a-infrared-remote-control-using-the-irdroid-rpi/). These commands must be first learned from my Set Top Box infrared remote control using irrecord, but it is a commercial remote.

I have followed the documentation and finally got the IRDroid-Rpi to work. However, it will only work if I learn commands from commercial remote controls like a Samsung TV remote control. My STB remote control is non commercial, and I have not been able to make the IRDroid-Rpi learn and send the commands correctly. Here is my procedure and files:

pi@raspberrypi:~ $ sudo irrecord -f -d /dev/lirc0 lircdtp2.conf

Press RETURN now to start recording.
Found const length: 108301
Please keep on pressing buttons like described above.
Creating config file in raw mode.
Now enter the names for the buttons.

Please enter the name for the next button (press <ENTER> to finish recording)

Now hold down button "KEY_CHANNELUP".
Sorry, something went wrong.
Try again.
Got it.
Signal length is 3

# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
# this config file was automatically generated
# using lirc-0.9.0-pre1(default) on Tue Apr 25 23:40:23 2017
# contributed by 

Open in new window


Raspberry Pi





The Raspberry Pi Foundation works to put the power of digital making into the hands of people all over the world, so they are capable of understanding and shaping our increasingly digital world, able to solve the problems that matter to them, and equipped for the jobs of the future.

We provide low-cost, high-performance computers that people use to learn, solve problems and have fun. We provide outreach and education to help more people access computing and digital making. We develop free resources to help people learn about computing and how to make things with computers, and train educators who can guide other people to learn.