Also tried that, but without result. I did observe that after filling in this code, the receiver doesn’t register remote control entries anymore (no flashing light on the receiver). Isnt this a trick to turn your remote into ‘another remote’ old school style?
I have NR3030 and also struggled with making CEC work. For my receiver, the 32910 control code did the trick (same as what shadow mentioned above). In NR3030 manual, they mention that you can also try 33101/33501/31612 codes - all to control a CEC-compatible BDP/DVD. Although, maybe your receiver is using different control codes.
I took a look at SR507 user guide (from their website, starting on page 84), and they mention some other ‘Remote Control Codes list’ for your receiver, maybe you need to locate that list / manual. If you don’t have that list, maybe check out NR3030 instructions, as they have quite a bit of codes listed there.
Although, saying that, I have just basic stuff working, and if I get stuck (not that often), I use Yatse on my phone.
It looks more that what popcornmix suggested is finally working (TV remote). Maybe that is precluding RPi from responding to Onkyo’s remote right now (if that control code also works for your receiver).
Maybe take some BDP, connect to a different HDMI input (one control code per HDMI input), and try to make it work with Onkyo’s remote. Once that would work, you will know that the procedure should be also working for RPi (with Onkyo’s generic control code).