Ad-hoc Networking with Low-Cost Devices: How to Do It Right