0

I'm trying programming an python application in visual Studio and run it on raspberry Pi but if I used specific raspberry imports like a rpi.gpio, Visual Studio not found this libraries.

Exist any way to develop python app in visual Studio for debugging while this app run on raspberry?

Thanks in advance

crossmax
  • 346
  • 3
  • 20

1 Answers1

1

I do not have an answer for you for the VS remote debugging, and doubt you'll be able to do it. I have created a mock GPIO library in the past so I could develop a web service locally and it would work. I would do something like:

try:
    import GPIO
except:
    print "GPIO not found"
    import mock_gpio as GPIO

mock_gpio would implement all of the features of the Pi GPIO lib, and I could work locally.

Why don't you do the development on the PI? There are lots of debugging tools that you can use. You can also use RDP or VNC to connect to the PI.

Remote PI Access: https://www.raspberrypi.org/documentation/remote-access/vnc/

Python debugging: https://wiki.python.org/moin/PythonDebuggingTools

mikeb
  • 10,578
  • 7
  • 62
  • 120
  • So what you're saying that VS debugging running in local machine? I need write source code and debugging over Desktop and run application on raspberry to use the raspberry's peripherals. My raspberry runs OS without gui. I can use the tools that you said? – crossmax Jan 08 '16 at 10:16
  • 1
    Yes, there are console tools available. You can also install an X server on your Desktop (XMing or Cygwin) and run the GUI tools on your PI and display them on your desktop. This, however, is not debugging with VS, I don't think you can do that. – mikeb Jan 08 '16 at 13:05
  • Ok, thanks for this information. Finally, I installed PyCharm and II've the development enverioment that I need to remote debugging. For now, I no need X server on my Desktop, I dont known if with Pycharm I'll can do it. – crossmax Jan 13 '16 at 09:55
  • You should be able to remote debug. Did you see [this question](http://stackoverflow.com/questions/26311371/unable-to-debug-on-raspberry-pi-using-python-tools-for-visual-studio), perhaps for the basic setup? Here is a link to the PTVS [documentation](https://github.com/Microsoft/PTVS/wiki/Cross-Platform-Remote-Debugging). – RatherBKnitting Jun 07 '16 at 22:21