Bug on v0.9.6

Related to the development libraries, released by Curt Binder
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bug on v0.9.6

Post by rimai »

Wow. Nice troubleshooting.
Let me look into what happens within the parabola function when you use the 1 parameter.


Sent from my SPH-D700 using Tapatalk 2
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bug on v0.9.6

Post by rimai »

I can't seem to be able to replicate the issue.
Is there any particular window frame that this happens or is it all the time?
Roberto.
00Warpig00
Posts: 289
Joined: Wed May 16, 2012 9:52 pm

Re: Bug on v0.9.6

Post by 00Warpig00 »

Here is my complete code with the problem. Maybe it matters.

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 <ReefAngel.h>

// Initialize Buzzer variables
byte buzzer=0;

////// 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 = Port3Bit | Port4Bit | Port5Bit;
    ReefAngel.FeedingModePortsE[0] = Port5Bit | Port6Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port3Bit | Port4Bit;
    ReefAngel.WaterChangePortsE[0] = 0;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    ReefAngel.LightsOnPortsE[0] = Port1Bit | Port2Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port4Bit | Port5Bit | Port6Bit;
    ReefAngel.OverheatShutoffPortsE[0] = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port7Bit | Port8Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 850 );


    // Ports that are always on
    ReefAngel.Relay.On( Port3 );

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

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

void loop()
{
    ReefAngel.StandardFan( Port1,790,820 );
    ReefAngel.StandardATO( Port2,60 );
    ReefAngel.Relay.DelayedOn( Port4,5 );
    ReefAngel.WavemakerRandom( Port5,30,100 );
    ReefAngel.StandardHeater( Port6,751,761 );
    ReefAngel.StandardLights( Box1_Port1,14,0,23,0 );
    ReefAngel.StandardLights( Box1_Port2,14,0,23,0 );
    ReefAngel.StandardHeater( Box1_Port3,751,761 );
    ReefAngel.StandardHeater( Box1_Port4,751,761 );
    ReefAngel.PWM.SetChannel( 0, PWMParabola(9,0,20,0,3,100,3) );
    ReefAngel.PWM.SetChannel( 1, PWMParabola(9,0,20,0,1,100,1) );
    ReefAngel.PWM.SetChannel( 2, PWMSlope(0,0,10,0,15,100,2,15) );

    ////// Place your custom code below here
    

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

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

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Dimming Expansion
    x = 15;
    y = 2;
    for ( int a=0;a<6;a++ )
    {
      if ( a>2 ) x = 75;
      if ( a==3 ) y = 2;
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x,y,"Ch :" );
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+12,y,a );
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+24,y,ReefAngel.PWM.GetChannelValue(a) );
      y += 10;
    }
    pingSerial();

    // I/O Expansion
    byte bkcolor;
    x = 14;
    y = 34;
    for ( int a=0;a<6;a++ )
    {
      ReefAngel.LCD.DrawCircleOutline( x+(a*20),y,4,COLOR_MEDIUMORCHID );
      if ( ReefAngel.IO.GetChannel(a) ) bkcolor=COLOR_WHITE; else bkcolor=COLOR_GRAY;
      ReefAngel.LCD.FillCircle( x+(a*20),y,2,bkcolor );
    }
    pingSerial();

    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 44, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 44, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();

    // Salinity
    ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,15,76, "SAL:" );
    ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,39,76, ReefAngel.Params.Salinity );
    pingSerial();

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

    // Relay Expansion
    TempRelay = ReefAngel.Relay.RelayDataE[0];
    TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
    TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
    ReefAngel.LCD.DrawOutletBox( 12, 104, TempRelay );
    pingSerial();

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

void DrawCustomGraph()
{
}
code generated by install wizard.

Im using 1.0.0 libs.

all the hardware I bought from you is plugged in on the bench except any probes or float switches or LED drivers. IE all modules are plugged in however no input devices are... except temp probes. They are pluged in.

