{"id":671,"date":"2019-04-30T04:00:04","date_gmt":"2019-04-29T21:00:04","guid":{"rendered":"http:\/\/class.ajarnsunny.com\/?page_id=671"},"modified":"2019-05-01T08:26:13","modified_gmt":"2019-05-01T01:26:13","slug":"mqtt","status":"publish","type":"page","link":"http:\/\/class.ajarnsunny.com\/?page_id=671","title":{"rendered":"MQTT"},"content":{"rendered":"<h3><strong>IoT and MQTT<\/strong><\/h3>\n<p><strong>MQTT<\/strong><\/p>\n<p>MQTT (MQ Telemetry Transport or Message Queuing Telemetry Transport) is an ISO standard (ISO\/IEC PRF 20922) publish-subscribe-based messaging protocol. It works on top of the TCP\/IP protocol. It is designed for connections with remote locations where a \u201csmall code footprint\u201d is required or the network bandwidth is limited. The publish-subscribe messaging pattern requires a message broker.<\/p>\n<p>Raspberry Pi can become a broker server or the broker server can be a service on cloud server. Please be noted that the broker can act as a client also at the same time.<\/p>\n<p><strong>MQTT Client:\u00a0<\/strong>An MQTT client is any device that runs an MQTT library and connects to an MQTT broker over a network.<strong>\u00a0<\/strong>Both publisher and subscriber are MQTT clients. The publisher and subscriber refer that whether the client is publishing messages or subscribing to messages.<\/p>\n<p><strong>MQTT Broker:\u00a0<\/strong>The broker receives all messages, filter the messages, determine who is subscribed to each message, and send the message to these subscribed clients<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/wso2.com\/files\/mqtt-article-buddhima.png\" alt=\"Image result for MQTT\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/dcvta86296.i.lithium.com\/t5\/image\/serverpage\/image-id\/4984i9A09D722A2430BE8\/image-size\/large?v=1.0&amp;px=999\" alt=\"Image result for MQTT\" \/><\/p>\n<p><strong>OSI layer and TCP\/IP application<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-541 aligncenter\" src=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1375-Mar.-29-19.45.jpg\" sizes=\"(max-width: 574px) 100vw, 574px\" srcset=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1375-Mar.-29-19.45.jpg 574w, http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1375-Mar.-29-19.45-300x175.jpg 300w\" alt=\"\" width=\"574\" height=\"334\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-542\" src=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1376-Mar.-29-21.05.jpg\" sizes=\"(max-width: 892px) 100vw, 892px\" srcset=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1376-Mar.-29-21.05.jpg 892w, http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1376-Mar.-29-21.05-300x133.jpg 300w, http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1376-Mar.-29-21.05-768x340.jpg 768w\" alt=\"\" width=\"892\" height=\"395\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-543 aligncenter\" src=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1377-Mar.-29-21.06.jpg\" sizes=\"(max-width: 694px) 100vw, 694px\" srcset=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1377-Mar.-29-21.06.jpg 694w, http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1377-Mar.-29-21.06-300x109.jpg 300w\" alt=\"\" width=\"694\" height=\"253\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>Raspberry Pi MQTT Server Install (credit: iotdesignpro.com)<\/strong><\/h3>\n<p>To install\u00a0<em>Mosquitto<\/em>\u00a0server and client on your Pi, open Pi terminal and run this command:<\/p>\n<pre><strong>sudo apt-get install -y <\/strong><strong>mosquitto<\/strong> <strong>mosquitto<\/strong><strong>-clients<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<p>After running this command, a Mosquitto server is started automatically.<\/p>\n<p>Now we will open a subscriber in the channel using\u00a0<em>\u201ctest_channel\u201d<\/em>\u00a0that will receive messages from publisher:<\/p>\n<pre><strong>mosquitto_sub -h localhost -<\/strong><strong>v -t<\/strong><strong> test_channel<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<p>After subscriber we will open a publisher in the same channel with a message to subscriber:<\/p>\n<pre><strong>mosquitto_pub -h localhost -t test_channel -m \"Hello Raspberry Pi\"\r\n<\/strong><\/pre>\n<h3><\/h3>\n<h4><strong><span style=\"color: #000080;\">Example 1 <\/span><\/strong><\/h4>\n<p>Testing the mosquitto protocol<\/p>\n<p>1. Open one Raspberry Pi terminal and type the following command to subscribe to the topic\u2019s name \u201ctopic\u201d at your own IP, the IP address can be changed to be the IP of another broker<\/p>\n<p><strong>mosquitto_sub -h 127.0.0.1 -t <span style=\"color: #000080;\">topic<\/span><\/strong><\/p>\n<p>(Note: <strong><span style=\"color: #000080;\">topic<\/span><\/strong> can be changed to your\u00a0 own topic)<\/p>\n<p>2. Open another terminal and try to Publish by using the following command:<\/p>\n<p><strong>mosquitto_pub -h 127.0.0.1 -t <span style=\"color: #000080;\">topic<\/span> -m \u201cHello world\u201d<\/strong><\/p>\n<p>Note! :\u00a0<strong>-h<\/strong>\u00a0=\u00a0<strong>host<\/strong>,\u00a0<strong>-t<\/strong>\u00a0= parameter of the\u00a0<strong>topic<\/strong>\u00a0and\u00a0<strong>-m<\/strong>\u00a0=\u00a0<strong>message<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-544\" src=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1378-Mar.-29-22.00.jpg\" sizes=\"(max-width: 761px) 100vw, 761px\" srcset=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1378-Mar.-29-22.00.jpg 761w, http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1378-Mar.-29-22.00-300x114.jpg 300w\" alt=\"\" width=\"761\" height=\"290\" \/><\/p>\n<pre><strong>\u00a0<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Note:<\/strong>\u00a0We are simply transferring data to the same Raspberry Pi. For that just open two putty terminals, one for the subscriber and other for the publisher. If you are using two different Raspberry Pi\u2019s, then enter your second Pi\u2019 IP address rather than localhost. For example:<\/p>\n<pre><strong>mosquitto_pub -h 192.168.1.31 -t test_channel -m \"Hello Raspberry Pi\"<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/iotdesignpro.com\/sites\/default\/files\/inline-images\/Raspberry-Pi-MQTT-Server-Install.png\" alt=\"Raspberry Pi MQTT Server Install\" data-entity-type=\"file\" data-entity-uuid=\"b66903af-b5e8-47d3-bc02-ce8c0558c4a7\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/iotdesignpro.com\/sites\/default\/files\/inline-images\/Raspberry-Pi-MQTT-Server-Install-Window.png\" alt=\"Raspberry Pi MQTT Server Install Window\" data-entity-type=\"file\" data-entity-uuid=\"29d0d397-a1d4-4224-bab5-8a4feee5c336\" \/><\/p>\n<p>&nbsp;<\/p>\n<h4><strong><span style=\"color: #000080;\">Example 2<\/span><\/strong><\/h4>\n<h3><strong>Raspberry Pi &#8211; MQTT Data Exchanging Using Python<\/strong><\/h3>\n<p>The second method to set up a connection between two Raspberry Pi\u2019s using MQTT is using Python code.<\/p>\n<p>In this method, we will use two different python codes for the subscriber and publisher in two different windows or two different Pi\u2019s.<\/p>\n<p>For this first install Paho MQTT library using this command:<\/p>\n<pre><strong>sudo<\/strong><strong> pip install <\/strong><strong>paho<\/strong><strong>-<\/strong><strong>mqtt<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<p>Now in the first terminal window, create a subscriber file<\/p>\n<pre><strong>sudo<\/strong><strong> nano mqtt_subscriber.py<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<p>Copy this code and paste it to the subscriber file.<\/p>\n<pre><strong>import paho.mqtt.client as mqtt<\/strong>\r\n<strong>MQTT_SERVER = \"localhost\"<\/strong>\r\n<strong>MQTT_TOPIC = \"your_topic\"<\/strong>\r\n\r\n<strong># The callback for when the client receives a connect response from the server.<\/strong>\r\n<strong>def on_connect(client, <\/strong><strong>userdata<\/strong><strong>, flags, <\/strong><strong>rc<\/strong><strong>):<\/strong>\r\n<strong>    print(\"Connected with result code \"+str(<\/strong><strong>rc<\/strong><strong>))<\/strong>\r\n\r\n<strong>    # on_connect() means that if we lose the connection and reconnect then subscriptions will be renewed.<\/strong>\r\n<strong>    client.subscribe(MQTT_TOPIC)<\/strong>\r\n\r\n<strong># The callback for when a PUBLISH message is received from the server.<\/strong>\r\n<strong>def on_message(client, userdata, msg):<\/strong>\r\n<strong>    print(msg.topic+\" \"+str(msg.payload))<\/strong>\r\n<strong>    # more callbacks, etc<\/strong>\r\n\r\n<strong>client = mqtt.Client()<\/strong>\r\n<strong>client.on_connect = on_connect<\/strong>\r\n<strong>client.on_message = on_message<\/strong>\r\n<strong>client.connect(MQTT_SERVER, 1883, 60)<\/strong>\r\n\r\n<strong># Blocking call that processes network traffic, dispatches callbacks and<\/strong>\r\n<strong># handles reconnecting.<\/strong>\r\n<strong># Other loop*() functions are available that give a threaded interface and a<\/strong>\r\n<strong># manual interface.<\/strong>\r\n<strong>client.loop_forever()<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<p>Now run this code using:<\/p>\n<pre><strong>sudo<\/strong><strong> python mqtt_subscriber.py<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<p>Now our subscriber setup is complete. To set up publisher open a new putty window and create a publisher file using:<\/p>\n<pre><strong>sudo<\/strong><strong> nano mqtt_publisher.py<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<p>Copy the below code to publisher file.<\/p>\n<pre><strong>import paho.mqtt.publish as publish\r\nMQTT_SERVER = \"localhost\"\r\nMQTT_PATH = \"test_channel\"\r\npublish.single(MQTT_PATH, \"Hello World!\", hostname=MQTT_SERVER)<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Note:\u00a0<\/strong>If you are using two different Pi\u2019s, then enter your second Pi\u2019s IP address in place of\u00a0<em>\u2018localhost\u2019<\/em>\u00a0in\u00a0<em>MQTT_ SERVER<\/em>.<\/p>\n<p>&nbsp;<\/p>\n<p>And run it using:<\/p>\n<pre><strong>sudo python mqtt_publisher.py<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/iotdesignpro.com\/sites\/default\/files\/inline-images\/Raspberry-Pi-MQTT-data-exchange-Using-Python.png\" alt=\"Raspberry Pi MQTT data exchange Using Python\" data-entity-type=\"file\" data-entity-uuid=\"cdf8af52-60ee-4879-b670-cbeaea2b5639\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/iotdesignpro.com\/sites\/default\/files\/inline-images\/Sending-Data-from-Pi-to-Pi-using-MQTT-Server.png\" alt=\"Sending Data from Pi to Pi using MQTT Server\" data-entity-type=\"file\" data-entity-uuid=\"95ea23ef-9951-4001-8ad7-6ca59edaf085\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Hence, we have successfully send the data from Pi using MQTT Server.<\/p>\n<p>&nbsp;<\/p>\n<h3><strong>Different MQTT servers\/services<\/strong><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-546\" src=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1380-Mar.-29-23.12.jpg\" sizes=\"(max-width: 780px) 100vw, 780px\" srcset=\"http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1380-Mar.-29-23.12.jpg 959w, http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1380-Mar.-29-23.12-300x148.jpg 300w, http:\/\/class.ajarnsunny.com\/wp-content\/uploads\/2018\/03\/ScreenHunter_1380-Mar.-29-23.12-768x378.jpg 768w\" alt=\"\" width=\"780\" height=\"384\" \/><\/p>\n<h3><\/h3>\n<h4><strong><span style=\"color: #000080;\">Example 3<\/span><\/strong><\/h4>\n<p><span style=\"color: #0000ff;\"><strong>Connect LED from the smart board to pins 22. Control LED based on the messages received from the clients.<\/strong><\/span><\/p>\n<p><span style=\"color: #000080;\"><strong>Code for client<\/strong><\/span><\/p>\n<pre class=\"prettyprint prettyprinted\"><span class=\"com\"># MQTT Client demo<\/span>\r\n<span class=\"com\"># Continuously monitor two different MQTT topics for data,<\/span>\r\n<span class=\"com\"># check if the received data matches two predefined 'commands'<\/span>\r\n \r\n<span class=\"kwd\" style=\"color: #0000ff;\">import<\/span><span class=\"pln\"> paho<\/span><span class=\"pun\">.<\/span><span class=\"pln\">mqtt<\/span><span class=\"pun\">.<\/span><span class=\"pln\">client <\/span><span class=\"kwd\">as<\/span><span class=\"pln\"> mqtt\r\nMQTT_SERVER = \"localhost\"\r\nMQTT_TOPIC = \"topic1\"\r\nMQTT_TOPIC2 = \"topic2\"\r\n<\/span>\r\n \r\n<span class=\"com\"># The callback for when the client receives a CONNACK response from the server.<\/span>\r\n<span class=\"kwd\" style=\"color: #0000ff;\">def<\/span><span class=\"pln\"> on_connect<\/span><span class=\"pun\">(<\/span><span class=\"pln\">client<\/span><span class=\"pun\">,<\/span><span class=\"pln\"> userdata<\/span><span class=\"pun\">,<\/span><span class=\"pln\"> flags<\/span><span class=\"pun\">,<\/span><span class=\"pln\"> rc<\/span><span class=\"pun\">):<\/span>\r\n    <span class=\"kwd\" style=\"color: #0000ff;\">print<\/span><span class=\"pun\">(<\/span><span class=\"str\">\"Connected with result code \"<\/span><span class=\"pun\">+<\/span><span class=\"pln\">str<\/span><span class=\"pun\">(<\/span><span class=\"pln\">rc<\/span><span class=\"pun\">))<\/span>\r\n \r\n    <span class=\"com\"># Subscribing in on_connect() - if we lose the connection and<\/span>\r\n    <span class=\"com\"># reconnect then subscriptions will be renewed.<\/span>\r\n<span class=\"pln\">    client<\/span><span class=\"pun\">.<\/span><span class=\"pln\">subscribe<\/span><span class=\"pun\">(<\/span><span class=\"str\">\"<span class=\"pln\">MQTT_TOPIC<\/span>\"<\/span><span class=\"pun\">)<\/span>\r\n<span class=\"pln\">    client<\/span><span class=\"pun\">.<\/span><span class=\"pln\">subscribe<\/span><span class=\"pun\">(<\/span><span class=\"str\">\"<span class=\"pln\">MQTT_TOPIC2<\/span>\"<\/span><span class=\"pun\">)<\/span>\r\n \r\n<span class=\"com\"># The callback for when a PUBLISH message is received from the server.<\/span>\r\n<span class=\"kwd\" style=\"color: #0000ff;\">def<\/span><span class=\"pln\"> on_message<\/span><span class=\"pun\">(<\/span><span class=\"pln\">client<\/span><span class=\"pun\">,<\/span><span class=\"pln\"> userdata<\/span><span class=\"pun\">,<\/span><span class=\"pln\"> msg<\/span><span class=\"pun\">):<\/span>\r\n    <span class=\"kwd\" style=\"color: #0000ff;\">print<\/span><span class=\"pun\">(<\/span><span class=\"pln\">msg<\/span><span class=\"pun\">.<\/span><span class=\"pln\">topic<\/span><span class=\"pun\">+<\/span><span class=\"str\">\" \"<\/span><span class=\"pun\">+<\/span><span class=\"pln\">str<\/span><span class=\"pun\">(<\/span><span class=\"pln\">msg<\/span><span class=\"pun\">.<\/span><span class=\"pln\">payload<\/span><span class=\"pun\">))<\/span>\r\n\r\n    <span class=\"kwd\" style=\"color: #0000ff;\">if<\/span><span class=\"pln\"> msg<\/span><span class=\"pun\">.<\/span><span class=\"pln\">payload <\/span><span class=\"pun\">==<\/span> <span class=\"str\">\"ON\"<\/span><span class=\"pun\">:<\/span>\r\n        <span class=\"kwd\">print<\/span><span class=\"pun\">(<\/span><span class=\"str\">\"Received message #1, do something\"<\/span><span class=\"pun\">)<\/span>\r\n    GPIO.output(22, 1) # turn on LED\r\n\r\n    <span style=\"color: #0000ff;\">elif<\/span><span class=\"pln\"> msg<\/span><span class=\"pun\">.<\/span><span class=\"pln\">payload <\/span><span class=\"pun\">==<\/span> <span class=\"str\">\"OFF\"<\/span><span class=\"pun\">:<\/span>\r\n        <span class=\"kwd\">print<\/span><span class=\"pun\">(<\/span><span class=\"str\">\"Received message #2, do something else\"<\/span><span class=\"pun\">)<\/span>\r\n        <span class=\"com\"># Do something else\r\n    GPIO.output(22, 0) # turn off LED<\/span>\r\n \r\n<span class=\"com\"># Create an MQTT client and attach our routines to it.<\/span>\r\n<span class=\"pln\">client <\/span><span class=\"pun\">=<\/span><span class=\"pln\"> mqtt<\/span><span class=\"pun\">.<\/span><span class=\"typ\">Client<\/span><span class=\"pun\">()<\/span>\r\n<span class=\"pln\">client<\/span><span class=\"pun\">.<\/span><span class=\"pln\">on_connect <\/span><span class=\"pun\">=<\/span><span class=\"pln\"> on_connect<\/span>\r\n<span class=\"pln\">client<\/span><span class=\"pun\">.<\/span><span class=\"pln\">on_message <\/span><span class=\"pun\">=<\/span><span class=\"pln\"> on_message<\/span>\r\n \r\n<span class=\"pln\">client<\/span><span class=\"pun\">.<\/span><span class=\"pln\">connect<\/span><span class=\"pun\">(<\/span><span class=\"str\">\"<span class=\"pln\">MQTT_SERVER<\/span>\"<\/span><span class=\"pun\">,<\/span> <span class=\"lit\">1883<\/span><span class=\"pun\">,<\/span> <span class=\"lit\">60<\/span><span class=\"pun\">)<\/span>\r\n \r\n<span class=\"com\"># Process network traffic and dispatch callbacks. This will also handle<\/span>\r\n<span class=\"com\"># reconnecting. Check the documentation at<\/span>\r\n<span class=\"com\"># https:\/\/github.com\/eclipse\/paho.mqtt.python<\/span>\r\n<span class=\"com\"># for information on how to use other loop*() functions<\/span>\r\n<span class=\"pln\">client<\/span><span class=\"pun\">.<\/span><span class=\"pln\">loop_forever<\/span><span class=\"pun\">()\r\n\r\n<\/span><\/pre>\n<p><strong>To Control the LED, open another terminal to publish the IoT message:<\/strong><\/p>\n<p><strong>mosquitto_pub -h 192.168.1.31 -t topic1 -m &#8220;ON&#8221;<\/strong><\/p>\n<p><strong>mosquitto_pub -h 192.168.1.31 -t topic2 -m &#8220;OFF&#8221;<\/strong><\/p>\n<p>&nbsp;<\/p>\n<h4><strong>Assignment 5.A<\/strong><\/h4>\n<p><span style=\"color: #0000ff;\"><b style=\"color: #0000ff;\">Connect also LED 2 and LED 1 to pins 26 and 24 respectively. Modify the previous assignment to control LEDs (on and off) based on IoT messages from two <\/b><span style=\"color: #0000ff;\"><b>topics. Topic1 control LED 1 and Topic 2 control LED 2<\/b><\/span><b style=\"color: #0000ff;\">.<\/b><\/span><\/p>\n<pre id=\"python\" class=\"prettyprint prettyprinted\"><span class=\"pun\">\u00a0<\/span><\/pre>\n<div id=\"themify_builder_content-671\" data-postid=\"671\" class=\"themify_builder_content themify_builder_content-671 themify_builder\">\n\n    <\/div>\n<!-- \/themify_builder_content -->","protected":false},"excerpt":{"rendered":"<p>IoT and MQTT MQTT MQTT (MQ Telemetry Transport or Message Queuing Telemetry Transport) is an ISO standard (ISO\/IEC PRF 20922) publish-subscribe-based messaging protocol. It works on top of the TCP\/IP protocol. It is designed for connections with remote locations where a \u201csmall code footprint\u201d is required or the network bandwidth is limited. The publish-subscribe messaging [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-671","page","type-page","status-publish","hentry","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=\/wp\/v2\/pages\/671"}],"collection":[{"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=671"}],"version-history":[{"count":9,"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=\/wp\/v2\/pages\/671\/revisions"}],"predecessor-version":[{"id":682,"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=\/wp\/v2\/pages\/671\/revisions\/682"}],"wp:attachment":[{"href":"http:\/\/class.ajarnsunny.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}