wifi attachment causing problems

Expansion modules and attachments
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

wifi attachment causing problems

Post by bencollinz »

This has been working fine for the past, at least 3 months. Now whenever I attach the wifi to the head unit the following happens....
[youtube]http://www.youtube.com/watch?v=nJ71dvUF-Zs[/youtube]

The cable is inserted correctly at both ends. If I leave it unplugged the head unit is fine forever.

Are there any troubleshooting steps I can take? Before the head unit goes into that infinite loop the wifi attachment does light up green and works via the portal/android phone, very briefly. Then the wifi flashes an orange LED and goes into the loop in the video.

my current code

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 <Salinity.h>
        #include <RF.h>
        #include <IO.h>
        #include <ORP.h>
        #include <AI.h>
        #include <PH.h>
        #include <WaterLevel.h>
        #include <ReefAngel.h>
        /*
        #define Heater      1
        #define Return      2
        #define Skimmer     3
        #define Vortech1    5
        #define Vortech2    6
        #define ATO         7
        */
        ////// Place global variable code below here
    byte vtechmode;
        ////// Place global variable code above here


        void setup()
        {
            // This must be the first line
            ReefAngel.Init();  //Initialize controller
            // Ports toggled in Feeding Mode
            ReefAngel.FeedingModePorts = Port2Bit;
            // Ports toggled in Water Change Mode
            ReefAngel.WaterChangePorts = Port7Bit | Port4Bit | Port5Bit | Port6Bit;
            // Ports toggled when Lights On / Off menu entry selected
            ReefAngel.LightsOnPorts = 0;
            // Ports turned off when Overheat temperature exceeded
            ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port7Bit | Port4Bit | Port5Bit | Port6Bit;
            // Use T1 probe as temperature and overheat functions
            ReefAngel.TempProbe = T1_PROBE;
            ReefAngel.OverheatProbe = T1_PROBE;


            // Ports that are always on
            ReefAngel.Relay.On( Port2 );
            ReefAngel.Relay.On( Port5 );
            ReefAngel.Relay.On( Port6 );
           

            ////// Place additional initialization code below here
           
      // Hardcode calibrations
      ReefAngel.PHMin=576; // PH7.0
      ReefAngel.PHMax=842; // PH10.0
            ReefAngel.SalMax=3000; // 35ppt
            ////// Place additional initialization code above here
        }

        void loop()
        {
            ReefAngel.StandardHeater( Port1,796,802 );
            StandardHeater2( Port3,760,770 );
            ReefAngel.WaterLevelATO( Port7,120,50,52 );   // If water level less than 52, turn on auto top off relay; else, keep it off
            ReefAngel.PWM.SetChannel( 0,PWMSlope(21,30,8,0,15,31,10,15) );
            ReefAngel.PWM.Channel1PWMSlope();
            ReefAngel.PWM.Channel2PWMSlope();
            ReefAngel.PWM.Channel3PWMSlope();
            ReefAngel.PWM.Channel4PWMSlope();
            // ReefAngel.SingleATOLow(Port2);
            if ( ReefAngel.HighATO.IsActive())
            {
              ReefAngel.Relay.On(Port2);
            }
            else
            {
              ReefAngel.Relay.Off(Port2);
            }
           
      if (hour() >=8 && hour() < 21)
      {
        if (ReefAngel.RF.Mode==Night) ReefAngel.RF.SetMode(Feeding_Stop,0,0);
        ReefAngel.RF.UseMemory=true;
        ReefAngel.Relay.Off(Port8);
      }
      else
      {
        ReefAngel.RF.UseMemory=false;
        ReefAngel.RF.SetMode(Night,15,0);
        ReefAngel.Relay.On(Port8);
      }


            // This should always be the last line
            ReefAngel.Portal( "bencollinz" );
            ReefAngel.ShowInterface();
        }
       
        void DrawCustomMain()
        {
          char text[7];
            // Date and Time
            ReefAngel.LCD.DrawDate( 6, 2 );
            ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
            pingSerial();

      ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 6, 90, "--------------------");
      ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 6, 126, "--------------------");
      for (byte Left=93; Left < 133; Left+=10)
      {
        ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, Left, "|");
        ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, Left, "|");
      }
    ReefAngel.LCD.DrawText(0,255,18,12,"EcoSmart Vortech");
      ReefAngel.LCD.Clear(255, 1, 19, 128, 29);
      if (vtechmode == 0) ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,35,21,"Constant");
      else if(vtechmode == 1) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,42,21,"Lagoon");
      else if (vtechmode == 2) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,25,21,"Reef Crest");
      else if (vtechmode == 3) ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,22,21,"Short Pulse");
      else if (vtechmode == 4) ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,25,21,"Long Pulse");
      else if (vtechmode == 5) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,8,21,"Nutrient Trnsp.");
      else if (vtechmode == 6) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,23,21,"Tidal Swell");
      else if (vtechmode == 9) ReefAngel.LCD.DrawLargeText(COLOR_WHITE,0,45,21,"Night");
     
      ReefAngel.LCD.DrawText(0,255,10,30,"Temp");
      ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10);
      ReefAngel.LCD.DrawLargeText(COLOR_INDIANRED, 255, 10, 40, text, Num8x8);
      pingSerial();

      ReefAngel.LCD.DrawText(0,255,50,30,"Temp2");
      ConvertNumToString(text, ReefAngel.Params.Temp[T2_PROBE], 10);
      ReefAngel.LCD.DrawLargeText(COLOR_INDIANRED, 255, 50, 40, text, Num8x8);
      pingSerial();

      ReefAngel.LCD.DrawText(0,255,100,30,"pH");
      ConvertNumToString(text, ReefAngel.Params.PH, 100);
      ReefAngel.LCD.DrawLargeText(COLOR_PLUM, 255, 85, 40, text, Num8x8);
      pingSerial();

      ReefAngel.LCD.DrawText(0,255,43,48,"Salinity");
      ConvertNumToString(text, ReefAngel.Params.Salinity, 10);
      ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN, 255, 49, 58, text, Num8x8);
      pingSerial();

              // Main Relay Box
            byte TempRelay = ReefAngel.Relay.RelayData;
            TempRelay &= ReefAngel.Relay.RelayMaskOff;
            TempRelay |= ReefAngel.Relay.RelayMaskOn;
            ReefAngel.LCD.DrawOutletBox( 12, 77, TempRelay );
            pingSerial();
    // water level
        ReefAngel.LCD.DrawText(0,255,8,68,"WL:");
        ReefAngel.LCD.DrawText( COLOR_CORNFLOWERBLUE,255, 40, 68, ReefAngel.WaterLevel.GetLevel() );
        pingSerial();


        }

        void DrawCustomGraph()
        {
        }
        void StandardHeater2(byte HeaterRelay, int LowTemp, int HighTemp)
        {
        if (ReefAngel.Params.Temp[T2_PROBE] == 0) return; // Don't turn the heater on if the temp is reading 0
        if (ReefAngel.Params.Temp[T2_PROBE] <= LowTemp && ReefAngel.Params.Temp[T2_PROBE] > 0) ReefAngel.Relay.On(HeaterRelay); // If sensor 2 temperature <= LowTemp - turn on heater
        if (ReefAngel.Params.Temp[T2_PROBE] >= HighTemp) ReefAngel.Relay.Off(HeaterRelay); // If sensor 2 temperature >= HighTemp - turn off heater
        }
