Forum Software Ferduino code Strange random problem with all values

Strange random problem with all values  [SOLVED]


Post Number:#1 Post Tue Dec 23, 2014 7:39 am
Posts: 10
Topics: 3
Solve rating: 0
Joined: Wed Oct 22, 2014 7:40 am
Topics: 3
Age: 45
Gender: None specified
National Flag:
Spain
Hi Fernando, Since the first days I have noted that sometimes my values get strange values, (-127 for temp probres, 9,2 for PH and 0 for EC) in a radon way. Some times I only need to reset hte ferduino with the reset button , other times i need to reload the code, some times also I need to reload the code different times as once the screen didn´t show anything, other times it didn´t communicate with joy reef..

I have tryed to detect any casuistic related to those strange problem but I couldn´t find any related cause.

As you can see at the next captures for example on main page of joy reef and on ferduino screen I see -127 degrees, but If I go to search temp probes it shows correct temperatures.

It also shows ramdon values about LEDs , but I haven´t any led connected to the system as I have a independant controller for it.

With the EC if I load the test code for stamps I obtained corect values, but on the ferduino screen and on joy reef I get those strange values.

Any idea or previous experiences about it?

https://www.sugarsync.com/pf/D237988_69056399_6992806

https://www.dropbox.com/s/o5rb1ebd047qy ... 2.jpg?dl=0

https://www.dropbox.com/s/8adjdnpdt1mqx ... t.jpg?dl=0

https://www.dropbox.com/s/h1vj1pra2vt52 ... t.jpg?dl=0

PD: sorry but img code give me error with sugarsync and dropbox images links
Last edited by Fernando Garcia on Tue Dec 23, 2014 7:31 pm, edited 1 time in total.
Reason: Title fixed.

Post Number:#2 Post Tue Dec 23, 2014 9:37 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 40
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

1º -127 ºC mean that the probe wasn't found. Check if the probes are associated correctly to a parameter on menu 2.

Also check if have some bad contact on connector or oxidation on probe if is in saltwater.

2º EC and pH depend of the temperature so, if you have problem with temperature it's normal.

3º Check if your SD card is working correctly, if the controller don't start after reset it mean that it's trying get an IP. Look the serial monitor.

4º Reload the code isn't needed because the problems are not of compilation, otherwise would not work even once.

5º What you mean with strange values to LED's?

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Tue Dec 23, 2014 10:11 am
Posts: 10
Topics: 3
Solve rating: 0
Joined: Wed Oct 22, 2014 7:40 am
Topics: 3
Age: 45
Gender: None specified
National Flag:
Spain
Hi again Fernando.

1.- As you can see at the captures, both probes are found correctly, once is associated with the water temp, and the second one i´m trying to associate throught joyreef and it give me a data saved, but when I go to the dashboard I found water temp is ok, but ambient is still at -127.

Those changes from -127 to correct temo of 23º had made without moving or re-connecting anything, it change alone to -127 and it recovers alone to 23º (but on "search temp probes" they appear correctly during all this time)

https://www.sugarsync.com/pf/D237988_69056399_6934822

https://www.dropbox.com/s/o5rb1ebd047qy ... 2.jpg?dl=0

2.- now that temp shows correctly , PH is again on 8.2 but EC give a 0 value. using test code it give me a 1022, and as the water temp is ok, it must be showing a correct value. isn´t it?

3.- I have checked it and seems it´s working fine, it´s a new 8Gb SD card. during the restart process it took more than 8 to 10 seconds to start working.

4.- Ok, undestood, but it seems like it was the only one solution to resolve the problem of not restarting.

5.- it shows ramdon values, but I haven´t anything connected to those pins so I don´t know why some times it shows 80% other times 20%, other times 0%.

best regards and sorry for so many questions but after trying a lot of things I´m a little bit frustrated

Post Number:#4 Post Tue Dec 23, 2014 10:30 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 40
Location: São Paulo
Gender: Male
National Flag:
Brazil

1 - Try using the menu 2 on touch screen.

2 - Check the code for EC stamp at stamps.ino.

3 - Use a SD card of 1 or 2 GB only.

5 - The power is calculated according the time. Check if this values are consistent with your LED table. No matter if have or not LEDs connected.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#5 Post Tue Dec 23, 2014 12:00 pm
Posts: 10
Topics: 3
Solve rating: 0
Joined: Wed Oct 22, 2014 7:40 am
Topics: 3
Age: 45
Gender: None specified
National Flag:
Spain
1.- Now after doing at the touch screen, joy reef had take the value correctly, maybe a joy reef bug? cause last times I have do it at the web directly.

