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

 
#!/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:



Comments

  1. Hello Nicolas,
    I 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.

    ReplyDelete
    Replies
    1. I 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

Post a Comment

Popular posts from this blog

Exception: Could not find a default OpenFlow controller in Mininet

How to fix Android when developer options are not available for this user

Webcam streaming throught VLC with YUY2 compatibility