Skip to content

Commit 2f24d3f

Browse files
authored
Merge pull request #3 from pxsty0/main
update
2 parents 45ce68f + fe9c29a commit 2f24d3f

File tree

5 files changed

+162
-55
lines changed

5 files changed

+162
-55
lines changed

README.md

Lines changed: 58 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,60 @@
11
# PxServ
22

3-
## Kullanım / Usage
4-
5-
```cpp
6-
#include <WiFi.h>
7-
#include <PxServ.h>
8-
9-
// Wi-Fi ayarları (Wi-Fi SSID ve Şifre)
10-
#define WIFI_SSID "your_wifi_ssid" // Wi-Fi Adı
11-
#define WIFI_PASS "your_wifi_password" // Wi-Fi Şifresi
12-
13-
// PxServ API Key (Proje API Anahtarınızı buraya ekleyin)
14-
PxServ client("your_pxserv_api_key");
15-
16-
void setup()
17-
{
18-
// Seri haberleşmeyi başlat
19-
Serial.begin(115200);
20-
21-
// Wi-Fi'a bağlan
22-
WiFi.begin(WIFI_SSID, WIFI_PASS);
23-
Serial.print("Wi-Fi'ya bağlanıyor...");
24-
25-
// Bağlantı sağlanana kadar bekle
26-
while (WiFi.status() != WL_CONNECTED)
27-
{
28-
Serial.print(".");
29-
delay(500); // Bağlantı sürecini yavaşlatmak için kısa bir gecikme eklenebilir
30-
}
31-
Serial.println("Bağlandı!");
32-
}
33-
34-
void loop()
35-
{
36-
// Veri ekle (Set Data)
37-
PxServ::Callback setResult = client.setData("msg", "value"); // "msg" anahtarına "value" değerini ekle
38-
Serial.println("Set Result -> Status: " + String(setResult.status) + " | Message: " + String(setResult.message) + " | Data: " + String(setResult.data));
39-
40-
delay(2000); // İki saniye bekle
41-
42-
// Veri al (Get Data)
43-
PxServ::Callback getResult = client.getData("msg"); // "msg" anahtarı için değeri getir
44-
Serial.println("Get Result -> Status: " + String(getResult.status) + " | Message: " + String(getResult.message) + " | Data: " + String(getResult.data));
45-
46-
delay(2000); // İki saniye bekle
47-
48-
// Veri kaldır (Remove Data)
49-
PxServ::Callback removeResult = client.removeData("msg"); // "msg" anahtarını kaldır
50-
Serial.println("Remove Result -> Status: " + String(removeResult.status) + " | Message: " + String(removeResult.message) + " | Data: " + String(removeResult.data));
51-
52-
delay(2000); // İki saniye bekle
53-
}
54-
```
3+
`PxServ` is an Arduino library that allows you to save and manage your data in the PxServ database in a simple and effective way. It is also compatible with ESP32 and ESP8266.
4+
5+
`PxServ`, verilerinizi basit ve etkili bir şekilde PxServ veritabanına kaydetmenizi ve yönetmenizi sağlayan bir Arduino kütüphanesidir. Ayrıca ESP32 ve ESP8266 ile uyumludur.
6+
7+
## Installation / Kurulum
8+
9+
You can add the library to your project using the Arduino Library Manager or manually:
10+
11+
Kütüphaneyi Arduino Library Manager veya manuel olarak projenize ekleyebilirsiniz:
12+
13+
### Using Arduino Library Manager / Arduino Library Manager Kullanarak
14+
15+
**English:**
16+
17+
1. Open the Arduino IDE.
18+
2. Go to `Sketch` > `Include Library` > `Manage Libraries...`.
19+
3. Search for `PxServ`.
20+
4. Click `Install`.
21+
22+
**Türkçe:**
23+
24+
1. Arduino IDE'yi açın.
25+
2. `Sketch` > `Include Library` > `Manage Libraries...` menüsüne gidin.
26+
3. `PxServ` araması yapın.
27+
4. `Install` butonuna tıklayın.
28+
29+
### Manual Installation / Manuel Kurulum
30+
31+
**English:**
32+
33+
1. Download the latest release from the [PxServ releases page](https://github.com/pxserv/pxserv.arduino/releases).
34+
2. Extract the downloaded ZIP file.
35+
3. Move the extracted folder to your Arduino libraries directory (usually located in `Documents/Arduino/libraries`).
36+
37+
**Türkçe:**
38+
39+
1. [PxServ releases sayfasından](https://github.com/pxserv/pxserv.arduino/releases) en son sürümü indirin.
40+
2. İndirilen ZIP dosyasını çıkarın.
41+
3. Çıkarılan klasörü Arduino kütüphaneleri dizinine taşıyın (genellikle `Documents/Arduino/libraries` konumunda bulunur).
42+
43+
## Usage / Kullanım
44+
45+
For detailed usage, please refer to the documentation:
46+
47+
Daha detaylı kullanım için lütfen dokümantasyona bakınız:
48+
49+
- [English Documentation](https://docs.pxserv.net/en/arduino-library)
50+
- [Türkçe Dokümantasyon](https://docs.pxserv.net/tr/arduino-kutuphanesi)
51+
52+
## Contributing / Katkıda Bulunma
53+
54+
If you would like to contribute, you can fork the project and develop on your own branch. We would be happy to review your changes!
55+
56+
Katkıda bulunmak isterseniz, projeyi forklayarak kendi branch'inizde geliştirme yapabilirsiniz. Değişikliklerinizi incelemekten memnuniyet duyarız!
57+
58+
## License / Lisans
59+
60+
[![MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

examples/helloWorld/helloWorld.ino

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#include <PxServ.h>
2+
3+
// Wi-Fi settings (Wi-Fi SSID and Password)
4+
#define WIFI_SSID "your_wifi_ssid" // Wi-Fi Name
5+
#define WIFI_PASS "your_wifi_password" // Wi-Fi Password
6+
7+
// PxServ API Key (Enter your project API key here)
8+
PxServ client("your_pxserv_api_key");
9+
10+
void setup()
11+
{
12+
// Start serial communication
13+
Serial.begin(115200);
14+
15+
// Connect to Wi-Fi
16+
WiFi.begin(WIFI_SSID, WIFI_PASS);
17+
Serial.print("Connecting to Wi-Fi...");
18+
19+
// Wait until the connection is established
20+
while (WiFi.status() != WL_CONNECTED)
21+
{
22+
Serial.print(".");
23+
delay(500); // Adding a short delay to slow down the connection process
24+
}
25+
Serial.println("Connected!");
26+
}
27+
28+
void loop()
29+
{
30+
// Add data (Set Data)
31+
PxServ::Callback setResult = client.setData("msg", "value"); // Add "value" to the "msg" key
32+
Serial.println("Set Result -> Status: " + String(setResult.status) + " | Message: " + String(setResult.message) + " | Data: " + String(setResult.data));
33+
34+
delay(2000); // Wait for two seconds
35+
36+
// Get data (Get Data)
37+
PxServ::Callback getResult = client.getData("msg"); // Get the value for the "msg" key
38+
Serial.println("Get Result -> Status: " + String(getResult.status) + " | Message: " + String(getResult.message) + " | Data: " + String(getResult.data));
39+
40+
delay(2000); // Wait for two seconds
41+
42+
// Remove data (Remove Data)
43+
PxServ::Callback removeResult = client.removeData("msg"); // Remove the "msg" key
44+
Serial.println("Remove Result -> Status: " + String(removeResult.status) + " | Message: " + String(removeResult.message) + " | Data: " + String(removeResult.data));
45+
46+
delay(2000); // Wait for two seconds
47+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#include <PxServ.h>
2+
3+
// Wi-Fi ayarları (Wi-Fi SSID ve Şifre)
4+
#define WIFI_SSID "your_wifi_ssid" // Wi-Fi Adı
5+
#define WIFI_PASS "your_wifi_password" // Wi-Fi Şifresi
6+
7+
// PxServ API Key (Proje API Anahtarınızı buraya ekleyin)
8+
PxServ client("your_pxserv_api_key");
9+
10+
void setup()
11+
{
12+
// Seri haberleşmeyi başlat
13+
Serial.begin(115200);
14+
15+
// Wi-Fi'a bağlan
16+
WiFi.begin(WIFI_SSID, WIFI_PASS);
17+
Serial.print("Wi-Fi'ya bağlanıyor...");
18+
19+
// Bağlantı sağlanana kadar bekle
20+
while (WiFi.status() != WL_CONNECTED)
21+
{
22+
Serial.print(".");
23+
delay(500); // Bağlantı sürecini yavaşlatmak için kısa bir gecikme eklenebilir
24+
}
25+
Serial.println("Bağlandı!");
26+
}
27+
28+
void loop()
29+
{
30+
// Veri ekle (Set Data)
31+
PxServ::Callback setResult = client.setData("msg", "value"); // "msg" anahtarına "value" değerini ekle
32+
Serial.println("Set Result -> Status: " + String(setResult.status) + " | Message: " + String(setResult.message) + " | Data: " + String(setResult.data));
33+
34+
delay(2000); // İki saniye bekle
35+
36+
// Veri al (Get Data)
37+
PxServ::Callback getResult = client.getData("msg"); // "msg" anahtarı için değeri getir
38+
Serial.println("Get Result -> Status: " + String(getResult.status) + " | Message: " + String(getResult.message) + " | Data: " + String(getResult.data));
39+
40+
delay(2000); // İki saniye bekle
41+
42+
// Veri kaldır (Remove Data)
43+
PxServ::Callback removeResult = client.removeData("msg"); // "msg" anahtarını kaldır
44+
Serial.println("Remove Result -> Status: " + String(removeResult.status) + " | Message: " + String(removeResult.message) + " | Data: " + String(removeResult.data));
45+
46+
delay(2000); // İki saniye bekle
47+
}

library.properties

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name=PxServ
2-
version=1.0.6
2+
version=1.0.7
33
author=mustafa_kok
44
maintainer=PxServ
5-
sentence=PxServ Library for Arduino / ESP32
6-
paragraph=Thanks to PxServ, get the opportunity to add power to IoT projects that need things like sending data and reading data over WiFi!
5+
sentence=PxServ Library for ESP32 / ESP8266
6+
paragraph=Enhance your IoT projects with PxServ by enabling data transmission and retrieval over WiFi!
77
category=*
88
url=https://github.com/pxserv/pxserv.arduino
99
architectures=*
10+
depends=Arduino_JSON

src/PxServ.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
#include <Arduino_JSON.h>
55
#include <Arduino.h>
66

7+
#if defined(ESP32)
78
#include <WiFi.h>
89
#include <WiFiMulti.h>
910
#include <HTTPClient.h>
1011
#include <WiFiClientSecure.h>
12+
#elif defined(ESP8266)
13+
#include <ESP8266WiFi.h>
14+
#include <ESP8266HTTPClient.h>
15+
#include <WiFiClientSecureBearSSL.h>
16+
#endif
1117

1218
class PxServ
1319
{

0 commit comments

Comments
 (0)