thank you in advance

Also, I did have a power outage that ended up frying 3 of my other expansions which have since been replaced. I'm really hoping this isn't the same case.
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: wifi attachment causing problems

Post by rimai »

Can you communicate with the wifi module using putty?
Roberto.
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

rimai wrote:Can you communicate with the wifi module using putty?
tera term.jpg
tera term.jpg (50.33 KiB) Viewed 8722 times
putty.jpg
putty.jpg (38.01 KiB) Viewed 8722 times
tera term just repeats that over and over

putty you can see for yourself

what would you like me to try next?
Image
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

and twice now it's gone into 'feeding mode' without any input from me. I'm really lost here. I've replaced EVERYTHING besides the relay box.
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: wifi attachment causing problems

Post by rimai »

Those GET stuff is coming from your client software, I think.
Do you have the client running somewhere?
I don't see why it would cause that to the controller though.
But I can see you can connect with the wifi using putty just fine.
You have a relay expansion, right?
Can you try swapping those relay boxes?
Roberto.
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

rimai wrote:Those GET stuff is coming from your client software, I think.
Do you have the client running somewhere?
I don't see why it would cause that to the controller though.
But I can see you can connect with the wifi using putty just fine.
You have a relay expansion, right?
Can you try swapping those relay boxes?
the "get w" is from me just to see if it would respond.
I do not have the client running anywhere.

