ESP8266 BASIC
  • Home
  • Documentation
    • Editor Interface
    • Flashing Instructions
    • Language Reference
    • FAQ
    • Videos
    • Examples
      • ESP8266-projects.com
      • Wifi Station & AP Examples
      • GPIO & PWM & Servo Example
      • GUI Example
      • Hello World Example
      • Graphics Example
      • Blink example
      • I2C READING DS1321 REAL TIME CLOCK
      • Timer Example
      • MSG URL Usage
      • MSG URL (Advanced)
      • DS18B20 Wifi Thermostat
      • CSS Example
      • WIFI Scanner Example
      • Graphic Clock Example
      • Analog Input Graph
  • Flashing Instructions
  • Download
  • Forum
  • Store
  • Home
  • Documentation
    • Editor Interface
    • Flashing Instructions
    • Language Reference
    • FAQ
    • Videos
    • Examples
      • ESP8266-projects.com
      • Wifi Station & AP Examples
      • GPIO & PWM & Servo Example
      • GUI Example
      • Hello World Example
      • Graphics Example
      • Blink example
      • I2C READING DS1321 REAL TIME CLOCK
      • Timer Example
      • MSG URL Usage
      • MSG URL (Advanced)
      • DS18B20 Wifi Thermostat
      • CSS Example
      • WIFI Scanner Example
      • Graphic Clock Example
      • Analog Input Graph
  • Flashing Instructions
  • Download
  • Forum
  • Store

MSG URL (Advanced) ​(3.0 branch only)

This is a universal program that will allow for arbitrary I/O pin input and output. It will allow you to us your browser or shell on a PC to control any I/O pin on the device and query a pins input status. 

On your pc you create a bat file for shell script.
If you are on windows you can download wget from the following site. 
https://eternallybored.org/misc/wget/ or from the link below.
wget.exe
File Size: 2863 kb
File Type: exe
Download File

​If on linux you are all set already. 

The code here will allow for arbitrary io control and reading. 

If you are connected to your your esp through a router change the IP in the example below to that of the ESP8266 module.

​BAT FILE OR SHELL SCRIPT: 

​wget "http://192.168.4.1/msg?pin=2&stat=1&action=po" -q -O -

BASIC CODE:

​msgbranch [mybranch]
print "You can send msgs to the esp and do things based on accessing a URL"
wait
[mybranch]
MyReturnMsg = "Not a valid msg received"
pinNo = val(msgget("pin"))
pinStatus = val(msgget("stat"))
pinAction = msgget("action")

if pinAction == "po" then
   io(po,pinNo,pinStatus)
   MyReturnMsg = "good"
end if
if pinAction == "pi" then
   MyReturnMsg = io(pi,pinNo)
end if
if pinAction == "pwo" then
   io(pwo,pinNo,pinStatus)
   MyReturnMsg = "good"
end if
if pinAction == "pwi" then 
   MyReturnMsg = io(pwi,pinNo)
end if
if pinAction == "ai" then 
   MyReturnMsg = io(ai)
end if
print "DOne with retrn code"
msgreturn MyReturnMsg
wait
Powered by Create your own unique website with customizable templates.
  • Home
  • Documentation
    • Editor Interface
    • Flashing Instructions
    • Language Reference
    • FAQ
    • Videos
    • Examples
      • ESP8266-projects.com
      • Wifi Station & AP Examples
      • GPIO & PWM & Servo Example
      • GUI Example
      • Hello World Example
      • Graphics Example
      • Blink example
      • I2C READING DS1321 REAL TIME CLOCK
      • Timer Example
      • MSG URL Usage
      • MSG URL (Advanced)
      • DS18B20 Wifi Thermostat
      • CSS Example
      • WIFI Scanner Example
      • Graphic Clock Example
      • Analog Input Graph
  • Flashing Instructions
  • Download
  • Forum
  • Store