Bus Lock Issues

Expansion modules and attachments
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

Something is not making sense.
If you disconnect the rf module from the hub and plug it back in, it should blink red three times and go off.
Does it eventually change colors (after a minute or so) or it stays off all the time?
Roberto.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

rimai wrote:Something is not making sense.
If you disconnect the rf module from the hub and plug it back in, it should blink red three times and go off.
Does it eventually change colors (after a minute or so) or it stays off all the time?
It blinks red 3 times, then immediately goes to the color of the mode I want to run in. It stays lit all the time.

I believe I have not gotten any locks for maybe 24 hours now. However, my Vortechs do not respond to the mode shown all of the time. They go into feeding mode no problem, and respond to changes to the internal memory, but nothing that I coded. I have them set to go to NutrientTransport mode at night. The controller says it is in NTM, however the Vortechs stay in whatever the last mode they were in. Very weird.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

Can I see your entire code?
It was not supposed to light up after the 3 blinks.
Roberto.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

Sorry for the delay in sending this to you, but here it is:

Code: Select all

#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <ReefAngel.h>

void setup()
{
  ReefAngel.Init(); // Initialize Controller
  ReefAngel.Use2014Screen();
  ReefAngel.AddStandardMenu();
  ReefAngel.AddDateTimeMenu();  
  ReefAngel.AddWaterLevelExpansion(); // Water Level Expansion Module
  ReefAngel.FeedingModePorts = Port5Bit; // Turn off Port 5 (skimmer, carbon reactor) when Feeding Mode is activated
  ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port7Bit | Port8Bit; // Turn off Ports 1 (ATO), 5 (skimmer/reactor, etc), 7 (heater) and 8 (return pump, powerhead) when Water Change Mode is activated
  ReefAngel.OverheatShutoffPorts = Port4Bit; // Turn off Ports 4 when overheat occurs
  ReefAngel.LightsOnPorts = Port3Bit | Port4Bit; // Turn on/off Ports 3 & 4 when Light On/Off menu option is selected
  ReefAngel.OverheatProbe = T2_PROBE; // Use Temperature probe 2 to check for overheat
  ReefAngel.TempProbe = T2_PROBE;
  ReefAngel.Relay.On(Port8); // Always on
  ReefAngel.Relay.On(Port6);
  ReefAngel.Relay.On(Port5);
}

void loop()
{
  ReefAngel.Portal("Marshall%20O",""); // Note I deleted my password to post this
  
  ReefAngel.WaterLevelATO(Port1,800,60,63); // On at 60% and Off at 63%, timeout 800 seconds
  
  ReefAngel.StandardLights(Port3,60); // Actinic Lights set for 60 minute offset from daylights
  ReefAngel.StandardLights(Port4); // Daylight Lights
  //ReefAngel.StandardLights(Port6,05,30,23,30); // Moon Lights on at 530A, off at 1130P
  ReefAngel.StandardHeater(Port7); // Heater
  ReefAngel.StandardFan(Port2); // Fans
  ReefAngel.Relay.DelayedOn(Port5, 60); //delay skimmer 1 hr after feed/water change
  if (ReefAngel.Params.Temp[T1_PROBE||T2_PROBE]>778) ReefAngel.Relay.Off(Port7);
  if (ReefAngel.Params.Temp[T2_PROBE]>790||ReefAngel.Params.Temp[T2_PROBE]<755) ReefAngel.PWM.SetActinic(100); else ReefAngel.PWM.SetActinic(0);
  //if (!ReefAngel.HighATO.IsActive()) ReefAngel.PWM.SetDaylight(100); else ReefAngel.PWM.SetDaylight(0);
  if (!ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Port1); 
  if (ReefAngel.LowATO.IsActive() || !ReefAngel.HighATO.IsActive()) ReefAngel.PWM.SetActinic(100); else ReefAngel.PWM.SetActinic(0);
    
  if (ReefAngel.DisplayedMenu!=FEEDING_MODE || ReefAngel.DisplayedMenu!=WATERCHANGE_MODE)
  {
    if (hour()>=22 && hour()<=23)
    {
      ReefAngel.RF.UseMemory=false;
      ReefAngel.RF.SetMode(NutrientTransport,100,10);
    }
     else if (hour()>=0 && hour()<2)
    {
      ReefAngel.RF.UseMemory=false;
      ReefAngel.RF.SetMode(NutrientTransport,100,10);
    }
    else if (hour()>=2 && hour()<7)
    {
      ReefAngel.RF.UseMemory=false;
      ReefAngel.RF.SetMode(TidalSwell,50,0);
    }
    else
    {
      ReefAngel.RF.UseMemory=true;
     }
  }

  
  ReefAngel.ShowInterface(); // Display everything on the LCD screen
}
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

Ok, I was able to figure out why your LED was lighting up.
There was a bug in the libraries.
Please open the RF.cpp again.
Remove the comment you added to the line the previous time.
Then you need to update the line right below it.
Both lines should look like this:

Code: Select all

			if (millis()%60000<200) lastcrc=-1;
			if ( (lastcrc!=(byte)(mode+speed+duration)) || millis()<5000 )
Save and upload the code to your RA again.
Let me know how it goes.
Roberto.
Lionfan
Posts: 166
Joined: Wed Nov 26, 2014 8:53 am

Re: Bus Lock Issues

Post by Lionfan »

Is any of this common with my problems, Roberto?
Image
weaverwf
Posts: 2
Joined: Wed Dec 10, 2014 8:45 am

Re: Bus Lock Issues

Post by weaverwf »

Roberto, it looks like the second close paren after "duration" prematurely closes off the if clause.
weaverwf
Posts: 2
Joined: Wed Dec 10, 2014 8:45 am

Re: Bus Lock Issues

Post by weaverwf »

Never mind delete previous
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bus Lock Issues

Post by rimai »

Lionfan wrote:Is any of this common with my problems, Roberto?
No. this is for a bus lock issue he's been having.
Roberto.
Marshall O
Posts: 24
Joined: Sat Apr 26, 2014 11:19 am

Re: Bus Lock Issues

Post by Marshall O »

rimai wrote:Ok, I was able to figure out why your LED was lighting up.
There was a bug in the libraries.
Please open the RF.cpp again.
Remove the comment you added to the line the previous time.
Then you need to update the line right below it.
Both lines should look like this:

Code: Select all

			if (millis()%60000<200) lastcrc=-1;
			if ( (lastcrc!=(byte)(mode+speed+duration)) || millis()<5000 )
Save and upload the code to your RA again.
Let me know how it goes.
Thanks Roberto! I will do this tonight and then update you.
Post Reply