Meltwater's Raspberry Pi Hardware

Embed Size (px)

Citation preview

  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    1/22

    Meltwater's Raspberry Pi Hardware

    Raspberry Pi Educational Hardware Kits

    stay updated via rss

    Guide ToDirect Network Connection

    159

    Raspberry Pi Remote Connections Without A

    Network!

    o keyboard or screen available for your Raspberry Pi, but you have a laptop?

    There are often times when a HDMI monitor is not available to use with your Raspberry Pi. In thosecircumstances it can be very useful to remote connect using a nearby network and a laptop (see

    the Guide toRemote Connections (http://pihw.wordpress.com/guides/guide-to-remote-connections/)However, sometimes there isnt a network available either!

    So how can we make use of a laptop screen and keyboard when there is no network?

    As discussed previously (in the Guide toRemote Connections(http://pihw.wordpress.com/guides/guide-to-remote-connections/)), there is the option of using a(console) TTL-serial cable, however this only provides rather slow access. The serial connection wontsupport X11 (which as we have seen, allows us to run graphical programs too), and you wont be ableuse VNC or shared folders if you have them setup.

    The answer is a simple network cable!

    (http://pihw.files.wordpress.com/2013/04/directconnect1.png)Connect and use your Raspberry Pi with just a Network Cable, a standard Imaged SD Card and

    Power!

    It is advisable to set this up before you need it so you can be sure that it is configured and workingcorrectly. As long as you have an SD-Card reader available, you can switch between the configurationusing a laptop (or directly on the Raspberry Pi if you have a screen/keyboard at the time).

    http://pihw.files.wordpress.com/2013/04/directconnect1.pnghttp://pihw.wordpress.com/feed/http://pihw.wordpress.com/http://pihw.files.wordpress.com/2013/04/directconnect1.pnghttp://pihw.wordpress.com/guides/guide-to-remote-connections/http://pihw.wordpress.com/guides/guide-to-remote-connections/http://pihw.wordpress.com/feed/http://pihw.wordpress.com/
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    2/22

    Remember if you need the wired network for your computer (i.e. to get internet) then you shall have tomake a choice about which one you wish to use (or get an extra network port by adding a USBnetwork dongle). If you use wireless connections, then you can still have both!

    Any standard network cable should be suitable (needs to have a male RJ45 connector on each end),most cables available will be fine for our needs.

    ote:You can use a normal network cable since the Raspberry Pi LAN chip is smart enough to reconfiguritself for direct network connections (in the past older computers would have needed a special cross-overcable).

    Ive also created a cut-down version of the instructions for more advanced users who wont need all

    the details:

    In A Nut ShellDirect Network Connection (http://pihw.wordpress.com/guides/direct-network-

    connection/in-a-nut-shell-direct-network-connection/)

    How to use a direct network cable

    What are we trying to achieve?

    A good way to remotely control a Raspberry Pi is to connect it to a network and use one of the methoddiscussed in the Guide toRemote Connections (http://pihw.wordpress.com/guides/guide-to-remote-connections/). This will provide access to the terminal, by usig SSH, even the ability to view the deskto

    using VNC, or the ability to run graphical programs as if they were running directly on the laptop itse(see below for X11 Forwarding). We just need to make the network link work directly without requrina full network setup (with Router etc).

    Making a network connection work

    Normally, if you take a Raspberry Pi and directly connect it to a network, it will attempt toautomatically find an IP address (see bottom of the page for information about IP Addresses and whatthey are) by requesting one from your Router or other device running a DHCP server (a protocol whicautomatically deals out addresses to computers as they attach to a network).

    However, if you connect the Raspberry Pi directly to another computer, not a lot will happen. TheRaspberry Pi wont get an IP Address since there isnt a DHCP server to talk to (it cant talk to anythinother than the laptop).

    http://pihw.wordpress.com/guides/guide-to-remote-connections/http://pihw.wordpress.com/guides/direct-network-connection/in-a-nut-shell-direct-network-connection/
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    3/22

    Other computers will often give themselves a default address (in the address range 169.254.0.0 169.254.255.255) but the Raspberry Pi doesnt do this (yet). Besides even if the Raspberry Pi did, wewould still need to know what address it had picked to be able to connect to it!

    To get around this, we have to give the Raspberry Pi a fixed IP address (i.e. we tell it what its IPAddress should be so it doesnt have to wait for one).

    There is just one complication to this, and that is if your laptop is configured to a fixed IP too. At first

    this may not seem like a problem, since if both IPs are fixed then we will know the address of bothcomputers every time.

    However for them to be able to talk to each other directly, they need to have similaraddresses (atminimum the first number should match, but we shall match at least the first 2 in this case to work widefault network settings). For more information on this, see the section at the bottom of the page abouSUBNETs.

    Step 1 Find the Laptops Network Settings

    Before we power up our Raspberry Pi, we can have a look at the network settings of the computer weare planning on connecting to and determine if the address is automatically allocatedor fixed.

    Windows Instructions:

    1. From the Start Menu, run the Control Panel.

    (Windows 7/Vista) Open Network and Sharing Center and click on Change adapter settings onthe left side.

    (Windows XP) Open Network Connections

    2. Find the item which relates to your Wired network adaptor (by default this is usually called LocalArea Connection).

    (https://reader009.{domain}/reader009/html5/0313/5aa7faae8df96/5aa7fab13240c.pnLocate the Wired Network Adaptor Local Area Connection

    3. Right-click on it and open Properties.

    (https://reader009.{domain}/reader009/html5/0313/5aa7faae8df96/5aa7fab16d3a1.pnNetwork Properties Window, find the TCP/IP Entry

    4. Select the item which is called Internet Protocol (TCP/IP) or Internet Protocol Version 4(TCP/IPv4) if there are two (the other is Version 6), and open the Properties.

    http://pihw.files.wordpress.com/2013/04/networkproperties.pnghttp://pihw.files.wordpress.com/2013/04/networkadaptors.png
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    4/22

    (https://reader009.{domain}/reader009/html5/0313/5aa7faae8df96/5aa7fab220d6f.png)Wired Network Adaptor is configured as Automatic

    Hopefully, the IP Address will be set to Obtain an IP address automatically. If not dont worry, justtake a note of the IP address and Subnet Mask set here (you may find the rest of the information usefuto keep, but we wont need it this time). If you know what you are doing, you can change this settingto automatic, or you can leave it alone (we shouldnt need to adjust it as long as we know the IP

    Address).

    Mac and Linux:

    You will need to locate the settings for your wired adaptor and check to see if the IP Address isconfigured automatically, or fixed to a specific value.

    To get to network settings on Mac OS X:1) Load System Preferences.2) Click Networks.

    (http://pihw.files.wordpress.com/2013/04/mac-lan-auto.png)(MAC) Wired Network Adaptor is configured as Automatic

    Step 2 Setting the Raspberry Pis IP address

    Option 1: Quick Setup / Setting up when you dont have a monitor

    This quick method skips all of the testing which can be performed if we have a Raspberry Pi runningwith a monitor and keyboard attached. If you run into problems, then follow the steps in Option 2, totest the network settings.

    1. Ensure the Raspberry Pi is powered off, and remove the SD-Card.

    2. Insert the SD-Card into a card reader and plug it into your laptop.

    3. Find the drive and you should find several files on the Card (note it a lot smaller than youd expectsince it is only the boot section of the Card (the rest is hidden)).

    4. Make a copy of cmdline.txt and rename it cmdline.normal

    5. Edit cmdline.txt and add the IP address at the end (be sure you dont add any extra lines).

    http://pihw.files.wordpress.com/2013/04/mac-lan-auto.pnghttp://pihw.files.wordpress.com/2013/04/networkpropertiesauto.png
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    5/22

    For network settings where the IP address is obtained automatically, use an address in the range169.254.X.X (169.254.0.0 169.254.255.255):

    ip=169.254.0.2

    For network settings where the IP address is fixed, use an address which matchesthe laptop/computeaddress exceptthe last one.

    ip=192.168.0.2

    Ensure you take note of this IP address(you will need it every time you want to directly connect tothe Raspberry Pi).

    6. Make new copy of cmdline.txt and rename it cmdline.direct

    7. To swap between configurations, just replace cmdline.txt with either cmdline.normalor cmdline.direct (or use the commands in Option 2 to do it directly on the Raspberry Pi the changewill take effect next time you power up)

    8. Return the card to the Raspberry Pi. Attach the network cable attached to both the computer andRaspberry Pi and power up.

    NOTE THE FOLLOWING:

    1. You will need to wait for your computer to finish detecting the network settings (you may see a smanetworking icon flashing in your system tray while it does, or open up the network settings to see whenit has finished and has an IP address) it can take around 1/2 minute. Your computer may report theconnection as limited or no connection when connected to the Raspberry Pi in this way, this isnormal as indicates it is a direct computer to computer connection rather than a standard network.

    2. If you forget or decide not to plug in the network cable, the Raspberry Pi willwait 2 minutes(oruntil you connect the cable) before completing its start-up (so if you only have a keyboard andmonitor attached, you need to wait!).

    3. If you are using multiple wired network adaptors (i.e. Using an extra USB-LAN dongle) on yourcomputer you may find you have to unplug the other network cable and reattach afterwards (myWindows XP machine needed this before it would connect through the direct link).

    Option 2: Set-up using a monitor and keyboard (i.e. before you really need

    it):

  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    6/22

    You will now see that having a keyboard and monitor available at this stage is helpful for when we setthis up, as we can test each step.

    1. Boot up the Raspberry Pi and plug in the network cable to both machines.

    2. When the Raspberry Pi has booted ensure you log in and open the terminal if not already open.

    Type the following:

    hostname -I

    You will probably find that nothing is shown, as this is trying to show you the current IP address(which is not allocated yet). If it does show something, then you may have already have a fixed IPaddress (if you do take note of it in case you need to put it back later).

    3. Now set the new address as follows:

    For network settings where the IP address is obtained automatically, use an address in the range169.254.X.X (169.254.0.0 169.254.255.255):

    sudo ifconfig eth0 169.254.0.2

    For network settings where the IP address is fixed, use an address which matchesthe laptop/computeaddress exceptthe last number.

    sudo ifconfig eth0 192.168.0.2

    4. We can check this has worked by rechecking the IP address:

    hostname -I

    You will see we now have the IP address set.

    We should now be able to ping the laptop.

    5. Find the laptop address (if it wasnt a fixed address) by returning to the list of Network Adaptors inwindows and double clicking on the icon to see its Status (dont worry about the warning of limiteor no connection).

    Then select the Support tab and then Details. You should see the laptops IP address.

  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    7/22

    ping 169.254.0.1

    We should get lots of responses (the laptop is responding the Raspberry Pi through the network cable)Ctrl+C to stop that. (If you didnt then double check your connections and the IP addresses you areusing).

    As mentioned before, the new IP address will be lost when we reboot, so we need to ensure it is set evertime we boot (or at least every time we want it to be when we boot).

    To do that we can edit the cmdline.txt file which is located on the boot partition of the SD Card.

    6. Make a copy of the file, with the following command:

    sudo cp /boot/cmdline.txt /boot/cmdline.normal

    7. Next edit the original file using nano:

    sudo nano /boot/cmdline.txt

    At the end of the long line, add the following (you will need to add a space between the last item andip:

    ip=169.254.0.2

    Ctrl+x and y to save and exit.

    8. Make a copy of this file too:

    sudo cp /boot/cmdline.txt /boot/cmdline.direct

    9. You can now reboot the Raspberry Pi (sudo reboot), and next time the IP address will beautomatically set.

    10. To change between configurations, simply use the following commands (just remember toedit /boot/cmdline.direct if you need to change the IP address in future).

  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    8/22

    sudo cp /boot/cmdline.normal /boot/cmdline.txtsudo cp /boot/cmdline.direct /boot/cmdline.txt

    Summary

    Now you should be able to do most of the things you would normally do when connected to a networkIt is even possible to use this direct network link to share your laptop/computers internet connection (iit is connected via Wifi for example), although Ive not needed to do this yet.

    One VERY useful thing to do is to set up Putty and Xming to allow you to control the terminal angraphical programs directly from your laptop/computer.

    (http://pihw.files.wordpress.com/2013/03/scratch-x11.png)

    Scratch running nicely inside a window using X-11!

    See the main Guide toRemote Connections (http://pihw.wordpress.com/guides/guide-to-remote-connections/) for links for how to set-up VNC and shared folders, and X-11 on other computers.

    Step 3 (recommended) Install Putty and Xming Server (for

    SSH and X11)

    I am assuming you are using the latest version of Raspbian (http://www.raspberrypi.org/downloads)which has SSHand X11 Forwardingenabled by default (if not see the bottom of this post to enablethem if things dont work).

    1. Install and run a X-Windows server on your computer

    Download and run http://sourceforge.net/projects/xming/ (http://sourceforge.net/projects/xming/) from

    the Xming (http://people.arsc.edu/~murakami/xming/) site.

    Follow the installation, including installing Putty if you dont have it already. You can alsodownload Putty separately from http://www.putty.org/ (http://www.putty.org/)

    2. Ensure your SSH program (Putty) has X-11 enabled.

    http://www.putty.org/http://people.arsc.edu/~murakami/xming/http://sourceforge.net/projects/xming/http://www.raspberrypi.org/downloadshttp://pihw.wordpress.com/guides/guide-to-remote-connections/http://pihw.files.wordpress.com/2013/03/scratch-x11.png
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    9/22

    In the PuTTY configuration, find Connection, SSH, X11 and tick the check-box for X11forwarding. If you leave the X display location blank, it will assume the default Server 0:0 (you canconfirm the server number by hovering your mouse over the Xming icon in the system tray when it isrunning). You can save your set-up within Putty so you will wont have to do this each time.

    (http://pihw.files.wordpress.com/2013/03/puttycongif-x11.png)Putty Configuration for X11 Forwarding

    3. Enter the Raspberry Pis IP Address

    (http://pihw.files.wordpress.com/2013/03/puttyconfig.png)Putty Configuration for given IP

    Enter the IP Address of the Raspberry Pi in the Session settings above (you may also find that you canuse the Raspberry Pis hostname here instead (default: raspberrypi)).

    Save the setting using a suitable name (RaspberryPiDirect) and press open to connect to yourRaspberry Pi. You will likely get a warning pop-up stating you havent connected to the computer

    before (allows you to check you have everything right before continuing).

    All being well, you should be greeted with a prompt for your username and password (remember thedefaults are pi and raspberry).

    4. Using X11 and Xming

    Ensure you have Xming running, by starting the Xming program from your computers start menu anthen in the terminal window, type a program which normally runs within the Raspberry Pi desktop(such as leafpad or scratch). Wait a little while and the program should appear on your computedesktop (if you get an error you have probably forgotten to start Xming, so run it and try again).

    1. If you want to run an X program, but still be able to use the same terminal console for other stuff,you can run the command in the background with &:

    i.e. leafpad &

    Just remember that the more programs you run, the slower everything will get. You can switch to thebackground program by typing fg, check for background jobs with bg.

    2. You can even run a full desktop session through X-11, although it isnt particularly user-friendly andVNC will produce better results. To do this you have to use lxsession instead of startx.

    3. If you get the following error (or similar) when running PyGame or Tkinter scripts:

    http://pihw.files.wordpress.com/2013/03/puttyconfig.pnghttp://pihw.files.wordpress.com/2013/03/puttycongif-x11.png
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    10/22

    _tkinter.TclError: couldn't connect to display "localhost:10.0"

    Use the fix below:

    cd ~sudo cp .Xauthority ~root/

    More details and links are in the main Guide toRemote Connections(http://pihw.wordpress.com/guides/guide-to-remote-connections/).

    Additional Information / Troubleshooting

    1. To switch on (or off) SSH you can access raspi config (just type sudo raspi-config from theterminal) and select SSH in the menu (it seems like SSH is already enabled by default for some distros

    (https://reader009.{domain}/reader009/html5/0313/5aa7faae8df96/5aa7fab6bd003.png)Enable/Disable SSH via Raspi-config

    2. Ensure X-11 forwarding is enabled on the Raspberry Pi (again, a lot of distros now have this enabledby default).

    Use nano with the following command:

    sudo nano /etc/ssh/sshd_config

    Look for a line in the /etc/ssh/sshd_config file which controls X11Forwarding and ensure it says (withno # before it):

    X11Forwarding yes

    Save if required (ctrl+x,Y, enter), and reboot:

    sudo reboot

    http://pihw.files.wordpress.com/2013/03/ssh-raspi-config.pnghttp://pihw.wordpress.com/guides/guide-to-remote-connections/
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    11/22

    Using cmdline.txt for Other Network Settings

    The ip= command-line option allows us to specify the network settings when the kernel is loaded (thcore of the linux system), its full options are in the following format (allows us to set every aspect of th

    network if required):

    ip=::::::

    More details of what each part means and other kernel options is detailed in section 2 of this kerneldocumentation (https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt).

    Easy Changing with a Simple Script:

    The following script will prompt to allow you to change your settings (just type./switchip.shto run).

    To create the file, you can use nano:

    nano switchip.sh

    Just press ctrl+x and y, to save and exit when you are done.

    switchip.sh

    12345678

    910111213141516171819

    #!/bin/sh#Function to swap to Direct IP Addressdirect () { sudo cp /boot/cmdline.direct /boot/cmdline.txt;}#Function to swap to Normal Automatic IP Addressnormal () { sudo cp /boot/cmdline.normal /boot/cmdline.txt;}

    # Menu using case-esacecho "Select IP Address? Use Direct or Auto or Keep (d/a/-)?"read answercase $answer ind|D) echo Use Direct IP;direct;;a|A) echo Use Auto IP;normal;;*) echo Keep -No Change;;esacecho cmdline.txtecho ____________

    https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    12/22

    You could even extend this to allow you to setup fixed IP addresses for different networks, so you canalways be sure you can find your IP and connect correctly.

    What is an IP Address / Hostnames / Pinging /Subnets?

    An IP Address is like your phone number or post code, it simply allows other computers to find thatparticular computer in the network and ensure any messages it sends goes to that one in particular.

    Often, IP Addresss can be replaced with hostnames so that we can ask for a specific computer withouknowing all the numbers (like the contacts list on your phone, the computer looks up the name and

    uses the number for you). For instance, http://www.google.com (http://www.google.com), is ahostname, where its IP address is 173.194.45.49 (probably depending on where you are). We canping the address using the following command, which simply sends some short messages to see ifthere is another computer on the other side to respond to them.

    ping www.google.com

    or:

    ping 173.194.45.49

    Subnets:

    Networks use subnets to help handle the fact that there could be a HUGE number of computers on anetwork (like the internet) and it would be impossible for a computer to listen to and respond to anycomputer in the address range 0.0.0.0 to 255.255.255.255.

    To handle this, networks will use a subnet mask, this ensures that a computer only needs to respond tocomputers with are within the same SUBSET, which is defined by the SUBNET MASK setting.

    The mask is a series of flags which defines which range of addresses the computer will respond to (byfiltering out any which are not within the allowed range):

    20 cat /boot/cmdline.txt

    http://www.google.com/
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    13/22

    255.255.255.0

    Means it will respond to computers which have IP addressing matching at least the 3 first numbers. Sa computer with an address of 192.168.1.90 and subnet mask of 255.255.255.0 will only talk to othercomputers with addresses in the range 192.168.1.0-192.168.1.255 (except 90 of course!). Large networkoften use SUBNETs to split up larger networks into sections so that they run more efficiently.

    ote: You wil l not be able to set the SUBNET MASK to wider than 255.0.0.0. The Raspberry Pi defaultsto a subnet mask of 255.255.0.0, which is perfect for most situations.

    References:

    Thanks to fellow MagPi - Colin Deady for testing out on Mac for me.

    Thanks to the following sites for providing various parts of the puzzle (in no specific order):

    www.kernel.org kernel documention(https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt)

    http://learn.adafruit.com/adafruits-raspberry-pi-lesson-6-using-ssh (http://learn.adafruit.com/adafruitsraspberry-pi-lesson-6-using-ssh)

    http://people.arsc.edu/~murakami/xming/ (http://people.arsc.edu/~murakami/xming/)

    http://jeremy-nicola.info/portfolio-item/ssh-x-forwarding-on-windows/ (http://jeremy-nicola.info/portfolio-item/ssh-x-forwarding-on-windows/)

    http://en.wikipedia.org/wiki/Subnetwork (http://en.wikipedia.org/wiki/Subnetwork)

    http://en.wikipedia.org/wiki/Link-local_address (http://en.wikipedia.org/wiki/Link-local_address)

    http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=22716(http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=22716)

    http://www.raspberrypi.org/phpBB3/viewtopic.php?f=27&t=24993(http://www.raspberrypi.org/phpBB3/viewtopic.php?f=27&t=24993)

    http://www.raspberrypi.org/phpBB3/viewtopic.php?f=32&t=26934(http://www.raspberrypi.org/phpBB3/viewtopic.php?f=32&t=26934)

    Commentssuptosays:

    July 16, 2013 at 3:47 amsuccessful thank you very much and appreciate your awesome work which made our job very easy

    ReplyDirect Access Raspberry Pi Shell and Desktop on Laptop/PC without installing anything

    http://anwaarullah.wordpress.com/2013/07/16/direct-access-raspberry-pi-shell-and-desktop-on-laptoppc-without-installing-anything-extra-on-the-raspberry-pi-os-or-connecting-it-to-a-display-unit/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2242#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2242http://www.raspberrypi.org/phpBB3/viewtopic.php?f=32&t=26934http://www.raspberrypi.org/phpBB3/viewtopic.php?f=27&t=24993http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=22716http://en.wikipedia.org/wiki/Link-local_addresshttp://en.wikipedia.org/wiki/Subnetworkhttp://jeremy-nicola.info/portfolio-item/ssh-x-forwarding-on-windows/http://people.arsc.edu/~murakami/xming/http://learn.adafruit.com/adafruits-raspberry-pi-lesson-6-using-sshhttps://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    14/22

    extra on the Raspberry Pi OS or connecting it to a Display Unit | Syed Anwaarullah says:July 16, 2013 at 7:42 am[] http://pihw.wordpress.com/guides/direct-network-connection []

    ReplyDirect Access Raspberry Pi Shell and Desktop on Laptop/PC without installing anythingon the Raspberry Pi OS or connecting it to a Display Unit | Syed Anwaarullah says:

    July 16, 2013 at 7:28 pm[] http://pihw.wordpress.com/guides/direct-network-connection []

    ReplyPingksays:

    July 16, 2013 at 11:16 pmI have RPis NOOBS 1.2 but having unzipped it, I cannot locate the cmdline.txt file anywhereshould I be using a different setup? Whats going wrong?

    Reply

    meltwater2000 says:July 17, 2013 at 11:47 amIve not had chance to try NOOBS, I should be having a go with it next week.

    ReplyPingksays:

    July 17, 2013 at 1:30 pmThanks! Take your time, youve done a great job with the tutorial thus far, very easy tounderstand

    Studentsays:July 17, 2013 at 11:42 amHi meltwater, Ive followed your instructions and have got my pi running through my laptopperfectly. I was just wondering since my ethernet port on my pi is now used for this, is thereanyway I can get internet access on my pi through my laptops wifi connection? If I try to bridgemy ethernet and wifi networks on my laptop (Windows 7) for internet access through ethernet, thevnc server will no longer connect to my pi

    Replymeltwater2000 says:

    July 17, 2013 at 11:48 amHave a look at http://pihw.wordpress.com/2013/06/13/testers-required-super-easydirect-network-connection/ that should give you an idea on how to share the laptops internetconnection. Let me know if it works, so far no-one has said if it works or not (no news is goodnews I guess).

    ReplyRichardsays:

    July 23, 2013 at 9:28 pm

    http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2362http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2259#respondhttp://pihw.wordpress.com/2013/06/13/testers-required-super-easydirect-network-connection/http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2259http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2257#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2257http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2263http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2258#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2258http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2253#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2253http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2251#respondhttp://pihw.wordpress.com/guides/direct-network-connectionhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2251http://anwaarullah.wordpress.com/2013/07/16/direct-access-raspberry-pi-shell-and-desktop-on-laptoppc-without-installing-anything-on-the-raspberry-pi-os-or-connecting-it-to-a-display-unit/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2246#respondhttp://pihw.wordpress.com/guides/direct-network-connectionhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2246http://anwaarullah.wordpress.com/2013/07/16/direct-access-raspberry-pi-shell-and-desktop-on-laptoppc-without-installing-anything-extra-on-the-raspberry-pi-os-or-connecting-it-to-a-display-unit/
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    15/22

    Yes, this configuration works just fine. You can do RPI software updates via the directconnected PC and the WiFi shared port. I find that some RPI programs like Leafpad do notwork under this connection option but I would only use this connection method for softwareupdates on the RPI anyway. Otherwise just use the direct connection mode. Oh yes, makesure the PC ethernet port is not set to sharing as that run me around for a while. Timspackage works great.

    Richard

    Andrew Cluffsays:July 19, 2013 at 2:39 pmhey my pi wont ping the laptop.

    ReplyAaron Psays:

    July 19, 2013 at 3:10 pmExcellent walkthrough! Tried it with NOOBS but the cmdline.txt file does not exist. Downloaded thnewest Raspbian image from raspberrypi.org/downloads, imaged that to my SD card, let it start uponce all the way, turned it off and followed the directions on this page. Worked like a charm. Nohiccups. Xming works excellent for this. Thank you for the good writeup!

    Replymeltwater2000 says:

    July 29, 2013 at 9:49 amYep, Ive yet to have chance to try NOOBS, I am hoping there is a similar way to specify thestart up command-line, there probably is just moved somewhere.

    ReplyPiNEsays:

    July 24, 2013 at 2:18 pmHi Meltwater,

    Got direct connection working (with PuTTY and UltraVNC) but the one thing that gave meproblems was pinging the W7 PC during the initial set up. The Pi sent packages but the PC did noreply. Looking at The Network and Sharing Centre, the PC seemed to be receiving stuff, but wasnot responding. Hmmm? Checking the PCs IP address, it showed 169.254.98.136.

    Not important because Ive got the direct link working, but any ideas why the PC did not respondCheers

    Replymeltwater2000 says:

    July 29, 2013 at 9:38 amMight be down to your default firewall settings perhaps, or sometimes it can get confused abouwhich connection to use (such as wifi). I think this is because it classes the direct link as a badlink (there is no internet or router responding) it will respond on the other link instead.

    http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2420http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2373#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2373http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2423#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2423http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2297#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2297http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2296#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2296
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    16/22

    ReplyLouissays:

    July 28, 2013 at 3:31 pmIm stuck, if followed the instructions, made sure everything is as identical as it can be (apart from ipadresses) but when i open PuTTy is freezes, waits then says connections timed out

    Reply

    Louissays:July 28, 2013 at 3:32 pmA few typos: I open PuTTy it connection has

    ReplyLouissays:

    July 28, 2013 at 3:59 pmForget all that, it works now, but my question is now: how do you configure it to show theprograms/desktop?

    Louissays:July 28, 2013 at 4:51 pmFinally got it all working, please ignore all my other posts

    meltwater2000 says:July 29, 2013 at 9:40 amNo problem, Linux can be very fussy about the text file format.

    Lessays:July 29, 2013 at 9:01 am

    Im hoping to use the Pi to collect data from inside a beehive. How would I link the Pi and a W7laptop wirelessly, so that the laptop can control the Pi and collect the data?

    Replymeltwater2000 says:

    July 29, 2013 at 9:35 amIve not had chance to experiment much with wifi links so far, but you may find some of thesolutions at the bottom of this post useful.http://blogs.arcsoftwareconsultancy.com/pi/

    ReplyLessays:July 29, 2013 at 11:14 amOoops. Jumped before I was bitten. Picked up the ip from the Pi with ifconfig. Set the laptop tothe same network. Both had the same mask. Loaded putty on the laptopdone.

    Apologies for being gormless.

    Replymeltwater2000 says:

    http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2427#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2427http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2419#respondhttp://blogs.arcsoftwareconsultancy.com/pi/http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2419http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2418#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2418http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2421http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2405http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2404http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2403#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2403http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2402#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2402http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2420#respond
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    17/22

    July 29, 2013 at 11:23 amNo problem. Plenty of little things which can make it difficult until you get the idea. Glad itworks!

    Magichsusays:July 29, 2013 at 5:47 pmTo get a fixed IP addr, you can also find a file (path: etc->network->interfaces) on the SD card an

    modify it with static IP addr such as following:(for standard Ethernet connection)iface eth0 inet staticaddress=192.168.0.xxx (this should be in the same subnet range as your computer)netmask=xxx.xxx.xxx.xxx

    ReplyNJsays:August 13, 2013 at 1:42 pmAfter adding the line with the ip address in the cmdline.txt nothing happens. The screen remains

    blank. It also wont work with the serial connection after this. Removal of the line allows serialconnection once again. I used the same address as the one in the above and my computer, runningwindows7, is and was configured to automatically assign ip addresses

    ReplyNJsays:August 13, 2013 at 2:33 pmso I fixed my problem. I could be wrong but it seems you cant just generate your own ipaddress. I connected the pi by network to the my computer(windows7) and then took the IPv4address from its details in the network center(rough translation from win7 in French). Then I

    wrote that into to the cmdline.txt file, booted up again and it work perfectly.Thanks for the guide.

    Replymeltwater2000 says:August 13, 2013 at 2:47 pmThe PC will typically set an IP address in the range 169.254.x.x when connected directly,what IP address did you use? It must match the first two numbers the PC is set to.

    Anyway glad it is working.

    NJsays:August 13, 2013 at 4:04 pmIt was within that range. I just didnt know how to go about retrieving it.

    ReplySargesays:August 14, 2013 at 11:51 pm

    http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2656http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2628#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2628http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2627http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2626#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2626http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2624#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2624http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2436#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2436http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2428
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    18/22

    I wanted to thank you for the awesome instructions. I found myself in an isolated part of the coast Maine without access to a monitor and keyboard. Although I had to drive 45 minutes to a RadioShack, I was able to pick-up a RJ45 cable and USB SD Card reader and implement the connectioninstructions you provided.

    This approach will be my travelling solution for setting up and running Raspberry Pi basedapplications in the future. The SD Card reader, RJ45 cable, Pi and laptop are all going in the travel

    bag.

    I got great time-lapse photograps of sunsets this time. Not sure what might happen in the future.

    Sarge

    Replymeltwater2000 says:August 15, 2013 at 9:00 amThank you for sharing your excellent success! A tiny computer isnt so small if you need amonitor to use it.I would love to see the time-lapse you have produced.

    ReplySaravanan says:August 16, 2013 at 10:16 amI have a new pi.and I am using Ubuntu in my laptop.And configured the file in memory card andall.Ubutu is set to automatic DHCP by default for wired connection.I switched on raspberry pi withethernet cable plugged in,The status LED is turned on in the pi.but I cannot establish connection

    between pi and laptop(Connection fails all the time).I dont have a tv monitor orenything else to

    connect with the pi help me.Do you have any video tutorials on youtube?Reply

    meltwater2000 says:August 16, 2013 at 10:42 amI did try to record a video, but it was taking too long to sort out.

    Perhaps you can try using the .bat files which are in thehttp://pihw.wordpress.com/guides/direct-network-connection/super-easy-direct-network-connection/ post (even if you just use the CMDLINE.TXT file directly).

    Unfortunately this will only work with a Raspbian image rather than the NOOBS system.The common issues are:1. Not using a linux compatible file editor on CMDLINE.TXT (ends up with extra characterswhich shouldnt be in the file).2. Having Wifi enabled on the Laptop when trying to connect (it tries to ping through thatrather than the LAN)3. Ensure you wait for your LAN connection to finish detecting the direct connection (check thestatus of your network device and that it has an IP given to it).

    http://pihw.wordpress.com/guides/direct-network-connection/super-easy-direct-network-connection/http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2680http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2679#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2679http://mypythonprojects.blogspot.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2664#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2664http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2656#respond
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    19/22

    Fingers crossed that should help.

    ReplySaravanan says:August 16, 2013 at 4:17 pmI am using the latest raspian wheezy

    liarlaisays:September 2, 2013 at 1:57 pmhii have the same situation like Saravanan. first, i have follow your tutor on my laptop(win7),and i used automaticly obtained ip address(ip=169.254.0.2), and this works perfectly like yosaid(i left a reply below).BUT, i re-installed my laptop to ubuntu(12.04), and without changing cmdline.txt ofrpi(ip=169.254.0.2), and i used putty to connect, but it didnt work.and i noticed that 169.254.x.x is the default ip address of windows system when there is nodhcp server for windows pc to connect to, and i suggest that the default ip address for

    ubuntu is not 169.254.x.x. so i google it and i found out default ip address for ubuntu is192.168.1.100~192.168.1.150(i am 100% NOT sure about this). so i changed ip address incmdline.txt to that range, but it didnt work so far, i dont know this info help or not, just letyou know. thanks again.

    meltwater2000 says:September 2, 2013 at 3:15 pm169.254.x.x is a reserved range for direct LAN connections. 192.168.x.x is a common rangefor local LAN connections.You can check to see what gets allocated when you connect the LAN to your Ubuntu

    machine, whatever gets allocated by Ubuntu when you directly connect a LAN cable to theRPi should be the range you should use (ORyou can just force it by setting a fixed IPaddress in Ubuntu, and then similar one in the correct range on the RPi it shouldnt care along as they are in the same range according to the netmask).

    Saravanan says:August 16, 2013 at 4:55 pmstill not working.I would appreciate a video tutorial on you tube with the essetials only.

    Reply

    LiarLaisays:August 19, 2013 at 7:07 ami dont have HDMI monitor nor internet access, and i find your tutor. and it works perfectly for me.thank you. first, i follow your instructions and it doesnt work, then i found out that i have edited mcmdline.txt before, i deleted console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 this line for thepurpose of uart , so i recovered this line and it works just like you said.can you tell me what is the connection between this line and the ethernet workings? thanks.

    Replymeltwater2000 says:

    http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2728#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2728http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2686#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2686http://mypythonprojects.blogspot.com/http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2915http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2913http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2684http://mypythonprojects.blogspot.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2680#respond
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    20/22

    September 1, 2013 at 8:16 amNot sure, it may just a bad character in the text perhaps. The file is very fussy since it is literallydropped into the command line automatically run at boot, so anything which breaks the line ornulls the line will mean it is ignored.There may be something more to it, since tty was originally for serial, but then extended forLAN etc, perhaps removing that just ends up disabling it (as nothing else is set up to use it). Acloser look at the commands may shed light on it otherwise.

    ReplyDavid Briscoesays:August 31, 2013 at 11:28 amHi,I have a spare ethernet port on my main PC (the first/primary ethernet port is connected to anADSL router for internet access). Can I just plug my RasPi into this spare port and use set it up inthe same way? Will I be able to access the internet this way? Thanks.

    Reply

    meltwater2000 says:September 1, 2013 at 8:11 amYes it should, Ive used a USB-LAN dongle to do just that. To get internet through to the RPiyou will need to use ICS (Internet Connection Sharing) to share to the 2nd LAN port (should besimilar to the wifi method).

    Just watch that you can still ping it, and if required disable the other port until you getconnection with the RPi working, as windows sometimes tries connecting on the 1st port that isvalid.

    Hopefully itll work well.

    ReplyRandy Kibbesays:September 5, 2013 at 10:18 pmI went through the whole tutorial but when I try to connect through putty I get a connectionrefused pop up. Am I doing something wrong?

    Replymeltwater2000 says:September 5, 2013 at 10:23 pm

    You will need to confirm thata) The IP addresses are set correctly on both machines (if not check the cmdline.txt file)

    b) You can ping between both machines (if not disable any other adaptors)c) You dont have a firewall blocking SSH connections

    ReplyStudentsays:September 6, 2013 at 5:37 amThis connection error also happens if you try to connect through putty too soon after powering upthe pi, give the pi time to boot up!

    http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2984http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2976#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2976http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2975#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2975http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2897#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2897http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2886#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2886http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2898#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-2898
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    21/22

    ReplyF. Janessays:September 16, 2013 at 9:09 pmHi Les,

    Since Im very interested in Your project to gather data inside a bee hipe, did You succeed in doingit?

    Thanks

    Aloha

    Replytechie009says:September 17, 2013 at 12:27 amwhere can i find the file cmdline.txt ? I cant find it . i have a file named recovery.cmdline , I treidediting this file and following the steps you mentioned, but it didnt work.

    Replymeltwater2000 says:September 18, 2013 at 9:31 amHI. You are using NOOBS, which makes this trick a little more difficult.See the note on this page:http://pihw.wordpress.com/guides/direct-network-connection/super-easy-direct-network-connection/

    Replytechie009says:September 19, 2013 at 5:26 amHi, thanks for the reply. I tried doing the same as mentioned in the link, i meant using theVM,but unfortunately I could not fine the cmdline.txt. Can you please help me with that.Also yes I am using NOOBS.

    meltwater2000 says:September 19, 2013 at 9:40 amWhen I connect it to my Debian VM, it has two mount points, including /media/boot.Within there you will find the cmdline.txt file (which will get executed after the NOOBS

    system has booted).

    Hope that helps.

    starcow123says:September 19, 2013 at 7:23 pmPuTTY Fatal ErrorNetwork error: Connectio timed out

    http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-3197http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-3191http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-3187http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=3175#respondhttp://pihw.wordpress.com/guides/direct-network-connection/super-easy-direct-network-connection/http://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-3175http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=3153#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-3153http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=3147#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-3147http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=2984#respond
  • 7/23/2019 Meltwater's Raspberry Pi Hardware

    22/22

    Windows 8-64bitRaspberry Pi Model BStandard ethernet cable (not crossover)Using PuTTY and XmingFirst boot on Raspberry Pi on Raspbianin SD root file system I only have cmdline.normalHELP?

    Replymeltwater2000 says:September 19, 2013 at 7:31 pmYou need cmdline.txt in there. cmdline.normal / cmdline.direct etc are example files (and used

    by the bat script to change cmdline.txt). You want to make cmdline.txt match cmdline.direct fodirect connections.

    ReplySaravanan says:

    September 20, 2013 at 8:56 amCan you write a tutorial on X11 forwarding in ubuntu/linux.I can now access the command line ofpi only.

    Reply

    Blog at WordPress.com. | The Greyzed Theme.

    http://theme.wordpress.com/themes/greyzed/http://wordpress.com/?ref=footerhttp://pihw.wordpress.com/guides/direct-network-connection/?replytocom=3201#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-3201http://mypythonprojects.blogspot.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=3198#respondhttp://pihw.wordpress.com/guides/direct-network-connection/comment-page-2/#comment-3198http://pihw.wordpress.com/http://pihw.wordpress.com/guides/direct-network-connection/?replytocom=3197#respond