![]() |
Forum Index : Microcontroller and PC projects : 'Option wifi' within programs ?
Author | Message | ||||
DigitalDreams Newbie ![]() Joined: 03/05/2025 Location: United KingdomPosts: 13 |
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: 10158 |
No |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7735 |
A man of few words, is Peter. :) There will be good reasons why not though. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4975 |
It is always polite to speak with 2 words... NO, NO... ![]() ![]() ![]() ![]() Volhout . Edited 2025-05-28 00:38 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10158 |
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![]() Regular Member ![]() Joined: 13/08/2024 Location: NetherlandsPosts: 83 |
![]() |
||||
PhenixRising Guru ![]() Joined: 07/11/2023 Location: United KingdomPosts: 1278 |
![]() 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: 74 |
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: 2535 |
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 RUN 'start main program End Sub |
||||
toml_12953 Guru ![]() Joined: 13/02/2015 Location: United StatesPosts: 409 |
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: 2535 |
deleted Edited 2025-06-06 13:53 by phil99 |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6248 |
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 VK7JH MMedit |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4021 |
Should really use If n=15 Then Exit Sub 'give up! John |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10158 |
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: 4021 |
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: 2535 |
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: 74 |
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. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |