How do I get a Raspberry Pi Model A+ on to wifi?
... When I cant plug in wifi and a keyboard at the same time ...
MagPi 38 had an interesting article about making a Raspberry Pi powered robot for under £50 including the Pi. This seemed like my kind of project so I procured all of the bits one by one. The base of the robot was a Raspberry Pi Model A. This would be the first time that I had used the cut down model A.
The article spoke about setting up the Pi and then running it headless. After installing the OS on a card and booting to desktop it simply said "Connect to the WiFi via the normal graphical method and the Pi will remember the password." However, the model A has only one USB port. This was the problem:
How do I log into the Pi using a USB keyboard, whilst having the USB dongle installed to set up the wifi?
So I started this experiment by installing Wheezy onto the sd card. The Pi booted fine, and when an HDMI monitor was added to it, I could attach a keyboard and log in, expand the filesystem and all the other normal setup stuff. I could even run startx to get to the desktop - although that had limited value without a mouse.
Now to connect to the wifi network. The keyboard is plugged in to the single USB port, so the normal process when you run out of USB ports is to add a USB hub. In fact if you add a powered hub its even better as the Pi gets its power from that too.
Here's the usb hub I bought:
That's got to work - so in goes the keyboard and the USB dongle, I boot the Pi and the keyboard doesn't work so I can't log into it. Ok - so this HUB was £1.80 from eBay, it probably had a rubbish cheap chipset so that might be why it doesn't work.
So I bought another one:
It didn't work either. Then tried this one:
No joy. I did some research to find out that there was a Belkin Traveller hub that 'Worked really well with the Pi model A' so I bought one of these too:
It didn't work. Notice a theme here. I had no idea what was going on - On one of the hubs I had plugged in an external power supply, and it looked like everything had worked correctly - but I wondered if I had broken the Pi's usb port by plugging the power supply in the wrong way around. I hadn't though, as when I plugged the keyboard directly in it worked. But when it went through the usb hub, not so much...
Next I remembered that I had a Pi debug clip from Ryantech. This allowed a serial console session with a Pi through its GPIO. This would allow me to set up the wifi dongle without using a keyboard.
I managed to connect a mac to the Pi and log in - but whatever tutorial I used about connecting to a wifi via command line also didn't work. At this point the Pi just got put in a box and forgotten about.
A couple of weeks later I was reading about the new 'Jessie' version of Raspian. I was interested in the talk of the new UI and so flashed a sf card with it and booted up my Pi 2B. At a whim, I decided not to use a wired network but to test one of the wifi dongles that I had got for the Pi A. It might have just been that they were faulty. A couple of seconds after X started I got a message asking if I wanted to join to my wifi network. I did and I was online. So it wasn't the dongles fault.
Then I had an idea - I'd try the Pi A with Jessie, as I had been using Wheezy before. And again - as another whim, I just took the sd card from the B and plugged it into the A along with the wifi dongle. After a couple of seconds it had booted to desktop and connected to the WIFI - jackpot!
Then it was just a case of looking at my router to find the Pi's IP address, ssh'ing into it and installing VNC. Now I'm ready to make the robot.
So in summary - what I learned was you can use the same SD card across different PI's. So to connect to a network with a PI when you don't have a HUB that it recognises all you do is set it up on a PI with several USB ports then transfer the SD card and wifi dongle back into the Pi A. Oh - and use Jessie - as this particular wifi dongle doesn't seem to be compatible with an out of the box Wheezy distro.
16-Nov-2015 Add commentblog comments powered by Disqus Permanent Link