Esp32 den veri̇ arada gelmi̇yor

The operation yail-divide cannot accept the arguments: , [" 0 0 "], [181]
Not: 5 saniye boyunca bildirilen başka bir hata görmezsiniz.

SÜREKLİ BU HATAYI ALIYORUM

ESP32 BLUETOOTH VERİLERİMİ BU ŞEKİLDE GÖNDERİYORUM

SerialBT.println(b16); // boş

SerialBT.println("+");

SerialBT.println(t,1); // sıcaklık 2

SerialBT.println("+");

SerialBT.println(h,1); // nem 3

SerialBT.println("+");

SerialBT.println(td); // temiz depo 4

SerialBT.println("+");

SerialBT.println(ad); // atık depo 5

SerialBT.println("+");

SerialBT.println(sd); // siyah depo 6

SerialBT.println("+");

SerialBT.println(g); // gaz 7

SerialBT.println("+");

SerialBT.println(v); // volt 8

SerialBT.println("+");

SerialBT.println(b1,1); // role1 9

SerialBT.println("+");

SerialBT.println(b2); // role2 10

SerialBT.println("+");

SerialBT.println(b3); // role3 11

SerialBT.println("+");

SerialBT.println(b4); // role4 12

SerialBT.println("+");

SerialBT.println(b5); // role5 13

SerialBT.println("+");

SerialBT.println(b6); // role6 14

SerialBT.println("+");

SerialBT.println(b7); // role7 15

SerialBT.println("+");

SerialBT.println(b8); // role8 16

SerialBT.println("+");

SerialBT.println(b9); // role9 17

SerialBT.println("+");

SerialBT.println(b10); // role10 18

SerialBT.println("+");

SerialBT.println(b11); // role11 19

SerialBT.println("+");

SerialBT.println(b12); // role12 20

SerialBT.println("+");

SerialBT.println(b13); // role13 21

SerialBT.println("+");

SerialBT.println(b14); // role14 22

SerialBT.println("+");

SerialBT.println(b15); // role15 23

SerialBT.println("+");

SerialBT.println(b16); // role16 24

SerialBT.println("+");

SerialBT.println(b16); // boş

SAAT
VERİÇEKME

CLOCK 50 MS
VERİLERİDE BU LİSTE İLE CEKİYORUM
ESP DELAY(1000)

