Code loads per Webwizard but doesn't appear to really load

Basic / Standard Reef Angel hardware

Posts: 66
Joined: Fri May 05, 2017 11:27 am
PostPosted: Thu May 18, 2017 8:55 pm
I decided to move this to its own thread. I've run some code via the Webwizard, saving to internal memory. When I upload, the program compiles and tells me that it loaded. I'm using the USB-TTL cable, plugged into the first 6 pins, (starting from the right), with the black wire plugged into the first pin (on the right). The red Status light on the controller shimmers while loading and then the small screen on the controller goes back to the initial screen with T1, T2, T3, pH, etc. once completed. However, my temperature parameters, lights on/off times, etc. don't match the parameters from the code I've loaded. It also doesn't recognize that I have multiple lights and multiple heaters. When I go to the Uapp and Portal, I get the same things that are showing on the controller's screen (again, not what I loaded). If I click a relay on the Portal, I get the message, Only available with valid wifi address. Please make sure your controller is sending data to the Portal web server. If I click on a relay in the Uapp, it times out.

This is what the Portal shows regarding my connection:

Reef Angel wifi address: 75.66.121.57:2000
My reefangelid: jcjrogers
Connection Status: Unreachable Address

Last Update: 5/18/2017, 10:41:38 PM
Displaying data from: Webbanner database


I really am connected because the temperature and pH readings are following what the controller's screen shows, though the pH is bogus because there is no probe plugged-in.

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu May 18, 2017 9:16 pm
The web wizard unfortunately will not create a internal memory file to load into your controller.
If you use the wizard on the Arduino IDE, you will get that file.
It basically updates the memory settings and does nothing else.
Then you will need to upload your code. It's a 2 upload process.
So, if you are exclusively using the web wizard, you will need to manually upload this code or simply go to uapp and change the settings.
The portal is not capable of using the cloud server. It needs port forwarding setup on your router to allow access to your controller.
The web based uapp on the other hand, allows you to do that.
uapp/
The uapp for iOS needs an update to connect to the cloud server. It was released before we put the server online.
I'm waiting for more feedback to make sure everything is working before I push the update to the apple store.
So, if you don't want to setup port forwarding, just use the web based one linked above.
Roberto.

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu May 18, 2017 9:18 pm
Oh, i forgot to mentioned where the internal memory code is.
If you open Arduino, it will be on the example folder.
If you didn't install it, 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 <AI.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <Salinity.h>
#include <PH.h>
#include <WaterLevel.h>
#include <ReefAngel.h>

