Automatically connect to any open network in range?

Any way to programmatically have the CC3000 connect to any open visible wifi network? For a core that wanders around (in a car, or anything else that’s spark enabled), I’d like it to connect whenever it can and report in. I’ve search this forum, and looked into CC3000 documentation, but seems to be over my head…

Continuing the discussion from Using Spark Core in a standalone product changing wifi credentials?:

Hi @brianr,

This is definitely possible on the CC3000, the trick is changing the connection policy. At the moment we don’t have a friendly wrapper for this, but if you’re building locally it’s shouldn’t be too bad. If you change a few set_connection_policy calls in wlan_loop, and wlan_setup to something like this:

//try connecting to any open AP
wlan_ioctl_set_connection_policy(1, 0, 0).

I think it would be here-ish:

More info on the cc3000 behaviors here:

I hope that helps!


1 Like

Beyond that, the issue will be getting past the sign-on screen for most open hotspots (at least in US/EU.)

1 Like

Yikes, that’s a lot messier than I was hoping! I’ll give it a try a keep my fingers crossed! Thanks so much, @Dave!