Yes, I have expansion. I will swap.
Did you want me to try anything else with the wifi module?
Image
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

I swapped the relay box and no more wifi module issues. strange.
I haven't re-attached the box in question; however.
As soon as my son wakes up from his nap I will open up the relax box in question to see if I can see anything odd.
Image
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

I opened the relay box in question and don't see anything odd...
CAM00302[1].jpg
CAM00302[1].jpg (988.21 KiB) Viewed 8705 times
CAM00301[1].jpg
CAM00301[1].jpg (962.49 KiB) Viewed 8705 times
any suggestions?
Image
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

nevermind, just as I typed the last post it started doing that loop in the original video again.
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: wifi attachment causing problems

Post by rimai »

What happens if you disable the client or gadget from polling data from the wifi??
Roberto.
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

rimai wrote:What happens if you disable the client or gadget from polling data from the wifi??
I'm not really sure what this means. The only thing that I use the wifi with is the portal or my phone(android) but nothing that runs separate on a PC. Sorry.
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: wifi attachment causing problems

Post by rimai »

Well, the screen shot above tells me that there is something trying to connect to your RA repeatedly.
Do you know what it is?
Roberto.
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

rimai wrote:Well, the screen shot above tells me that there is something trying to connect to your RA repeatedly.
Do you know what it is?
ok, you were correct. even though I didn't have the reef angel client open the listener process was still running. I ended that and no longer get anything in the tera term window unless I input a command.

where now?

in addition, with the wifi module plugged into the PC with the usbttl the green light is flashing steadily. I don't know if that means anything.
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: wifi attachment causing problems

Post by rimai »

Do you still get the reboots on RA with the client shut down?
Roberto.
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

rimai wrote:Do you still get the reboots on RA with the client shut down?
yes, almost immediately.
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: wifi attachment causing problems

Post by rimai »

Humm...
Maybe you need to send that wifi attachment back to be checked out.
PM me for details.
Roberto.
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

rimai wrote:Humm...
Maybe you need to send that wifi attachment back to be checked out.
PM me for details.
Hey, I got your PM but before I send the wifi to you please take a look at the following video...
I noticed that if I plug in the wifi cable without the attachment it does this. Maybe that's supposed to be normal behavior? I wasn't sure.
I plug in the TTLUSB and it doesn't do this. You'll see in the video that I also plug in the cable WITH the wifi attached to it and it doesn't reboot immediately but inevitably it does (not shown in this video).
[youtube]http://www.youtube.com/watch?v=evdPKbO_y0o[/youtube]

So I got my old board out, which I 'thought was bad', and it does the same thing.

Is all of this just because of a bad cable?
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: wifi attachment causing problems

Post by rimai »

No, by plugging just the cable, without the wifi attachment on the other end, will cause that behavior in the video.
The wifi must be connected on the other end or the cable must be disconnected.
Roberto.
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