void setup()
{
    InternalMemory.MHOnHour_write(15);
    InternalMemory.MHOnMinute_write(30);
    InternalMemory.MHOffHour_write(21);
    InternalMemory.MHOffMinute_write(0);
    InternalMemory.MHDelay_write(7);
    InternalMemory.StdLightsOnHour_write(14);
    InternalMemory.StdLightsOnMinute_write(0);
    InternalMemory.StdLightsOffHour_write(21);
    InternalMemory.StdLightsOffMinute_write(30);
    InternalMemory.DP1OnHour_write(20);
    InternalMemory.DP1OnMinute_write(0);
    InternalMemory.DP2OnHour_write(22);
    InternalMemory.DP2OnMinute_write(30);
    InternalMemory.DP1Timer_write(4);
    InternalMemory.DP2Timer_write(4);
    InternalMemory.DP1RepeatInterval_write(60);
    InternalMemory.DP2RepeatInterval_write(60);
    InternalMemory.ATOHourInterval_write(0);
    InternalMemory.FeedingTimer_write(900);
    InternalMemory.LCDTimer_write(600);
    InternalMemory.LEDPWMActinic_write(20);
    InternalMemory.LEDPWMDaylight_write(20);
    InternalMemory.WM1Timer_write(10);
    InternalMemory.WM2Timer_write(15);
    InternalMemory.HeaterTempOn_write(766);
    InternalMemory.HeaterTempOff_write(770);
    InternalMemory.ChillerTempOn_write(774);
    InternalMemory.ChillerTempOff_write(770);
    InternalMemory.OverheatTemp_write(1500);
    InternalMemory.PHMax_write(830);
    InternalMemory.PHMin_write(540);
    InternalMemory.SalMax_write(2550);
    InternalMemory.ORPMax_write(285);
    InternalMemory.ORPMin_write(1400);   
    InternalMemory.RFMode_write(Constant);
    InternalMemory.RFSpeed_write(50);
    InternalMemory.RFDuration_write(8);
    InternalMemory.RFDuration_write(8);
    InternalMemory.PWMSlopeStartD_write(15);
    InternalMemory.PWMSlopeEndD_write(100);
    InternalMemory.PWMSlopeDurationD_write(60);
    InternalMemory.PWMSlopeStartA_write(15);
    InternalMemory.PWMSlopeEndA_write(100);
    InternalMemory.PWMSlopeDurationA_write(60);
    InternalMemory.PWMSlopeStart0_write(15);
    InternalMemory.PWMSlopeEnd0_write(100);
    InternalMemory.PWMSlopeDuration0_write(60);
    InternalMemory.PWMSlopeStart1_write(15);
    InternalMemory.PWMSlopeEnd1_write(100);
    InternalMemory.PWMSlopeDuration1_write(60);
    InternalMemory.PWMSlopeStart2_write(15);
    InternalMemory.PWMSlopeEnd2_write(100);
    InternalMemory.PWMSlopeDuration2_write(60);
    InternalMemory.PWMSlopeStart3_write(15);
    InternalMemory.PWMSlopeEnd3_write(100);
    InternalMemory.PWMSlopeDuration3_write(60);
    InternalMemory.PWMSlopeStart4_write(15);
    InternalMemory.PWMSlopeEnd4_write(100);
    InternalMemory.PWMSlopeDuration4_write(60);
    InternalMemory.PWMSlopeStart5_write(15);
    InternalMemory.PWMSlopeEnd5_write(100);
    InternalMemory.PWMSlopeDuration5_write(60);
    InternalMemory.ATOExtendedTimeout_write(120);
    InternalMemory.ORPMin_write(2050);
    InternalMemory.ORPMax_write(450);
    InternalMemory.ActinicOffset_write(30);
    InternalMemory.CO2ControlOn_write(770);
    InternalMemory.CO2ControlOff_write(760);
    InternalMemory.PHControlOn_write(800);
    InternalMemory.PHControlOff_write(810);
    InternalMemory.AISlopeStartW_write(0);
    InternalMemory.AISlopeEndW_write(100);
    InternalMemory.AISlopeDurationW_write(60);
    InternalMemory.AISlopeStartB_write(0);
    InternalMemory.AISlopeEndB_write(100);
    InternalMemory.AISlopeDurationB_write(60);
    InternalMemory.AISlopeStartRB_write(0);
    InternalMemory.AISlopeEndRB_write(100);
    InternalMemory.AISlopeDurationRB_write(60);
    InternalMemory.RadionSlopeStartW_write(0);
    InternalMemory.RadionSlopeEndW_write(100);
    InternalMemory.RadionSlopeDurationW_write(60);
    InternalMemory.RadionSlopeStartRB_write(0);
    InternalMemory.RadionSlopeEndRB_write(100);
    InternalMemory.RadionSlopeDurationRB_write(60);
    InternalMemory.RadionSlopeStartR_write(0);
    InternalMemory.RadionSlopeEndR_write(100);
    InternalMemory.RadionSlopeDurationR_write(60);
    InternalMemory.RadionSlopeStartG_write(0);
    InternalMemory.RadionSlopeEndG_write(100);
    InternalMemory.RadionSlopeDurationG_write(60);
    InternalMemory.RadionSlopeStartB_write(0);
    InternalMemory.RadionSlopeEndB_write(100);
    InternalMemory.RadionSlopeDurationB_write(60);
    InternalMemory.RadionSlopeStartI_write(0);
    InternalMemory.RadionSlopeEndI_write(100);
    InternalMemory.RadionSlopeDurationI_write(60);
    InternalMemory.DelayedStart_write(7);
    InternalMemory.PHExpMax_write(2500);
    InternalMemory.PHExpMin_write(500);
    InternalMemory.WaterLevelMax_write(1300);
    InternalMemory.WaterLevelMin_write(900);
    InternalMemory.SalTempComp_write(750);
    InternalMemory.WaterLevelLow_write(60);
    InternalMemory.WaterLevelHigh_write(65);
    InternalMemory.DP3Timer_write(4);
    InternalMemory.DP3RepeatInterval_write(60);
    InternalMemory.DCPumpMode_write(0);
    InternalMemory.DCPumpSpeed_write(50);
    InternalMemory.DCPumpDuration_write(50);
    InternalMemory.WaterLevel1Max_write(1900);
    InternalMemory.WaterLevel1Min_write(590);
    InternalMemory.WaterLevel2Max_write(1900);
    InternalMemory.WaterLevel2Min_write(590);
    InternalMemory.WaterLevel3Max_write(1900);
    InternalMemory.WaterLevel3Min_write(590);
    InternalMemory.WaterLevel4Max_write(1900);
    InternalMemory.WaterLevel4Min_write(590);

    InternalMemory.IMCheck_write(0xCF06A31E);
    ReefAngel.Init();
    ReefAngel.LCD.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL+20, MENU_START_ROW*3, "Memory Updated");
    ReefAngel.LCD.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL+25, MENU_START_ROW*6, "You can now");
    ReefAngel.LCD.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL+25, MENU_START_ROW*7, "upload your");
    ReefAngel.LCD.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL+33, MENU_START_ROW*8, "INO code") ;
}

void loop()
{
  wdt_reset();
}
Roberto.

Posts: 66
Joined: Fri May 05, 2017 11:27 am
PostPosted: Thu May 18, 2017 10:25 pm
Ok, I copy/pasted that into Arduino, compiled and uploaded. I then created code to internal memory in Webwizard, generated, and loaded. I pretty much ended up where I started but I think I realize part of the error...