I miss spoke earlier. I still seem to get the XML Parser error on My Android most of the time but at least now my android controls the relay boxes and the Portal can connect to my controller. I have made NO changes to anything except that one line of code. to get this far. right now I am using the line to match the one above it except addressing it to PWM port 1

ReefAngel.PWM.SetChannel( 1, PWMParabola(9,0,20,0,3,100,3) );

using this line I dont get the Parser error. but changing the two 3.'s on that line and experimenting with different values causes the parser error to sometimes appear. particularly if i use a line like..

ReefAngel.PWM.SetChannel( 1, PWMParabola(9,0,20,0,0,100,1) );

this gives me a parser error most all the time on my droid app but I can still control relay boxes.
and the portal can still find my controller



Nick
180G FOWLR
20GH QT#1
29G QT#2

Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bug on v0.9.6

Post by rimai »

Ok, so just to confirm that it is indeed the parabola that is causing it, can you set the channels to:

Code: Select all

ReefAngel.PWM.SetChannel( 0, 10 );
ReefAngel.PWM.SetChannel( 1, 10 );
ReefAngel.PWM.SetChannel( 2, 10 );
By doing so, do you still get xml parser errors?
Roberto.
00Warpig00
Posts: 289
Joined: Wed May 16, 2012 9:52 pm

Re: Bug on v0.9.6

Post by 00Warpig00 »

I will try your code in a minute. While I was out to dinner I played with the Android app a bit. I'm not exactly sure whats going on with the "Error 23: XML SAX Parser" issue. I have not identified a pattern yet but with the following code...

ReefAngel.PWM.SetChannel( 0, PWMParabola(9,0,20,0,3,100,3) );
ReefAngel.PWM.SetChannel( 1, PWMParabola(9,0,20,0,3,100,3) );
ReefAngel.PWM.SetChannel( 2, PWMSlope(0,0,10,0,15,100,2,15) );

The Portal seems to be fine connecting with my controller at this point.
I am still having the Parser error show up in the android app. Seems as if the android app is having trouble and cannot update UI of the app or is not reading data correctly from the controller. IE I can still turn outlets on and off but If I exit the App and go back in it may not show the correct state of the outlet. I can still flip the outlet on/off but I see the parser error every time I touch anything in the app.
It has worked a couple times without error... but it seems to be immediately after I upload to and boot the controller that it may work with no parser error.

Going to try your code now. Back in a few with results.

Nick
180G FOWLR
20GH QT#1
29G QT#2

Image
00Warpig00
Posts: 289
Joined: Wed May 16, 2012 9:52 pm

Re: Bug on v0.9.6

Post by 00Warpig00 »

rimai wrote:Ok, so just to confirm that it is indeed the parabola that is causing it, can you set the channels to:

Code: Select all

ReefAngel.PWM.SetChannel( 0, 10 );
ReefAngel.PWM.SetChannel( 1, 10 );
ReefAngel.PWM.SetChannel( 2, 10 );
By doing so, do you still get xml parser errors?

This seems to take care of the Parser issue. I touched the update button about 25 times while holding one or two termp probes and was watching the temp climb. I would hit refresh about every 5 seconds. 90% of the time no parser errors. I did see one or two out of about 25 touches but the app said connecting... for about 5 seconds before the error (seemed more like a timeout) a subsequent touch of refresh would go through and update the screen with no errors. Before I was lucky to get one without an error then all subsequent would error.

However now the Portal says my controller is unreachable again... lol

Nick
180G FOWLR
20GH QT#1
29G QT#2

Image
00Warpig00
Posts: 289
Joined: Wed May 16, 2012 9:52 pm

Re: Bug on v0.9.6

Post by 00Warpig00 »

I am SO CONFUSED at this point! The parser error has got to be related to something else... I have completely removed all the PWM lines and uploaded to the controller. was working fine with no parser errors for about 10 refreshes... then BAM! Parser error. now it wont work again and all I get is parser errors. This is crazy!

Rebooted controller and wifi mod... nothing but parser errors now.

