You can see and download the code for this project from the GitHub repository here. Light is the controlled object, switch is the action, and on is the parameter. ![]() For example, if you want to switch on a light, you will send: Light:switch:on. ![]() So every time you want to control something on your Raspberry Pi, you will send something following this format. Then we can define a format for the protocol, like below. We can call these objects “ controlled objects”. Let's define that each action you perform on your Raspberry Pi is associated with an object. To control Raspberry Pi by SMS, we need to define a protocol that it can understand. In human language, grammar defines rules and conventions, so we can call it a protocol. If they want to communicate correctly, they need to use a language that both parties can understand.Ī protocol is a set of rules, conventions, and data structures that define how two parties exchange information in order to understand each other. Their communication will fail because they cannot understand each other. Imagine a Japanese man talking to an English man, each using their own mother language without any translator. Design of a communication protocol based on SMSĪny two parties who want to exchange information need to understand each other in order to communicate correctly. One important part is that your web application needs to understand the SMS content.įor that, we will create a message protocol that defines each specific action. Next, the web application interprets the SMS content, and then performs an action on the Raspberry Pi GPIO.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |