![]() |
Forum Index : Microcontroller and PC projects : PicoMiteWeb firmware for the Pico W - now making real progress
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
bigmik![]() Guru ![]() Joined: 20/06/2011 Location: AustraliaPosts: 2947 |
Hi Jim, The link times out for me.. I will try it again later. Regards, Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6266 |
Sorry Mick, that was a silly programming error. Try again Edit: I is obvious that it is not going to work as is. I will have to set up a simpler site tomorrow. Jim Edited 2023-02-13 17:38 by TassyJim VK7JH MMedit |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10180 |
That's a bug caused by me being lazy and using printf with no USB connected. Will fix in next version |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10180 |
V5.07.07a12 PicoMiteWebV5.07.07a12.zip Fixes bug where the Pico-W would repeatedly crash on boot if no USB terminal connected |
||||
Michal Senior Member ![]() Joined: 02/02/2022 Location: PolandPosts: 125 |
Can PicoW with PicoMiteWeb be overclocked and if so how much? Michał |
||||
goc30![]() Guru ![]() Joined: 12/04/2017 Location: FrancePosts: 435 |
![]() There is progress. I was able (finally) to enter my 3 minimum options "System" and lcdpanel without blocking the card. However, after entering the WIFi option, I had to restart the pico (powet off/power on) because I couldn't do anything anymore. After the restart, I have wifi. A little more effort and the picoW under picomite will be almost as good as under Arduino |
||||
Hans![]() Senior Member ![]() Joined: 18/10/2022 Location: CanadaPosts: 116 |
@matherp Peter; A12 works a charm now with no console needed, just power and go! I also like how you masked the password on the WIFI option. ![]() ![]() Thank you very much for the changes ![]() Hans ... |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6266 |
My attempt at hosting the MMEdit help files on a pico was a failure. It worked well for local network use but the connections from the real world did not go well. My Help system uses frames and the first connection requires 3 "pages" to get loaded. External users couldn't get that far. I changed to a simple page that refreshes every 15 seconds. That went better for a few hours. There were a few successful connections and I assume that most of then were halted by the user, not my pico. I even had a web crawler visit. [23:06:16] 23 23:06:16 robots.txt [23:06:18] 404 robots.txt [23:06:29] 24 23:06:29 index.html after 3 hours, things fell over. [02:42:50] 38 02:42:50 index.html [02:42:52] 39 02:42:52 favicon.ico [02:45:07] 40 02:45:07 index.html [03:00:05] Error: Invalid address - resetting [03:00:07] Port: COM12 removed Disconnected Port: COM12 inserted Connected to COM12 at 115200 PicoMiteWeb MMBasic Version 5.07.07a11 [03:00:07] Copyright 2011-2023 Geoff Graham [03:00:07] Copyright 2016-2023 Peter Mather [03:00:07] [03:00:08] Connecting to WiFi... [03:00:11] failed to connect. [03:00:11] Starting server at 0.0.0.0 on port 80 [03:00:11] > At 0245 local time (UTC +11) there was a page request and then nothing until 0300 when Error: Invalid address - resetting. The 15 minutes between the last request and the rest is interesting. I have observed various times for this but 15 minutes is the longest. The reset would be OK except, on my network/router, the WiFi logon fails and always needs two reboots to get an address. I will try a different access point and one that I can get more details from (Mikrotik). Much of the time, once I have the WiFi connected, the bas program has disappeared so I have to reload. The flash drive survives. Jim VK7JH MMedit |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3347 |
Without having any real understanding of how it might work with the PicoMiteWeb, I thought/hoped that javascript might work, since as I understand it, execution is on the PC side. I have a little html file which presents Day of Week, Month, Day, Year, Time (with the time updated second by second). This works when I just put the local address of the file in a browser line: file:///C:/dl/micromite/_picomite/PicoMiteWeb/clock.htm ![]() When I try to serve it from the PicoMiteWeb, I get a syntax error: >run ntp address 162.159.200.123 got ntp response: 13/02/2023 15:26:41 String is GET / HTTP sending page [33] WEB transmit page ii%,"clock.htm" Error : Expression syntax > Here's the HTML: <html> <div id="clockbox"></div> <script type="text/javascript"> var tday=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; var tmonth=["January","February","March","April","May","June","July","August","September","October","November","December"]; function GetClock(){ var d=new Date(); var nday=d.getDay(),nmonth=d.getMonth(),ndate=d.getDate(),nyear=d.getFullYear(); var nhour=d.getHours(),nmin=d.getMinutes(),nsec=d.getSeconds(),ap; if(nhour==0){ap=" AM";nhour=12;} else if(nhour<12){ap=" AM";} else if(nhour==12){ap=" PM";} else if(nhour>12){ap=" PM";nhour-=12;} if(nmin<=9) nmin="0"+nmin; if(nsec<=9) nsec="0"+nsec; var clocktext=""+tday[nday]+", "+tmonth[nmonth]+" "+ndate+", "+nyear+" "+nhour+":"+nmin+":"+nsec+ap+""; document.getElementById('clockbox').innerHTML=clocktext; } GetClock(); setInterval(GetClock,1000); </script> <html> Am I doing something wrong, and/or is there a way to get this to work on the PicoMiteWeb (the file is named "clock.htm")? PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3347 |
I don't know if it's coincidence or not, but with the a12 firmware, XMODEM R locks up about half the time, and I have to powercycle to get the ">" prompt again. I never had this happen with prior releases. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
TheMonkeys![]() Regular Member ![]() Joined: 15/12/2022 Location: AustraliaPosts: 59 |
Hi, Lisby. You'll need to put your javascript into a separate file eg "getclock.js" then add <script src="getclock.js" type="text/javascript"></script> to your HTML. also, you'll need to add ElseIf page$="getclock.js" Then Print "Sending script" WEB transmit file a%,"getclock.js","script/javascript" into the TCPrequest subroutine. The {} characters are being interpreted as tags for basic strings. Edited 2023-02-14 10:58 by TheMonkeys |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6266 |
What size files are you shifting? I have done 30k files without any issues. re your JavaScript. If you leave it in the HTML file, just double up on the opening curly brace and all will be well again. function GetClock(){{ It just won't run correctly when you test it on your local PC if you access the file directly. Jim VK7JH MMedit |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3347 |
Jim--these are the files. All except clock.html I had sent previously before I flashed a12: > files A:/ <DIR> . <DIR> .. 00:00 01-01-2000 4 bootcount 00:01 01-01-2000 1024 clock.html 00:00 01-01-2000 1152 favicon.ico 00:00 01-01-2000 27904 gh.bas 18:44 13-02-2023 4160 gh.html 00:01 01-01-2000 4096 gretempl.txt 00:02 01-01-2000 3712 small.jpg 00:01 01-01-2000 1024 web.bas 2 directories, 8 files With the doubled "{{", I now get "Sending page", but in the browser, "This page cannot be found". (I noticed that my html code ended with "<html>", not "</html>". I changed it, but no difference.) > load "clock.html" > list <html> <div id="clockbox"></div> <script type="text/javascript"> VAR tday=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; VAR tmonth=["January","February","March","April","May","June","July","August","September","October","November ","December"]; Function GetClock(){{ VAR d=new Date(); VAR nday=d.getDay(),nmonth=d.getMonth(),ndate=d.getDate(),nyear=d.getFullYear(); VAR nhour=d.getHours(),nmin=d.getMinutes(),nsec=d.getSeconds(),ap; If (nhour==0){ap=" AM";nhour=12;} ElseIf (nhour<12){ap=" AM";} ElseIf (nhour==12){ap=" PM";} ElseIf (nhour>12){ap=" PM";nhour-=12;} If (nmin<=9) nmin="0"+nmin; If (nsec<=9) nsec="0"+nsec; VAR clocktext=""+tday[nday]+", "+tmonth[nmonth]+" "+ndate+", "+nyear+" "+nhour+":"+nmin+":"+nsec+ap+""; document.getElementById('clockbox').innerHTML=clocktext; } } GetClock(); setInterval(GetClock,1000); </script> </html> > The .bas file: > load "web.bas" > list Dim buff%(512) WEB tcp interrupt TCPrequest WEB ntp -5 main: Do Loop 'Sub poll Sub TCPrequest Local p%, t%, ii%, ss$ For ii%=1 To MM.Info(max connections) If Not MM.Info(TCP request ii%) Then Continue For LongString clear buff%() WEB tcp read ii%,buff%() p%=LInStr(buff%(),"GET") t%=LInStr(buff%(),"HTTP") ' If LLen(buff%()) Then Print "_________________________________________________" If Not LLen(buff%()) Then Continue For ss$="" If (p%<>0) And (t%<>0) And (t%>p%) Then ss$=LGetStr$(buff%(),p%,t%-p%+4) Print "String is ",ss$ EndIf If Instr(ss$,"small") Then Print "sending picture" WEB Transmit FILE ii%,"small.jpg","image/jpeg" ElseIf Instr(ss$,"favicon") Then Print "sending icon" WEB Transmit FILE ii%,"favicon.ico","image/vnd.microsoft.icon" ElseIf Instr(ss$,"HTTP") Then Print "sending page" WEB transmit page ii%,"clock.html" EndIf Next ii% End Sub > PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3347 |
@TheMonkeys -- Thanks for your suggestion. I tried it, and got closer. I'm getting a response to the browser--but the page is blank. If I "view source", I see the html code but not the js code. The PicoMiteWeb says it is sending the js code file. It's too late in the day here for me to be able to make sense of what I may be doing wrong. I'll try again tomorrow. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6266 |
@lixby You need to replace all instances of a single { with {{. Any html file a single { indicates the start of a variable name. The double {{ is MMBasic's signal to send a single { and not substitute a variable value. clock.html <html> <div id="clockbox"></div> <script type="text/javascript"> VAR tday=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; VAR tmonth=["January","February","March","April","May","June","July","August","September","October","November ","December"]; Function GetClock(){{ VAR d=new Date(); VAR nday=d.getDay(),nmonth=d.getMonth(),ndate=d.getDate(),nyear=d.getFullYear(); VAR nhour=d.getHours(),nmin=d.getMinutes(),nsec=d.getSeconds(),ap; If (nhour==0){{ap=" AM";nhour=12;} ElseIf (nhour<12){{ap=" AM";} ElseIf (nhour==12){{ap=" PM";} ElseIf (nhour>12){{ap=" PM";nhour-=12;} If (nmin<=9) nmin="0"+nmin; If (nsec<=9) nsec="0"+nsec; VAR clocktext=""+tday[nday]+", "+tmonth[nmonth]+" "+ndate+", "+nyear+" "+nhour+":"+nmin+":"+nsec+ap+""; document.getElementById('clockbox').innerHTML=clocktext; } } GetClock(); setInterval(GetClock,1000); </script> </html> Jim VK7JH MMedit |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6266 |
fat finger induced double post Edited 2023-02-14 13:47 by TassyJim VK7JH MMedit |
||||
morgs67 Regular Member ![]() Joined: 10/07/2019 Location: AustraliaPosts: 77 |
@lizby @TassyJim I copied your "replace all instances of { with {{....." Along the way, several keywords now are in capitals or initial capitals , these need to be in lower case. Initial tmonth line has an extra CRLF. else if has turned into ElseIf, function into Function. Anyway, fixed these up and the clock now runs via the web page :) Tony |
||||
Plasmamac![]() Guru ![]() Joined: 31/01/2019 Location: GermanyPosts: 573 |
@ Michael Most of my pico or pico/w are runing up to 270000 . Above this Frequency it will never come back. I try some different pc and port and also some official cable , some of my thirst test let me go up to 300000 and above. But can’t get back without start problems. So i step up the Overclock frequency in babysteps to become S shure shot. Plasma |
||||
morgs67 Regular Member ![]() Joined: 10/07/2019 Location: AustraliaPosts: 77 |
Reformatted post from @TassyJim <html> <div id="clockbox"></div> <script type="text/javascript"> var tday=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; var tmonth=["January","February","March","April","May","June","July","August","September","October","November","December"]; function GetClock(){{ var d=new Date(); var nday=d.getDay(),nmonth=d.getMonth(),ndate=d.getDate(),nyear=d.getFullYear(); var nhour=d.getHours(),nmin=d.getMinutes(),nsec=d.getSeconds(),ap; if(nhour==0){{ap=" AM";nhour=12;} else if(nhour<12){{ap=" AM";} else if(nhour==12){{ap=" PM";} else if(nhour>12){{ap=" PM";nhour-=12;} if(nmin<=9) nmin="0"+nmin; if(nsec<=9) nsec="0"+nsec; var clocktext=""+tday[nday]+", "+tmonth[nmonth]+" "+ndate+", "+nyear+" "+nhour+":"+nmin+":"+nsec+ap+""; document.getElementById('clockbox').innerHTML=clocktext; } GetClock(); setInterval(GetClock,1000); </script> </html> Tony |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6266 |
Tony Thank you for that. My java-script knowledge is zero. I just knew the { needed tweaking for the web server. Jim VK7JH MMedit |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |