Once upon a time...

Once upon a time...
Christmas 2016

Friday 24 April 2020

Raspberry Pi initalisation

NOTE: I'm catching up on Blogger and decided to post these draft posts that I've had partially written. I'm not completing them at this point and probably won't revisit them, but as a big part of the reason for blogging is to remind myself of what I was thinking/doing, they're still valid in this sense. This draft was dated 28/11/2015.

It's been a long time since I blogged.  Family life will do that to you.

Things on all fronts (Camper, RepRap, etc) have moved on, I'll catch up with the details as these and when I get a chance, however, for now, I'm starting something new.  The aim of the blog posts are as much to remind myself what I did as to be helpful to others in the future, so...

I bought some Raspberry Pi's when they first came out, and have been using one to run my Mendel 90 using OctoPrint which is great (more on that later).

However, some of you will recall that I also have an Armdoid robot arm which I intended to get working.  Well recently developments in the household unearthed the arm and I did some Googling which led to the discovery of Richard Morris's great Armdroid Blog.  Reading through this re-inspired me to get "Ron" the robot working, which I will do as a joint project with my son (now 13), who claims to want to be a software developer (like dad), but seems more intent on consumption than creation right now.

So, I will be setting up the Raspberry Pi and then using this to ultimately control Ron through an Arduino.  This may all sound like overkill, but all will be revealed in good time.  Besides it means learning about all this great kit!!

Initialising the Raspberry Pi

Hardware used:

  • Raspberry Pi Model B Rev 1 (As ordered in the first week they were announced)
    • Fuses removed ages ago due to issues when using with OctoPrint
    • I also happen to have at least one Raspberry Pi 2 Model B's at my disposal, but we'll start with the Rev 1 and re-assign it back to printer duties later.
  • Raspberry Pi Camera Rev 1.3
  • Edimax Wifi Dongle
  • Temporary:
    • 7 inch composite 12v screen (lying around from the Camper project)
    • Keyboard
    • Mouse

I followed these steps to get my RaspPi working:

  • Downloaded the Raspbian Jessie image from https://www.raspberrypi.org/ and wrote to an SD card using Win32DiskImager
  • Initial config
    • Booted up the RaspPi
    • Switched to command line
    • Ran "sudo raspi-config" to enter the config utility and ran through these...
      • Enlarged file system
      • Changed password
      • Boot Options - Console (I will run the GUI as and when I want it)
      • Enabled Camera
      • Rebooted
    • Connected to Wifi
      • Used GUI (easier)
      • Connected to RaspPi using SSH (I use PuTTY on my PC) as this is easier than constantly switching devices.  (Checked the IP by looking at my router for connected devices)
      • Update settings to static IP (I run my home network with a reserved range for the devices I need to access by IP).  For detailed instructions follow this tutorial.  Simplified steps follow below (as I know my network settings):
        • sudo nano /etc/network/interfaces
        • Find the line with wlan0 and change the manual or auto to static
        • Add these lines (replacing values where neccessary):
          • address 192.168.x.y
          • netmask
          • network 192.168.x.y
          • broadcast 192.168.x.y
          • gateway 192.168.x.y
        • Ctrl-X, Y to Exit and Save  (This will probably cause a reboot and you will need to change your PuTTY config if you SSH'd in).
      • At this point I backed up the image (using Win32DiskImager) to make it easier to start new configs if I mess things up.  (I learnt the hard way last night...)
      • Ensure all patches are up to date
        • sudo apt-get update
        • sudo apt-get upgrade
    • My Pi seems to go to "sleep" after some time and I can't connect to it without rebooting, so trying this:
      • Disable power management on WiFI (Pi seems to go to "sleep" after some time
        • Link to source of this information.
        • Create new config file: sudo nano /etc/modprobe.d/8192cu.conf
          • # Disable power management
          • options 8192cu rtw_power_mgnt=0 rtw_enusbss=0
        • Save and reboot.
        • Check settings using: cat /sys/module/8192cu/parameters/rtw_power_mgnt
      • If it doesn't work, try this:  Fix for Ethernet Connection Drop on Raspberry Pi
  • Setting up the camera based on www.raspberrypi.org

No comments:

Post a Comment