Raspberry Pi

167

Solutions

287

Contributors

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

Hi There

I am playing with my raspberry pi with raspian OS (wheezy). I have three local accounts: root, pi and gc.
I wanted to test PAM Module pam_time.so to restrict SSH access for user pi (time limits). The idea was to restrict pi to not allow ssh login avery day from 0913-0920 (for testing).

Now of course something went wrong and i am not able to login by ssh at all (not with user gc and not with user pi... root is blocked anyway by sshd_conf). The configuration in /etc/security/time.conf looks

ssh;*;pi;!0913-0920

What I can see is, that I made a mistake with the date: it should look like
ssh;*;pi;!Al0913-0920

So my question: How can I fix it? And would it be correct that way?

I do not understand why i am not able to login by ssh with user gc at all, as the rule is only for user pi??
0
Is there a way to make a Raspberry Pi boot via PXE?  
Are there any similar devices that could boot PXE?

What are the complications as far as the image that would be downloaded by the PXE bootstrap?
0
I'd like install Asterisk on a Rasberry Pi, and hook it up to a PTSN line. From what I've read, I'll need an ATA adapter.  Any recommendations for a good adapter, preferably from personal experience :) ?
0
on a raspberry pi I have a python script which runs without error from within Idle3 (sudo /usr/bin/idle3) When I try to run it from a shell script it fails with the error message "ImportError: No module named pytz".  It has no problem finding the other modules (picamera, time, and datetime)  I installed the pytz package using apt-get.
My searches have yielded suggestions relating to PATH, python installation etc. I cannot find documentation that has helped.
0
Has anybody found a good battery solution for the Pi that will let it run without regular wall power for a decent length of time - 2 or more hours?
0
I want to build a software Web server on a Raspberry Pi running Linux and then place it directly between an existing firewall and a cable/ADSL ISP modem.  The idea is that if via my dynamic IP I could access the Web server on my Pi but otherwise all traffic would flow through to the existing firewall and then through to my home system. I do not want to have to open any ports/make any modification in the existing firewall.  The Raspberry will have two NIC's - the on-board one and then one that works through the USB.  Is this possible and if so how would I do it? I know there are lots of firewall apps for Linux - not sure if that would be necessary here but if it is then I would be willing to implement it. Again, I do not want to make any changes to the current firewall, the only traffic I want to interrupt is to my Web Server and if it has to be on some strange port not usually associated with a Web Server so be it. Also if there is a 'Linux software appliance' distribution that I could install on the Pi that would also let me add a Web Server that would be ok as well.
0
Having some fun with a Raspberry Pi, setting up a little Python script to run a ping, and if it fails, send me an email via gmail - I'm a novice in Python, but using google-fu I was able to do just that (and I have full understanding of how this is working).

What I'd like to achieve, is be able to use a list (in a txt file) where I can have either by line or CSV, a list of hosts to run the script on .    

import smtplib
import datetime
import os
import sys
import time
#Set Host
host = "histname.com"
def sendmail(message):
    debuglevel = 0
    server = smtplib.SMTP('smtp.gmail.com:587')
    server.starttls()
    server.login('username@gmail.com', 'password')

    from_addr= 'fromuser@gmail.com'
    to_addr= 'touser@gmail.com'
    subj = "Network Down", host
    date = datetime.datetime.now().strftime( "%d/%m/%Y %H:%M" )

    message_text= message
    
    msg = "From: %s\nTo: %s\nSubject: %s\n Date: %s\n%s" % ( from_addr, to_addr, subj, date, message_text )

    server.sendmail(from_addr, to_addr, msg)
    server.quit()
def ping(ipaddress):
    os.system("clear")
    result = os.system("ping -c 5 %s" %(ipaddress))
    os.system("clear")
    return result


ip = host
bFailed=False
ictr=0
while True:
    result =ping(ip)
    if result != 0:
        print ('Ping failed', host) 
        if bFailed==False:
            mess = ("Is Down", host) 
            sendmail(mess)
        bFailed=True
    else:
        if bFailed==True:
            mess= ("Mesasge Body 2") 
       

Open in new window

0
I am looking for a small form factor PC like the Raspberry Pi that has two Ethernet ports and can run a version of Linux from an SD card.
0
Hi,

What's the status of Netflix on Raspbmc? Is it only possible via Playon?

J.
1
Hi,

I wonder if there are solutions to monitor my ups (basic apc 350). I d like to get an email or sms whenever ups is activated/used and when its not used anymore.

Are there budget solutions for it or simple ways to configure via raspberry pi?

Pls advise.
J.
0
See the configuration below. The dhcp server does not like the statement "interface eth0.1". It does not work with the interface statement left out. I have enabled 802.1q trunking on the port that the NIC is connected to and I am distinguishing between the vlans with eth0.x where x is the vlan number. To my knowledge I therefore need this configuration. I also have an extensive iptables script that distinguished between two different names, eth0.1 and eth0.2.

