myAVR myEthernet | Web server |
Status Configuration Technical doc Quick start Hardware Functionality PINs ISP UART MicroSD Web server pdf Glossary Examples of use Contact Safety guideline |
myEthernet web serverThe firmware for the myEthernet contains software for a embedded web server, that supports the sending of files to the pc via LAN and WAN as well as the assignment and the placement of states, values and configurations for the myEthernet. Settings of the web server
The web server must have a definite and not yet used adress in the network. The settings will be saved in the file "config.cfg"
on the microSD-card (must be placed in the root directory).
If you power-up the myEthernet the file will be read and all stored settings will be used.
# that is a comment ; that is also a comment #IP-adress ip=192.168.20.98 #subnet mask ipMask=255.255.255.0 #web server port port=80 #Mac-adress macAddr=2.0.0.2.8.100 twiMode=m24c twiAddr=0xB0 sharedRamSize=128 sharedEepromSize=128 If no config.cfg exists or no microSD-card is inserted the following defaults values will be activated:
IP-address: 192.168.20.96
web server-port: 80 subnet-mask: 255.255.255.0 mac-adress: 2.0.0.2.8.100 Substitutions:
With the embedded web server of the myEthernet many analyses are possible. Therefor it uses it's own command- and
substitution syntax. With the execution of these commands you can scan current values for several or all pins.
Furthermore current pin-configurations and all possibilities from the pin-settings will be displayed.
Syntax:
°<type><pin no>~<count>~<divider>~<format>°
Additional substitutions° ⇒ separator (degree) <type> ⇒ scan value or configuration
<count> ⇒ count of adjacent pins (physical or virtual) - only with type "V" <divider> ⇒ divider for values of adjacent pins - only with type "V" <format> ⇒ preformated value output, eg: "%d" "lm75" Example:
var ledGruen="°c20°";
Displays the current configuration at pin 20 and assigns it to the variable "ledGruen" in the java script of a HTML-page
<body>°v*°</body> Displays all values of all pins on HTML-page <body>°V200~2~°C ~lm75°</body> returns preformated temperature data of TWI-sensor 200,201 (divider = °C) Besides the scanning of the pins you can also readout information about the embedded web server and its current configuration.
Syntax:
°i<parameter>°
Comments:° ⇒ separator (degree) i ⇒ command for information request <parameter> ⇒ information type
syntax:
°!<comment text>°
The whole text betwenn the seperators will be removed.
° ⇒ Separator (degree) ! ⇒ Sign for comments Commands:
The Commands are instructions for the microcontroller of the myEthernet. They cause a modification of one or more pins.
Thereby the output values and the setting of the pins can be controlled.
Syntax:
<command>=°<type><pin-Nr>~<value>°
<command> ⇒ command for myEthernet
° ⇒ separator (degree) with the code of characters «%B0» <type> ⇒ change value or configuration
~ = Value association sign (tilde) with the code of characters «%7E» <value> ⇒ new output value at decimal or hexa-decimal format i.e.: 0x20 Example:
http://192.168.20.98/?myConfigCmd=%B0c0%7E0x1%B0
set pin 0 to digital-ouput
http://192.168.20.98/?myChangeCmd=%B0o21%7E0%B0
switch off the red LED at pin 21 If many HTTP-requests taking place on the same pin it is necessary to send an extra parameter. This is needed to avoid the us of the browser cache. The previous modified example should be:
http://192.168.20.98/?myChangeCmd=%B0o21%7E0%B0&423801
The blue value is a random value and can be generated via java script. |