Debug SDN Ryu controller with Pycharm
If you want debug your Ryu App, you need execute ryu-manager throught Pycharm.
To do it, you need execute the following python script in the same folder where you have the ryu app. I got the script from https://www.mail-archive.com/ryu-devel%40lists.sourceforge.net/msg08519.html
Where simple_switch_13 is your ryu.app.name. Run with Shift+F9 in Pycharm.
If you choose any line in your Ryu app to debug, the console will show you the data about this variable like the following screenshot:
To do it, you need execute the following python script in the same folder where you have the ryu app. I got the script from https://www.mail-archive.com/ryu-devel%40lists.sourceforge.net/msg08519.html
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from ryu.cmd import manager def main(): sys.argv.append('--ofp-tcp-listen-port') sys.argv.append('6633') sys.argv.append('simple_switch_13') sys.argv.append('--verbose') sys.argv.append('--enable-debugger') manager.main() if __name__ == '__main__': main()
Where simple_switch_13 is your ryu.app.name. Run with Shift+F9 in Pycharm.
If you choose any line in your Ryu app to debug, the console will show you the data about this variable like the following screenshot:
Hello Nicolas,
ReplyDeleteI tried your script but not able to debug the complete app. It goes into the __init__ method but then the method annotated with config dispatcher don't stop at any debug pointer.
What Pycharm version do you have?
Deletepycharm 2016.2.3
DeleteI upgrade the post. Maybe you are not runnig the file from the same folder where you have your app. Also, you need to specify only the name of your app, without ryu.app. prefix.
Delete