This is on Raspbian for Raspberry PI. Pretty much Debian.

/etc/network/interfaces
auto eth0.1
iface eth0.1 inet static
        address 192.168.1.254
        network 192.168.1.0
        netmask 255.255.255.0
        broadcast 192.168.1.255
        dns-search nodenet.local
        pre-up iptables-restore < /etc/iptables.rules
        post-down iptables-save -c > /etc/iptables.rules


auto eth0.2
iface eth0.2 inet dhcp

Open in new window


/etc/dhcp/dhcp.conf and /etc/dhcp3/dhcp.conf:
ddns-update-style none;
log-facility local7;

default-lease-time 7200;
max-lease-time 12000;

subnet 192.168.1.0 netmask 255.255.255.0 {
        interface eth0.1;
        range 192.168.1.105 192.168.1.200;
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.1.255;
        option routers 192.168.1.254;
        option netbios-name-servers 192.168.1.254;
        option domain-name-servers 192.168.1.254;
        option domain-name "nodenet.local";
        option domain-search "nodenet.local";
        option ntp-servers 192.168.1.254;
        option netbios-node-type 8;

        host Tom {
          hardware ethernet 00:25:fc:66:a8:18;
          fixed-address 192.168.1.208;
          option subnet-mask 255.255.255.0;
          option broadcast-address 192.168.1.255;
        }
}

Open in new window

0
Dear Experts,

Here is a strange thing for you. I went to bed Tuesday and everything in my home network was working well.

Wednesday morning before going to work I want to reply an email. My internet is not accessible from my laptop. I see that my wireless connection is established, but my NIC card is not connected to the Netgear router. The Netgear router is not able to connect with the ISP modem, not obtaining the public IP address.

I came back that day and figure that my Raspberry Pi also does not have connectivity via NIC with the Netgear Router. After checking the Netgear router I see that all its network cards are not able to establish a connection. I called Cox to see if it was them and it wasn’t. I put a second laptop (work) in the network and got the same result no connectivity. I put that same laptop directly to the ISP modem and yes I get to go to the internet this way. So for sure it was not my ISP modem.

Basically all the NICs are affected for the Netgear router, Raspberry Pi and even my laptop.

To make matters worse I purchased a new home router and my laptop now only works with the wireless card to access the internet and it shuts down every ½ hour or so.  It shuts down if I do certain things like down load from the web something or try to check this file that I see in the event viewer an “MSS.log”(C:\ProgramData\Microsoft\Search\Data\Applications\Windows\MSS.log).

For all this to happen overnight leads me to believe that my systems were hacked …
0
I have a simple temp sensor pushing data to Xively via my Raspberry Pi.. Ocassionally I will get readings like -1500 or 290. What I am trying to do is limit these readings and for some reason this code won't work... any ideas?

def read_temperature():
   tempfile = open("/sys/bus/w1/devices/28-000005aac776/w1_slave")
   thetext = tempfile.read()
   tempfile.close()
   tempdata = thetext.split("\n")[1].split(" ")[9]
   temperature = float(tempdata[2:])
   temperature = temperature / 1000
   temperature = 9.0/5.0 * temperature + 32
   temperature = "{0:.2f}".format(temperature)
   if temperature<0 and temperature>140:
     read_temperature()
   print('%s' % ( temperature )+'Degrees Fahrenheit')
   return temperature

Open in new window


So what I am trying to do on lines 10 and 11 is rerun the function if the value is out of bounds... doesn't work. The functions runs but the extreme values still get through.
0
How do I create a subdomain in apache2 for a domain that I am hosting on my Raspberry Pi? Next, how do I set up the A record to point to the subdomain?
0
I am trying to set up Citadel on my Raspberry Pi. I can send and receive emails internally, but nothing externally. The domain name domgarofalo.net points the IP address of the Pi.

Where should I be looking to troubleshoot this?
0
I tried removing Pwnie Express from my Raspberry Pi. I tried:

UNINSTALL_raspberry_pwn.sh

on the following site:

https://github.com/pwnieexpress/raspberry_pwn

When I ssh into my pi I still get the Pwnie Express message (see attached)

What am I doing wrong? I don't want that message appearing when I ssh into my Pi anymore. How do I get rid of it?
pwnie.PNG
0
Hi,

I'd like to attach an USB to my raspberry pi with raspbmc.
Is there a way to easily sync video-files from my Synology (RSync?) to this raspberry pi? I'd then remove the smb shares.

Please advise.
J.
0
I need some help here .. I want to connect a Fujifilm EXP-2500 to a raspberry Pi, in order to save pictures taken with the EXP-2500 on a hard-drive.

In this topic I would like to know which solutions I have to save the pictures, coming through a VGA or a DVI port from the EXP-2500, in the Raspberry Pi. The easiest solution is the following :  An Epiphan© VGA2USB frame grabber. But this device has too many features towards the use that would be made of it : only take a few images each hour (maybe 10!). Do I have any other (and cheaper?) solution to "digitalize" the VGA/RGB- or DVI signal ?

