Esp8266-cep telefonu bağlantı sorunu

Katılım
19 Eyl 2020
Mesajlar
60
Puanları
1
Yaş
42
merhaba cep telefonu wifi ağından esp8266 ya bağlanmak istiyorum olmuyor acaba ne yapılmalı?
mesela bu linkteki örnekte 14:30 da bağlantı kuruluyor aynı şeyleri yapmama rağmen bende olmuyor. çok kez denedim.
 
Kod:
Serial.begin(115200);
delay(100);

// önce bağlantı türü belirtilmeli.
WiFi.mode(WIFI_STA); // WiFi.mode(m): set mode to WIFI_AP, WIFI_STA, WIFI_AP_STA or WIFI_OFF

// sonra ssid ve şifre ile bağlantı kurulmalı.
// Bağlantı sonunda da aldığı ip'yi ya serial üzerinden ya da modemden bulursunuz elbet.
WiFi.begin("ssid", "pass");
while (WiFi.status() != WL_CONNECTED) {
  delay(500);
  Serial.print(".");
}
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
Kodunuzu görebilir miyiz? ESP'yi istemci olarak ayarlamanız gerekiyor.
 
Kod:
/*
   -- New project --
  
   This source code of graphical user interface
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 2.4.3 or later version
   download by link http://remotexy.com/en/library/
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/                  
     - for ANDROID 4.5.1 or later version;
     - for iOS 1.4.1 or later version;
   
   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.   
*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT

#include <RemoteXY.h>

// RemoteXY connection settings
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID "esp8266"
#define REMOTEXY_WIFI_PASSWORD "123456789"
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate 
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,2,0,0,0,30,0,10,13,0,
  1,0,25,17,12,12,6,31,88,0,
  2,0,47,18,22,11,1,26,31,31,
  79,78,0,79,70,70,0 };
 
// this structure defines all the variables and events of your control interface
struct {

    // input variables
  uint8_t button_1; // =1 if button pressed, else =0
  uint8_t switch_1; // =1 if switch ON and =0 if OFF

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

#define PIN_BUTTON_1 13
#define PIN_SWITCH_1 10


void setup()
{
  RemoteXY_Init ();
 
  pinMode (PIN_BUTTON_1, OUTPUT);
  pinMode (PIN_SWITCH_1, OUTPUT);
 
  // TODO you setup code
 
}

void loop()
{
  RemoteXY_Handler ();
 
  digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH);
  digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?LOW:HIGH);
 
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay()


}
birşeyi yeni farkettim ağ adı esp8266 idi onu değiştirdim sonra doğru porttan arduinyaya upload ettim kartın ışıkları her zaman ki şekilde yanıyor done uploading diyor fakat sonra cep telefonundan wifi listesini arıyınca yeni ağ adı çıkmıyor onun yerine yine esp8266 diye çıkıyor anladığım kadarıyla pcden arduinoya karta attığım kod gidermiş gibi yapıyor ama gitmiyor fakat neden böyle anlayamadım acaba espye ayrıca mı yazdırmak gerekiyor?
 
Moderatör tarafında düzenlendi:
İyi de bu kodda ESP'ye bağlantı kısmı nerede? Kodun baş tarafına bunu ekleyin.
Kod:
#include <ESP8266WiFi.h>

Sonra yukarıda yazdıklarımı setup içine ekleyin öyle derleyin ve karta yazdırın.
 
Kod:
/*
   -- New project --
  
   This source code of graphical user interface
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 2.4.3 or later version
   download by link http://remotexy.com/en/library/
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/                  
     - for ANDROID 4.5.1 or later version;
     - for iOS 1.4.1 or later version;
   
   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.   
*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library


#include <ESP8266WiFi.h>


#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT

#include <RemoteXY.h>

// RemoteXY connection settings
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID "esp8266"
#define REMOTEXY_WIFI_PASSWORD "123456789"
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate 
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,2,0,0,0,30,0,10,13,0,
  1,0,25,17,12,12,6,31,88,0,
  2,0,47,18,22,11,1,26,31,31,
  79,78,0,79,70,70,0 };
 
// this structure defines all the variables and events of your control interface
struct {

    // input variables
  uint8_t button_1; // =1 if button pressed, else =0
  uint8_t switch_1; // =1 if switch ON and =0 if OFF

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

#define PIN_BUTTON_1 13
#define PIN_SWITCH_1 10


void setup()
{

  Serial.begin(115200);
delay(100);

// önce bağlantı türü belirtilmeli.
WiFi.mode(WIFI_STA); // WiFi.mode(m): set mode to WIFI_AP, WIFI_STA, WIFI_AP_STA or WIFI_OFF

// sonra ssid ve şifre ile bağlantı kurulmalı.
// Bağlantı sonunda da aldığı ip'yi ya serial üzerinden ya da modemden bulursunuz elbet.
WiFi.begin("ssid", "pass");
while (WiFi.status() != WL_CONNECTED) {
  delay(500);
  Serial.print(".");
}
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());

  RemoteXY_Init ();
 
  pinMode (PIN_BUTTON_1, OUTPUT);
  pinMode (PIN_SWITCH_1, OUTPUT);
 
  // TODO you setup code
 
}

void loop()
{
  RemoteXY_Handler ();
 
  digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH);
  digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?LOW:HIGH);
 
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay()


}
bu şekilde yazdım esp8266.h no such file or directory diyor
acaba esp8266 kutuphanesi mi yüklemeliiym
 
Moderatör tarafında düzenlendi:
Bir tanesi bu olsa da bir çok anlatım var. Öncelikle ESP8266 modülünün arduino'ya tanıtılması gerekiyor. Ondan sonra da ilgili esp8266 kütüphanelerinin eklenmesi.
 
hocam doğrudur ama ilk videoda remotexy den üretilen kodu arduinoyay yapıştırıyor oluyor sadece remotexy kutuphanesi istiyor onu da yükledim ama olmadı

verdiğiniz linkledilerle yine hata veriyor resimdeki gibi
 

Ekli dosyalar

  • 1.jpg
    1.jpg
    83.5 KB · Görüntüleme: 36
seri portu açma satırlarını eklemediniz sanırım.
Kod:
Serial.begin(115200);
delay(100);
 
o da var hocam sizinkilerle birleşen kodlar şu şekilde
Kod:
/*
-- New project --

This source code of graphical user interface
has been generated automatically by RemoteXY editor.
To compile this code using RemoteXY library 2.4.3 or later version
download by link http://remotexy.com/en/library/
To connect using RemoteXY mobile app by link http://remotexy.com/en/download/
- for ANDROID 4.5.1 or later version;
- for iOS 1.4.1 or later version;

This source code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
*/

