Wifi attachment commands

Related to the development libraries, released by Curt Binder

Posts: 12188
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Sun Jul 22, 2012 3:26 pm
These are the commands available so far, extracted from RA_wifi.cpp:

/wifi - simple internal webserver

/rxy - override relay where
x=relay
y=0 - mask off
y=1 - mask on
y=2 - auto

/mbx - read memory location (byte size) where
x=memory location

/mbx,y - write memory location (byte size) where
x=memory location
y=value to be written

/mix - read memory location (int size) where
x=memory location

/mix,y - write memory location (int size) where
x=memory location
y=value to be written

/mr - returns a string with all memory values in hexdecimal

/mrx,y - returns a string with memory values in hexdecimal between x and y location

/v - dev libs version

/dhhmm,MMdd,yy - sets date/time where
hh=hours of the day, including leading 0 if hour<10
mm=minutes of the hour, including leading 0 if minutes<10
MM=month of the year, including leading 0 if month<10
dd=day of the month, including leading 0 if day<10
yy=last 2 digits of the year

/sr - returns XML with all parameters

/sa -same as above

/bp - call joystick button press

/mf - call feeding mode

/mw - call water change mode

/mt - clear ATO timeout flag

/mo - clear Overheat flag

/ml - clear Leak flag

/pox,y - override dimming signal where
x=override id
Valid ids:
0-Daylight
1-Actinic
2-Dimming expansion channel 0
3-Dimming expansion channel 1
4-Dimming expansion channel 2
5-Dimming expansion channel 3
6-Dimming expansion channel 4
7-Dimming expansion channel 5
8-Aqua Illumination - White Channel
9-Aqua Illumination - Royal Blue Channel
10-Aqua Illumination - Blue Channel
11-Radion - White Channel
12-Radion - Royal Blue Channel
13-Radion - Red Channel
14-Radion - Green Channel
15-Radion - Blue Channel
16-Radion - Intensity Channel

y=value to be overwritten. Values <=100 enables override and values > 100 disables it

/boot - force reboot

/cvarx,y - set custom variable (byte size) where
x=custom variable index
y=value to be written

/calx - starts the calibration where
x=parameter id
Valid ids:
0 - pH
1 - Salinity
2 - ORP
3 - pH Expansion
4 - Water Level
Roberto.
User avatar
Posts: 2723
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
PostPosted: Sun Jul 22, 2012 3:30 pm
When using the /rxy command, x is the relay (like roberto said).
The values for x can be:
  • 1-8 - main relay
  • 11-18 - expansion relay 1
  • 21-28 - expansion relay 2
  • 31-38 - expansion relay 3
  • 41-48 - expansion relay 4
  • 51-58 - expansion relay 5
  • 61-68 - expansion relay 6
  • 71-78 - expansion relay 7
  • 81-88 - expansion relay 8

Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD
PostPosted: Sun Jul 22, 2012 7:01 pm
was there a pre-post to this that explains how we might use this? Thx in advance.

I found it:

viewtopic.php?f=7&t=1477&view=unread#unread
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.

Posts: 12188
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Sun Jul 22, 2012 7:46 pm
To use the commands, all you need to do is browse to your controller with your favorite internet browser.
For example:
http://ipaddress:2000/wifi
You can use any command above after the port number.
This is what the Portal and apps use underneath the pretty user interface :)
Roberto.

Posts: 137
Joined: Sat Feb 16, 2013 7:44 am
PostPosted: Sat Feb 16, 2013 3:00 pm
Quick question, is there a schema for the data that /sr or /sa will return?

Posts: 12188
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Sat Feb 16, 2013 4:08 pm
They are both the same :)
/r99 is also the same thing.
XML formatted data with the parameters your RA is monitoring/controlling.
Roberto.
User avatar
Posts: 5342
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Thu Apr 11, 2013 6:37 pm
Does anyone have insight into how to read the /mr information? I want to populate some variables to display on a web page.
User avatar
Posts: 2723
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
PostPosted: Thu Apr 11, 2013 6:54 pm
lnevo wrote:Does anyone have insight into how to read the /mr information? I want to populate some variables to display on a web page.

This should give you some insight. From RA_Wifi.cpp
Code: Select all
//... exert
byte m;
for ( int x = VarsStart; x < VarsEnd; x++ )
{
   m=InternalMemory.read(x);
   if (m<16) WIFI_SERIAL.print("0");
   WIFI_SERIAL.print(m,HEX);
}  // for x

It goes through all the locations, one by one and prints out the hex value for them. The function read() only reads a byte value. So you should plan on 2 digits per memory location. Your code will need to know the start and stop values (which can be obtained from the Globals.h file). Then you will also need to know if you are dealing with 1 or 2 memory locations (2 or 4 digits in the string).
I don't personally use this string in the Android app. I think the Client Suite uses it. I also think Roberto uses it for something otherwise he wouldn't have created it.
Hopefully that helps you out.
User avatar
Posts: 5342
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Thu Apr 11, 2013 7:28 pm
Yeah that helped. It looks like /mr only prints the standard values, so I'm going to have to add a function. More work to do :) if my ReefAngel doesn't blow up when I finally load my code I'll be pretty impressed.
User avatar
Posts: 5342
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Thu Apr 11, 2013 8:22 pm
I'm gonna try this

Code: Select all
         case REQ_M_CUSTOM:
         {
            int s = 11;  // start with the base size of the mem tags
            int CustomVarsStart=100;
            s += (VarsStart-CustomVarsStart)*2;
            PrintHeader(s,1);
            PROGMEMprint(XML_MEM_OPEN);
            byte m;
            for ( int x = CustomVarsStart; x < VarStart; x++ )
            {
               m=InternalMemory.read(x);
               if (m<16) WIFI_SERIAL.print("0");
               WIFI_SERIAL.print(m,HEX);
            }  // for x
            PROGMEMprint(XML_MEM_CLOSE);
            break;
         }  // REQ_M_CUSTOM


I add /mc to access it.

And now I found another Relay.Write I have to consider for my override mask :) gonna be a challenge to get that back into git.
Next

Return to Development Libraries

Who is online

Users browsing this forum: No registered users and 1 guest