DigitalDreams Regular Member Joined: 03/05/2025 Location: United KingdomPosts: 65
Posted: 09:48am 27 May 2025
Can we have this allowed within programs please Peter ?. It would be MUCH easier moving from one known wifi to another then....
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11636
Posted: 10:35am 27 May 2025
No
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8964
Posted: 02:16pm 27 May 2025
A man of few words, is Peter. :)
There will be good reasons why not though.
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5994
Posted: 02:34pm 27 May 2025
It is always polite to speak with 2 words...
NO, NO...
Volhout . Edited 2025-05-28 00:38 by Volhout
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11636
Posted: 03:42pm 27 May 2025
Getting the Webmite/Pico2-W to run reliably has been a nightmare - it's basically a c..p design. There is no chance I'm going to change anything on this port relating to anything to do with the wifi/web operations
Marcel27 Senior Member Joined: 13/08/2024 Location: NetherlandsPosts: 104
Posted: 05:29am 28 May 2025
PhenixRising Guru Joined: 07/11/2023 Location: United KingdomPosts: 2003
Posted: 05:35am 28 May 2025
Reminds me of an old friend talking to his 9 year-old daughter:
Friend: "So how's it going at school?" Daughter: "Fine" Friend: "Well can you expand upon that?" Daughter: "Fiiiiiiiiiiiiiiiiiinnnnnnnnnnnnnnnnnne" Edited 2025-05-28 15:36 by PhenixRising
damos Regular Member Joined: 15/04/2016 Location: AustraliaPosts: 81
Posted: 11:42pm 05 Jun 2025
I have the same problem, and would be quite happy for the system to reboot as soon as it hits the option wifi line of code.
I have a solution for myself. Switch the console to a serial port on the webmite and put the user interface on a second Picomite which sends the option wifi command to the webmite through the serial port. This has the advantage of being able to display friendly messages while the webmite is rebooting.
This means the webmite can have really simple code that just handles the HTTP requests and the picomite drives the touch screen and handles the UI. It can also be used as a watchdog for the webmite. The hardware watchdog really doesn't work well on HTTP as the code can regularly take longer than the watchdog time limit. I think you could output a "." every second or so to show the processor is running and the picomite will send a "^C" and cpu restart if it gets no serial activity for 10s. You could use the software watchdog on the webmite, but the serial activity means the picomite can also display an online indication.
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 3321
Posted: 01:07am 06 Jun 2025
That looks like a good solution. Below is what I have been using. It's adapted from the work of others here.
Sub MM.STARTUP Pause 200 On error skip 6 If MM.Info(ip address) = "0.0.0.0" Then 'test for WiFi link Print "WiFi not found"; Pause 8000 Print "...Rebooting now" CPU restart 'endless re-boot until WiFi found EndIf
Local float TZ = 10, DS = 1 'Time Zone, Daylight Saving Local integer n = 0 Do While Date$ = "01-01-2024" 'test internet connection, wait for date$ to update On error skip WEB NTP TZ+DS, "203.12.160.2" 'Second choice is 0.au.pool.ntp.org or 1.au.pool.ntp.org
Inc n : Print n; " tries", DateTime$(now), Pause 2000 If n=15 Then End Sub 'give up! Loop Print RUN 'start main program End Sub
toml_12953 Guru Joined: 13/02/2015 Location: United StatesPosts: 685
Posted: 02:58am 06 Jun 2025
I agree but, to be Zen about it, it is what it is. Edited 2025-06-06 13:37 by toml_12953
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 3321
Posted: 03:51am 06 Jun 2025
deleted Edited 2025-06-06 13:53 by phil99
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6546
Posted: 05:16am 06 Jun 2025
The webmite is easy to break but if you really want to try, this should work:
' print "started" END "option wifi "+chr$(34)+"myWiFi"+chr$(34)+","+chr$(34)+"myPWord"+chr$(34)
It causes a reboot with the new WiFi
Jim
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4352
Posted: 10:36am 06 Jun 2025
Should really use If n=15 Then Exit Sub 'give up!
John
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11636
Posted: 11:10am 06 Jun 2025
Should really use If n=15 Then Exit Sub 'give up!
Both execute the same code
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4352
Posted: 12:34pm 06 Jun 2025
I know - but it's wrong and if someone ever changes the parser or writes another it'll show up as a bug.
John
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 3321
Posted: 12:59pm 06 Jun 2025
In this instance it doesn't matter if it fails with an error as it has failed to find the internet and the program is abandoned.
damos Regular Member Joined: 15/04/2016 Location: AustraliaPosts: 81
Posted: 01:07am 10 Jun 2025
Thanks Jim,
I will give this a go before proceeding with my option. It basically does what I need and saves a second processor and serial port.