Menu
JAQForum Ver 19.10.27

Forum Index : Microcontroller and PC projects : PicoMiteWeb firmware for the Pico W - now making real progress

   Page 4 of 8    
Posted: 11:08pm
09 Feb 2023
Copy link to clipboard
lizby
Guru

What is the output of "files"?

What is the code for the .bas program you're running?

Please list the html file you want to display.
 
Posted: 11:27pm
09 Feb 2023
Copy link to clipboard
palcal
Guru


> files
A:/
  <DIR>  .
  <DIR>  ..
00:00 01-01-2000          4  bootcount
00:08 01-01-2000       1152  favicon
00:11 01-01-2000        896  simpleweb
00:10 01-01-2000       3712  small
00:09 01-01-2000        896  test4
2 directories, 5 files
>
HTML file ?  I'm just trying to run Peters example
 
Posted: 11:46pm
09 Feb 2023
Copy link to clipboard
phil99
Guru


"HTML file ?  I'm just trying to run Peters example"

Is seems you need to turn this into a file with HTML extension.
eg Remote_Thermostat.html and save it to Pico A:/
- assuming you mean the one at the top of the previous page.

Edit. In the program code I see "thermo.html" so call it that.

  Quote  <html>
<head>
<title>
Remote Thermostat</title></head
<link rel="icon" type="image/x-icon" sizes="16x16" href="data:image/png;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAP//ADMA/wD/AAQAFf8AAAIACABZAP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAVQBVAAUABQUABQBQBVAFBQAFAFAFBQAAVQBVAAUFBQAAAAAABVAAAAAAAAAAAAAAAAAAACREMzERAAAAJkRDMxEQAAAmZEQzMREAAAZmREMzERAAAGZkRDMxEQAABmZEQzMREAAAZmREMzERAAAGZkRDMxH//wAAuzMAALrtAACa7QAArzMAAKv/AACf/wAA//8AAAA/AAAAHwAAAA8AAIAHAADAAwAA4AEAAPAAAAD4AAAA" />
<body>
<form name='f1' method='get' action='{pp$}'>
<h2 align='left'>Remote Thermostat Control System V1.0</h2>
Update Code: <input type='text' name='CODE' size='6' value='000000'>

<TABLE BORDER='1' CELLSPACING='0' CELLPADDING='5'>
<TR><TD>Heating</TD><TD{heating$}</TD></TR>
</TABLE>

<TABLE BORDER='1' CELLSPACING='0' CELLPADDING='5'><TR><TD></TD>
<TD>Temperature</TD></TR><TR><TD>Current</TD><TD> {str$(currenttemp,4,1)}°C
</TD><TR><TD>Max</TD><TD> {str$(maxtemp,4,1)}°C
</TD><TR>
<TD>Min</TD><TD> {str$(mintemp,4,1)}°C
</TD>
</TABLE>

<input name='RESET' type='checkbox' value='YES' onClick='this.form.submit()'>
Reset Max/Min

<TABLE BORDER='1' CELLSPACING='0' CELLPADDING='5'><TR><TD>Thermostat</TD>
<TD><input name='RB' type='radio' value='R0' {checked$(0)} onClick='this.form.submit()'> Off
</TD>
<TD><input name='RB' type='radio' value='R1' {checked$(1)} onClick='this.form.submit()'> {stemp}
</TD>
<TD><input name='RB' type='radio' value='R2' {checked$(2)} onClick='this.form.submit()'> {stemp+1}
</TD>
<TD><input name='RB' type='radio' value='R3' {checked$(3)} onClick='this.form.submit()'> {stemp+2}
</TD>
<TD><input name='RB' type='radio' value='R4' {checked$(4)} onClick='this.form.submit()'> {stemp+3}
</TD>
<TD><input name='RB' type='radio' value='R5' {checked$(5)} onClick='this.form.submit()'> {stemp+4}
</TD>
<TD><input name='RB' type='radio' value='R6' {checked$(6)} onClick='this.form.submit()'> {stemp+5}
</TD>
<TD><input name='RB' type='radio' value='R7' {checked$(7)} onClick='this.form.submit()'> {stemp+6}
</TD>
<TD><input name='RB' type='radio' value='R8' {checked$(8)} onClick='this.form.submit()'> {stemp+7}
</TD>
<TD><input name='RB' type='radio' value='R9' {checked$(9)} onClick='this.form.submit()'> {stemp+8}
</TD>
<TD><input name='RB' type='radio' value='R10' {checked$(10)} onClick='this.form.submit()'> {stemp+9}
</TD>
<TD><input name='RB' type='radio' value='R11' {checked$(11)} onClick='this.form.submit()'> On
</TD>
</TABLE>

