Expansion module
Expansion module
I just hooked up the expansion hub and and plugged in the second relay box(which was already connected and running) and I plugged in the salinity module. I plugged the both relay boxes in and when the system came on, it would run for a second or two and shut off and come back on - over and over. Can anyone advise me on what to do?
Re: Expansion module
Did you use the +5VDC power supply that came with it?
It's required to get the HUB powered up.
It's required to get the HUB powered up.
Roberto.
Re: Expansion module
Yep, both modules are plugged in and the red light is on.
Re: Expansion module
Let's try this:
1. Connect just the hub into the relay box. Does it work?
2. Connect the relay expansion module into the hub, but leave the salinity out. Does it work?
3. Connect the salinity module into the hub. Does it work?
1. Connect just the hub into the relay box. Does it work?
2. Connect the relay expansion module into the hub, but leave the salinity out. Does it work?
3. Connect the salinity module into the hub. Does it work?
Roberto.
Re: Expansion module
1. The hub worked
2. The relay expansion worked and the 2nd relay box seems to work fine.
3. Plugged in the salinity box and as soon as power is applied, the main relay box starts kicking in and out. I looked at the RA display while this is going on and the salt display is going wild.
2. The relay expansion worked and the 2nd relay box seems to work fine.
3. Plugged in the salinity box and as soon as power is applied, the main relay box starts kicking in and out. I looked at the RA display while this is going on and the salt display is going wild.
Re: Expansion module
Ah!!
We need to initialize the memory to accept the salinity module.
Can't remember if you have wifi. Do you?
We need to initialize the memory to accept the salinity module.
Can't remember if you have wifi. Do you?
Roberto.
Re: Expansion module
I have the module but it is not hooked up yet...?
Re: Expansion module
ok. so, let's do this.
1. Connect the usb cable to RA
2. Open Arduino
3. Open Serial Monitor on menu Tools->Serial Monitor
4. Make sure you have baud rate 57600
5. Type "GET \mi847,2550 " without the quote marks and make sure there is a space after 847
6. Does the controller respond with OK?
1. Connect the usb cable to RA
2. Open Arduino
3. Open Serial Monitor on menu Tools->Serial Monitor
4. Make sure you have baud rate 57600
5. Type "GET \mi847,2550 " without the quote marks and make sure there is a space after 847
6. Does the controller respond with OK?
Roberto.
Re: Expansion module
nope, it does not respond at all
Re: Expansion module
Let's go another route then.
Load this code
This should initialize the salinity calibration memory setting.
Load this code
Code: Select all
#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <Time.h>
#include <OneWire.h>
#include <Phillips6610LCDInv.h>
#include <avr/pgmspace.h>
#include <ReefAngel_EEPROM.h>
Phillips6610LCDInv e;
void setup()
{
e.lcd_init();
e.lcd_clear(COLOR_WHITE,0,0,132,132);
e.lcd_BacklightOn();
InternalMemory.SalMax_write(2550);
}
void loop()
{
e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW, "Done");
}
Roberto.
Re: Expansion module
it says color white was not declared in this scope. remember I have the custom screen running.
Re: Expansion module
Ok, so try this instead then:
Code: Select all
#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <Time.h>
#include <OneWire.h>
#include <Phillips6610LCDInv.h>
#include <avr/pgmspace.h>
#include <ReefAngel_EEPROM.h>
Phillips6610LCDInv e;
void setup()
{
e.lcd_init();
e.lcd_clear(255,0,0,132,132);
e.lcd_BacklightOn();
InternalMemory.SalMax_write(2550);
}
void loop()
{
e.lcd_draw_text(0, 255, 10, 10, "Done");
}
Roberto.
Re: Expansion module
That seemed to work. I had to disable my custom menu and then load your code. I then reloaded my pde. I hooked up the salinity module and the system is still running and not kicking in and out.
Now...what about calibration of the module and probe? Right now it says 51.2. I assume that is PPT?
Now...what about calibration of the module and probe? Right now it says 51.2. I assume that is PPT?
Re: Expansion module
Cool
Yes, ppt.
The calibration on the libraries you are running is broken
I fixed it for the new update.
So, we will need to load another code to calibrate the probe too.
Try this one:
Yes, ppt.
The calibration on the libraries you are running is broken
I fixed it for the new update.
So, we will need to load another code to calibrate the probe too.
Try this one:
Code: Select all
#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <Time.h>
#include <OneWire.h>
#include <Wire.h>
#include <Phillips6610LCDInv.h>
#include <avr/pgmspace.h>
#include <ReefAngel_EEPROM.h>
Phillips6610LCDInv e;
unsigned long avgSal=0;
void setup()
{
e.lcd_init();
e.lcd_clear(255,0,0,132,132);
e.lcd_BacklightOn();
for (int a=0;a<6;a++)
avgSal+=SalRead();
avgSal/=5;
InternalMemory.SalMax_write(avgSal);
}
void loop()
{
e.lcd_draw_text(0, 255, 10, 10, "Done");
}
int SalRead()
{
int iSal=0;
Wire.requestFrom(I2CSalinity, 2);
if (Wire.available())
{
iSal = Wire.receive();
iSal = iSal<<8;
iSal += Wire.receive();
}
return iSal;
}
Roberto.
Re: Expansion module
Just so I know what to expect..... what will this do? How will it work?
Re: Expansion module
Looks like it will start up and then read the salinity and average the values and store in Internal Memory. Once it's finished, it will show "Done". Then you can reload your PDE and be all set for your salinity.
Re: Expansion module
Well, it ran fast and said done before I could blink. I reloaded my pde and now it says - 5.9. That seems like an odd number. Does it seem right to you?
Re: Expansion module
No doesn't seem right.
Let's see what the module is actually reporting.
We can manually set it later.
Let's see what the module is actually reporting.
We can manually set it later.
Code: Select all
#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <Time.h>
#include <OneWire.h>
#include <Wire.h>
#include <Phillips6610LCDInv.h>
#include <avr/pgmspace.h>
#include <ReefAngel_EEPROM.h>
Phillips6610LCDInv e;
unsigned long avgSal=0;
void setup()
{
e.lcd_init();
e.lcd_clear(255,0,0,132,132);
e.lcd_BacklightOn();
}
void loop()
{
e.lcd_draw_text(0, 255, 10, 10, SalRead());
}
int SalRead()
{
int iSal=0;
Wire.requestFrom(I2CSalinity, 2);
if (Wire.available())
{
iSal = Wire.receive();
iSal = iSal<<8;
iSal += Wire.receive();
}
return iSal;
}
Roberto.
Re: Expansion module
it does not like this line:
e.lcd_draw_text(0, 255, 10, 10, SalRead());
it flagged it yellow and gave an error that said:
invalid conversion int to char
e.lcd_draw_text(0, 255, 10, 10, SalRead());
it flagged it yellow and gave an error that said:
invalid conversion int to char
Re: Expansion module
Let's see if I got it right this time:
Code: Select all
#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <Time.h>
#include <OneWire.h>
#include <Wire.h>
#include <Phillips6610LCDInv.h>
#include <avr/pgmspace.h>
#include <ReefAngel_EEPROM.h>
Phillips6610LCDInv e;
unsigned long avgSal=0;
void setup()
{
e.lcd_init();
e.lcd_clear(255,0,0,132,132);
e.lcd_BacklightOn();
}
void loop()
{
char buff[10];
itoa(SalRead(),buff,10);
e.lcd_draw_text(0, 255, 10, 10, buff);
}
int SalRead()
{
int iSal=0;
Wire.requestFrom(I2CSalinity, 2);
if (Wire.available())
{
iSal = Wire.receive();
iSal = iSal<<8;
iSal += Wire.receive();
}
return iSal;
}
Roberto.
Re: Expansion module
I uploaded it and on the RA screen it says 0(zero)
Re: Expansion module
LOL....yeah I do...thats funny. And I checked it to make sure it it hooked up - it is. and the power is on to the module as well.
Re: Expansion module
on the module itself, there is a green light and a yellow light on
Re: Expansion module
Ok, I hope I get this right this time....
Code: Select all
#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel_Salinity.h>
#include <ReefAngel.h>
void setup()
{
ReefAngel.Init();
SetupCalibrateSalinity();
ReefAngel.ClearScreen(DefaultBGColor);
ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, MENU_START_COL, MENU_START_ROW*5, "Done");
}
void loop()
{
#if defined WDT || defined WDT_FORCE
wdt_reset();
#endif // defined WDT || defined WDT_FORCE
}
void SetupCalibrateSalinity()
{
bool bOKSel = false;
bool bSave = false;
bool bDone = false;
bool bDrawButtons = true;
unsigned int iS = 0;
byte offset = 65;
// draw labels
ReefAngel.ClearScreen(DefaultBGColor);
ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, MENU_START_COL, MENU_START_ROW, "Calibrate Salinity");
ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, MENU_START_COL, MENU_START_ROW*5, "35 PPT");
do
{
#if defined WDT || defined WDT_FORCE
wdt_reset();
#endif // defined WDT || defined WDT_FORCE
iS=0;
for (int a=0;a<15;a++)
{
iS += ReefAngel.Salinity.Read();
}
iS/=15;
ReefAngel.LCD.DrawCalibrate(iS, MENU_START_COL + offset, MENU_START_ROW*5);
if ( bDrawButtons )
{
if ( bOKSel )
{
ReefAngel.LCD.DrawOK(true);
ReefAngel.LCD.DrawCancel(false);
}
else
{
ReefAngel.LCD.DrawOK(false);
ReefAngel.LCD.DrawCancel(true);
}
bDrawButtons = false;
}
if ( ReefAngel.Joystick.IsUp() || ReefAngel.Joystick.IsDown() || ReefAngel.Joystick.IsRight() || ReefAngel.Joystick.IsLeft() )
{
// toggle the selection
bOKSel = !bOKSel;
bDrawButtons = true;
}
if ( ReefAngel.Joystick.IsButtonPressed() )
{
bDone = true;
if ( bOKSel )
{
bSave = true;
}
}
}
while ( ! bDone );
if ( bSave )
{
// save PHMin & PHMax to memory
InternalMemory.SalMax_write(iS);
ReefAngel.SalMax = iS;
}
}
Roberto.
Re: Expansion module
now I have a calibration screen. What is the correct way to use it ?
Re: Expansion module
Does it show something other than 0?
Just place the probe in 35ppt or your tank, assuming it is correct and press OK
Just place the probe in 35ppt or your tank, assuming it is correct and press OK
Roberto.
Re: Expansion module
and it say on the screen:
35 ppt 3957
35 ppt 3957