# Cihaz Haberleşmesi

#### Cihaz içerizindeki haberleşmeleri ayarlayın

* Cihazınızı wifiye bağlayın
* Göndermek istediğiniz veriyi HTTP GET isteği ile gönderin
* Veriyi göndereceğiniz adres “<https://prodiot.com/pi/> Sizin ClientID’niz/Cihaz Seri Numarası /Gönderme istediğiniz verinin iletişim adı/Göndermek istediğiniz değer”

<pre class="language-clike"><code class="lang-clike"><strong>    HTTPClient http;
</strong>    WiFiClientSecure client;
    client.setInsecure();
    String url = "https://prodiot.com/pi/ClientID/SeriNumarası/IletisimAdi/Deger”;
    http.begin(client, url);
    int httpCode = http.GET();
    
    if (httpCode == HTTP_CODE_OK) {
      String payload = http.getString();
    } else {
      Serial.println("HTTP isteği başarisiz oldu.");
    }
<strong>
</strong>    http.end();
    digitalWrite(getLedPin,LOW);
</code></pre>

* Uygulamadan gelen komutları alabilmek için MQTT bağlantısını yapın
* MQTT de bağlancağınız kanal “pi/Sizin ClientID’niz/Cihaz Seri Numarası ”

<pre class="language-clike"><code class="lang-clike"> 
  client.setServer(mqttServer, mqttPort);
  client.setCallback(callback);
   
  while (!client.connected()) {
    Serial.println("MQTT Bağlantisi yapiliyor..");
    if (client.connect("ESP8266Client", mqttUser, mqttPassword )) {
<strong>      Serial.println("Bağlanti Sağlandi");  
</strong>    } else {
      Serial.print("failed with state ");
      Serial.print(client.state());
      delay(2000);
    }
  }
  
  client.subscribe("pi/ClientID/SeriNumarası");
    
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.prodiot.com/nasil-kullanilir/cihaz-haberlesmesi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