rimai wrote:No, by plugging just the cable, without the wifi attachment on the other end, will cause that behavior in the video.
The wifi must be connected on the other end or the cable must be disconnected.
Ok, sending the wifi module to you right now! Thank you so much for your help. I know, I'm probably such a pain.
Image
td7971
Posts: 2
Joined: Fri Feb 15, 2013 8:49 pm

Re: wifi attachment causing problems

Post by td7971 »

I am late to this party. I have been fighting this same issue for the past two weeks. My unit was working great for the past four months. I installed a new salinity expansion. When I did this, I updated to the latest libraries. I noticed that the wizard put the following line in twice:

#include <InternalEEPROM.h>

I see this in your sketch also. When I removed the second line, the rebooting was not as frequent. It still happens several times per day. Mine is very frustrating, I have my tank in my bedroom. When it reboots, the PWM takes the tank lights to 100% and then fades off. I don't like waking up to that every couple of hours.

I am leaning to a problem in the new libraries.
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

td7971 wrote:I am late to this party. I have been fighting this same issue for the past two weeks. My unit was working great for the past four months. I installed a new salinity expansion. When I did this, I updated to the latest libraries. I noticed that the wizard put the following line in twice:

#include <InternalEEPROM.h>

I see this in your sketch also. When I removed the second line, the rebooting was not as frequent. It still happens several times per day. Mine is very frustrating, I have my tank in my bedroom. When it reboots, the PWM takes the tank lights to 100% and then fades off. I don't like waking up to that every couple of hours.

I am leaning to a problem in the new libraries.
you are correct. I never noticed that before. however, I can't confirm that that would matter or not and I don't have my wifi module to test it.
Image
td7971
Posts: 2
Joined: Fri Feb 15, 2013 8:49 pm

Re: wifi attachment causing problems

Post by td7971 »

I have tested running without the wifi unit. I have also tried rolling back to an older library (1.07). Nothing seems to work. It is a real pain when I was doing a water change, and everything kept coming back on. I am at a dead end as to what is causing this. I am going to unplug the PWM expansion and if that is not it, I will unplug the salinity expansion.
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

td7971 wrote:I have tested running without the wifi unit. I have also tried rolling back to an older library (1.07). Nothing seems to work. It is a real pain when I was doing a water change, and everything kept coming back on. I am at a dead end as to what is causing this. I am going to unplug the PWM expansion and if that is not it, I will unplug the salinity expansion.
I unplugged everything at one point including ph and temp except the wifi and it still did it.
Roberto has had my wifi for a week testing it and he found nothing wrong with it. so I'm lost as well.
Image
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

got my wifi back today, plugged it in and now this...
[youtube]http://www.youtube.com/watch?v=21QnDxmbj3s[/youtube]

it locks up everything to the point it won't run/turn on/off things that should be.
it keeps whatever was happening at that moment running until I press the joystick or reboot.


PLEASE HELP!

current code

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 <RA_Colors.h>
    #include <RA_CustomColors.h>
    #include <Salinity.h>
    #include <RF.h>
    #include <IO.h>
    #include <ORP.h>
    #include <AI.h>
    #include <PH.h>
    #include <WaterLevel.h>
    #include <ReefAngel.h>
    /* 
    #define HeaterTk2   1
    #define Return      2
    #define Heater      3
    #define Skimmer     4
    #define Vortech1    5
    #define Vortech2    6
    #define ATO         7 
    #define Sump Light  8
    */
    ////// Place global variable code below here