time to dumb everything down... unplugging EVERYTHING except main relay box wifi mod and temp sensors and going back to default load...

Nick
180G FOWLR
20GH QT#1
29G QT#2

Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bug on v0.9.6

Post by rimai »

Let's try resetting the wifi attchment.
But this time, I want you to use a different route to set it up.
First, use the wifi utility to factory reset it.
Please download TeraTerm: http://www.rovingnetworks.com/resources ... 6/Teraterm
Then decompress and edit the wifi attachment.ttl file with your ssid and passphrase.
Start Tera Term and connect to your wifi attachment at 9600 baud using the correct serial com port.
Execute the macro with menu Control->Macro
Let me know if this changes anything.
Attachments
wifi attachment.zip
(711 Bytes) Downloaded 454 times
Roberto.
00Warpig00
Posts: 289
Joined: Wed May 16, 2012 9:52 pm

Re: Bug on v0.9.6

Post by 00Warpig00 »

Here is a paste of my tera term results. i have changed a few characters in my WIFI key to keep it protected for now until I change it later. but I wanted everyone with this issue to see the results as it may be helpful to others

CMD
factory RESET
Set Factory Defaults
<2.32> reboot
*Reboot*WiFly Ver 2.32, 02-13-2012 on RN-131
MAC Addr=00:06:66:30:07:6a
Auto-Assoc roving1 chan=6 mode=NONE FAILED
*READY*
CMD
set ftp address 208.109.14.133
AOK
<2.32> save
Storing in config
<2.32> set wlan ssid 2WIRE993
AOK
<2.32> set wlan pass -dx?(X-Ksc%<&jk51l>vn^Bq8D6yB%^yOTlT7P6E/MvR_,#baV.Jt7-pksCh#=z
AOK
<2.32> set option deviceid ReefAngelWifi
AOK
<2.32> set c c 0
AOK
<2.32> set c r 0
AOK
<2.32> set c o 0
AOK
<2.32> set c i 3
AOK
<2.32> set c s 2048
AOK
<2.32> set dns name www.reefangel.com
AOK
<2.32> set i h 198.171.134.6
AOK
<2.32> set i r 80
AOK
<2.32> set i f 0x6
AOK
<2.32> set s t 0x10
AOK
<2.32> set u m 2
AOK
<2.32> set i p 2
AOK
<2.32> save
Storing in config
<2.32> reboot
*Reboot*WiFly Ver 2.32, 02-13-2012 on RN-131
MAC Addr=00:06:66:30:07:6a
Auto-Assoc 2WIRE993 chan=1 mode=WPA2 SCAN OK
Joining 2WIRE993 now..
*READY*
Associated!
DHCP: Start
DHCP in 2024ms, lease=-1s
IF=UP
DHCP=ON
IP=192.168.128.200:2000
NM=255.255.255.0
GW=192.168.128.254
Listen on 2000
CMD
ftp u wifly-235.img
<2.32> FTP connecting to 208.109.14.133
FTP file=34
.........................................................
FTP OK.
UPDATE OK
ftp r wps.img
<2.32> FTP connecting to 208.109.14.133
FTP file=66
.................................
FTP OK.
set u b 57600
AOK
<2.32> set s p 0
AOK
<2.32> save
Storing in config
<2.32> save user
Storing in user
<2.32> reboot


It appears to be working as of now with the base RA load and only the temp probes and main relay box connected. i am headed to lunch now and will try remotely.

Nick
180G FOWLR
20GH QT#1
29G QT#2

Image
00Warpig00
Posts: 289
Joined: Wed May 16, 2012 9:52 pm

Re: Bug on v0.9.6

Post by 00Warpig00 »

MUST be something somewhere in the code generated by the RA Install wiz or libs. After it was working all afternoon on the base RA load I decided to plug in ONLY the expansion hub and the Expansion relay module/box.

loaded the following code as it sits here... I commented some stuff in/out (commented //wp)
to try to make at least the setup portion more like the RA base load setup to see if I could find the issue.
Uploaded the following to the RA+ and the XML Parser error instantly came back on my android app and the Portal is having intermittent issues connecting to my RA+ (earlier Tera Term Wifi config still in place).

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>
//wp #include <InternalEEPROM.h> //duplicate line - see above
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <ReefAngel.h>

// Initialize Buzzer variables
//wp byte buzzer=0;

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


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


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


    // Ports that are always on
    ReefAngel.Relay.On( Port3 );

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

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

void loop()
{
    ReefAngel.StandardFan( Port1,790,820 );
    ReefAngel.StandardATO( Port2,60 );
    ReefAngel.Relay.DelayedOn( Port4,5 );
    ReefAngel.WavemakerRandom( Port5,30,100 );
    ReefAngel.StandardHeater( Port6,751,761 );
    ReefAngel.StandardLights( Box1_Port1,14,0,23,0 );
    ReefAngel.StandardLights( Box1_Port2,14,0,23,0 );
    ReefAngel.StandardHeater( Box1_Port3,751,761 );
    ReefAngel.StandardHeater( Box1_Port4,751,761 );
//wp    ReefAngel.PWM.SetChannel( 0, PWMParabola(9,0,20,0,3,100,3) );
//wp    ReefAngel.PWM.SetChannel( 1, PWMParabola(9,0,20,0,1,100,1) );
//wp    ReefAngel.PWM.SetChannel( 2, PWMSlope(0,0,10,0,15,100,2,15) );
//wp    ReefAngel.PWM.SetChannel( 0, 10 );
//wp    ReefAngel.PWM.SetChannel( 1, 10 );
//wp    ReefAngel.PWM.SetChannel( 2, 10 );

    ////// Place your custom code below here
    

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

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

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Dimming Expansion
    x = 15;
    y = 2;
    for ( int a=0;a<6;a++ )
    {
      if ( a>2 ) x = 75;
      if ( a==3 ) y = 2;
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x,y,"Ch :" );
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+12,y,a );
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+24,y,ReefAngel.PWM.GetChannelValue(a) );
      y += 10;
    }
    pingSerial();

    // I/O Expansion
    byte bkcolor;
    x = 14;
    y = 34;
    for ( int a=0;a<6;a++ )
    {
      ReefAngel.LCD.DrawCircleOutline( x+(a*20),y,4,COLOR_MEDIUMORCHID );
      if ( ReefAngel.IO.GetChannel(a) ) bkcolor=COLOR_WHITE; else bkcolor=COLOR_GRAY;
      ReefAngel.LCD.FillCircle( x+(a*20),y,2,bkcolor );
    }
    pingSerial();

    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 44, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 44, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();

    // Salinity
    ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,15,76, "SAL:" );
    ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,39,76, ReefAngel.Params.Salinity );
    pingSerial();

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

    // Relay Expansion
    TempRelay = ReefAngel.Relay.RelayDataE[0];
    TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
    TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
    ReefAngel.LCD.DrawOutletBox( 12, 104, TempRelay );
    pingSerial();

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

