Forum Software Ferduino code A few questions

A few questions  [SOLVED]


Post Number:#1 Post Thu Apr 14, 2016 2:51 pm
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 39
Location: England
Gender: Male
National Flag:
Great Britain
Hi Fernando,

I am using your code in a diy controller with no lcd and have a few questions please.

1) what is the best way to connect 1 PH stamp on its own and do I need to change any code?
2) when its turned on, it slowly comes up to te correct led brightness then after about 30 seconds to 1 minute, all the leds turn off then it slowly comes back up to full brightness and keeps doing this over and over. have you any suggesions please? I have the pwm wires and gnd connected to an ldd 5up boards with ldd-h drivers on it. I dont think its anything to do with the drivers though as everytime the leds go off, it ramps back up to full power which is a controller feature.
3) i am only using 3 of the outlets, can I put the 5 timers in the others place without changing too much code? otherwise can I set the timers to be on all the time?
4) on led presets, if i set red to 100 and uv to 200 then save, then refresh the screen, the values are swaped round? this is all done from the web interface as I have no LCD connected.

Any help is appreciated :D

Post Number:#2 Post Thu Apr 14, 2016 4:21 pm
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 39
Location: England
Gender: Male
National Flag:
Great Britain
edit on the below

2) when its turned on, it slowly comes up to te correct led brightness then after about 30 seconds to 1 minute, all the leds turn off then it slowly comes back up to full brightness and keeps doing this over and over. have you any suggesions please? I have the pwm wires and gnd connected to an ldd 5up boards with ldd-h drivers on it. I dont think its anything to do with the drivers though as everytime the leds go off, it ramps back up to full power which is a controller feature.

It actually shows on the web interface that the device has been reset as the online / uptime counter resets to zero after about 2 minutes of being online but the lights etc on the ethernet do not go out like a proper reset. Similar to what I had when there was a serial issue causing like a soft reset but I have both stamp types (ezo / v4x) commented out at the moment as I have not connected the ph yet until I am sure how to do it on its own.

I have used 20 / 21 for rtc and re used 18 / 19 for something else if that has any effect?

edit 2

uncommenting debug has stopped the reboots for some reason. It was commented as I was going to use pin 1 for a buzzer but hadnt connected it yet.

Post Number:#3 Post Fri Apr 15, 2016 6:24 am
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 39
Location: England
Gender: Male
National Flag:
Great Britain
got a few more questions if you can help ^:)^

i got an email at 0800 this morning saying the controller had stopped sending data and nothing has shown on the graphs since but i can still log onto it and make changes etc. why would it stop sending data if its still on the network?

on the dosing section, i have set the container volume, calibrated the dosers and set up a custom dosing schedule. when I enable the schedule and click save, the changes are saved in that section but in the scheduled dosage section it says not activated and the doser doesnt run. on manual it works.

lastly (for now) in the custom names section i can name my sensors (floats) but cannot find them anywhere in the web interface to see there current status (high / low) to get the ato function working correctly as I think i need swap high for low and low for high etc in the code to work with my floats.

Thank you in advance :D

Post Number:#4 Post Fri Apr 15, 2016 1:06 pm
Posts: 1578
Topics: 38
Images: 271
Solve rating: 213
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 34
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

1) Connect directly the stamp in serial port 3, RX to TX and TX to RX. No changes on code is needed.

2) The max. brightness will be reached after 1 minute. It's a feature on code.

There something doing soft reseft, are you using the latest libraries available in my Github and the IDE 1.6.7?

3) if you won't use the multiplexer and PCF8575, can use the pins 16, 17, 18 and 19 for this outlets. Don't forget to change the current value of this variable to any other like 80, 81 and etc.

4) Before refresh the page click on button "Save to EEPROM" otherwise the controller will get the old values from EEPROM again.

Regarding dosing pumps, the dosage is activated (green button "enabled")?

