Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
I have been building a web based PICO -w simple website to send battery and solar information monitoring a remote site. My problem is that my code works fine for a while then stops and a browser returns a page not found error.
As a test I reduced the code to that in the manual. Same problem. This what I've done:
Latest copy of MMBASIC installed using "WebmiteRP2040V6.00.03.uf2" on the 2040 PICO-w. Wifi setup, working and connected to router. OPTION TCP SERVER PORT 80 My .bas file installs via command prompt in Windows using TFTP -i 192.168.0.57 PUT "battbasic.bas" (as per the manual sample) My index.html installs the same way (manual sample with a line to print). The system works for maybe 30 mins - sometimes less sometimes more, then the site is no longer found. Once this happens I can no longer ping the address although the LED is flashing on the Pico W. I've scattered "watchdog 10000" around, used OPTION AUTORUN, no change. On TerraTerm connected via the USB serial I receive the following:
1 DIM buff%(4096/8) 2 WEB TCP INTERRUPT WebInterrupt 3 DO 4 '<do some processing here>' 5 LOOP 6 7 SUB WebInterrupt 8 LOCAL a%, p%, t%, s$ 9 FOR a% = 1 To MM.INFO(MAX CONNECTIONS) 10 WEB TCP READ a%, buff%() 11 p% = LINSTR(buff%(),"GET") 12 t% = LINSTR(buff%(),"HTTP") 13 If (p% <> 0) And (t% > p%) Then 14 WEB TRANSMIT PAGE a%,"index.html" 15 ENDIF 16 NEXT a% 17 END SUB
Any help would be appreciated. I also tried on another new PICO-W but same problem. Thanks John
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10386
Posted: 09:35am 01 Sep 2025
Copy link to clipboard
Print this post
Can't test as away from home but the symptoms suggest the wifi may be dropping out. Try with the Pico close to the router but not too close - say 3m/10ft
Thanks for the reply matherp. As it was already about 2m from the router I tried moving it further away near my PICO-W working watering controller. With the watering controller off it operated for about 45 minutes. I then connected to my master router (DHCP for my network)and about 12m away. Similar problem except after the crash it presented an error message of "No response to request from connection no. 1". It responded to a ping and a <ctrl>C then returned me to a cursor. John