(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.
export_and_upload_aia

deneme_Screen_KaydetmeNoktasi2_Screen_KaydetmeNoktasi1.aia (778.9 KB)

VERİ GELİYOR AMA ARADA BU HATAYI ALIYORUM. BLUETOOTH KONTROLLLÜ AKILLI KARAVAN KONTROL SİSTEMİ YAPMAYA ÇALIŞIYORUM.

#include <DHT.h>

#include "BluetoothSerial.h"

DHT dht(15, DHT11);

int r1 = 32;

int r2 = 33;

int r3 = 25;

int r4 = 26;

int r5 = 27;

int r6 = 14;

int r7 = 12;

int r8 = 13;

int r9 = 16;

int r10 = 17;

int r11 = 5;

int r12 = 18;

int r13 = 19;

int r14 = 21;

int r15 = 22;

int r16 = 23;

int d1 = 35;

int d2 = 34;

int d3 = 39;

int gas = 2;

int volt = 36;

int td;

int ad;

int sd;

int g;

int b1;

int b2;

int b3;

int b4;

int b5;

int b6;

int b7;

int b8;

int b9;

int b10;

int b11;

int b12;

int b13;

int b14;

int b15;

int b16;

float t;

float h;

BluetoothSerial SerialBT;

void setup() {

 SerialBT.begin("UMAYVANOTOMASYON");

  pinMode(r1, OUTPUT);

  pinMode(r2, OUTPUT);

  pinMode(r3, OUTPUT);

  pinMode(r4, OUTPUT);

  pinMode(r5, OUTPUT);

  pinMode(r6, OUTPUT);

  pinMode(r7, OUTPUT);

  pinMode(r8, OUTPUT);

  pinMode(r9, OUTPUT);

  pinMode(r10, OUTPUT);

  pinMode(r11, OUTPUT);

  pinMode(r12, OUTPUT);

  pinMode(r13, OUTPUT);

  pinMode(r14, OUTPUT);

  pinMode(r15, OUTPUT);

  pinMode(r16, OUTPUT);

  dht.begin();

}

void loop() {

  double vt_deger = analogRead(volt);

  double kalibre = 3.6;

  double v = vt_deger *(5.0 / 4095)* kalibre;

  td = analogRead(d1);

  ad = analogRead(d2);

  sd = analogRead(d3);

  g = analogRead(gas);

  b1 = digitalRead(r1);

  b2 = digitalRead(r2);

  b3 = digitalRead(r3);

  b4 = digitalRead(r4);

  b5 = digitalRead(r5);

  b6 = digitalRead(r6);

  b7 = digitalRead(r7);

  b8 = digitalRead(r8);

  b9 = digitalRead(r9);

  b10 = digitalRead(r10);

  b11 = digitalRead(r11);

  b12 = digitalRead(r12);

  b13 = digitalRead(r13);

  b14 = digitalRead(r14);

  b15 = digitalRead(r15);

  b16 = digitalRead(r16);

  t = dht.readTemperature();

  h = dht.readHumidity();

  SerialBT.println(b16);  // boş

  SerialBT.println("+");

  SerialBT.println(t,1); // sıcaklık 2

  SerialBT.println("+");

  SerialBT.println(h,1); // nem 3

  SerialBT.println("+");

  SerialBT.println(td); // temiz depo  4

  SerialBT.println("+");

  SerialBT.println(ad); // atık depo  5

  SerialBT.println("+");

  SerialBT.println(sd); // siyah depo 6

  SerialBT.println("+");

  SerialBT.println(g); // gaz 7

  SerialBT.println("+");

  SerialBT.println(v); // volt 8

  SerialBT.println("+");

  SerialBT.println(b1,1); // role1 9

  SerialBT.println("+");

  SerialBT.println(b2); // role2 10

  SerialBT.println("+");

  SerialBT.println(b3); // role3 11

  SerialBT.println("+");

  SerialBT.println(b4); // role4 12

  SerialBT.println("+");

  SerialBT.println(b5); // role5 13

  SerialBT.println("+");

  SerialBT.println(b6); // role6 14

  SerialBT.println("+");

  SerialBT.println(b7); // role7 15

  SerialBT.println("+");

  SerialBT.println(b8); // role8 16

  SerialBT.println("+");

  SerialBT.println(b9); // role9 17

  SerialBT.println("+");

  SerialBT.println(b10); // role10 18

  SerialBT.println("+");

  SerialBT.println(b11); // role11 19

  SerialBT.println("+");

  SerialBT.println(b12); // role12 20

  SerialBT.println("+");

  SerialBT.println(b13); // role13 21

  SerialBT.println("+");

  SerialBT.println(b14); // role14 22

  SerialBT.println("+");

  SerialBT.println(b15); // role15 23

  SerialBT.println("+");

  SerialBT.println(b16); // role16 24

  SerialBT.println("+");

  SerialBT.println(b16); // boş

  if(SerialBT.available()) {

    char c = SerialBT.read();

    if(c=='0'){digitalWrite(r1, LOW);}

    else if (c=='1'){digitalWrite(r1, HIGH);}

    if(c=='3'){digitalWrite(r2, LOW);}

    else if (c=='2'){digitalWrite(r2, HIGH);}

    if(c=='5'){digitalWrite(r3, LOW);}

    else if (c=='4'){digitalWrite(r3, HIGH);}

    if(c=='7'){digitalWrite(r4, LOW);}

    else if (c=='6'){digitalWrite(r4, HIGH);}

    if(c=='9'){digitalWrite(r5, LOW);}

    else if (c=='8'){digitalWrite(r5, HIGH);}

    if(c=='b'){digitalWrite(r6, LOW);}

    else if (c=='a'){digitalWrite(r6, HIGH);}

    if(c=='e'){digitalWrite(r7, LOW);}

    else if (c=='d'){digitalWrite(r7, HIGH);}

    if(c=='g'){digitalWrite(r8, LOW);}

    else if (c=='f'){digitalWrite(r8, HIGH);}

    if(c=='i'){digitalWrite(r9, LOW);}

    else if (c=='h'){digitalWrite(r9, HIGH);}

    if(c=='k'){digitalWrite(r10, LOW);}

    else if (c=='j'){digitalWrite(r10, HIGH);}

    if(c=='m'){digitalWrite(r11, LOW);}

    else if (c=='x'){digitalWrite(r11, HIGH);}

    if(c=='o'){digitalWrite(r12, LOW);}

    else if (c=='n'){digitalWrite(r12, HIGH);}

    if(c=='r'){digitalWrite(r13, LOW);}

    else if (c=='p'){digitalWrite(r13, HIGH);}

    if(c=='t'){digitalWrite(r14, LOW);}

    else if (c=='s'){digitalWrite(r14, HIGH);}

    if(c=='v'){digitalWrite(r15, LOW);}

    else if (c=='w'){digitalWrite(r15, HIGH);}

    if(c=='z'){digitalWrite(r16, LOW);}

    else if (c=='y'){digitalWrite(r16, HIGH);}

   

  }

  delay(20);

}

Your problem is caused by you losing synchronization of the input stream against the very long list you are trying to build.

You have many items to send, and I am not sure you would be able to use a long enough MTU size to hold a complete message with all those items.

You made it harder when you used a println() for each item of data, instead of saving the line feed character for end of message.

image

You use 4095 as a Delimiter byte.
Why?

I recommend a different message format, allowing identification of each piece of data as it arrives:

SerialBT.print('t:');
SerialBT.println(t,1);

SerialBT.print('h:');
SerialBT.println(h,1);

SerialBT.print('td:');
SerialBT.println(td); // td:(td)

SerialBT.print('ad:');
SerialBT.println(ad); // ad:(ad)

...

and using a Delimiter of 10 (line feed).

Be sure to use println() at the end of each message to send from the sending device, to signal end of message.

Only use print() in the middle of a message.

Be sure not to println() in the middle of a message, or you will break it into two short messages and mess up the item count after you split the message in AI2.

Do not rely on timing for this, which is unreliable.

In the AI2 Designer, set the Delimiter attribute of the BlueTooth Client component to 10 to recognize the End of Line character.
BlueToothClient1_Properties
Also, return data is not immediately available after sending a request,
you have to start a Clock Timer repeating and watch for its arrival in the Clock Timer event. The repeat rate of the Clock Timer should be faster than the transmission rate in the sending device, to not flood the AI2 buffers.

In your Clock Timer, you should check

  Is the BlueTooth Client still Connected?
  Is Bytes Available > 0?
     IF Bytes Available > 0 THEN
       set message var  to BT.ReceiveText(-1) 

This takes advantage of a special case in the ReceiveText block:

ReceiveText(numberOfBytes)
Receive text from the connected Bluetooth device. If numberOfBytes is less than 0, read until a delimiter byte value is received.

If you are sending multiple data values per message separated by | or comma, have your message split into a local or global variable for inspection before trying to select list items from it. Test if (length of list(split list result) >= expected list length) before doing any select list item operations, to avoid taking a long walk on a short pier. This bulletproofing is necessary in case your sending device sneaks in some commentary messages with the data values.

Some people send temperature and humidity in separate messages with distinctive prefixes like "t:" (for temperature) and "h:" (for humidity).
(That's YAML format.)

The AI2 Charts component can recognize these and graph them. See Bluetooth Client Polling Rate - #12 by ABG

To receive YAML format messages, test if the incoming message contains ':' . If true, split it at ':' into a list variable, and find the prefix in item 1 and the value in item 2.

sınırlıyıcı byte 10 yaptım polling rate sizce kaç olmalı

pollingrate kaç olmalı

The Polling Rate attribute of the Bluetooth component is only used to drive the Charts component's input rate.