Connecting to an iPhone's WiFi and using its 3G/4G web connection?

Hi,

Great project, it certainly makes you think of lots of potential applications.
Whilst reading over some of the documentation I was wondering, would the following configuration be valid ?

Assume that the CS3000 setup had been completed, could I use an iPhones WiFi tethering network to connect to the SparkCore device - with the same iPhones 3G/4G connection being used to connect to the SparkCloud?

Best Regards

Keith

The iPhone (and Android) Tethering is an Access Point, so I think there will be no problem using the 3G/4G of your smartphone.

Yes, definitely! We’ve done this a number of times.

Thanks Zach! Great news :slight_smile:

I tried this at work earlier with one of my coworkers. We were having issues with the wireless network, and even trying a bridge with my MacBook to our wired network, but it seems the firewall is somehow too restrictive. So, we tried with my coworker using his Android phone to set up a hot spot/tethering and still got nowhere. I know it could have been any number of factors affecting our lack of success, but however much you theorize that it should work flawlessly, there’s obviously some exception.

That doesn’t mean that I’m going to stop trying. It’s always a challenge to overcome when I can’t get around a firewall. :wink:

1 Like

I’ve also been trying to do this with using another person’s iPhone with the spark core app to connect to my iPhone’s wifi hotspot but it always timesout.

I’ve also tried to do it through CoolTerm application but that doesn’t connect either

@johnwlawrence88 can you provide more detail for why the CoolTerm set-up isn’t working?

The set-up works fine, I can input my wifi details and it updates the board but doesn’t connect to my iPhone. I’ve also tried the app in my iPad but that fails as well. It would be good as a add-in to the iPhone app.

The iPhone uses WPA2 authentication but is there a limit to the amount of characters the SSID can be ?

If anyone has successfully tethered their core to with iPhone could you please share your process ?

Yes, it’s limited to 32 characters.

I’m a little confused on what you’re trying to do; are you creating a hotspot on your iPhone, and connecting the Core to that hotspot?

@zach Yes, I’ve never had any problems connecting anything else

I have done this on my own phone a number of times, without issue. Can you please provide more information about your set-up? Are you using the USB set-up? Is your password beyond the 32-character limit? Have you reset the memory of Wi-Fi networks on the Spark Core and tried again, in case you typed your password wrong? Please follow these troubleshooting instructions:

http://docs.spark.io/#/connect/troubleshooting

i’ve tried resetting the memory but that hasn’t helped is it because my iPhones SSID has spaces and an apostrophe ? “John Lawrence’s iPhone”

That should not be an issue. Has you been able to connect it to another network without problems?

yea no problem connecting to my home network, do you use an iPhone and what authentication type do you use ? could also be to do with the size of my password as i believe WPA2 needs to be exactly 13 characters

I use an Android phone most of the time but I have connected it to an iPhone hotspot. 13 characters should be fine (there is no such limitation on WPA2 passwords). Are you setting up the Core over USB?

I Tried it now from my Android phone.
Setup WPA tethering Wi-Fi hotspot.

Problem is that the Spark app on android then tells me the phone is not connected to wifi, and refused that I enter a SSID

Would be very handy for times when there is no AP arround.

Hi @diepes, as in the other thread we “meat” :wink: I have the same problem, but had worked my way round it by connecting another Android phone to my Android HotSpot phone and send the credentials to the :spark: Core from the connected phone.

It works, but it’s a pain and should not be necessary as proposed here ( https://community.spark.io/t/suggestions-for-enhancing-the-spark-app/2103/3 ) already.

“Some extra blurb to overcome ‘too similar’ rule”

When you setup your iPhone/Android as a hotspot, you won’t be able to use that device to setup a Core through the Spark.app. This isn’t a limit that be overcome, at least on the iPhone (not sure about Android) because the hotspot software is using the WiFi hardware on the phone as an AP. At this point user apps on the phone can’t access the WiFi at all, for all intents and purposes the WiFi is reported as being off.

The CC3000 WiFi module on the Core uses TI’s SmartConfig process, which looks for special broadcast packets that are sent in a way that allows unassociated devices to read the SSID and password and connect to the network.

So, when your iPhone is in personal hotspot mode, iOS doesn’t give the Spark.app access to WiFi. Unfortunately this isn’t something that can be overcome. So, you need to either upload the credentials to the Core via USB or use another iDevice/Android connected to the hotspot running the Spark.app. :smile:

A fix for this might be to add a way for the Spark Core to internally store several WiFi setups with the ability to switch between them through the MODE button. Maybe holding it down for 5 seconds could put it into a “WiFi Select Mode” or something. I imagine in this mode the light could pulse X times per second to show the currently selected mode. I.e., if you press the button twice after entering the mode, the light will flash two times per second to represent the second stored connection. @zach Do you think something like this is feasible?

@timb interesting to hear about the broadcast that leaks the wifi credentials to the spark.

A simpler suggestion would be that when reset to factory defaut, the spark is preconfigured for a default ssid and key e.g. ssid:spark wpa-key:spark

Then to setup just create the Hotspot with the right credentials, reset the spark, it connects and links to cloud, now phone can manage it through the cloud, probably not perfect either, not sure how the phone will now claim the spark. Maybe the wifi mac of the phone can be used to do the claim, or once the spark is connected to the Hotspot, ip broadcasts can be used to claim it.

@timb: Thanks for that interesting background info.

As far as I got the impression there must be a SSID/PWD repository on the :spark: Core.
I had my Core connected ti my home AP once and to my Android AP another time.
And ever since my Core can connect to either of them without any further ado - so I guess the different credentials must be stored on the Core and the bootup an “cloud keep alive” cycle will choose which one of the pre-defined networks to use.

I’d still like to know what the maximum number of storable SSID/PWD combinations might be and if it might be thinkable to access this repository somehow - e.g. readout the corrently stored SSIDs and maybe even push a new list of desired SSID/PWD combinations into the Core (? @zach)

Another weird thougt about Android AP: I guess the disconnected Core enters promiscuous WiFi mode to listen for any incoming packets. So would it be thinkable to either have an “unconnected” phone in non AP-mode to send out the packets expected by the Core or would there be a way to use the loopback 127.0.0.1 to relay 3G/4G packets to the WiFi side of the phone to get them broadcasted, or have an external server to bounce the credentials back to the phone which in turn relays them to the WiFi devices in its AP range?