Custom Screen, Salinity and pH value not displaying properly

Do you have a question on how to do something.
Ask in here.
Nikkwins
Posts: 20
Joined: Fri Nov 18, 2011 10:30 pm

Custom Screen, Salinity and pH value not displaying properly

Post 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);
}
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

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

Post 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();
Nikkwins
Posts: 20
Joined: Fri Nov 18, 2011 10:30 pm

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

Post 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'
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

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

Post 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
Nikkwins
Posts: 20
Joined: Fri Nov 18, 2011 10:30 pm

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

Post 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?
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

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

Post 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
Nikkwins
Posts: 20
Joined: Fri Nov 18, 2011 10:30 pm

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

Post 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>
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

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

Post 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?
Nikkwins
Posts: 20
Joined: Fri Nov 18, 2011 10:30 pm

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

Post 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?
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

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

Post by Deckoz2302 »

hmmm mine only has two lights on also, have you tried disconnecting and reconnecting the probe?
Nikkwins
Posts: 20
Joined: Fri Nov 18, 2011 10:30 pm

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

Post 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.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post 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.
Roberto.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post by rimai »

Also, did you place the jumpers in the head unit?
Roberto.
Nikkwins
Posts: 20
Joined: Fri Nov 18, 2011 10:30 pm

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

Post by Nikkwins »

rimai wrote:Also, did you place the jumpers in the head unit?
Negat...where can I find instructions for that?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post 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.
Roberto.
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

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

Post 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
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

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

Post by Deckoz2302 »

Bump for the reading ??
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

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

Post 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.
Nikkwins
Posts: 20
Joined: Fri Nov 18, 2011 10:30 pm

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

Post 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?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post by rimai »

Yes, what was the numbers you saw on the screen?
Roberto.
Nikkwins
Posts: 20
Joined: Fri Nov 18, 2011 10:30 pm

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

Post 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.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post by rimai »

Sorry, I mean the numbers that were being displayed while calibrating.
Roberto.
Nikkwins
Posts: 20
Joined: Fri Nov 18, 2011 10:30 pm

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

Post by Nikkwins »

rimai wrote:Sorry, I mean the numbers that were being displayed while calibrating.
Fluctuating rapidly from 3560 to 3580
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post by rimai »

Ok, can you do that step to get the internal memory value again?
GET /mi847
Roberto.
Nikkwins
Posts: 20
Joined: Fri Nov 18, 2011 10:30 pm

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

Post 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
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post by rimai »

Can you try again.
That was the webbanner code running at the same time.
Roberto.
Nikkwins
Posts: 20
Joined: Fri Nov 18, 2011 10:30 pm

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

Post 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...
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

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

Post by Deckoz2302 »

oops haha I guess I didn't think about that lol, thanks binder
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post 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.
Roberto.
Nikkwins
Posts: 20
Joined: Fri Nov 18, 2011 10:30 pm

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

Post 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>
Post Reply