Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Raspberry Pi / Function "GetInternetState()" doesn't work on Pi - only Windows

Author
Message
Yeshu777
4
Years of Service
User Offline
Joined: 26th Feb 2020
Location: Cymru
Posted: 25th Jul 2024 17:59
Hi All,

After testing on both platforms ( Raspian & Windows ) the GetInternetState() only appears to work on Windows.

Is there a simple work around for the Pi ? eg. an alternative method.

Cheers!

Yeshu777
Yeshu777
4
Years of Service
User Offline
Joined: 26th Feb 2020
Location: Cymru
Posted: 25th Jul 2024 18:34 Edited at: 25th Jul 2024 18:35
Ok,

Found a temporary solution... create a bash script, eg. checkwifi.sh

copy the following to the file..



This will create the bash script file as above, if not connected the ESSID will show "ESSID:off/any"



It's only a quick workaround, but does the trick

Yeshu777
Virtual Nomad
Moderator
18
Years of Service
Recently Online
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 25th Jul 2024 19:48 Edited at: 25th Jul 2024 19:49
the Pi is linux-based IIRC?

i wonder if it's working on linux at all but it does work on android, WIN and HTML for me. ie, not "only Windows"
Yeshu777
4
Years of Service
User Offline
Joined: 26th Feb 2020
Location: Cymru
Posted: 25th Jul 2024 22:31 Edited at: 25th Jul 2024 22:35
Hello there!, hope you're well..

I haven't tested on Android / HTML, so yes you are correct .. I was in a hurry to demo a project this afternoon and halfway through a meeting

The above workaround works for Pi / Linux - ( the GetInternetState() function always returns 1 on the Pi - and iOS judging by other posts, but can't confirm it )

I can now also scan for SSID's from an AppGameKit app ( on PI ) - enter the Password Key etc and configure the wifi without leaving the AppGameKit app.. great for a KIOSK mode style project.





All the best!

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-09-08 00:51:27
Your offset time is: 2024-09-08 00:51:27