Regarding level sensors, I didn't any page to show level status for now. To see the level status you can change the code on loop to see the result on serial monitor. Uncomment this lines:

      Serial.print("Sensor 1: ");
      Serial.println(analogRead(A0));

      Serial.print("Sensor 2: ");
      Serial.println(analogRead(A1));

      Serial.print("Sensor 3: ");
      Serial.println(analogRead(A2));

      Serial.print("Sensor 4: ");
      Serial.println(analogRead(A3));

      Serial.print("Sensor 5: ");
      Serial.println(analogRead(A4));

      Serial.print("Sensor 6: ");
      Serial.println(analogRead(A5));


Best regards.
Please do not PM me for support unless it is absolutely necessary.

I'll not write custom function to nobody unless you can pay for my job.

Post Number:#5 Post Fri Apr 15, 2016 3:18 pm
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 39
Location: England
Gender: Male
National Flag:
Great Britain
Thanks for the reply.

I will try the stamp in this mode, but when i tried before it did not seem to return any info and all 4 probe sections returned data even with only one stamp connected.

i am using the latest version of the code and 1.6.7

on the leds, i click save with these settings

https://goo.gl/photos/Kgm4yWWx3epGdCwF9

then go to dashboard and see this

https://goo.gl/photos/BoezFB1xkaN1zt3z7

which is the opposite and when I go back into preset mode its like this

https://goo.gl/photos/ALBhN1SWUWKEBwEZ7

on the dosers i set the custom schedule like this

https://goo.gl/photos/9QYEpoj5GVD6FGYUA

then click save then when I go to schedule i see this and it doesnt seem to run

https://goo.gl/photos/Uc7pKpZVhNfst1Sq5

I have enabled the serial settings for the level sensors so I can work with that thank you.

For the timers, i tried 00:00 23:59 but it does actually switch off for 1 minute. Is there a way to make it always on for timers please as I have them connected to relays for return pump and skimmer and wavemaker etc which I want on all the time primarily but want the ability to turn them off in case I want to run the skimmer on a schedule or have refugium light only on part of the time at a later date.

With the resetting, i will leave debug enabled for now as that stops the resetting and not have a buzzer connected at the moment.

p.s. I had to take the [img] tags off as "it was not possible to determine the dimensions of the image"

Post Number:#6 Post Fri Apr 15, 2016 4:38 pm
Posts: 1578
Topics: 38
Images: 271
Solve rating: 213
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 34
Location: São Paulo
Gender: Male
National Flag:
Brazil

I will try the stamp in this mode, but when i tried before it did not seem to return any info and all 4 probe sections returned data even with only one stamp connected.


Look on setup and loop to enable/disable only the functions required to your controller.

Setup:

  iniciar_stamp_ph_reator();    // Lê o pH do reator
  iniciar_stamp_orp();          // Lê a ORP
  // iniciar_stamp_densidade();    // Lê a densidade
  iniciar_stamp_ph_aquario();   // Lê o pH do aquário


Loop:

    check_parametro_ph_reator(); // Verifica os "stamps".
    check_parametro_orp();
    // check_parametro_densidade();
    check_parametro_ph_aquario();



on the leds, i click save with these settings

https://goo.gl/photos/Kgm4yWWx3epGdCwF9

then go to dashboard and see this

https://goo.gl/photos/BoezFB1xkaN1zt3z7

which is the opposite and when I go back into preset mode its like this

https://goo.gl/photos/ALBhN1SWUWKEBwEZ7


Sorry I did a mess, I was talking about LED table.

You are right, it was swapped. Now should be ok, check please.

After a click in save button in custom dosage can you see a success message?

Apparently the controller is not saving the TXT file on SD card. Check if your SD card is working fine with example available on forum.

PS. I'll answer others questions later, I'm not fine now.
Please do not PM me for support unless it is absolutely necessary.

I'll not write custom function to nobody unless you can pay for my job.

Post Number:#7 Post Sat Apr 16, 2016 10:26 am
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 39
Location: England
Gender: Male
National Flag:
Great Britain
Thanks again Fernando,

I hope you are ok soon and no rush to answer any questions.