I have to manually load the internal memory code, meaning I have to copy/paste from the Webwizard into Arduino. I tried that but there are errors, apparently because the internal memory code doesn't use the same nomenclature. For instance, internal memory uses "HeaterTempOn", where the file I created uses "StandardHeater1". The internal memory code also doesn't have "CloudPortal". Is it as simple as editing/adding those things to the internal memory code and re-loading both or am I totally out in left-field?

Maybe what you are saying is that I have to use the Wizard from Arduino. This might make the most sense, but that Wizard doesn't include a selection for Cloud Wifi.

Sorry, I feel like I'm an inch away from getting it, but I can't get past that inch.

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Fri May 19, 2017 8:36 am
You can use the code I posted on the webwizard too.
It is just the internal memory code.
It doesn't do anything else but setting the memory settings.
You will see that the screen will say "Memory Updated. You can load your INO code" after you uploaded it.
Then you can upload your normal code.
If this is too confusing and you are getting lost, just forget about this internal memory code and just update the settings using the head unit or the web based uapp. They will all do the same thing. Change the internal memory settings.
Roberto.

Posts: 66
Joined: Fri May 05, 2017 11:27 am
PostPosted: Fri May 19, 2017 9:19 am
Ok, I got the Internal Memory code posted and then went through the Arduino Wizard and added to Internal Memory. It doesn't update the parameters either, but it also doesn't include Cloud Wifi. I tried adding ReefAngel.CloudPortal(); to the void loop code, but it didn't recognize and wouldn't complete compiling. I don't mind adding parameters manually, but what I can't get my head around is how to get the listings for those parameters I want to add into memory. For instance, I have set up 3 Time schedules-- main lights, main light fans, and refugium light. However, the Uapp only gives me 1 Time schedule to edit. I have two heaters set-up, but the Uapp only gives me one heater to edit. How do I tell Uapp I have set up 3 Time schedules and two heaters? I have the same issue with the screen on the controller. I can make it show me 4 water levels for my multi-channel water level expansion, but I can't make it show more than 1 light or 1 heater to change parameters for.

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Fri May 19, 2017 4:39 pm
There is no way.
You will need to either create your own function or hard code the settings.
It will only have 1 schedule and 1 heater settings in the apps or portal.
Roberto.

Posts: 66
Joined: Fri May 05, 2017 11:27 am
PostPosted: Fri May 19, 2017 7:29 pm
rimai wrote:There is no way.
You will need to either create your own function or hard code the settings.
It will only have 1 schedule and 1 heater settings in the apps or portal.


So if I alter the time setting in Uapp, which time setting does it really alter-- the one assigned to Port 2, the one assigned to Port 3, the one assigned to Port 4, or all of them? All three are StandardLights in the code.

Also, what do you mean by, "Create your own 'function'?" I don't know where these functions are coming from. It looked to me like they were coming from the InternalMemory lines, possibly allowing something like:
InternalMemory.StdLightsOnHour1_write(9);
InternalMemory.StdLightsOnMinute1_write(0);
InternalMemory.StdLightsOnHour2_write(22);
InternalMemory.StdLightsOnMinute2_write(0);
InternalMemory.StdLightsOffHour1_write(21);
InternalMemory.StdLightsOffMinute1_write(0)
InternalMemory.StdLightsOffHour2_write(8);
InternalMemory.StdLightsOffMinute2_write(0)

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Fri May 19, 2017 8:02 pm
If they are all StandardLights , all of them are going to use those settings.
In order to create your own function, you have to actually code your own function.
Here is what the StandardLights function looks like in the background:
https://github.com/reefangel/Libraries/ ... l.cpp#L967
Roberto.

Posts: 66
Joined: Fri May 05, 2017 11:27 am
PostPosted: Fri May 19, 2017 8:43 pm
rimai wrote:If they are all StandardLights , all of them are going to use those settings.
In order to create your own function, you have to actually code your own function.
Here is what the StandardLights function looks like in the background:
https://github.com/reefangel/Libraries/ ... l.cpp#L967


Ok... I'm with you now. When you use the Webwizard, everything that uses a timer is StandardLights... at least what I've done with no delays or offsets. Unfortunately, I'm waaaayyy better with logic than I am with coding. Now, with this new knowledge, there is probably a logical answer to my riddle:

/// LED lights: Port 1 - Always On (LEDs are controlled by a phone app). Lights on 9:00am, Lights off 9:00pm.
/// T5's: Port 2 - Time Schedule. Lights on 11:30am, Lights off 5:30pm.
/// Fixture Fans: Port 3 - Time Schedule. Fans on 9:00am, Fans off 9:00pm (matches LED schedule).
/// Refugium LED: Port 4 - Time Schedule. Lights on 10:00pm, Lights off 8:00am.

Hence, I have 3 schedules and 3 inputs (Daylights on/off, Delayed Start, and Actinic Offset). It looks like I should be able to make it work, but I don't really know what Delayed Start and Actinic Offset do. I also don't know how these tie back to ports.

The heater issue is solved because I don't plan to ever use one high/low temperature for one heater and another high/low temperature for the other heater.
Next

Return to Standard

Who is online

Users browsing this forum: No registered users and 2 guests

cron