byte vtechmode;
    ////// Place global variable code above here


    void setup()
    {
        // This must be the first line
        ReefAngel.Init();  //Initialize controller
        // Ports toggled in Feeding Mode
        ReefAngel.FeedingModePorts = Port2Bit;
        ReefAngel.FeedingModePortsE[0] = 0;
        // Ports toggled in Water Change Mode
        ReefAngel.WaterChangePorts = Port7Bit | Port4Bit | Port5Bit | Port6Bit;
        ReefAngel.WaterChangePortsE[0] = 0;
        // Ports toggled when Lights On / Off menu entry selected
        ReefAngel.LightsOnPorts = 0;
        ReefAngel.LightsOnPortsE[0] = 0;
        // Ports turned off when Overheat temperature exceeded
        ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port7Bit | Port4Bit | Port5Bit | Port6Bit;
        ReefAngel.OverheatShutoffPortsE[0] = 0;
        // Use T2 probe as temperature and overheat functions
        ReefAngel.TempProbe = T2_PROBE;
        ReefAngel.OverheatProbe = T2_PROBE;


        // Ports that are always on
        ReefAngel.Relay.On( Port2 );
        ReefAngel.Relay.On( Port4 );
        ReefAngel.Relay.On( Port5 );
        ReefAngel.Relay.On( Port6 );
        ReefAngel.Relay.On( Box1_Port1 );
        ReefAngel.Relay.On( Box1_Port2 );
        ReefAngel.Relay.On( Box1_Port3 );
        ReefAngel.Relay.On( Box1_Port4 );
        ReefAngel.Relay.On( Box1_Port5 );
        ReefAngel.Relay.On( Box1_Port6 );
        ReefAngel.Relay.On( Box1_Port7 );
        ReefAngel.Relay.On( Box1_Port8 );
       

        ////// Place additional initialization code below here
       
        // Hardcode calibrations
        ReefAngel.PHMin=576; // PH7.0
        ReefAngel.PHMax=842; // PH10.0
        ReefAngel.SalMax=3000; // 35ppt
        ////// Place additional initialization code above here
    }

    void loop()
    {
    vtechmode=InternalMemory.RFMode_read();
    static unsigned long feeding;
        StandardHeater1( Port3,760,770 );
        StandardHeater2( Port1,796,802 );
        ReefAngel.WaterLevelATO( Port7,120,72,74 );
        ReefAngel.PWM.SetChannel( 0,PWMSlope(21,30,4,0,15,31,10,0) );
        ReefAngel.PWM.SetChannel( 1,PWMSlope(8,30,21,30,15,50,10,0) );
        ReefAngel.PWM.SetChannel( 2,PWMSlope(8,30,21,30,15,90,10,0) );
        ReefAngel.PWM.SetChannel( 3,PWMSlope(8,30,21,30,15,50,10,0) );
        ReefAngel.PWM.SetChannel( 4,PWMSlope(8,30,21,30,15,50,10,0) );
        if ( ReefAngel.HighATO.IsActive())
        {
          ReefAngel.Relay.On(Port2);
        }
        else
        {
          ReefAngel.Relay.Off(Port2);
        }
        
 if (hour() >=8 && hour() < 22)
      {
        if (ReefAngel.RF.Mode==Night) ReefAngel.RF.SetMode(Feeding_Stop,0,0);
        ReefAngel.RF.UseMemory=true;
            if (ReefAngel.DisplayedMenu==FEEDING_MODE)
            {
             feeding=now();
             }
            if (now()-feeding > 1 && now()-feeding < 3600) { // 1 second after feeding mode until 60 minutes after feeding mode.
  ReefAngel.RF.UseMemory=false;
    ReefAngel.RF.SetMode(Smart_NTM,65,5);
    }
        ReefAngel.Relay.Off(Port8);
      }
      else
      {
        ReefAngel.RF.UseMemory=false;
        ReefAngel.RF.SetMode(Night,15,0);
        ReefAngel.Relay.On(Port8);
      }


        // This should always be the last line
        ReefAngel.Portal( "bencollinz" );
        ReefAngel.ShowInterface();
    }
   
    void DrawCustomMain()
    {
      char text[7];
        // Date and Time
        ReefAngel.LCD.DrawDate( 6, 2 );
        ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
        pingSerial();

    ReefAngel.LCD.DrawText(0,255,18,12,"EcoSmart Vortech");
  ReefAngel.LCD.Clear(255, 1, 19, 128, 29);
  if (vtechmode == 0) ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,35,21,"Constant");
  else if(vtechmode == 1) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,42,21,"Lagoon");
  else if (vtechmode == 2) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,25,21,"Reef Crest");
  else if (vtechmode == 3) ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,22,21,"Short Pulse");
  else if (vtechmode == 4) ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,25,21,"Long Pulse");
  else if (vtechmode == 5) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,8,21,"Nutrient Trnsp.");
  else if (vtechmode == 6) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,23,21,"Tidal Swell");
  else if (vtechmode == 9) ReefAngel.LCD.DrawLargeText(COLOR_WHITE,0,45,21,"Night");
  
  ReefAngel.LCD.DrawText(0,255,10,30,"Temp");
  ConvertNumToString(text, ReefAngel.Params.Temp[T2_PROBE], 10);
  ReefAngel.LCD.DrawLargeText(COLOR_INDIANRED, 255, 10, 40, text, Num8x8);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,50,30,"Temp2");
  ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10);
  ReefAngel.LCD.DrawLargeText(COLOR_INDIANRED, 255, 50, 40, text, Num8x8);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,100,30,"pH");
  ConvertNumToString(text, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_PLUM, 255, 85, 40, text, Num8x8);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,43,48,"Salinity");
  ConvertNumToString(text, ReefAngel.Params.Salinity, 10);
  ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN, 255, 49, 58, text, Num8x8);
  pingSerial();

       // Main Relay Box
        byte TempRelay = ReefAngel.Relay.RelayData;
        TempRelay &= ReefAngel.Relay.RelayMaskOff;
        TempRelay |= ReefAngel.Relay.RelayMaskOn;
        ReefAngel.LCD.DrawOutletBox( 12, 77, TempRelay );
        pingSerial();
      // Relay Expansion
        TempRelay = ReefAngel.Relay.RelayDataE[0];
        TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
       TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
       ReefAngel.LCD.DrawOutletBox( 12, 90, TempRelay );
        pingSerial();
