<?xml version="1.0" encoding="iso-8859-9" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Clomosy | Forum : MQTT  belirtilen anahtar bulunamadı problemi</title>
  <link>https://forum.clomosy.com.tr/</link>
  <description><![CDATA[XML içerik linki; Clomosy | Forum : Genel &#304;&#351;lemler : MQTT  belirtilen anahtar bulunamadı problemi]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 04 May 2026 14:37:51 +0000</pubDate>
  <lastBuildDate>Wed, 09 Jul 2025 13:41:01 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.07</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://forum.clomosy.com.tr/RSS_post_feed.asp?TID=1069</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Clomosy | Forum]]></title>
   <url>https://forum.clomosy.com.tr/forum_images/logo.png</url>
   <link>https://forum.clomosy.com.tr/</link>
  </image>
  <item>
   <title><![CDATA[MQTT  belirtilen anahtar bulunamadı problemi : Merhabalar,mqtt mesajini kontrol...]]></title>
   <link>https://forum.clomosy.com.tr/forum_posts.asp?TID=1069&amp;PID=2153#2153</link>
   <description>
    <![CDATA[<strong>Yazar:</strong> <a href="https://forum.clomosy.com.tr/member_profile.asp?PF=101">ztashia</a><br /><strong>Konu:</strong> 1069<br /><strong>Gönderim Zamanı:</strong> 09&nbsp;Temmuz&nbsp;2025 Saat 13:41<br /><br /><div>Merhabalar,</div><div>mqtt mesajini kontrol ederken checkin yaparken checkout time ve location almaya calisiyorsunuz fakat o field'lari gondermediginizde anahtar bulunamadi dönüyor aynı olay tam tersi checkout yaparkende geçerli. Çözüm olarak aşağıda gönderirken her field'ı gönderdim.<br><br>if (MQTT1.Connected) {</div><div>&nbsp; &nbsp; jsonMesaj = '{"action":"insert","table":"checkins",' +</div><div>&nbsp; &nbsp; &nbsp; '"user_id":"' + IntToStr(aktifKullaniciId) + '",' +</div><div>&nbsp; &nbsp; &nbsp; '"checkin_time":"' + qrSaat + '",' +</div><div>&nbsp; &nbsp; &nbsp; '"checkout_time":"",' +</div><div>&nbsp; &nbsp; &nbsp; '"checkout_location":"",' +</div><div>&nbsp; &nbsp; &nbsp; '"checkin_location":"' + konum + '"}';</div><div>&nbsp; &nbsp; MQTT1.Send(jsonMesaj);</div><div>&nbsp; }<br><br><div>&nbsp; if (MQTT1.Connected) {</div><div>&nbsp; &nbsp; jsonMesaj = '{"action":"update","table":"checkins",' +</div><div>&nbsp; &nbsp; &nbsp; '"id":"' + IntToStr(kayitId) + '",' +</div><div>&nbsp; &nbsp; &nbsp; '"checkout_time":"' + qrSaat + '",' +</div><div>&nbsp; &nbsp; &nbsp; '"checkin_time":"",' +</div><div>&nbsp; &nbsp; &nbsp; '"checkin_location":"",' +</div><div>&nbsp; &nbsp; &nbsp; '"checkout_location":"' + konum + '"}';</div><div>&nbsp; &nbsp; MQTT1.Send(jsonMesaj);</div><div>&nbsp; }</div></div>]]>
   </description>
   <pubDate>Wed, 09 Jul 2025 13:41:01 +0000</pubDate>
   <guid isPermaLink="true">https://forum.clomosy.com.tr/forum_posts.asp?TID=1069&amp;PID=2153#2153</guid>
  </item> 
  <item>
   <title><![CDATA[MQTT  belirtilen anahtar bulunamadı problemi : kay&#305;t i&#351;lemi id&amp;#039;siz mqtt...]]></title>
   <link>https://forum.clomosy.com.tr/forum_posts.asp?TID=1069&amp;PID=2148#2148</link>
   <description>
    <![CDATA[<strong>Yazar:</strong> <a href="https://forum.clomosy.com.tr/member_profile.asp?PF=307">Mahmutdmr</a><br /><strong>Konu:</strong> 1069<br /><strong>Gönderim Zamanı:</strong> 08&nbsp;Temmuz&nbsp;2025 Saat 18:35<br /><br />kayıt işlemi id'siz mqtt ile diğer cihaza kayıt işlemini gerçekleştiriyor ancak giriş-çıkış zamanları ve lokasyon bilgilerini diğer cihaza yansıtamıyorum. Aldığım hata ise "belirtilen anahtar bulunamadı "oluyor ilk olarak veri tablomu daha sonrasında MQTT bağlantısı olan sayfada ki prosedürleri ve&nbsp; giriş-çıkış işlemlerinin olduğu sayfa da ki prosedürleri sizinle paylaşacağım&nbsp; sorunun id den kaynaklandığını düşünüyorum ama ne yaptıysam olmadı yardımcı olursanız sevinirim&nbsp;<br><br><div><div>uses</div><div>anaEkran;</div><div>var</div><div>&nbsp; database, password: String;</div><div><br></div><div>{</div><div>&nbsp; clomosy.rununit('anaEkran');</div><div>&nbsp; database = Clomosy.AppFilesPath + 'database1.db3';</div><div>&nbsp; password = '';</div><div><br></div><div>&nbsp; try</div><div>&nbsp; &nbsp; Clomosy.DBSQLiteConnect(database, password);</div><div><br></div><div>&nbsp; &nbsp; // USERS tablosu</div><div>&nbsp; &nbsp; Clomosy.DBSQLiteQuery.Sql.Text = 'CREATE TABLE IF NOT EXISTS users (' +</div><div>&nbsp; &nbsp; &nbsp; 'id INTEGER PRIMARY KEY AUTOINCREMENT, ' +</div><div>&nbsp; &nbsp; &nbsp; 'email TEXT NOT NULL UNIQUE, ' +</div><div>&nbsp; &nbsp; &nbsp; 'password TEXT NOT NULL, ' +</div><div>&nbsp; &nbsp; &nbsp; 'kullanici_adi TEXT)';</div><div>&nbsp; &nbsp; Clomosy.DBSQLiteQuery.OpenorExecute;</div><div><br></div><div>&nbsp; &nbsp; // CHECKINS tablosu</div><div>&nbsp; &nbsp; Clomosy.DBSQLiteQuery.Sql.Text = 'CREATE TABLE IF NOT EXISTS checkins (' +</div><div>&nbsp; &nbsp; &nbsp; 'id INTEGER PRIMARY KEY AUTOINCREMENT, ' +</div><div>&nbsp; &nbsp; &nbsp; 'user_id INTEGER, ' +</div><div>&nbsp; &nbsp; &nbsp; 'checkin_time TEXT, ' +</div><div>&nbsp; &nbsp; &nbsp; 'checkout_time TEXT, ' +</div><div>&nbsp; &nbsp; &nbsp; 'checkin_location TEXT, ' +</div><div>&nbsp; &nbsp; &nbsp; 'checkout_location TEXT)';</div><div>&nbsp; &nbsp; Clomosy.DBSQLiteQuery.OpenorExecute;</div><div><br></div><div>&nbsp; &nbsp; // ADMINS tablosu</div><div>&nbsp; &nbsp; Clomosy.DBSQLiteQuery.Sql.Text = 'CREATE TABLE IF NOT EXISTS admins (' +</div><div>&nbsp; &nbsp; &nbsp; 'id INTEGER PRIMARY KEY AUTOINCREMENT, ' +</div><div>&nbsp; &nbsp; &nbsp; 'email TEXT NOT NULL UNIQUE, ' +</div><div>&nbsp; &nbsp; &nbsp; 'password TEXT NOT NULL)';</div><div>&nbsp; &nbsp; Clomosy.DBSQLiteQuery.OpenorExecute;</div><div><br></div><div>&nbsp; &nbsp; // Admin hesabı ekleniyor (sadece ilk çalıştırmada eklenir)</div><div>&nbsp; &nbsp; Clomosy.DBSQLiteQuery.Sql.Text = 'INSERT OR IGNORE INTO admins (email, password) VALUES ("admin@gmail.com", "123456")';</div><div>&nbsp; &nbsp; Clomosy.DBSQLiteQuery.OpenorExecute;</div><div><br></div><div>&nbsp; &nbsp; ShowMessage('Tablolar başarıyla oluşturuldu');</div><div>&nbsp; except</div><div>&nbsp; &nbsp; ShowMessage('Veritabanı oluşturulamadı: '+LastExceptionMessage);</div><div>&nbsp; }</div><div>}</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><div>void ParseAndApplyMQTTMessage</div><div>{</div><div>&nbsp; // Gelen mesajı ekrana yazdır</div><div>&nbsp; ShowMessage('GELEN MQTT MESAJI: ' + gelenMesaj);</div><div><br></div><div>&nbsp; // Önce action ve table çek</div><div>&nbsp; action = Clomosy.CLParseJSON(gelenMesaj, 'action');</div><div>&nbsp; table&nbsp; = Clomosy.CLParseJSON(gelenMesaj, 'table');</div><div><br></div><div>&nbsp; // Sadece tabloya göre ilgili alanları çek</div><div>&nbsp; if table == 'users'</div><div>&nbsp; {</div><div>&nbsp; &nbsp; kullanici_adi = Clomosy.CLParseJSON(gelenMesaj, 'kullanici_adi');</div><div>&nbsp; &nbsp; email&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= Clomosy.CLParseJSON(gelenMesaj, 'email');</div><div>&nbsp; &nbsp; password&nbsp; &nbsp; &nbsp; = Clomosy.CLParseJSON(gelenMesaj, 'password');</div><div><br></div><div>&nbsp; &nbsp; if action == 'insert'</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; sql = 'INSERT INTO users (kullanici_adi, email, password) VALUES (' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QuotedStr(kullanici_adi) + ', ' + QuotedStr(email) + ', ' + QuotedStr(password) + ')';</div><div>&nbsp; &nbsp; &nbsp; Clomosy.DBSQLiteQuery.Sql.Text = sql;</div><div>&nbsp; &nbsp; &nbsp; Clomosy.DBSQLiteQuery.OpenOrExecute;</div><div>&nbsp; &nbsp; &nbsp; ShowMessage('&#091;MQTT&#093; Kullanıcı eklendi: ' + kullanici_adi + ' / ' + email);</div><div>&nbsp; &nbsp; }</div><div>&nbsp; &nbsp; // update, delete işlemleri için de alanları ekle</div><div>&nbsp; }</div><div>&nbsp; else if table == 'checkins'</div><div>&nbsp; {</div><div>&nbsp; &nbsp; id&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = Clomosy.CLParseJSON(gelenMesaj, 'id');</div><div>&nbsp; &nbsp; user_id&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= Clomosy.CLParseJSON(gelenMesaj, 'user_id');</div><div>&nbsp; &nbsp; checkin_time&nbsp; &nbsp; &nbsp; = Clomosy.CLParseJSON(gelenMesaj, 'checkin_time');</div><div>&nbsp; &nbsp; checkout_time&nbsp; &nbsp; &nbsp;= Clomosy.CLParseJSON(gelenMesaj, 'checkout_time');</div><div>&nbsp; &nbsp; checkin_location&nbsp; = Clomosy.CLParseJSON(gelenMesaj, 'checkin_location');</div><div>&nbsp; &nbsp; checkout_location = Clomosy.CLParseJSON(gelenMesaj, 'checkout_location');</div><div><br></div><div>&nbsp; &nbsp; if action == 'insert'</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; sql = 'INSERT INTO checkins (user_id, checkin_time, checkin_location) VALUES (' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QuotedStr(user_id) + ', ' + QuotedStr(checkin_time) + ', ' + QuotedStr(checkin_location) + ')';</div><div>&nbsp; &nbsp; &nbsp; Clomosy.DBSQLiteQuery.Sql.Text = sql;</div><div>&nbsp; &nbsp; &nbsp; Clomosy.DBSQLiteQuery.OpenOrExecute;</div><div>&nbsp; &nbsp; }</div><div>&nbsp; &nbsp; else if action == 'update'</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; sql = 'UPDATE checkins SET checkout_time = ' + QuotedStr(checkout_time) +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ', checkout_location = ' + QuotedStr(checkout_location) +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ' WHERE id = ' + QuotedStr(id);</div><div>&nbsp; &nbsp; &nbsp; Clomosy.DBSQLiteQuery.Sql.Text = sql;</div><div>&nbsp; &nbsp; &nbsp; Clomosy.DBSQLiteQuery.OpenOrExecute;</div><div>&nbsp; &nbsp; }</div><div>&nbsp; &nbsp; else if action == 'delete'</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; sql = 'DELETE FROM checkins WHERE id = ' + QuotedStr(id);</div><div>&nbsp; &nbsp; &nbsp; Clomosy.DBSQLiteQuery.Sql.Text = sql;</div><div>&nbsp; &nbsp; &nbsp; Clomosy.DBSQLiteQuery.OpenOrExecute;</div><div>&nbsp; &nbsp; }</div><div>&nbsp; }</div><div>}</div><div>void OnLoginClick;</div><div>{</div><div>&nbsp; Clomosy.RunUnit('uLogin');</div><div>}</div><div><br></div><div>void OnRegisterClick;</div><div>{</div><div>&nbsp; Clomosy.RunUnit('uRegister');</div><div>}</div><div><br></div><div>void OnMembersClick;</div><div>{</div><div>&nbsp; Clomosy.RunUnit('uAdminLog');</div><div>}</div><div><br></div><div>void OnQrOkuyucuClick;</div><div>{</div><div>&nbsp; if (Clomosy.PlatformIsMobile)</div><div>&nbsp; &nbsp; ShowMessage('Yalnızca sorumlu ekranda çıkar');</div><div>&nbsp; else</div><div>&nbsp; &nbsp; Clomosy.RunUnit('uQrKodu');</div><div>}</div><div><br></div><div>void OnMQTTPublishReceived</div><div>{</div><div>&nbsp; if (MQTT1.ReceivedAlright)</div><div>&nbsp; {</div><div>&nbsp; &nbsp; gelenMesaj = MQTT1.ReceivedMessage;</div><div>&nbsp; &nbsp; ParseAndApplyMQTTMessage;</div><div>&nbsp; }</div><div>}</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><div><br></div><div>void KonumGirisClicked {</div><div>&nbsp; Clomosy.GetCurrentLocation;</div><div>&nbsp; latitude&nbsp; = clGetStringTo(Clomosy.LocationValue, '|');</div><div>&nbsp; longitude = clGetStringAfter(Clomosy.LocationValue, '|');</div><div>&nbsp; konumGirisEdit.Text = latitude + '|' + longitude;</div><div>}</div><div><br></div><div><br></div><div>void KonumCikisClicked {</div><div>&nbsp; Clomosy.GetCurrentLocation;</div><div>&nbsp; latitude&nbsp; = clGetStringTo(Clomosy.LocationValue, '|');</div><div>&nbsp; longitude = clGetStringAfter(Clomosy.LocationValue, '|');</div><div>&nbsp; konumCikisEdit.Text = latitude + '|' + longitude;</div><div>}</div><div><br></div><div><br></div><div>void GirisQrClicked {</div><div>&nbsp; qrForm.CallBarcodeReader(girisEdit);</div><div>}</div><div><br></div><div><br></div><div>void GirisKaydet {</div><div>&nbsp; aktifKullaniciId = Clomosy.GlobalVariableInteger;</div><div>&nbsp; qrSaat = girisEdit.Text;</div><div>&nbsp; konum = konumGirisEdit.Text;</div><div><br></div><div><br></div><div>&nbsp; if qrSaat == '' {</div><div>&nbsp; &nbsp; ShowMessage('QR kodu bilgisi alınmadı!');</div><div>&nbsp; &nbsp; Exit;</div><div>&nbsp; }</div><div>&nbsp; if konum == '' {</div><div>&nbsp; &nbsp; ShowMessage('Konum bilgisi alınmadı!');</div><div>&nbsp; &nbsp; Exit;</div><div>&nbsp; }</div><div><br></div><div>&nbsp; Clomosy.DBSQLiteQuery.SQL.Text =</div><div>&nbsp; &nbsp; 'SELECT id FROM checkins ' +</div><div>&nbsp; &nbsp; 'WHERE user_id = ' + IntToStr(aktifKullaniciId) +</div><div>&nbsp; &nbsp; ' AND (checkout_time IS NULL OR checkout_time = '''') ';</div><div>&nbsp; Clomosy.DBSQLiteQuery.OpenOrExecute;</div><div><br></div><div>&nbsp; if Clomosy.DBSQLiteQuery.Found {</div><div>&nbsp; &nbsp; ShowMessage('Daha önce yapılmış bir giriş var, çıkış yapılmadan tekrar giriş yapılamaz!');</div><div>&nbsp; &nbsp; Exit;</div><div>&nbsp; }</div><div><br></div><div>&nbsp; Clomosy.DBSQLiteQuery.SQL.Text =</div><div>&nbsp; &nbsp; 'INSERT INTO checkins (user_id, checkin_time, checkin_location) VALUES (' +</div><div>&nbsp; &nbsp; IntToStr(aktifKullaniciId) + ', ' + QuotedStr(qrSaat) + ', ' +</div><div>&nbsp; &nbsp; QuotedStr(konum) + ')';</div><div>&nbsp; Clomosy.DBSQLiteQuery.OpenOrExecute;</div><div><br></div><div>&nbsp; ShowMessage('Giriş ve konum başarıyla kaydedildi!');</div><div>&nbsp; girisEdit.Text = '';</div><div>&nbsp; konumGirisEdit.Text = '';</div><div><br></div><div>&nbsp; if (MQTT1.Connected) {</div><div>&nbsp; &nbsp; jsonMesaj = '{"action":"insert","table":"checkins",' +</div><div>&nbsp; &nbsp; &nbsp; '"user_id":"' + IntToStr(aktifKullaniciId) + '",' +</div><div>&nbsp; &nbsp; &nbsp; '"checkin_time":"' + qrSaat + '",' +</div><div>&nbsp; &nbsp; &nbsp; '"checkin_location":"' + konum + '"}';</div><div>&nbsp; &nbsp; MQTT1.Send(jsonMesaj);</div><div>&nbsp; }</div><div>}</div><div><br></div><div><br></div><div>void CikisQrClicked {</div><div>&nbsp; qrForm.CallBarcodeReader(cikisEdit);</div><div>}</div><div><br></div><div>void CikisKaydet {</div><div>&nbsp; aktifKullaniciId = Clomosy.GlobalVariableInteger;</div><div>&nbsp; qrSaat = cikisEdit.Text;</div><div>&nbsp; konum = konumCikisEdit.Text;</div><div><br></div><div><br></div><div>&nbsp; if qrSaat == '' {</div><div>&nbsp; &nbsp; ShowMessage('QR kodu bilgisi alınmadı!');</div><div>&nbsp; &nbsp; Exit;</div><div>&nbsp; }</div><div>&nbsp; if konum == '' {</div><div>&nbsp; &nbsp; ShowMessage('Konum bilgisi alınmadı!');</div><div>&nbsp; &nbsp; Exit;</div><div>&nbsp; }</div><div><br></div><div>&nbsp; Clomosy.DBSQLiteQuery.SQL.Text =</div><div>&nbsp; &nbsp; 'SELECT id FROM checkins ' +</div><div>&nbsp; &nbsp; 'WHERE user_id = ' + IntToStr(aktifKullaniciId) +</div><div>&nbsp; &nbsp; ' AND (checkout_time IS NULL OR checkout_time = '''') ' +</div><div>&nbsp; &nbsp; 'ORDER BY checkin_time ASC LIMIT 1';</div><div>&nbsp; Clomosy.DBSQLiteQuery.OpenOrExecute;</div><div><br></div><div>&nbsp; if (not Clomosy.DBSQLiteQuery.Found) {</div><div>&nbsp; &nbsp; ShowMessage('Önce giriş yapılmamış ya da çıkış zaten kaydedilmiş!');</div><div>&nbsp; &nbsp; Exit;</div><div>&nbsp; }</div><div><br></div><div>&nbsp; kayitId = Clomosy.DBSQLiteQuery.FieldByName('id').AsInteger;</div><div><br></div><div>&nbsp; Clomosy.DBSQLiteQuery.SQL.Text =</div><div>&nbsp; &nbsp; 'UPDATE checkins SET checkout_time = ' + QuotedStr(qrSaat) +</div><div>&nbsp; &nbsp; ', checkout_location = ' + QuotedStr(konum) +</div><div>&nbsp; &nbsp; ' WHERE id = ' + IntToStr(kayitId) +</div><div>&nbsp; &nbsp; ' AND (checkout_time IS NULL OR checkout_time = '''')';</div><div>&nbsp; Clomosy.DBSQLiteQuery.OpenOrExecute;</div><div><br></div><div>&nbsp; ShowMessage('Çıkış ve konum başarıyla kaydedildi!');</div><div>&nbsp; cikisEdit.Text = '';</div><div>&nbsp; konumCikisEdit.Text = '';</div><div><br></div><div>&nbsp; if (MQTT1.Connected) {</div><div>&nbsp; &nbsp; jsonMesaj = '{"action":"update","table":"checkins",' +</div><div>&nbsp; &nbsp; &nbsp; '"id":"' + IntToStr(kayitId) + '",' +</div><div>&nbsp; &nbsp; &nbsp; '"checkout_time":"' + qrSaat + '",' +</div><div>&nbsp; &nbsp; &nbsp; '"checkout_location":"' + konum + '"}';</div><div>&nbsp; &nbsp; MQTT1.Send(jsonMesaj);</div><div>&nbsp; }</div><div>}</div></div><div><br></div><br>]]>
   </description>
   <pubDate>Tue, 08 Jul 2025 18:35:19 +0000</pubDate>
   <guid isPermaLink="true">https://forum.clomosy.com.tr/forum_posts.asp?TID=1069&amp;PID=2148#2148</guid>
  </item> 
 </channel>
</rss>