Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:46 12 Jun 2025 Privacy Policy
Jump to

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.

Forum Index : Microcontroller and PC projects : 'Option wifi' within programs ?

Author Message
DigitalDreams
Newbie

Joined: 03/05/2025
Location: United Kingdom
Posts: 13
Posted: 09:48am 27 May 2025
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 10158
Posted: 10:35am 27 May 2025
Copy link to clipboard 
Print this post

No
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7735
Posted: 02:16pm 27 May 2025
Copy link to clipboard 
Print this post

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: Netherlands
Posts: 4975
Posted: 02:34pm 27 May 2025
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 10158
Posted: 03:42pm 27 May 2025
Copy link to clipboard 
Print this post

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: Netherlands
Posts: 83
Posted: 05:29am 28 May 2025
Copy link to clipboard 
Print this post

  matherp said  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


 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1278
Posted: 05:35am 28 May 2025
Copy link to clipboard 
Print this post

  Volhout said  It is always polite to speak with 2 words...

NO, NO...      

Volhout
.


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: Australia
Posts: 74
Posted: 11:42pm 05 Jun 2025
Copy link to clipboard 
Print this post

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: Australia
Posts: 2535
Posted: 01:07am 06 Jun 2025
Copy link to clipboard 
Print this post

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 States
Posts: 410
Posted: 02:58am 06 Jun 2025
Copy link to clipboard 
Print this post

  DigitalDreams said  Can we have this allowed within programs please Peter ?. It would be MUCH easier moving from one known wifi to another then....


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: Australia
Posts: 2535
Posted: 03:51am 06 Jun 2025
Copy link to clipboard 
Print this post

deleted
Edited 2025-06-06 13:53 by phil99
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6248
Posted: 05:16am 06 Jun 2025
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4021
Posted: 10:36am 06 Jun 2025
Copy link to clipboard 
Print this post

  phil99 said  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


Should really use
If n=15 Then Exit Sub 'give up!

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10158
Posted: 11:10am 06 Jun 2025
Copy link to clipboard 
Print this post

Should really use
If n=15 Then Exit Sub 'give up!

Both execute the same code
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4021
Posted: 12:34pm 06 Jun 2025
Copy link to clipboard 
Print this post

  matherp said  
Should really use
If n=15 Then Exit Sub 'give up!

Both execute the same code

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: Australia
Posts: 2535
Posted: 12:59pm 06 Jun 2025
Copy link to clipboard 
Print this post

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: Australia
Posts: 74
Posted: 01:07am 10 Jun 2025
Copy link to clipboard 
Print this post

  TassyJim said  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


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.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025