// water level
    ReefAngel.LCD.DrawText(0,255,8,68,"WL:");
    ReefAngel.LCD.DrawText( COLOR_CORNFLOWERBLUE,255, 40, 68, ReefAngel.WaterLevel.GetLevel() );
    pingSerial();


    }

    void DrawCustomGraph()
    {
    }
    void StandardHeater2(byte HeaterRelay, int LowTemp, int HighTemp)
    {
    if (ReefAngel.Params.Temp[T2_PROBE] == 0) return; // Don't turn the heater on if the temp is reading 0
    if (ReefAngel.Params.Temp[T2_PROBE] <= LowTemp && ReefAngel.Params.Temp[T2_PROBE] > 0) ReefAngel.Relay.On(HeaterRelay); // If sensor 2 temperature <= LowTemp - turn on heater
    if (ReefAngel.Params.Temp[T2_PROBE] >= HighTemp) ReefAngel.Relay.Off(HeaterRelay); // If sensor 2 temperature >= HighTemp - turn off heater
    }
    void StandardHeater1(byte HeaterRelay, int LowTemp, int HighTemp)
    {
    if (ReefAngel.Params.Temp[T1_PROBE] == 0) return; // Don't turn the heater on if the temp is reading 0
    if (ReefAngel.Params.Temp[T1_PROBE] <= LowTemp && ReefAngel.Params.Temp[T1_PROBE] > 0) ReefAngel.Relay.On(HeaterRelay); // If sensor 2 temperature <= LowTemp - turn on heater
    if (ReefAngel.Params.Temp[T1_PROBE] >= HighTemp) ReefAngel.Relay.Off(HeaterRelay); // If sensor 2 temperature >= HighTemp - turn off heater
    }
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: wifi attachment causing problems

Post by rimai »

I tested that module for 3 uninterrupted days without a problem.
So, I'm confident the problem is not the wifi module.
It can only be something that is happening in your setup.
I would suggest you disconnect everything and go plain vanilla with just the controller.
Then add just the wifi.
And then go plugging one thing at a time.
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: wifi attachment causing problems

