| Menu | JAQForum Ver 19.10.27 |
Forum Index : Microcontroller and PC projects : PicoMiteWeb firmware for the Pico W - now making real progress
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. |
||||||
> 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 |
||||||
"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. Edited 2023-02-10 09:55 by phil99 |
||||||
Sorry HTML is over my head, I will have to leave this and do something more in my comfort zone. |
||||||
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. |
||||||
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. |
||||||
Put the file "thermo" on the pico but same response. |
||||||
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 |
||||||
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. |
||||||
Thanks Phil99 & Lizby, I got it finally. Learning veeery slooowly. |
||||||
The pico flash file system is case sensitive. That is likely to catch a few Windows users out. Jim |
||||||
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 |
||||||
Please ignore the above post. It was the router. All is good, now. |
||||||
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 |
||||||
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 |
||||||
|
||||||
That looks better |
||||||
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 |
||||||
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. |
||||||
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 |
||||||
| The Back Shed's forum code is written, and hosted, in Australia. |