</form>
</body></html>

Edited 2023-02-10 09:55 by phil99
 
Posted: 12:03am
10 Feb 2023
Copy link to clipboard
palcal
Guru


Sorry HTML is over my head, I will have to leave this and do something more in my comfort zone.
 
Posted: 12:24am
10 Feb 2023
Copy link to clipboard
phil99
Guru


As far as I can see all you need to do is copy-and-paste the above into a text file (Notepad) and save it as "thermo.html" on the Pico.
The program then reads it to create the web page.
 
Posted: 01:15am
10 Feb 2023
Copy link to clipboard
palcal
Guru


I'll have a go, I once hosted a weeb site for our local golf club, I got a Domain Name and used a third party app called KOMPOSER, I eventually had quite a good site running until they got a professional to take over.
 
Posted: 01:37am
10 Feb 2023
Copy link to clipboard
palcal
Guru


Put the file "thermo" on the pico but same response.
 
Posted: 02:09am
10 Feb 2023
Copy link to clipboard
lizby
Guru

It looks like you didn't include the file type in you xmodem command, e.g.:
xmodem r "test4.html" and "favicon.ico", etc.

This is what I get for "files":
> files
A:/
  <DIR>  .
  <DIR>  ..
00:00 01-01-2000          4  bootcount
12:38 05-02-2023       1152  favicon.ico
14:24 05-02-2023       3840  geotempl.txt
00:54 01-01-2000      27136  gh.bas
17:59 09-02-2023       4161  gh.html
00:05 01-01-2000       3968  gh1.html
00:01 01-01-2000      23808  greenhouse.bas
13:29 09-02-2023       4096  gretempl.txt
00:05 01-01-2000       3584  gretempl2.txt
00:10 01-01-2000        868  server.bas
12:40 05-02-2023       3712  small.jpg
12:35 05-02-2023          0  test
12:39 05-02-2023        896  test4.html
00:00 01-01-2000          0  xx.bas

The PicoMiteWeb is serving HTML files. The .bas program you are running has something like:

WEB transmit page a%,"test4.html"

If you don't have a file of the exact name you are trying to serve, the command
will fail (but it looks like an error message should be provided if the file is
not found--if that is what is happening).

I would suggest ERASEing all your files and re-doing the XMODEM Rs.

Might be a good idea to do a WEB ntp -5 before you use XMODEM so you will have rational dates.
(Replace "-5" with the offset you need for your time zone.)

~
Edited 2023-02-10 12:13 by lizby
 
Posted: 02:19am
10 Feb 2023
Copy link to clipboard
phil99
Guru


Beat me to it.
This bit of the program shows the files that are needed. And as noted above the names must match exactly.

  If UCase$(page$)="INDEX"  Then
    Print "sending test page"
    pp$=page$
    WEB transmit page a%,"test4.html"
  ElseIf UCase$(page$)="THERMO" Then
    Print "sending thermostat page"
    pp$=page$
    WEB transmit page a%,"thermo.html"
  ElseIf page$="small.jpg" Then
    Print "Sending picture"
    WEB transmit file a%,"small.jpg","image/jpeg"
  ElseIf page$="favicon.ico" Then
     Print "sending favicon"
     WEB Transmit FILE a%,"favicon.ico","image/vnd.microsoft.icon"
  Else
      s$=LGetStr$(buff%(),1,Min(255,LLen(buff%())))
      Print s$
      WEB transmit code a%, 404
  EndIf


"test4.html"
"thermo.html"
"small.jpg"
"favicon.ico"

