I've heard many people mention that their embedded IoT devices aren't powerful enough to process known protocols, like HTTPS or even TLS security for sockets.
Instead, they turn to creating their own protocol to produce a custom communication system that suits their particular use case, although, typically, little time is actually spent developing the protocol, because it's not a particularly important factor. Usually, these homebrew protocols include authentication, security, encryption, etc.
This article suggests some of the many pitfalls which would seem to be waiting for anyone who did go down the route of writing their own protocol, and it's well known that you shouldn't try to write your own encryption.
Are there ever any cases where you would have to write your own protocol, rather than using an existing, tested protocol? How can you tell if rolling your own is a reasonable idea, rather than a big security risk?