Yes, the GPIO header is consistent across all RPis so you can use the same RF module.

Going from a 2 to a 4/5, you’ll definitely want to install the OS from scratch and then restore as much data as you want/need. The RPi 2 is an older 32 bit ARM core, the 4/5 are modern 64bit ARM cores.

1 Like