-->
Page 1 of 8

trying to port some code from nodemcu

PostPosted: Fri Oct 02, 2015 6:32 pm
by xtal
This is a try to port a small amount of code over from nodemcu,, and of course it don't work, since I really don't know what to do....the save option is not working for me pops up the security login junk and does not save.

I tried RUN on the following code snip ... It's a simple HTML header with some java for a counter , I suspect the syntax is bad,but don't get any indication . I'm not sure if this basic can even handle the all the characters.. :cry:
I thought I would get a dhcp connection , How do I check if connection accomplished?
So how do I display the page :?:

Code: Select all ssid = "12345-NETGEAR"
password = "mikeis12345"
rfh='15'

connect ssid password
 
   
wprint {<!DOCTYPE HTML>\n<html lang="en-US">\n<head><meta http-equiv="refresh" content= rfh ></head>\n}
wprint {<script type = "text/javascript">\nvar timeInSecs;\nvar ticker;}
wprint {function startTimer(secs){ timeInSecs = parseInt(secs)-1; ticker = setInterval("tick()",1000); } }
wprint {function tick() { var secs = timeInSecs; if (secs>0) {timeInSecs--;} else {clearInterval(ticker); startTimer(rfh);}}               
wprint {document.getElementById("countdown").innerHTML = secs;} startTimer(rfh); </script>}
wprint {<body><div><table bgcolor="Lawngreen" border="1" cellpadding="5"><th><h1>ESP8266 Blinker Thing!</h1></th>'}
wprint {<td><IMG SRC= &s_img LEFT="1" WIDTH="120" HEIGHT="60" BORDER="1"></td>
wprint {<th id="countdown"> rfh </th></table><div><br>}

wait



This is the actual html page I'm trying to use :mrgreen:

Code: Select all<!DOCTYPE HTML>
<html lang="en-US">
<head><meta http-equiv="refresh" content="15" ></head>
<script type = "text/javascript">
var timeInSecs;
var ticker;function startTimer(secs){
 timeInSecs = parseInt(secs)-1;
 ticker = setInterval("tick()",1000);
 }
 function tick() {
 var secs = timeInSecs;
 if (secs>0) {timeInSecs--;} else {clearInterval(ticker);
 startTimer(15);}document.getElementById("countdown").innerHTML = secs;} startTimer(15);
 </script>
 <body>
 <div>
 <table bgcolor="Lawngreen" border="1" cellpadding="5">
 <th><h1>ESP8266 Blinker Thing!</h1></th>
 <td><IMG SRC="http://i.imgur.com/KS1dPa7.png" LEFT="1" WIDTH="120" HEIGHT="60" BORDER="1"></td>
 <th id="countdown">15</th>
 </table>
 <br>
 <div>
 <textarea name="cmd1s" cols="70" rows="14"></textarea>
 </div>
 <br>
 <div>
 <textarea name="cmd2s" cols="70" rows="6"></textarea>
 </div>
 <br>
 <div>
 <table bgcolor="Yellow" border="1" cellpadding="5">
 <tr>
 <th>Sensor</th>
 <th>TempC</th>
 <th>TempF</th>
 <th>PPMcntr</th>
 <th>PPM__</th>
 <th>Adj__1</th>
 <th>Adj__2</th>
 </tr>
 <tr>
 <td>DS18B20P</td>
 <td>25.9</td>
 <td>78.6</td>
 <td>43708</td>
 <td>1676</td>
 <td>1644.9</td>
 <td>1644.2</td>
 </tr>
 <tr>
 <th>Probe-K</th>
 <th>Pool-PH</th>
 <th>PH-Adj</th>
 <th>ADC Value</th>
 </tr>
 <tr>
 <td>01.0</td>
 <td>7.0</td>
 <td>7</td>
 <td bgcolor="Red">902</td>
 </tr>
 </table>
 </div>
 <br>
 <form action="" method="POST">
<input type="submit" name="m_do" value="BLINK" style="padding:5px;10px;">
<input type="submit" name="m_do" value="RD_ADC" style="padding:5px;10px;">
<input type="submit" name="m_do" value="TEMP_DN" style="padding:5px;10px;">
<input type="submit" name="m_do" value="TEMP_UP" style="padding:5px;10px;">
<br>
"CMD:"<input type="text" name="m_do" value="" maxlength="100" style="padding:5px;10px;">
<input type="submit" value="Submit">
</form>
<br>
</body>
</html>

Re: trying to port some code from nodemcu

PostPosted: Sat Oct 03, 2015 9:56 am
by xtal
after a successful save the test code looks like this :mrgreen:
but still non functional :(
Code: Select allssid = "12345-NETGEAR"
password = "mikeis12345"
rfh="15"

connect ssid password
 

wprint %7B<!DOCTYPE HTML>An<html lang="en-US">An<head><meta http-equiv="refresh" content= rfh ></head>An%7D
wprint %7B<script type = "text/javascript">Anvar timeInSecs;Anvar ticker;%7D
wprint %7Bfunction startTimer(secs)%7B timeInSecs = parseInt(secs)-1; ticker = setInterval("tick()",1000); %7D %7D
wprint %7Bfunction tick() %7B var secs = timeInSecs; if (secs>0) %7BtimeInSecs--;%7D else %7BclearInterval(ticker); startTimer(rfh);%7D%7D
wprint %7Bdocument.getElementById("countdown").innerHTML = secs;%7D startTimer(rfh); </script>%7D
wprint %7B<body><div><table bgcolor="Lawngreen" border="1" cellpadding="5"><th><h1>ESP8266 Blinker Thing!</h1></th>'%7D
wprint %7B<td><IMG SRC= &s_img LEFT="1" WIDTH="120" HEIGHT="60" BORDER="1"></td>
wprint %7B<th id="countdown"> rfh </th></table><div><br>%7D

wait

Re: trying to port some code from nodemcu

PostPosted: Sat Oct 03, 2015 10:06 am
by xtal
Question> When you do a save just where are you saving it. I thought it was going to flash, but after stopping and restarting webpage I cannot open what I thought was saved :roll:

The basic web page seems to be jumping between 2 addresses, maybe the code is trying to work :?

Re: trying to port some code from nodemcu

PostPosted: Sat Oct 03, 2015 12:09 pm
by xtal
tried the following also ---didn't work
I was on ipa 192.168.1.28
had the code in the edit screen
http://192.168.1.28/edit?name=web.bas&s ... =ssid+%3D+
clicked run ipa now 192.168.1.28/run
serial out 1234567890 failed wifi connect -0- -0-
now http://192.168.1.28/input? - blank page - then page not visable
now 192.168.1.28 and .13 no connect
now 192.168.4.1 connects and displays data between lines

Now how did this become part of the AP ????????

----------------------------------
ESP8266 Blinker Thing!

An
----------------------------------






ssid = "12345NETGEAR81"
password = "mikeisgreat12345"
ipa = "192.168.1.13"
rfh="15"
connect ipa
wprint "<h1>ESP8266 Blinker Thing!</h1>An"
wait