2.- the tab stamps is correct, and I hadn´t made any change at this tab and it was working correctly till last sunday

3.- I have change from 8Gb to 2Gb and it´s working with the same EC error as previously (and also I have change it after selecting the temp probe with the touch screen, so it doesn´t seem to be a SD size problem as I hadnt have it before.

4.- understood, I have change all values to 0 in order to avoid the graph.

stamps tab (As i mentioned I haven´t change it since the joyreef code update and it have been working fine till this weekend when the ferduino reset by herself and after that all the values star to show the problems I had mentioned, and this problem had occured ramdonly at the past.

//------------------------------------- Leitura dos stamps
void check_parametro_ph_aquario()
{
  boolean done = false;
  byte holding;
  char sensorstring[15];
 
  do{
    Open_channel(ph1);
    delay(50);

    while(Serial3.available())
    {
      char c = Serial3.read();
    }

    Serial3.print("T,");
    Serial3.print(tempC);
    Serial3.print('\r');
    delay(1000);

    Serial3.print("R"); // Envia um comando.
    Serial3.print('\r');
    delay(1000);

    if(Serial3.available() > 3)
    {
      holding = Serial3.available();
      for(byte i=1; i <= holding; i++)
      {
        sensorstring[i]= Serial3.read();
      }

      if(holding == 6)
      {
        PHA = ((sensorstring[1]-48)*100 + (sensorstring[3]-48)*10 + (sensorstring[4]-48));
        PHA /= 100;
      }
      else
      {
        PHA = ((sensorstring[1]-48)*1000 + (sensorstring[2]-48)*100 + (sensorstring[4]-48)*10 + (sensorstring[5]-48));
        PHA /= 100;
      }
      Serial3.flush();
      break;
    }
  }
  while (done == true);
}
/*
void check_parametro_ph_reator()
{
  boolean done = false;
  byte holding;
  char sensorstring[15];
 
  do{
    Open_channel(ph2);
    delay(50);
    Serial3.print(tempC); //Para se obter um valor compensado pode-se enviar um valor de temperatura da água.
    Serial3.print('\r');
    delay(500);

    if(Serial3.available() > 3)
    {
      holding = Serial3.available();
      for(byte i = 1; i <= holding; i++)
      {
        sensorstring[i]= Serial3.read();
      }
      if(holding == 5)
      {
        PHR = ((sensorstring[1]-48)*100 + (sensorstring[3]-48)*10 + (sensorstring[4]-48));
        PHR /= 100;
      }
      else
      {
        PHR = ((sensorstring[1]-48)*1000 + (sensorstring[2]-48)*100 + (sensorstring[4]-48)*10 + (sensorstring[5]-48));
        PHR /= 100;
      }
      Serial3.flush();
      break;
    }
  }
  while (done == true);
}

void check_parametro_orp()
{
  boolean done = false;
  byte holding;
  char sensorstring[15];
 
  do{
    Open_channel(orp);
    delay(50);
    Serial3.print("r"),
    Serial3.print('\r');
    delay(500);

    if(Serial3.available() > 3)
    {
      holding = Serial3.available();
      for(byte i = 1; i <= holding; i++)
      {
        sensorstring[i]= Serial3.read();
      }
      if(holding == 5)
      {
        ORP = ((sensorstring[1]-48)*10 + (sensorstring[2]-48));
      }
      else
      {
        ORP = ((sensorstring[1]-48)*100 + (sensorstring[2]-48)*10 + (sensorstring[3]-48));
      }
      Serial3.flush();     
      break;
    }
  }
  while (done == true);
}
*/
void check_parametro_densidade()
{
  boolean done = false;
  byte holding;
  char sensorstring[15];
 
  do{
    Open_channel(ec);
    delay(50);

    while(Serial3.available())
    {
      char c = Serial3.read();
    }

    Serial3.print("T,");
    Serial3.print(tempC);
    Serial3.print('\r');
    delay(1000);

    Serial3.print("R"); // Envia um comando.
    Serial3.print('\r');
    delay(1000);

    if(Serial3.available() > 3)
    {
      holding = Serial3.available();
      for(byte i=1; i <= holding; i++)
      {
        sensorstring[i]= Serial3.read();
      }

      if(holding == 6)
      {
        DEN = ((sensorstring[1]-48)*1000 + (sensorstring[3]-48)*100 + ((sensorstring[4]-48)*10) + (sensorstring[5]-48));
      }

      Serial3.flush();
      break;
    }
  }
  while (done == true);
}

void iniciar_stamp_ph_aquario()
{
  Open_channel(ph1);
  delay(50);
  Serial3.print("e"); // Envia um comando para que o "stamp" pare de enviar as leituras.
  Serial3.print('\r');
  delay(1000);
  Serial3.flush();
  Serial3.print("L,1"); // Envia um comando para que o "stamp" apague o led de depuração.
  Serial3.print('\r');
  delay(1000);
  check_parametro_ph_aquario();
}
/*
void iniciar_stamp_ph_reator()
{
  Open_channel(ph2);
  delay(50);
  Serial3.print("e"); // Envia um comando para que o "stamp" pare de enviar as leituras.
  Serial3.print('\r');
  delay(1000);
  Serial3.flush();
  Serial3.print("L0"); // Envia um comando para que o "stamp" apague o led de depuração.
  Serial3.print('\r');
  delay(1000);
  check_parametro_ph_reator();
}

void iniciar_stamp_orp()
{
  Open_channel(orp);
  delay(50);
  Serial3.print("e"); // Envia um comando para que o "stamp" pare de enviar as leituras.
  Serial3.print('\r');
  delay(1000);
  Serial3.flush();
  Serial3.print("L0"); // Envia um comando para que o "stamp" apague o led de depuração.
  Serial3.print('\r');
  delay(1000);
  check_parametro_orp();
}
*/
void iniciar_stamp_densidade()
{
  Open_channel(ec);
  delay(50);
 
  Serial3.print("O,EC,0"); // Envia um comando para que o "stamp" desactive la salida d evalor EC
  Serial3.print('\r');
  delay(1000);
 
  Serial3.print("O,S,0"); // Envia um comando para que o "stamp" desactive la salida d evalor S
  Serial3.print('\r');
  delay(1000);
 
  Serial3.print("O,TDS,0"); // Envia um comando para que o "stamp" desactive la salida d evalor TDS
  Serial3.print('\r');
  delay(1000);
 
  Serial3.print("K,10"); // Envia um comando para que o "stamp" asigne la lectura de valor k=10 (agua dsalada)
  Serial3.print('\r');
  delay(1000);
 
  Serial3.print("e"); // Envia um comando para que o "stamp" pare de enviar as leituras.
  Serial3.print('\r');
  delay(1000);
  Serial3.flush();
  Serial3.print("L,1"); // Envia um comando para que o "stamp" apague o led de depuração.
  Serial3.print('\r');
  delay(1000);
  check_parametro_densidade();
}

void Open_channel(short channel)
{
  switch (channel)
  {
  case 0:
    //open channel Y0
    //S0=0
    //S1=0
    digitalWrite(multiplexadorS0Pin, LOW);
    digitalWrite(multiplexadorS1Pin, LOW);
    break;

  case 1:
    //open channel Y1
    //S0=1
    //S1=0
    digitalWrite(multiplexadorS0Pin, HIGH);
    digitalWrite(multiplexadorS1Pin, LOW);
    break;

  case 2:
    //open channel Y2
    //S0=0
    //S1=1
    digitalWrite(multiplexadorS0Pin, LOW);
    digitalWrite(multiplexadorS1Pin, HIGH);
    break;

  case 3:
    //open channel Y3
    //S0=1
    //S1=1
    digitalWrite(multiplexadorS0Pin, HIGH);
    digitalWrite(multiplexadorS1Pin, HIGH);
    break;
  }
  Serial3.print('\r');
  return;
}

Post Number:#6 Post Tue Dec 23, 2014 1:13 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 40
Location: São Paulo
Gender: Male
National Flag:
Brazil

Your code is wrong.

Check my code here: viewtopic.php?f=8&t=187
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#7 Post Tue Dec 23, 2014 3:06 pm
Posts: 10
Topics: 3
Solve rating: 0
Joined: Wed Oct 22, 2014 7:40 am
Topics: 3
Age: 45
Gender: None specified
National Flag:
Spain
Hi fernando,I think the stamp code was the same except in 2 points

1.- I have switch ON the led code changing the "0" value for a "1" on this line

Serial3.print("L,0"); // To turn OFF the LEDs of debug


2.- Regarding what value we want to show for the EC probe, I modified the code acording to EZO datasheet ans sustitute

void iniciar_stamp_densidade()
{
  Open_channel(ec); // To open channel for salinity
  delay(50);
  Serial3.print("R"); // To get a value
  Serial3.print('\r');
  delay(1000);

  Serial3.print("C,0"); // To stop continuous reading
  Serial3.print('\r');
  delay(1000);

  Serial3.print("L,0"); // To turn OFF the  LEDs of debug
  Serial3.print('\r');
  delay(1000);

  Serial3.print("RESPONSE,0"); // To disable response code
  Serial3.print('\r');
  delay(1000);


  Serial3.print("O,EC"); // Disable EC reading.
  Serial3.print('\r');
  delay(1000);

  Serial3.print("O,TDS"); // Disable TDS reading.
  Serial3.print('\r');
  delay(1000);

  Serial3.print("O,S"); // Disable salinity reading
  Serial3.print('\r');
  delay(1000);
  check_parametro_densidade();
}



by

 Open_channel(ec); // To open channel for salinity
  delay(50);
  Serial3.print("R"); // To get a value
  Serial3.print('\r');
  delay(1000);

  Serial3.print("C,0"); // To stop continuous reading
  Serial3.print('\r');
  delay(1000);

  Serial3.print("L,0"); // To turn OFF the  LEDs of debug
  Serial3.print('\r');
  delay(1000);

  Serial3.print("RESPONSE,0"); // To disable response code
  Serial3.print('\r');
  delay(1000);

  Serial3.print("O,EC,0"); // Disable EC reading.
  Serial3.print('\r');
  delay(1000);

  Serial3.print("O,TDS,0"); // Disable TDS reading.
  Serial3.print('\r');
  delay(1000);

  Serial3.print("O,S,0"); // Disable salinity reading
  Serial3.print('\r');
  delay(1000);
  check_parametro_densidade();
}


But the rest it´s the same as you writte it on the post.

Best Regards.

Before loading it on the ferduino I have check at joyreef and it was showing agin the EC, after that I review and charge the last code and everyhing seems working again. (but it´s almost the same code than yesterday.) that´s why I considered it so strange.

Post Number:#8 Post Tue Dec 23, 2014 3:34 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 40
Location: São Paulo
Gender: Male
National Flag:
Brazil

Almost the same is different of equal.

I can't see it in your previous code:

void iniciar_stamp_densidade()
{
  Open_channel(ec); // To open channel for salinity
  delay(50);
  Serial3.print("R"); // To get a value
  Serial3.print('\r');
  delay(1000);


I already told for you don't change L,0 to L,1.

I'll not repeat information again.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#9 Post Wed Dec 24, 2014 8:42 am
Posts: 10
Topics: 3
Solve rating: 0
Joined: Wed Oct 22, 2014 7:40 am
Topics: 3
Age: 45
Gender: None specified
National Flag:
Spain
Almost the same is different of equal.

I can't see it in your previous code:

void iniciar_stamp_densidade()
{
  Open_channel(ec); // To open channel for salinity
  delay(50);
  Serial3.print("R"); // To get a value
  Serial3.print('\r');
  delay(1000);


I already told for you don't change L,0 to L,1.

I'll not repeat information again.



Hi Fernando, sorry but when I copy the code I made a mistake not copying the first line (
void iniciar_stamp_densidade()
{
), this is the code with the first line included on it.

void iniciar_stamp_densidade()
{
  Open_channel(ec); // To open channel for salinity
  delay(50);
  Serial3.print("R"); // To get a value
  Serial3.print('\r');
  delay(1000);

  Serial3.print("C,0"); // To stop continuous reading
  Serial3.print('\r');
  delay(1000);

  Serial3.print("L,0"); // To turn OFF the  LEDs of debug
  Serial3.print('\r');
  delay(1000);

  Serial3.print("RESPONSE,0"); // To disable response code
  Serial3.print('\r');
  delay(1000);

  Serial3.print("O,EC,0"); // Disable EC reading.
  Serial3.print('\r');
  delay(1000);

  Serial3.print("O,TDS,0"); // Disable TDS reading.
  Serial3.print('\r');
  delay(1000);

  Serial3.print("O,S,0"); // Disable salinity reading
  Serial3.print('\r');
  delay(1000);
  check_parametro_densidade();
}


About the activation of the led I had activate it in order to try to debug and test the problem with the test code and the atlas test code, but now it´s again off (o).




Return to Ferduino code





Who is online

Users viewing this topic: No registered users and 0 guests