Working Revision

Bugs Fixes on read_payload that caused segmentation fault on RPI
Re ordered RPI samples code