Page 1 of 1

Loggin activity

Posted: Mon May 15, 2017 2:59 pm
by lucho
I created a google sheet to download and log the RA status. I did his because I wanted to have a longer log than 7 days (I am collecting the data only every hour now), and have my own dashboard with charts to see how things are going.
This is working well. However, I have some questions on what each of the metrics in /status mean. Is there a place where it goes over each of them? Also, where would relay activity show up?
Let me know if anyone is interested, happy to share.
Thanks,
Lucho




Sent from my iPhone using Tapatalk

Re: Loggin activity

Posted: Mon May 15, 2017 7:50 pm
by rimai
Nice :)
It's an XML file with all the parameters for everything we can log.
I don't think we created a document.
Start with the source code:
https://github.com/reefangel/Libraries/ ... i.cpp#L223
If you still unsure of any of them, let us know.

Re: Loggin activity

Posted: Wed May 17, 2017 6:21 am
by lucho
Thanks Roberto. I think I managed to get most of them. I only have a few missing (EM, EM1, REM, R1-8, RON1-8, ROFF1-8, and SF).
The question may be answered with the above, but where can I see relay status? I have 2 relay expansions.

thanks,
Lucho

Re: Loggin activity

Posted: Wed May 17, 2017 11:16 am
by rimai
EM and EM1 are for expansion modules enabled.
SF and AF are for status flags and Alert flags.
REM is for which relay expansion module you have enabled.
R1-8 are the expansion relay boxes without the override flags.
RON1-8 are the expansion relay boxes override flag for always on flags.
ROFF1-8 are the expansion relay boxes override flag for always off flags.
In the Global.h, you will find the bits.

Code: Select all

// EM Bits
#ifdef PWMEXPANSION
	#define PWMEbit		1
#else
	#define PWMEbit		0
#endif  // PWMEXPANSION

#ifdef RFEXPANSION
	#define RFEbit		2
#else
	#define RFEbit		0
#endif  // RFEXPANSION

#ifdef AI_LED
	#define AIbit		4
#else
	#define AIbit		0
#endif  // AI_LED

#ifdef SALINITYEXPANSION
	#define Salbit		8
#else
	#define Salbit		0
#endif  // SALINITYEXPANSION

#ifdef ORPEXPANSION
	#define ORPbit		16
#else
	#define ORPbit		0
#endif  // ORPEXPANSION

#ifdef IOEXPANSION
	#define IObit		32
#else
	#define IObit		0
#endif  // IOEXPANSION

#ifdef PHEXPANSION
	#define PHbit		64
#else
	#define PHbit		0
#endif  // PHEXPANSION

#if defined WATERLEVELEXPANSION || defined MULTIWATERLEVELEXPANSION
	#define WLbit		128
#else
	#define WLbit		0
#endif  // WATERLEVELEXPANSION || MULTIWATERLEVELEXPANSION

// EM1 Bits
#ifdef HUMIDITYEXPANSION
	#define HUMbit		1
#else
	#define HUMbit		0
#endif  // HUMIDITYEXPANSION

#ifdef DCPUMPCONTROL
	#define DCPumpbit	2
#else
	#define DCPumpbit	0
#endif  // DCPUMPCONTROL

#ifdef LEAKDETECTOREXPANSION
	#define Leakbit		4
#else
	#define Leakbit		0
#endif  // LEAKDETECTOREXPANSION

#ifdef PAREXPANSION
	#define PARbit		8
#else
	#define PARbit		0
#endif  // PAREXPANSION
#ifdef SIXTEENCHPWMEXPANSION
	#define SCPWMbit		16
#else
	#define SCPWMbit		0
#endif  // SIXTEENCHPWMEXPANSION

// Alert Flags bits
#define ATOTimeOutFlag	0
#define OverheatFlag   	1
#define BusLockFlag   	2
#define LeakFlag		    3

// Status Flag Bits
#define LightsOnFlag   	0
#define FeedingFlag   	1
#define WaterChangeFlag	2

Re: Loggin activity

Posted: Fri May 19, 2017 7:35 am
by lucho
Thanks for the quick reply.
I am clearly beyond my expertise.
Are the bits pieces you quoted above a way to understand what the number means? E.g., a 3 in AF means Leak flag is activated?