Thanks in advance

Clément
1
Hi,
I need some help here .. I want to connect a Fujifilm EXP-2500 to a raspberry Pi, in order to save pictures taken with the EXP-2500 on a hard-drive.

The problem in this topic is the communication with the EXP-2500 : I've got 2 options : first of all, a 2wires cable that sends a signal when I need to capture an image. Using this signal in the Raspberry Pi wouldn't be too difficult, but I would prefer the 2nd option : The Endoscopy Processor (EXP-2500) has got an option for serial communication with a printer. I already managed to connect a computer to the serial port, but when I try to "print" an image with the EXP-2500, it only sends my computer a few bits (248 I think), two times the same ~128 bits sequence. But after that nothing more, except a message on the EXP-2500 annoucing a time out error while communicating with the printer.
It looks like the EXP-2500 is sending the beginning of a protocol to the computer, but as I am too young to know how RS232 printing was supposed to work, I'm here asking for help.
The EXP-2500 is able to communicate using the RS-232 port to 3 different devices : two Sony printers (a Sony UP-51MD printer and a UP-25MD if I remember well, and to device called "CP900" -no more infos about this one.).
What I need here is the protocol used by these printers, so that I could emulate the behaviour of a printer with the raspberry Pi. Once I have it, I'll be …
0
Dear Experts,

I just got a raspberry Pi. I want to install the application XBMC. I started yesterday following the instructions from the site bellow:
 
http://www.raspbian.org/RaspbianXBMC

It was going well until step 8: Prepare the XBMC code for compilation.

    cd xbmc-rbp/
    sed -i 's/USE_BUILDROOT=1/USE_BUILDROOT=0/' tools/rbp/setup-sdk.sh
    sed -i 's/TOOLCHAIN=\/usr\/local\/bcm-gcc/TOOLCHAIN=\/usr/' tools/rbp/setup-sdk.sh
    sudo sh tools/rbp/setup-sdk.sh
    sed -i 's/cd $(SOURCE); $(CONFIGURE)/#cd $(SOURCE); $(CONFIGURE)/' tools/rbp/depends/xbmc/Makefile

After this command line:   cd xbmc-rbp/

Nothing happens.

I wonder why I am not able to install this application. Is there a better way to do it?

For any help on this much grateful Experts...

Regards, M
0
I could use a programmable microwave like this one.

MQ: Do you think this guy will be New Zealand's next billionaire?
0
Hello Experts,

How do I copy / Image a Raspbian SD card.  When I put the SD card into my Win/XP laptop it does not see it.  I'm guessing that when I set up the SD card on my Raspberry that it formatted it in to a different format that Win/XP doesn't recognize so it doesn't see it.  I have a SD card with Noobs on it and Win/XP sees that card.  I have used Win32 Disk Imager and it doesn't see the Raspbian SD card.

Thanks!
0
I am attempting to start FEH with several command line switches when Raspbian boots on my raspberry pi.  I tried putting it in the RC.local, but I am not having any luck because I am not sure of the syntax to use.  

Can someone tell me what to add to the rc.local file to run feh?

Here is what I type in to start it from a terminal window
feh -Z -F -Y -q -z -r -D 6 /media/USB
0
I'm hoping someone can suggest a good PDF reader.  I have Raspbian and am using XPDF but it is very basic.  Can the Adobe Linux version run on the PI?  I'm not finding much information on it for the PI.  Thanks Much!
0
I'm making a web kiosk display board using a raspberry pi and I want to send some key strokes to the browser window 2 minutes after it's loaded. The script sends the logon details for a webserver.

I've got a script that sends the keystrokes which works fine from the telnet console:
#!/usr/bash
username="username"
password="password"
echo "Setting Display"
export DISPLAY=:0
echo "Sending Username"
for char in $(sed -E s/'(.)'/'\1 '/g <<<"$username"); do
    xdotool key $char
done
xdotool key Tab
echo "Sending Password"
for char in $(sed -E s/'(.)'/'\1 '/g <<<"$password"); do
    xdotool key $char
done
xdotool key Return
echo "Waiting 5 Seconds"
sleep 5
echo "Setting Remember Password"
xdotool key Tab
xdotool key Tab
xdotool key Return
echo "Finished"

Open in new window


I've tried to add
bash /home/pi/logon.sh

Open in new window

to the rc.local file - but it doesn't send the keystrokes to the browser?

Does any one know why that would be? As I say - it works fine from the telnet window if I run the script, but it doesn't work when run from boot.

I had
sleep 120

Open in new window

on the line before it to stop if firing right away and wait until the browser has loaded - and I know the script is running from rc.local, because when I remove the sleep command, I see the echos from the script.

Any ideas?
0

Raspberry Pi

167

Solutions

287

Contributors

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.