Still waiting for my Pico W so can't test it yet.
 
Posted: 02:23am
10 Feb 2023
Copy link to clipboard
palcal
Guru


Thanks Phil99 & Lizby, I got it finally. Learning veeery slooowly.
 
Posted: 02:38am
10 Feb 2023
Copy link to clipboard
TassyJim
Guru


The pico flash file system is case sensitive.
That is likely to catch a few Windows users out.

Jim
 
Posted: 07:57am
10 Feb 2023
Copy link to clipboard
TheMonkeys
Regular Member


A quick question.

Having updated to Alpha7, when (re-)starting, the W, the heartbeat flashes momentarily, (about 1/10th Sec) and then It just sits there.

Have I missed something?

EDIT: That being said, after 2 or 3 attempts it came good.

When I try the sample code above,

I receive the message "Error: Invalid address - resetting"
Then the usual boot message and I.P. is displayed.

What does that error indicate?

That error was the ntp request, but I'm having problems accessing
http://192;168.0.55/thermo (yes,the file is there and named correctly).
Edited 2023-02-10 18:58 by TheMonkeys
 
Posted: 11:25am
10 Feb 2023
Copy link to clipboard
TheMonkeys
Regular Member


Please ignore the above post.

It was the router.

All is good, now.
 
Posted: 07:10pm
10 Feb 2023
Copy link to clipboard
matherp
Guru

V5.07.07a8


PicoMiteWebV5.07.07a8.zip

Fixes a potential memory allocation error
Bring all other functionality in-line with the standard firmware

Added capability for inverted serial signals - use 'inv' in the OPEN command (same as MM2)
Improved memory allocation for PIO MAKE RING BUFFER
At the command prompt ONLY you can now use A: or B: to switch disk as well as DRIVE "A:" and DRIVE "B:"
FILES command now deletes variable to avoid "Out of Memory" error
New command: AUTOSAVE APPEND ' appends the incoming serial data stream to the existing program. Perfect for adding library routines to new code
 
Posted: 09:42pm
10 Feb 2023
Copy link to clipboard
TassyJim
Guru


a8 still shows up as a7 although it IS the new uf2 file in the zip

 Device E; changed
E:\PicoMiteWebV5.07.07a8.uf2
Port: COM12 inserted

Connected to COM12 at 115200
PicoMiteWeb MMBasic Version 5.07.07a7
Copyright 2011-2023 Geoff Graham
Copyright 2016-2023 Peter Mather


Jim
 
Posted: 10:50pm
10 Feb 2023
Copy link to clipboard
matherp
Guru

Don't understand that


PicoMiteWebV5.07.07a8.zip
 
Posted: 10:56pm
10 Feb 2023
Copy link to clipboard
TassyJim
Guru


That looks better
 
Posted: 07:05am
11 Feb 2023
Copy link to clipboard
TassyJim
Guru


alpha8 is working well.
My 'sensitive' DHT22 was getting a bad reading about one in 100.
With a8 it hasn't failed at all with over 1500 good readings.

I can make the pico lock up.
Using Firefox.
I have a small program running with a 15 second refresh.
If I tab away from the link in Firefox, I can usually tab back again and it will eventually run its timer down and request a new page (successfully).
If I tab away exactly while a page is being sent, the ACK is not sent to the pico and the pico sulks. It needs a hard reset to recover.

Is it practical to have a (possibly configurable) timeout on the waiting for ACK?

All things considered, you have come a long way in a short time.

Jim
 
Posted: 08:27am
11 Feb 2023
Copy link to clipboard
matherp
Guru

Jim

I've also seen this lockup but can't replicate ion a reliable way. There is already a timer on the transmit which should close the connection if it fails but that isn't catching the problem.

If you can provide a reliable protocol to create the lockup it would be greatly appreciated.
 
Posted: 08:53am
11 Feb 2023
Copy link to clipboard
TassyJim
Guru


I will see what I can do.
It takes a lot of manual attempts to get the timing right to cause the problem but I 'think' I might be able to come up with a program that does it.

A job for tomorrow.

Jim
 
   Page 4 of 8    
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026