I have commented all but ph aquaria in both sections but all are reporting zero, still no ph. I did have the stamp and probe connected to a different controller and it was working and an led on the stamp was flashing. It does not flash connected to the ferduino controller. Could I have damaged it by conecting it without changing the code forst to only one stamp uncommented?

The leds values are all correct and working perfectly now thanks

i couldnt run your code for tests on either of the sd card ones as it had a problem with compiling due to errors with sdvolume but I tried the sdreadwrite example sketch and that worked, now ever since that the dosers are working correctly and saving the data so thats good too :-?

Post Number:#8 Post Sat Apr 16, 2016 12:44 pm
Posts: 1578
Topics: 38
Images: 271
Solve rating: 213
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 34
Location: São Paulo
Gender: Male
National Flag:
Brazil

For the timers, i tried 00:00 23:59 but it does actually switch off for 1 minute. Is there a way to make it always on for timers please as I have them connected to relays for return pump and skimmer and wavemaker etc which I want on all the time primarily but want the ability to turn them off in case I want to run the skimmer on a schedule or have refugium light only on part of the time at a later date.


Hi!

I forgot of this detail in the last update.

It's easy to solve, look the tab "Temporizadores" and find this lines:

if ((NumMins(t.hour, t.min) >= NumMins(on_hora_e[i], on_minuto_e[i])) && (NumMins(t.hour, t.min) < NumMins(off_hora_e[i], off_minuto_e[i])))

if (NumMins(t.hour, t.min) >= NumMins(on_hora_e[i], on_minuto_e[i]) || (NumMins(t.hour, t.min) < NumMins(off_hora_e[i], off_minuto_e[i])))


Only replace < by <=.

I did an update on Github

https://github.com/FernandoGarcia/Ferdu ... 507178ba8e

With the resetting, i will leave debug enabled for now as that stops the resetting and not have a buzzer connected at the moment.


The code should work without debug too.

The variable USE_TFT is commented in your code?

I have commented all but ph aquaria in both sections but all are reporting zero, still no ph. I did have the stamp and probe connected to a different controller and it was working and an led on the stamp was flashing. It does not flash connected to the ferduino controller.


I you will use this stamp for tank pH leave this lines uncommented.

iniciar_stamp_ph_aquario();   // Lê o pH do aquário
check_parametro_ph_aquario();


Too select (comment / uncomment) the model of your stamp in Ferduino tab.

#define STAMPS_V4X     // Comente esta linha para usar Stamps EZO
//#define STAMPS_EZO     // Descomente esta linha para usar Stamps EZO


Could I have damaged it by conecting it without changing the code forst to only one stamp uncommented?


I don't think.


now ever since that the dosers are working correctly and saving the data so thats good too


I don't understand, the custom dosage is working for you now?

Best regards.
Please do not PM me for support unless it is absolutely necessary.

I'll not write custom function to nobody unless you can pay for my job.

Post Number:#9 Post Sun Apr 17, 2016 12:31 pm
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 39
Location: England
Gender: Male
National Flag:
Great Britain
The code for the timers is now changed thanks - do i still set it to 00:00 23:59 but it now will not turn off for 1 minute?

USETFT is commented out in the code.

the correct ph lines were commented / uncommented but yesterday my ph stamp went up in smoke so I have commented out stamps completely now until I can get a replacement. It must have been damaged somehow then the on board regulator hot too hot and melted the protective covering on the stamp itself.

Dosing is working well now

I still get the odd soft reset but very random and not during anything specific that I can see.

I will keep monitoring closely for now and see how it goes so hopefully i can relax a bit now and enjoy the tank.

Thank you so much for helping with my problems and for creating such a good controller :-bd

Post Number:#10 Post Mon Apr 18, 2016 10:35 am
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 39
Location: England
Gender: Male
National Flag:
Great Britain
I figure I may as well keep adding to this thread rather than creating a new one.

Timers set to 0000-2359 seems to have worked and they did not go off at 2359 according to the graphs :)

