Page 1 of 2

Custom Screen, Salinity and pH value not displaying properly

Posted: Sun Jan 01, 2012 10:01 pm
by Nikkwins
I attached my salinity module, and am trying to make it display. Since I need a custom screen to do this, I decided to get rid of DP and AP since I don't need them. My screen looks about how I want it, but the salinity and pH parameters are not displaying correctly. Is this a decimal place issue?

Image

Here is what I used for the custom main screen:

Code: Select all

void DrawCustomMain()
{
	// the graph is drawn/updated when we exit the main menu &
	// when the parameters are saved
	ReefAngel.LCD.DrawDate(6, 112);
	pingSerial();
        ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Salinity, COLOR_BLACK, 50,60, 10);
        ReefAngel.LCD.DrawText(COLOR_BLACK, COLOR_WHITE,15,60, "Sal:");
        ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp1, COLOR_BLACK, 50,70, 10);
        ReefAngel.LCD.DrawText(COLOR_BLACK, COLOR_WHITE,15,70, "Temp:");       
        ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.PH, COLOR_BLACK, 50,80, 10);   
        ReefAngel.LCD.DrawText(COLOR_BLACK, COLOR_WHITE,15,80,"pH:");  
	pingSerial();
	byte TempRelay = ReefAngel.Relay.RelayData;
	TempRelay &= ReefAngel.Relay.RelayMaskOff;
	TempRelay |= ReefAngel.Relay.RelayMaskOn;
	ReefAngel.LCD.DrawOutletBox(12, 93, TempRelay);
}

void DrawCustomGraph()
{
	ReefAngel.LCD.DrawGraph(5, 5);
}

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 6:32 am
by Deckoz2302
try this

Code: Select all

 ReefAngel.LCD.DrawText(0,255,15,80,"pH:");
  ConvertNumToString(text, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_BLACK, 255, 50, 80, text, Num8x8);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,15,60,"Sal:");
  ConvertNumToString(text, ReefAngel.Params.Salinity, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_BLACK, 255, 50, 60, text, Num8x8);
  pingSerial();

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 7:19 am
by Nikkwins
Deckoz2302 wrote:try this

Code: Select all

 ReefAngel.LCD.DrawText(0,255,15,80,"pH:");
  ConvertNumToString(text, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_BLACK, 255, 50, 80, text, Num8x8);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,15,60,"Sal:");
  ConvertNumToString(text, ReefAngel.Params.Salinity, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_BLACK, 255, 50, 60, text, Num8x8);
  pingSerial();
Thanks for the response, I'm getting the below error when trying to verify it:

RA_010112_2209.cpp: In function 'void DrawCustomMain()':
RA_010112_2209:68: error: 'text' was not declared in this scope
RA_010112_2209:69: error: 'class ReefAngel_NokiaLCD' has no member named 'DrawLargeText'
RA_010112_2209:76: error: 'class ReefAngel_NokiaLCD' has no member named 'DrawLargeText'

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 7:34 am
by Deckoz2302
oh ok my bad

add this to the top of custom main

Code: Select all

char text[7];
and try this instead

Code: Select all

ReefAngel.LCD.DrawText(0,255,15,80,"pH:");
  ConvertNumToString(text, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawText(COLOR_BLACK, 255, 50, 80, text);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,15,60,"Sal:");
  ConvertNumToString(text, ReefAngel.Params.Salinity, 100);
  ReefAngel.LCD.DrawText(COLOR_BLACK, 255, 50, 60, text);
  pingSerial();

my bad about that didnt realize you werent using larger text & i forgot about the character array, but this should be right

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 2:43 pm
by Nikkwins
Deckoz2302 wrote:oh ok my bad

add this to the top of custom main

Code: Select all

char text[7];
and try this instead

Code: Select all

ReefAngel.LCD.DrawText(0,255,15,80,"pH:");
  ConvertNumToString(text, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawText(COLOR_BLACK, 255, 50, 80, text);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,15,60,"Sal:");
  ConvertNumToString(text, ReefAngel.Params.Salinity, 100);
  ReefAngel.LCD.DrawText(COLOR_BLACK, 255, 50, 60, text);
  pingSerial();

my bad about that didnt realize you werent using larger text & i forgot about the character array, but this should be right
Looks like that put all the decimals in the right place, thanks so much for your help!

I'm still having problem with my salinity value. It's displaying 0.60 regardless of whether or not the probe is in salt water or fresh water. I followed Roberto's instructions:

1) loaded SalMemory.PDE on the controller, it displayed "Done"
2) put #define SALINITYEXPANSION in the ReefAngel_Features.h file
3) put #include <ReefAngel_Salinity.h> in my PDE
4) loaded RAGen PDE on controller again


Did I miss a step?

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 4:44 pm
by Deckoz2302
I had the same problem too, did you intialize the internal memory value? go into arduino and open up status monitor and type "GET /mi847,255 " and hit enter, make sure you have the space(spacebar) after 255 or it wont do anything

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 5:22 pm
by Nikkwins
Deckoz2302 wrote:I had the same problem too, did you intialize the internal memory value? go into arduino and open up status monitor and type "GET /mi847,255 " and hit enter, make sure you have the space(spacebar) after 255 or it wont do anything
Here's what I got. I'm not sure what I'm looking at.

