0

I use RPIO.PWM to control servos. All the time, the PWM.add_channel_pulse(dma_channel, gpio, start, width) method is called, text about the change is displayed (see image). I know there is a way (&> /dev/null) to hide all the output, but I don't want to hide the entire Python script's output, only the output displayed by the PWM.add_channel_pulse(dma_channel, gpio, start, width).

Output that sould be hidden

  • Do you remember where you downloaded RPIO.GPIO from? It's odd that just one debug statement is being printed. – joan Aug 5 '15 at 14:28
  • I've chosen the easiest way from there: pythonhosted.org/RPIO/#installation EDIT: not only one debug statement is being printed, but the others are printed just once – Alex Aug 5 '15 at 14:30
  • Ah, that's fine, I was wondering if you had picked up a modified source. Removing the line I mentioned in the answer should do what you want. – joan Aug 5 '15 at 14:43
0

You will have to edit the source to remove the line and then rebuild.

The line is in the file source/c_pwm/pwm.c in the source directory.

Remove line 458 of pwm.c

log_debug("add_channel_pulse: channel=%d, gpio=%d, start=%d, width=%d\n", channel, gpio, width_start, width);

There are other log_debug lines in the code. It's odd that just the one appears to come to the screen.

  • I've dowloaded the zipped file from there, and uncommented the line, but I'm not able to recompile it. How to do it? (on RPI or Win7) – Alex Aug 14 '15 at 8:58
  • @Alex Just do what you did during the original install of RPIO (apart from downloading the zip again). The build method you used should recompile the C program as part of the install. – joan Aug 14 '15 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.