Next question, it seems after around 10-12hrs usually (18hrs today) I get an email saying the controller has stopped sending data. If I log on the dashboard everything works and is there, but the graphs dont show any data since the email and I dont seem to get temp alerts. Is there a way to start the controller sending data again either automatically or remotely without resetting the controller as it is happening regularily and I am not sure why.

Thanks

Post Number:#11 Post Mon Apr 18, 2016 5:15 pm
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 39
Location: England
Gender: Male
National Flag:
Great Britain
Next question... :))

I have added to the code for fan for enclosure based on ambient temp as per

viewtopic.php?f=8&t=227

but the fan is not coming on. I have checked the wiring and it seems ok but I wanted to check something. The code has been updated quite a bit so wil this still work like it did before or do I need to make more changes?

Thanks again

Post Number:#12 Post Tue Apr 19, 2016 11:24 pm
Posts: 1578
Topics: 38
Images: 271
Solve rating: 213
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 34
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Timers set to 0000-2359 seems to have worked and they did not go off at 2359 according to the graphs


This is not a good way to check because the log is to each 2 minutes.

Next question, it seems after around 10-12hrs usually (18hrs today) I get an email saying the controller has stopped sending data. If I log on the dashboard everything works and is there, but the graphs dont show any data since the email and I dont seem to get temp alerts. Is there a way to start the controller sending data again either automatically or remotely without resetting the controller as it is happening regularily and I am not sure why.


Some controllers has this strange behaviour. Try to enable the TFT functions on code again to move the code in flash memory.

but the fan is not coming on. I have checked the wiring and it seems ok but I wanted to check something. The code has been updated quite a bit so wil this still work like it did before or do I need to make more changes?


This code should work with new version. Add the pin 7 as output os setup.

Best regards.
Please do not PM me for support unless it is absolutely necessary.

I'll not write custom function to nobody unless you can pay for my job.

Post Number:#13 Post Thu May 05, 2016 6:45 am
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 39
Location: England
Gender: Male
National Flag:
Great Britain
Hi!

Timers set to 0000-2359 seems to have worked and they did not go off at 2359 according to the graphs


This is not a good way to check because the log is to each 2 minutes.

Is this the right way to do it though?

Next question, it seems after around 10-12hrs usually (18hrs today) I get an email saying the controller has stopped sending data. If I log on the dashboard everything works and is there, but the graphs dont show any data since the email and I dont seem to get temp alerts. Is there a way to start the controller sending data again either automatically or remotely without resetting the controller as it is happening regularily and I am not sure why.


Some controllers has this strange behaviour. Try to enable the TFT functions on code again to move the code in flash memory.

I tried this but it all went bad and stopped working. Wiped eeprom, fresh install etc but its still happening after 1 day each time, around 1 day 5hrs to 1 day 20hrs. i can still access it online but it doesnt report until I manually reset it. Can it be reset online at all? or do you know what else it may be?

but the fan is not coming on. I have checked the wiring and it seems ok but I wanted to check something. The code has been updated quite a bit so wil this still work like it did before or do I need to make more changes?


This code should work with new version. Add the pin 7 as output os setup.

This worked, thank you

Best regards.

Post Number:#14 Post Sat May 07, 2016 4:09 pm
Posts: 1578
Topics: 38
Images: 271
Solve rating: 213
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 34
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Is this the right way to do it though?


Wait until 23:59 or change the clock to check.

I tried this but it all went bad and stopped working. Wiped eeprom, fresh install etc but its still happening after 1 day each time, around 1 day 5hrs to 1 day 20hrs. i can still access it online but it doesnt report until I manually reset it. Can it be reset online at all? or do you know what else it may be?


You can enable the watchdog to reset automatically after X number of attempt of upload. The upload is done to each 2 minutes.
In Ferduino tab uncomment this line:

//#define WATCHDOG


Edit this line if needed:

const byte limite_falha = 30;


Actually are 30 attempts or 60 minutes.

Best regards.
Please do not PM me for support unless it is absolutely necessary.

