Arduino MKR1000 unable to connect to iPhone WiFi hotspot


I’m working on making a soil moisture monitor for a final project for one of my college classes. This is the first time I’ve had to use Arduino and I’m having a few issues. I’m still living at school, and for some reason the school WiFi will not allow me to connect for this project, so I’m using the hotspot on my iPhone.

I’ve tried using both the web editor and the app, and I’m getting different errors on the web editor than the app. On the web editor the error I’m getting is “Serial port busy” and on the app, I just get “Attempting to connect to SSID:…” on a loop.

This is the code I’ve been given by my professor, minus the information I would have to enter, which he told me was fine:


#include <WiFi101.h>
const char WEBSITE = “”; //pushingbox API server
const String devid = “XXXXXXXX”; //device ID on Pushingbox for our Scenario
const char* MY_SSID = “XXXXXXX”;
const char* MY_PWD = “XXXXXXXX”;
// the loop routine runs over and over again forever:
void loop() {
// initialize serial communication at 9600 bits per second:
// read the input on analog pin 0:
delay(1000); // delay in between reads for stability
float moistureHum = analogRead(A1);
moistureHum = (1023 - moistureHum) * 100/1023;
// print out the value you read:

Serial.print(“Humidity: “);
Serial.print(” %\t”);
Serial.println("\nSending Data to Server…");
// if you get a connection, report back via serial:
WiFiClient client; //Instantiate WiFi object, can scope from here or Globally
//API service using WiFi Client through PushingBox then relayed to Google
if (client.connect(WEBSITE, 80))
client.print(“GET /pushingbox?devid=” + devid

  • “&moistureHum=” + (String) moistureHum);

// HTTP 1.1 provides a persistent connection, allowing batched requests
// or pipelined to an output buffer
client.println(" HTTP/1.1");
client.print(“Host: “);
client.println(“User-Agent: MKR1000/1.0”);
//for MKR1000, unlike esp8266, do not close connection
Serial.println(”\nData Sent”);
void printWifiStatus() {
// print the SSID of the network you’re attached to:
Serial.print("SSID: ");
// print your WiFi shield’s IP address:
IPAddress ip = WiFi.localIP();
Serial.print(“IP Address: “);
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print(“signal strength (RSSI):”);
Serial.println(” dBm”);

int status = WL_IDLE_STATUS;
void setup() {
//Initialize serial and wait for port to open:
while (!Serial)
; // wait for serial port to connect. Needed for native USB port only
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println(“WiFi shield not present”);
// don’t continue:
while (true);
// attempt to connect to Wifi network:
while (status != WL_CONNECTED)
Serial.print("Attempting to connect to SSID: ");
//Connect to WPA/WPA2 network.Change this line if using open/WEP network
status = WiFi.begin(MY_SSID, MY_PWD);
// wait 10 seconds for connection:

Serial.println(“Connected to wifi”);


This project is due 12/9, and I was told that I could still get a passing grade if it were unfinished, but I would really like to finish this project.

Thanks so much :slight_smile:

What made you think that your question has anything to do with the Website and Forum section which is clearly stated to be for "Improvements for the web system, applications to moderator, spam, etc."? I have suggested to the Moderator to move it to the Networking section.

This sort of carelessness makes unnecessary work for the Moderators.



Your topic was Moved to it's current location / section as it is more suitable.

Link you bypassed on the way in !
Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.