Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:37 27 Nov 2024 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 : [array%()]

Author Message
Dinosaur

Guru

Joined: 12/08/2011
Location: Australia
Posts: 311
Posted: 09:54am 19 Nov 2023
Copy link to clipboard 
Print this post

Hi All

Could someone please give me some guidance on declaring and using the following array.
  Quote  
WEB SCAN [array%()]
Scans for all available wifi connections. If ‘array%()’ is specified the output
will be stored in a Longstring, otherwise output will be to the console.


Using it without the Array works by displaying the various SSID's
I have tried various combinations of declaring and using it , but to no avail.
Nothing like FreeBasic anyway.

It seems like the only routine I can use to confirm the availability of the target SSID,
without actually trying it and creating an error

Regards
Regards
Hervey Bay Qld.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9122
Posted: 10:52am 19 Nov 2023
Copy link to clipboard 
Print this post


DIM a%(1024)
web scan a%()
longstring print a%()
if linstr(a%(),"MySSID") then .....


BUT you can only use web scan when you are connected to a network - this is a limitation of the WebMite
Edited 2023-11-19 20:54 by matherp
 
Dinosaur

Guru

Joined: 12/08/2011
Location: Australia
Posts: 311
Posted: 11:29am 19 Nov 2023
Copy link to clipboard 
Print this post

Hi All

Thanks matherp.
I guess the 1024 is max characters.

The reason I want to us this, is because none of the WEB commands have any feedback.
The screen (if it was fitted) would show the error.

Using OPTION WIFI SSID$, PassWd$ at boot up may or may not succeed,
(Pico & Pi Zero racing each other) if it doesn't,
then I can take action to reboot and try again.

I have it all working now on a Rpi-Hotspot, but it has to work unattended and recover from power shutdown.
Regards
Hervey Bay Qld.
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 12:23pm 19 Nov 2023
Copy link to clipboard 
Print this post

  Quote  I guess the 1024 is max characters.

Longstring packs 8 characters into each 64 bit integer so I think a%(1024) can hold 8k characters.

edit
Web Scan seems to output 91 characters + CR or CRLF per line so 12 integers / line.
You can size the array to suit the maximum entries you are likely to get.
Edited 2023-11-19 22:31 by phil99
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6099
Posted: 07:14pm 19 Nov 2023
Copy link to clipboard 
Print this post

MM.INFO(WIFI STATUS) will tell you if you are connected.
VK7JH
MMedit   MMBasic Help
 
Dinosaur

Guru

Joined: 12/08/2011
Location: Australia
Posts: 311
Posted: 08:13pm 19 Nov 2023
Copy link to clipboard 
Print this post

Hi All

Go looking for bread crumbs and find a whole loaf of bread.
Thanks for the replies.

The easiest is MM.INFO(WIFI STATUS)
There are some traps though.
I have DHCP on Manual and Fixed IP address on the Zero.
If there is any PC looking to connect using DHCP Auto, Wifi Status will still return 1
but WEB MQTT Connect will report that Wifi is not connected.

This happened because I am using my Desktop to connect to the Pico.
So turning the Wifi off on that solved that.

Once again many thanks.
Edited 2023-11-20 06:14 by Dinosaur
Regards
Hervey Bay Qld.
 
Print this page


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

© JAQ Software 2024