2

I have a Raspberry Pi 1 Model A, as well as a MacBook Pro (running Sierra 10.12.6), and would like to:

  • Use a USB cable (from Mac -> RPi) to provide my RPi with power/voltage; and; and
  • SSH into my RPi so I can do anything I'd normally do on a Linux machine: check what programs are running, check service health, check log files, etc.

I'm wondering what type of hardware setup I'd need to make this a reality.

Can I SSH into my RPi just via the USB cable? Or do I need to setup wifi on my RPi (is that even an option for the model I have?!) and SSH in wirelessly? I have to assume my model of RPi (even though its old) has some type of networking interface? Otherwise, how would one ever interact with it while its running?!

Thanks in advance!

1

There is different ways of connecting to the pi. You can use a usb to uart (serial) interface to communicate. Here is a good tutorial about how to use it. It's for the Pi Zero, but I assume it could be used for the pi 1 as well.

Also, you can configure the pi to appear as a ethernet device. It's explained here.

For me, the best way to do it is to connect the Pi to the router with an ethernet cable and power it using the usb. Then, configure the network settings on the pi to a static IP and then access using the mac terminal over ssh.

I don't know if the speed is important to you, but the pi 3 is much faster than the pi 1 and the pi 2, so, if you're going to use it a lot, I do recommend upgrading it.

  • Thanks @Luis (+1) -- do you know if that ehternet device option would work with Raspbian Stretch (in the Ethernet Gadget tutorial it uses Jesse as the OS)? – smeeb Sep 12 '17 at 15:54
  • Also question from that tutorial (the link you provided)... after I modify the config.txt and cmdline.txt files, do I leave the SD card in my laptop, or do I take it out and shove it into the pi? – smeeb Sep 12 '17 at 15:58
  • 1
    You have to move the SD card to the Raspberry Pi. The changes in the two files is read by the OS at boot. – MatsK Sep 12 '17 at 16:13
1

Answer: Yes!

Raspberry Pi Zero and Raspberry Pi 1A supports USB gadgets/OTG.

Raspberry Pi 1B, Raspberry Pi 2, Raspberry Pi 3 have USB hubs integrated and cant utilize USB gadgets/OTG.

USB gadgets/OTG is that you change the USB port from being a "USB host" to be a "USB client".

Ref.: https://en.wikipedia.org/wiki/USB_On-The-Go

  • Thanks @MatsK (+1), two (hopefully!) quick questions for you: (1) what about Luis's suggestion to wire the RPi to my router and assign it a static IP...are you saying that won't work with my model? And (2) If that method really won't work...then how does anybody easily interact with my model pi? Is my best bet to just get a keyboard and monitor and hook them up to my pi (its starting to sound like this is my best option...)? Thanks again! – smeeb Sep 12 '17 at 15:39
  • 1
    My apologies, the Raspberry A type can be changed into a USB gadget/OTG! So @Luis Diaz answer is valid and you should be able to follow the "Also, you can configure the pi to appear as a ethernet device....." to get it working! – MatsK Sep 12 '17 at 15:44
  • Thanks for confirming @MatsK -- do you know if that ehternet device option would work with Raspbian Stretch (in the Ethernet Gadget tutorial it uses Jesse as the OS)? – smeeb Sep 12 '17 at 15:54
  • Also @MatsK I have a question about what to do with the SD card after I modify those files (please see my question under Luis' answer)...I have the same question for you! – smeeb Sep 12 '17 at 15:59
  • The USB gadget is hardware dependent and I have used it in Jessie and it should work in Stretch. – MatsK Sep 12 '17 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.