Post by rossbryant1956 »

I experienced this same thing two nights ago. See my other posts re: berserk pH ports. I am now in the process of disassembling and reassembling everything. Strange that it is effecting some many of us at the same time...hard to blame everyone's hardware. Thx to all.
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

I changed my code to this. unplugged everything except dimming and wifi.

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 <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <DCPump.h>
#include <ReefAngel.h>

////// Place global variable code below here


////// Place global variable code above here


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = 0;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = 0;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 869 );


    // Ports that are always on
    ReefAngel.Relay.On( Port2 );
    ReefAngel.Relay.On( Port3 );
    ReefAngel.Relay.On( Port4 );
    ReefAngel.Relay.On( Port5 );
    ReefAngel.Relay.On( Port6 );

    ////// Place additional initialization code below here
    

    ////// Place additional initialization code above here
}

void loop()
{
    ReefAngel.StandardLights( Port8,22,0,6,0 );
    ReefAngel.StandardHeater( Port1,796,802 );
    ReefAngel.PWM.SetChannel( 0,PWMSlope(21,30,4,0,15,31,10,0) );
        ReefAngel.PWM.SetChannel( 1,PWMSlope(8,30,21,30,15,50,10,0) );
        ReefAngel.PWM.SetChannel( 2,PWMSlope(8,30,21,30,15,90,10,0) );
        ReefAngel.PWM.SetChannel( 3,PWMSlope(8,30,21,30,15,50,10,0) );
        ReefAngel.PWM.SetChannel( 4,PWMSlope(8,30,21,30,15,50,10,0) );
    ////// Place your custom code below here
    

    ////// Place your custom code above here

    // This should always be the last line
    ReefAngel.Portal( "bencollinz" );
    ReefAngel.ShowInterface();
}

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 15, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 15, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();

    // Main Relay Box
    byte TempRelay = ReefAngel.Relay.RelayData;
    TempRelay &= ReefAngel.Relay.RelayMaskOff;
    TempRelay |= ReefAngel.Relay.RelayMaskOn;
    ReefAngel.LCD.DrawOutletBox( 12, 56, TempRelay );
    pingSerial();

    // Date and Time
    ReefAngel.LCD.DrawDate( 6, 122 );
    pingSerial();
}

void DrawCustomGraph()
{
}
Image
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

so far no reboots or red LED, that I've noticed.
Image
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