void DrawCustomGraph()
{
}
I am very rusty in programming. I have a feeling that is gonna have to change. lol So I have not gone into the libraries at all at this time. Is there a way to launch the wizard that built this code for me so I can re-do it and start basic and add one piece back at a time? May help troubleshoot and I'm a bit rusty at this point to do it by hand without breaking the code.

Nick
180G FOWLR
20GH QT#1
29G QT#2

Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bug on v0.9.6

Post by rimai »

I'm going to load this code and see what I can find out.
The wizard saves the choices you made everytime you quit the application.
If you open again, it will have the same choices of your last code.
Roberto.
00Warpig00
Posts: 289
Joined: Wed May 16, 2012 9:52 pm

Re: Bug on v0.9.6

Post by 00Warpig00 »

I used the Reef Angel Wizard to do some process of elimination.

I have successfully and repeatedly been able to make the problem appear/disappear.

Using the wizard I did the following

Memory Settings = In The Code
Temperature *F (probably doesnt matter but thats what I picked 86.0* setpoint)
Expansion Modules = nothing checked
Attachments = Wifi only
Main Relay Box Ports 1-8 = all checked "Not Used" (no port mode check marks)
Daylight Dimming = None
Actinic Dimming = None
WiFi Attachment Username 00Warpig00
Generate