I'll not write custom function to nobody unless you can pay for my job.

Post Number:#15 Post Sat May 28, 2016 2:47 am
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 39
Location: England
Gender: Male
National Flag:
Great Britain
Hi!

Is this the right way to do it though?


Wait until 23:59 or change the clock to check.

I tried this and the outlets stayed on :)

I tried this but it all went bad and stopped working. Wiped eeprom, fresh install etc but its still happening after 1 day each time, around 1 day 5hrs to 1 day 20hrs. i can still access it online but it doesnt report until I manually reset it. Can it be reset online at all? or do you know what else it may be?


You can enable the watchdog to reset automatically after X number of attempt of upload. The upload is done to each 2 minutes.
In Ferduino tab uncomment this line:

//#define WATCHDOG


Edit this line if needed:

const byte limite_falha = 30;


Actually are 30 attempts or 60 minutes.

I tried this, but with watchdog enabled, it was resetting every 20 minutes or so even though it was sending data. After switching it off, I get over a day again before it stops sending, but it does stop sending which is confusing :-\

Best regards.

Post Number:#16 Post Sat May 28, 2016 2:06 pm
Posts: 1578
Topics: 38
Images: 271
Solve rating: 213
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 34
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Sorry, I don't understand what you told. :)

Best regards.
Please do not PM me for support unless it is absolutely necessary.

I'll not write custom function to nobody unless you can pay for my job.

Post Number:#17 Post Sun May 29, 2016 4:30 pm
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 39
Location: England
Gender: Male
National Flag:
Great Britain
Sorry, basically I think the outlets stay on at 23:59 with the amended code which is good, but I am still having problems with the controller stopping sending data. I applied watchdog and it was resetting every 20 or so minutes and that was while it was sending data so it didnt work properly. Turning it back off I get just over a day before it stops sending. I would like to find out why because it doesn't log dosing containers etc and I dont get warning alerts.

Post Number:#18 Post Tue May 31, 2016 11:46 am
Posts: 1578
Topics: 38
Images: 271
Solve rating: 213
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 34
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

What's the value of the variable "limite_falha" in your code?

Open the serial monitor and see how many "can't connect"you has and if you can see "Resetting" before of the reboot.

Best regards.
Please do not PM me for support unless it is absolutely necessary.

I'll not write custom function to nobody unless you can pay for my job.

Post Number:#19 Post Mon Jun 06, 2016 5:03 pm
Posts: 61
Topics: 11
Solve rating: 1
Joined: Thu Aug 28, 2014 9:27 am
Topics: 11
Age: 39
Location: England
Gender: Male
National Flag:
Great Britain
limite_falha is set to 30

I have been testing and this is what I get:

With watchdog turned off, I get between 1 and 2 days before it stops sending. When this happens, any graphs and alerts stop working. Also, dosing container doesn't log what has been dosed etc so cannot tell if its low etc.

With watchdog turned on, I get the same 1 to 2 days before it stops sending. Once it stops sending the watchdog then reboots the controller. The problem here is when it restarts the controller, it doesnt start the sending again so it keeps rebooting every 30 minutes until I manually press the reset button.

I would think it may be to do with the ethernet shield or sd card but it is always good for over a day before I get problems.

I am not sure where to go from here :-??

Post Number:#20 Post Wed Jun 08, 2016 4:06 pm
Posts: 1578
Topics: 38
Images: 271
Solve rating: 213
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 34
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Uncomment this debug message in Webserver tab:

      /*#ifdef DEBUG
            Serial.print(F("Socket:"));
            Serial.println(i);
        #endif*/


Tell me if you can see "Socket: x" (where "x" can be 1 - 4) on serial monitor.

Now do you have the TFT disabled on code?

Best regards.
Please do not PM me for support unless it is absolutely necessary.

I'll not write custom function to nobody unless you can pay for my job.

Next



  • Similar Topics
    Replies
    Views
    Last post

Return to Ferduino code





Who is online

Users viewing this topic: No registered users and 1 guest