//////////////////////////////////////////////
// RemoteXY include library //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library


#include <ESP8266WiFi.h>


#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT

#include <RemoteXY.h>

// RemoteXY connection settings
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID "esp8266"
#define REMOTEXY_WIFI_PASSWORD "123456789"
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,2,0,0,0,30,0,10,13,0,
1,0,25,17,12,12,6,31,88,0,
2,0,47,18,22,11,1,26,31,31,
79,78,0,79,70,70,0 };

// this structure defines all the variables and events of your control interface
struct {

// input variables
uint8_t button_1; // =1 if button pressed, else =0
uint8_t switch_1; // =1 if switch ON and =0 if OFF

// other variable
uint8_t connect_flag; // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////

#define PIN_BUTTON_1 13
#define PIN_SWITCH_1 10


void setup()
{

Serial.begin(115200);
delay(100);

// önce bağlantı türü belirtilmeli.
WiFi.mode(WIFI_STA); // WiFi.mode(m): set mode to WIFI_AP, WIFI_STA, WIFI_AP_STA or WIFI_OFF

// sonra ssid ve şifre ile bağlantı kurulmalı.
// Bağlantı sonunda da aldığı ip'yi ya serial üzerinden ya da modemden bulursunuz elbet.
WiFi.begin("ssid", "pass");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());

RemoteXY_Init ();

pinMode (PIN_BUTTON_1, OUTPUT);
pinMode (PIN_SWITCH_1, OUTPUT);

// TODO you setup code

}

void loop()
{
RemoteXY_Handler ();

digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH);
digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?LOW:HIGH);

// TODO you loop code
// use the RemoteXY structure for data transfer
// do not call delay()


}
 
