Skip to first unread message

Akanksha G

unread,
Jul 31, 2018, 3:28:21 AM7/31/18
to MIT App Inventor Forum
Hello there!
I am trying to turn an LED on and off over wifi using an app. When I click on  ON/OFF, a request is sent and I get a message on screen telling me whether LED is on or off. The app is working fine, but I have 2 concerns:

1. When I press ON/OFF button, I get the following error:
"Error 1101:Unable to get a response with the specified URL:http://192.168.1.2/ON (or OFF)"
I am able to get rid of the error by using when screen1.ErrorOccured. However, I'd like to know what the error means and be able to prevent it. 

2. When I press ON/OFF, the message "LED status" continues to change whether or not I am connected to the internet. Is there a way to check internet connectivity and whether the state of the LED is actually changing?

Thank you in advance for your help.

Regards
Akanksha
App Blocks.png
App Screen.PNG

Juan Antonio

unread,
Jul 31, 2018, 6:15:25 AM7/31/18
to mitappinv...@googlegroups.com

Michael Moreau

unread,
Jul 31, 2018, 4:40:00 PM7/31/18
to MIT App Inventor Forum
This fixed the same problem I had with my ESP32.
ErrorFix.JPG
Message has been deleted

Akanksha G

unread,
Aug 1, 2018, 1:23:10 AM8/1/18
to MIT App Inventor Forum
Thank you Juan and Micheal for your replies. I was able to remove the error by using screen1.ErrorOccured block but I want to understand why the error occurs. Also, is there a way to check whether the app is connected to the internet or not when a button is pressed?

Michael Moreau

unread,
Aug 1, 2018, 1:37:49 AM8/1/18
to mitappinv...@googlegroups.com
The error occurs because you are asking for something and not getting a response. The app is waiting for information. I haven't looked into how to send a response from the arduino.

You could always ping a server to find out if you have internet.

Akanksha G

unread,
Aug 2, 2018, 1:14:23 AM8/2/18
to MIT App Inventor Forum
Thank you Michael. What you wrote made a lot of sense. Just one question though, what did you mean by "ping a server to find out if you have internet"?
(Sorry if this sounds like a basic thing to know, I am a newbie). 

Michael Moreau

unread,
Aug 2, 2018, 1:55:45 AM8/2/18
to MIT App Inventor Forum
Its not exactly pinging but this will work. You just check to see if you get a response from a known good website.



Reply all
Reply to author
Forward
0 new messages