The other is in the relays. If i understand well, there are 3 status output per relay box (R, RON, and ROFF), with a number result for each. How do I translate that to knowing the status of each outlet within the relay box?

Thanks a lot!





rimai wrote:EM and EM1 are for expansion modules enabled.
SF and AF are for status flags and Alert flags.
REM is for which relay expansion module you have enabled.
R1-8 are the expansion relay boxes without the override flags.
RON1-8 are the expansion relay boxes override flag for always on flags.
ROFF1-8 are the expansion relay boxes override flag for always off flags.
In the Global.h, you will find the bits.

Code: Select all

// EM Bits
#ifdef PWMEXPANSION
	#define PWMEbit		1
#else
	#define PWMEbit		0
#endif  // PWMEXPANSION

#ifdef RFEXPANSION
	#define RFEbit		2
#else
	#define RFEbit		0
#endif  // RFEXPANSION

#ifdef AI_LED
	#define AIbit		4
#else
	#define AIbit		0
#endif  // AI_LED

#ifdef SALINITYEXPANSION
	#define Salbit		8
#else
	#define Salbit		0
#endif  // SALINITYEXPANSION

#ifdef ORPEXPANSION
	#define ORPbit		16
#else
	#define ORPbit		0
#endif  // ORPEXPANSION

#ifdef IOEXPANSION
	#define IObit		32
#else
	#define IObit		0
#endif  // IOEXPANSION

#ifdef PHEXPANSION
	#define PHbit		64
#else
	#define PHbit		0
#endif  // PHEXPANSION

#if defined WATERLEVELEXPANSION || defined MULTIWATERLEVELEXPANSION
	#define WLbit		128
#else
	#define WLbit		0
#endif  // WATERLEVELEXPANSION || MULTIWATERLEVELEXPANSION

// EM1 Bits
#ifdef HUMIDITYEXPANSION
	#define HUMbit		1
#else
	#define HUMbit		0
#endif  // HUMIDITYEXPANSION

#ifdef DCPUMPCONTROL
	#define DCPumpbit	2
#else
	#define DCPumpbit	0
#endif  // DCPUMPCONTROL

#ifdef LEAKDETECTOREXPANSION
	#define Leakbit		4
#else
	#define Leakbit		0
#endif  // LEAKDETECTOREXPANSION

#ifdef PAREXPANSION
	#define PARbit		8
#else
	#define PARbit		0
#endif  // PAREXPANSION
#ifdef SIXTEENCHPWMEXPANSION
	#define SCPWMbit		16
#else
	#define SCPWMbit		0
#endif  // SIXTEENCHPWMEXPANSION

// Alert Flags bits
#define ATOTimeOutFlag	0
#define OverheatFlag   	1
#define BusLockFlag   	2
#define LeakFlag		    3

// Status Flag Bits
#define LightsOnFlag   	0
#define FeedingFlag   	1
#define WaterChangeFlag	2

Sent from my iPhone using Tapatalk

Re: Loggin activity

Posted: Fri May 19, 2017 9:10 am
by rimai
You will need to learn a little about binary numbers.
Google "binary number".
Here is one hit: https://www.mathsisfun.com/binary-number-system.html
Basically, the decimal number that the controller gives is a decimal representation of an 8bit number.
So, let's say you get 9 on R. The binary representation of the decimal 9 number is: 00001001
So, port 1 and port 4 would be on.
RON and ROFF are the override masks for On and Off.
You need to bitwise AND and OR the masks.
The formula is ( R || RON ) && ROFF
You need to bitwise OR RON and then bitwise AND ROFF. This will give you what the relay ports will be like after the override masks are applied.

Re: Loggin activity

Posted: Fri May 19, 2017 11:06 am
by lucho
Got it. Thanks, I now decoded the relays piece (I am familiar with binary). Is this also the thinking behind the AF and SF?


Sent from my iPhone using Tapatalk

Re: Loggin activity

Posted: Fri May 19, 2017 11:43 am
by rimai
Yes.

Re: Loggin activity

Posted: Thu May 10, 2018 5:16 am
by dlplunkett44
Lucho, would you be willing to share this google sheet?
Thanks!