Moderatör tarafında düzenlendi:
Bir hata göremedim. Sadece esp'nin modeminize bağlanabilmesi için şu satırı
Kod:
WiFi.begin("ssid", "pass");
şu şekilde değiştirmeniz gerekiyor.
Kod:
WiFi.begin(REMOTEXY_WIFI_SSID, REMOTEXY_WIFI_PASSWORD);

Örnek olarak yazdığınız şu satırlar da;
#define REMOTEXY_WIFI_SSID "esp8266"
#define REMOTEXY_WIFI_PASSWORD "123456789"
kullandığınız modemin bilgileri olmalı. Yani herhangi bir cihaz, cep telefonu gibi esp de modem üzerinden internete çıkmış olacak. Ondan sonrası RemoteXY.com için bir üyelik ve My Projects üzerinden uzaktan kontrol ekranı tasarımı yapmanız. Bu ekranda button_1 ve switch_1 şeklinde iki nesne tanımlamanız gerekiyor ki program içinden kontrol edebilesiniz. Daha sonra sağ üstteki Get source code kısmından tasarımınız için oluşturulan aşağıdaki kısmı kendi modem adınız ve şifresiyle değiştirerek arduino kodunuz içerisine uygun yere eklemeniz yeterli. Daha sonra kodda veya tasarımda yapacağınız değişiklikler için sırf bu kısmı kopyalamanız size hız kazandıracaktır. My tokens'den bir adet her bir program için kullanılmak üzere token/anahtar oluşturmayı unutmayın. RemoteXY'de 5 nesneye kadar ücretsiz, daha fazlasında her 30 saniyede ekran kapanıyor bilginize.
// RemoteXY connection settings
#define REMOTEXY_WIFI_SSID "modem_adi"
#define REMOTEXY_WIFI_PASSWORD "modem_şifresi,!."
#define REMOTEXY_CLOUD_SERVER "cloud.remotexy.com"
#define REMOTEXY_CLOUD_PORT 6376
#define REMOTEXY_CLOUD_TOKEN "1a81234f745459a76cf123132sdf32040f7e75123453534ea061b5ea"


// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,3,0,22,0,65,0,10,180,1,
1,2,22,13,18,18,36,31,88,0,
67,5,11,77,18,8,67,26,11,67,
5,34,77,18,8,179,26,11,2,1,
6,44,22,11,132,26,31,31,79,78,
0,79,70,70,0,2,1,34,44,22,
11,132,26,31,31,79,78,0,79,70,
70,0 };

// this structure defines all the variables and events of your control interface
struct {

// input variables
uint8_t button_1; // =1 if button pressed, else =0
uint8_t switch_role1; // =1 if switch ON and =0 if OFF
uint8_t switch_role2; // =1 if switch ON and =0 if OFF

// output variables
char SICAKLIK[11]; // string UTF8 end zero
char NEM[11]; // string UTF8 end zero

// other variable
uint8_t connect_flag; // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)
Bu da kendi hazırladığım ekran tasarımı. 2 adet 5v röle ve dht11 sensöründen gelen sıcaklık ve nem değerlerini gösteriyor. X şeklindeki switch ise ikinci röleyi basılınca açıksa kapatıyor kapalıysa açıyor. Yani tersliyor.
1612205914077.png

Kod kısmı;
Kod:
void loop()
{
  RemoteXY_Handler ();

  if (RemoteXY.button_1==0)
    digitalWrite(PIN_ROLE1, (RemoteXY.switch_role1==0)?HIGH:LOW);
  else
    digitalWrite(PIN_ROLE1, (RemoteXY.switch_role1==0)?LOW:HIGH);

  float sicaklik = dht11_sensor.readTemperature();
  float nem = dht11_sensor.readHumidity();

  digitalWrite(PIN_ROLE2, (RemoteXY.switch_role2==0)?HIGH:LOW);

  dtostrf(sicaklik, 0, 1, RemoteXY.SICAKLIK);
  dtostrf(nem, 0, 1, RemoteXY.NEM);
  delay(1000);
}
 

Forum istatistikleri

Konular
128,133
Mesajlar
915,308
Kullanıcılar
449,850
Son üye
umutbaysal9

Yeni konular

Geri
Üst