HTTP/1.1 200 OK
Server: ReefAngel
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Connection: close
Content-Type: text/xml
Content-Length: 118

<M847>255</M847>

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 5:27 pm
by Deckoz2302
so it is intialized hmmm... i dunno roberto would have to help you out with that one also do you have the power supply hooked upto it?

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 5:33 pm
by Nikkwins
Deckoz2302 wrote:so it is intialized hmmm... i dunno roberto would have to help you out with that one also do you have the power supply hooked upto it?
Yup, power is on. I've got two out of for green lights on the salinity module. Should all four lights be on?

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 5:35 pm
by Deckoz2302
hmmm mine only has two lights on also, have you tried disconnecting and reconnecting the probe?

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 5:46 pm
by Nikkwins
Deckoz2302 wrote:hmmm mine only has two lights on also, have you tried disconnecting and reconnecting the probe?
Yeah, I unhooked it entirely, power cycled the whole system...checked to make sure the pin in the connector wasn't bent, swapped the USB cable...still not coming up.

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 6:26 pm
by rimai
sorry, something is wrong.
The value should've been 2550, not 255.
GET /mi847 should return 2550.
GET /mi847,2550 should set it to 2550 if you have nothing but 2550.
Or you can use joystick and calibrate salinity.
Let me know if this works.

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 6:56 pm
by rimai
Also, did you place the jumpers in the head unit?

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 7:02 pm
by Nikkwins
rimai wrote:Also, did you place the jumpers in the head unit?
Negat...where can I find instructions for that?

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 7:06 pm
by rimai
http://www.reefangel.com/files/Reef%20A ... 20v1.0.pdf

I need to update the manual to include the internal memory step, which was recently discovered by deckoz.

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Mon Jan 02, 2012 7:20 pm
by Deckoz2302
ooops typo :D
I do have one question since we are all here. My salinity on a refractometer is 35ppt. On the RA it reads 3.52 on screen? I assume this is right? or is the decimal in the wrong place?

And the jumpers! I forgot all about those! haha then again that was the first thing I did before i velcro'd it to my wall

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Tue Jan 03, 2012 10:27 am
by Deckoz2302
Bump for the reading ??

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Tue Jan 03, 2012 1:53 pm
by binder
Deckoz2302 wrote:Bump for the reading ??
you have the wrong value on the display line. you need to change the convertnumtotext to use 10 instead of 100.

Code: Select all

 ConvertNumToString(text, ReefAngel.Params.Salinity, 10);

that should fix it.

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Tue Jan 03, 2012 2:59 pm
by Nikkwins
Thanks Roberto, I'm getting a reading now, I've been rushing to get this set up so I can focus on non-hobby related things, I missed that manual entirely :oops:

After I calibrate it using the joystick, it reads 33.0...shouldn't it read 35.0?

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Tue Jan 03, 2012 3:17 pm
by rimai
Yes, what was the numbers you saw on the screen?

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Tue Jan 03, 2012 3:27 pm
by Nikkwins
rimai wrote:Yes, what was the numbers you saw on the screen?
On the main screen immediately after calibration it displays 33.0...it fluctuates but stays around there.

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Tue Jan 03, 2012 3:30 pm
by rimai
Sorry, I mean the numbers that were being displayed while calibrating.

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Tue Jan 03, 2012 3:35 pm
by Nikkwins
rimai wrote:Sorry, I mean the numbers that were being displayed while calibrating.
Fluctuating rapidly from 3560 to 3580

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Tue Jan 03, 2012 3:47 pm
by rimai
Ok, can you do that step to get the internal memory value again?
GET /mi847

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Tue Jan 03, 2012 4:04 pm
by Nikkwins
rimai wrote:Ok, can you do that step to get the internal memory value again?
GET /mi847
This is what it came back with when I typed that command:

GET /status/submit.asp?t1=784&t2=0&t3=0&ph=793&relaydata=242&id=nikkwins&t1n=Water&t2n=Not%20Used&t3n=Not%20Used&r1n=ATO&r2n=Disp Light&r3n=Sump Light&r4n=Heater&r5n=Powerhead%202&r6n=Powerhead%201&r7n=Skimmer&r8n=Return Pump

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Tue Jan 03, 2012 4:10 pm
by rimai
Can you try again.
That was the webbanner code running at the same time.

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Tue Jan 03, 2012 4:18 pm
by Nikkwins
rimai wrote:Can you try again.
That was the webbanner code running at the same time.
It keeps giving me the same results...

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Tue Jan 03, 2012 4:28 pm
by Deckoz2302
oops haha I guess I didn't think about that lol, thanks binder

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Tue Jan 03, 2012 4:52 pm
by rimai
Nikkwins wrote: It keeps giving me the same results...
GET /mi847
Make sure to type a space after the command before hitting enter.

Re: Custom Screen, Salinity and pH value not displaying prop

Posted: Tue Jan 03, 2012 4:55 pm
by Nikkwins
HTTP/1.1 200 OK
Server: ReefAngel
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Connection: close
Content-Type: text/xml
Content-Length: 118

<M847>3506</M847>