简体   繁体   中英

How to debug Python on Arduino Yun

How can you:

  1. Print debugging messages from a Python script?
  2. Access those messages in real-time on a remote device (Arduino Yun) you're SSH'ed into?

So far, I've been making changes, copying them to the Yun, restarting it, and doing all this without the benefit of debugging. (I have to test on the Yun itself.)

In a Python script, you can give yourself messages like this: print("var x = {0}; y = {1}".format(x, y))

Run python path/to/file.py (while SSH'ed) to access the server w/real-time logs.

If the server is already running, you can do ps | grep python ps | grep python then kill XXXX for the running process, then run the above instruction again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM