2

How do you develop for the Raspberry Pi. I'd rather use my own laptop but this speed comparison leads me to believe most developers get one or twe RPi and just develop directly on the device: How does speed of QEMU emulation compare to a real Raspberry Pi board?

I'd like to stay portable to I can do some RPi coding in my lunch hour. Is this an option?

What are my options?

  • can I plug a RPi into my MacBook pro?
  • can I emulate an Raspberry pi 2 as fast or faster than a physical one ?
  • can I cross compile? (is it any faster? And if do cross compile how do debug? on a RPi or on an emulator?
  • assuming I can't 'plug a RPi into my MacBook pro', and emulation is too slows: how do developers 'go mobile' with aO
Stephen
  • 123
  • 6

3 Answers3

3

If you were looking to go mobile, SSH or VNC are the best options for working without a separate monitor. Both of these require the Mac and the Pi to be connected to the same WIFI/Ethernet network, however I have read somewhere you can directly attach them with an Ethernet cable. Something worth looking up.

SSH is the best option if you are only using the command line. The SSH server is already installed on the Pi, you just have to enable it. As you have a Mac, a SSH client should be built into the command line of your computer. The Raspberry Pi website has instructions for using SSH with the Pi. See here.

VNC however is suited if you wish to use the graphical desktop of the Pi. There is a client that can be used with the RPi already installed, however this takes some time to set up and an external application is recommended. The VNC server will also need installing/setting up on the Pi. For instructions on setting up the server on the RPi, see here. For information on setting up the Mac client, see the mac link at the bottom of the page.

Also, in case you were wandering, I use my Pi connected to a TV, however I have tried VNC and SSH out.

I hope this helps!

angussidney
  • 703
  • 10
  • 21
2

Defining what a decent speed is is not possible. Perhaps for the type of development and for the need when testing the developed software, a qemu VM is perfect for you. Just try it and see for yourself if the time it takes is acceptable or not.

Then depending on the type of development you want to do, portability might be an issue or not. What is your programming language? If it's C it might be less portable than if it's Python. Then what 3rd party library do you plan to use? Are they portable?

So depending on what you do, you could develop it on your laptop without qemu, directly under your OS of choice (Linux, OS X or even Windows) and then test it either in qemu or a real RPi. Even for C development it is possible to cross-compile it from a x86_64 machine to run on a ARM board.

Only limitations you could encounter is when you want to use really specific RPi interfaces which you can't emulate (or have the same library to interface to them) on your laptop, such as the GPIO pins, SPI bus, etc.

So your question is too vague to have 1 answer. It all depends of what you want to do and how you are going to do it and how you are going to test it.

Huygens
  • 733
  • 5
  • 12
0

You can create a local route cycle on your desktop with wired Internet port. All the pi has to do is connect to your computer with that cable. And its up to you to feed the Internet to the pi.

angussidney
  • 703
  • 10
  • 21
noobs
  • 1