This will produce the following 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 <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( 860 );


    // Ports that are always on

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

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

void loop()
{
    ////// Place your custom code below here
    

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

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

This code WILL WORK FINE


Then I created another code using the wizard a second time. This time I did the following...

Memory Settings = In The Code
Temperature *F (probably doesnt matter but thats what I picked 86.0* setpoint)
Expansion Modules = Relay Only
Attachments = Wifi only
Main Relay Box Ports 1-8 = all checked "Not Used" (no port mode check marks)
Expansion Relay Box Ports 1-8 = all checked "Not Used" (no port mode check marks)
Daylight Dimming = None
Actinic Dimming = None
WiFi Attachment Username 00Warpig00
Generate

This will generate the following 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 <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;
    ReefAngel.FeedingModePortsE[0] = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = 0;
    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 = 0;
    ReefAngel.OverheatShutoffPortsE[0] = 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( 860 );


    // Ports that are always on

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

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

void loop()
{
    ////// Place your custom code below here
    

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

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

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 62, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 62, 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, 93, TempRelay );
    pingSerial();

    // Relay Expansion
    TempRelay = ReefAngel.Relay.RelayDataE[0];
    TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
    TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
    ReefAngel.LCD.DrawOutletBox( 12, 106, TempRelay );
    pingSerial();

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

void DrawCustomGraph()
{
    ReefAngel.LCD.DrawGraph( 5, 5 );
}
This code will show the XML Parser error and will cause the portal to loose connection and not be able to reconnect.

NOTE: the only difference while running the wizard between the two is the selection of the Relay box as well as the "Not Used" selections for each port on the Expansion relay box.

I had Relay Expansion plugged into the USB port on the Main Relay box (eliminating the expansion hub) for both code samples above.

Nick
180G FOWLR
20GH QT#1
29G QT#2

Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bug on v0.9.6

Post by rimai »

Try this command on the wifi attachment:

Code: Select all

set c s 1420
Let me know if it solves the problem.
Roberto.
00Warpig00
Posts: 289
Joined: Wed May 16, 2012 9:52 pm

Re: Bug on v0.9.6

Post by 00Warpig00 »

set comm size 1420

This appears to have resolved the issue at this time. I can now use both the Portal and the Android app the portal doesn't seem to have any trouble connecting so far nor do I get any parser errors in the android app at this time. Keeping an eye on it for now, but I was able to get it to fail within minutes and I have been messing around with it for the past hour with no trouble so far.

Thanks Roberto

Nick
180G FOWLR
20GH QT#1
29G QT#2

Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Bug on v0.9.6

Post by rimai »

Cool.
I'll add that to the wifi utility.
I remember that Dave added that setting to his utility in the past too.
The reason is that the default packet size is 450 bytes, so when you added the relay expansion module to the code, the size of the data stream went above 450 and the wifi attachment was splitting the payload in 2 packets.
I guess some routers don't like that and causes problems when you try to read the entire stream.
Roberto.
00Warpig00
Posts: 289
Joined: Wed May 16, 2012 9:52 pm

Re: Bug on v0.9.6

Post by 00Warpig00 »

I think the culprit may have been the wifi attachment.ttl script you sent me earlier in the thread to config the wifi.

That ttl script has sendln 'set c s 2048' in it.

BTW still working without issue. I get a url timeout once in a while from my android. but a subsequent refresh connects me and no more parser errors. The portal still is having no trouble. I have reverted to my full loaded code and it still is working fine.

Nick
180G FOWLR
20GH QT#1
29G QT#2

Image
Post Reply