trying this now

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 <Salinity.h>
    #include <RF.h>
    #include <IO.h>
    #include <ORP.h>
    #include <AI.h>
    #include <PH.h>
    #include <WaterLevel.h>
    #include <Humidity.h>
    #include <DCPump.h>
    #include <ReefAngel.h>

    ////// Place global variable code below here


    ////// Place global variable code above here


    void setup()
    {
        // This must be the first line
        ReefAngel.Init();  //Initialize controller
        // Ports toggled in Feeding Mode
        ReefAngel.FeedingModePorts = 0;
        // Ports toggled in Water Change Mode
        ReefAngel.WaterChangePorts = 0;
        // Ports toggled when Lights On / Off menu entry selected
        ReefAngel.LightsOnPorts = 0;
        // Ports turned off when Overheat temperature exceeded
        ReefAngel.OverheatShutoffPorts = 0;
        // Use T1 probe as temperature and overheat functions
        ReefAngel.TempProbe = T2_PROBE;
        ReefAngel.OverheatProbe = T2_PROBE;
        // Set the Overheat temperature setting
        InternalMemory.OverheatTemp_write( 829 );


        // Ports that are always on
        ReefAngel.Relay.On( Port2 );
        ReefAngel.Relay.On( Port4 );
        ReefAngel.Relay.On( Port5 );
        ReefAngel.Relay.On( Port6 );

        ////// Place additional initialization code below here
       

        ////// Place additional initialization code above here
    }

    void loop()
    {
        ReefAngel.StandardLights( Port8,22,0,6,0 );
        StandardHeater1( Port3,760,770 );
        StandardHeater2( Port1,796,802 );
        ReefAngel.PWM.SetChannel( 0,PWMSlope(21,30,4,0,15,31,10,0) );
            ReefAngel.PWM.SetChannel( 1,PWMSlope(8,30,21,30,15,50,10,0) );
            ReefAngel.PWM.SetChannel( 2,PWMSlope(8,30,21,30,15,90,10,0) );
            ReefAngel.PWM.SetChannel( 3,PWMSlope(8,30,21,30,15,50,10,0) );
            ReefAngel.PWM.SetChannel( 4,PWMSlope(8,30,21,30,15,50,10,0) );
        ////// Place your custom code below here
       

        ////// Place your custom code above here

        // This should always be the last line
        ReefAngel.Portal( "bencollinz" );
        ReefAngel.ShowInterface();
    }

    void DrawCustomMain()
    {
        int x,y;
        char text[10];
        // Parameters
    #if defined DisplayLEDPWM && ! defined RemoveAllLights
        ReefAngel.LCD.DrawMonitor( 15, 15, ReefAngel.Params,
        ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
    #else // defined DisplayLEDPWM && ! defined RemoveAllLights
        ReefAngel.LCD.DrawMonitor( 15, 15, ReefAngel.Params );
    #endif // defined DisplayLEDPWM && ! defined RemoveAllLights
        pingSerial();

        // Main Relay Box
        byte TempRelay = ReefAngel.Relay.RelayData;
        TempRelay &= ReefAngel.Relay.RelayMaskOff;
        TempRelay |= ReefAngel.Relay.RelayMaskOn;
        ReefAngel.LCD.DrawOutletBox( 12, 56, TempRelay );
        pingSerial();

        // Date and Time
        ReefAngel.LCD.DrawDate( 6, 122 );
        pingSerial();
    }

    void DrawCustomGraph()
    {
    }
    void StandardHeater2(byte HeaterRelay, int LowTemp, int HighTemp)
    {
    if (ReefAngel.Params.Temp[T2_PROBE] == 0) return; // Don't turn the heater on if the temp is reading 0
    if (ReefAngel.Params.Temp[T2_PROBE] <= LowTemp && ReefAngel.Params.Temp[T2_PROBE] > 0) ReefAngel.Relay.On(HeaterRelay); // If sensor 2 temperature <= LowTemp - turn on heater
    if (ReefAngel.Params.Temp[T2_PROBE] >= HighTemp) ReefAngel.Relay.Off(HeaterRelay); // If sensor 2 temperature >= HighTemp - turn off heater
    }
    void StandardHeater1(byte HeaterRelay, int LowTemp, int HighTemp)
    {
    if (ReefAngel.Params.Temp[T1_PROBE] == 0) return; // Don't turn the heater on if the temp is reading 0
    if (ReefAngel.Params.Temp[T1_PROBE] <= LowTemp && ReefAngel.Params.Temp[T1_PROBE] > 0) ReefAngel.Relay.On(HeaterRelay); // If sensor 2 temperature <= LowTemp - turn on heater
    if (ReefAngel.Params.Temp[T1_PROBE] >= HighTemp) ReefAngel.Relay.Off(HeaterRelay); // If sensor 2 temperature >= HighTemp - turn off heater
    }
added 2nd tank heater control back. as well as plugging 2nd temp probe back in.
Image
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: wifi attachment causing problems

Post by bencollinz »

I believe I have figured this out...everything has been running fine on the plain code above and when I got home from work I reconnected the expansion hub and only the dimming to the expansion.

after at most, 5 minutes I got the blinking red LED and the RA froze. so while I was moving wires around I noticed something.

[youtube]http://www.youtube.com/watch?v=--VFu3xCU_c[/youtube]

I tried a different usb cable and it does the same thing. It appears the micro port on the expansion hub is bad.

any thoughts?
Image
Post Reply