Signal Manager not working as expected

102 views
Skip to first unread message

diyhouse

unread,
Sep 25, 2018, 4:42:19 AM9/25/18
to mitappinv...@googlegroups.com
I have been struggling of late to 'set' a signal,.. via my app,.. so I have now tried ( having seen it confirmed on a video ) using 'Set Signal' with id =1234 and name = 'mark' and value = '44.4'.. ( no quotes btw ),..
Then trying to 'Get Signal',.. with the above name and id,.. and I cannot get a response,.. I have tried doing this with both chrome and edge,.. and I get no response from either browser.
What am I doing wrong,.. or have I got the wrong end of the stick, ( is there an issue with my router,.. should I open up a certain port ?)
BTW,.. if this is not the correct forum location, ( I am very much open to suggestions). where do you suggest for ai2 cloud communication issues.
Many tx

Evan Patton

unread,
Sep 26, 2018, 7:14:20 PM9/26/18
to MIT App Inventor Forum
Hi there,

I'm not sure I completely understand your question. You have these primitives get signal and set signal. Since your post is tagged as IOT related, are you referring to specific methods in the Bluetooth low energy extension? Are you using a third party extension? It might make sense to show a snapshot of the blocks related to your problem so we can help you debug.

Regards,
Evan

diyhouse

unread,
Sep 27, 2018, 1:25:01 PM9/27/18
to MIT App Inventor Forum
Thanks for assisting Evan,... At a higher level, I have a problem using an ESP8266 to write signals to the cloud www.ic2pro.com and I keep getting HTTP/1.1 502 Bad Gateway or 400 errors,.. something is failing during the submission/handshaking.
However, I have identified I cannot even write a signal via the set and get Signal used for testing signal values/state.
So hence I am essentially struggling to get off the starting blocks.

Ghica

unread,
Sep 28, 2018, 1:01:26 PM9/28/18
to MIT App Inventor Forum
If I try to go to your link, I just get bad gateway. 
Then I googled and found this: https://www.ic2cloud.com 
Is that what you are looking at? Did you follow their tutorials?
Cheers, Ghica.

diyhouse

unread,
Sep 28, 2018, 2:35:58 PM9/28/18
to MIT App Inventor Forum
Ghica,.. Many tx for your thoughts comments,.. yes I have followed their tutorials,.. as far as I know to the letter,... I am using a 64Auth,.. made up of my account login and API passwd,.. ( Not login Passwd, but separated by a colon),.. and a unique GUID....
But as I said in my original post why can I not set a 'wire' and then read it via the signal manager. Surely I must be able to write and read a signal via the web interface as the system knows who I am,.. as I am logged in!!

I appreciate the reality,.. I must be doing something wrong,.. or there is something funny in my network,.. as there are not thousands of other users complaining.... but it beats me as to what...

Ghica

unread,
Sep 28, 2018, 4:55:46 PM9/28/18
to MIT App Inventor Forum
Ok, I am not sure I want to try these tutorials too and I do not have the hardware, but so far it escapes me what this has to do with App Inventor. So a bit more explanation would be helpful.
Do you have an .aia to look at?
Cheers, Ghica

diyhouse

unread,
Sep 30, 2018, 6:02:58 AM9/30/18
to MIT App Inventor Forum
Hi many tx for responding again,.. "...what this has to do with App Inventor",.. you are correct my problem is talking to the cloud services,.. my app ( which run on an ESP8266 with Arduino code ),.. fails to talk and communicate with the cloud services and submit "wire states/values"... The only difference with this device is it uses wireless comms rather than a hard wired connection,.. ( I have ordered my self an arduino network card to replicate the test tutorials ). But!!,.. even if I try and set and read signal via the signal manager,.. that fails to... 

Question:-  do signals have to be first created in App-Inventor before they can be accessed via Signal manager? Or any other application?
my Arduino code is attached,.. 
Temp_Freezer_alarmV0.70a.ino

Juan Antonio

unread,
Sep 30, 2018, 6:09:35 AM9/30/18
to MIT App Inventor Forum
In this area:

you can get more information about ESP8266 and NodeMcu (ESP8266-12E)

diyhouse

unread,
Oct 4, 2018, 6:01:11 AM10/4/18
to MIT App Inventor Forum
Little confused Juan,.. as that is the group I thought I was in.... 
Ok I have received my Ethernet card to attach to my UNO board,.. and although running the base code ( with new Auth, and devID ), logging states temperature data has been sent. I cannot read it via the signal manager.
Lights flash on the network card as data/comms seems to take place,.. but nothing appears to be sent.
Note: I am not running the Appinventor app stuff yet, as I assume the Arduino app will create these "signals".

Juan Antonio

unread,
Oct 4, 2018, 3:43:16 PM10/4/18
to MIT App Inventor Forum
What Ethernet shield are you using? How is your code?

diyhouse

unread,
Oct 4, 2018, 5:00:48 PM10/4/18
to MIT App Inventor Forum
My Ethernet card "claims to be",.. Pro Network Ethernet Lan Shield Module Board W5100 For Arduino UNO Mega 1280 fpy.
I have run some test code that pulls a google page,.. as is responds and receives this data successfully,... responding with a "200" rather than a 502

Thanks for asking Juan,.... Have taken the base code changed the Auth and devID,.. and the code runs and says it has uploaded my Wire data,.. however I am still unable to read the data.
I have no way of knowing what has actually been sent to the server,. is there any handshaking that can be done.?
I have also run the base .aia app on my phone,.. this responds with the following error.

Select list item: Attempt to get item number 2 of a list of length 1: 
(<html> <head><title>502 Bad Gateway</title></head> <body bgcolor="white"> <center><h1>502 Bad Gateway</h1></center> </body> </html> )
Note: You will not see another error reported for 5 seconds.

To my lack of knowledge this could just be that there is no data to read,.. so hence 2nd field empty.
The 502 error is similar to the error I was getting with the ESP8266,..  I would love to know what the server receives from my system,.. and I still cannot set or read a Wire Signal
So still confused,..

Ghica

unread,
Oct 5, 2018, 3:06:22 AM10/5/18
to MIT App Inventor Forum
If you read the error message, you see that the URL you provided is wrong (bad gateway). You should consult the documentation of your shield to find out what it should be.
A good way to debug WiFi stuff is to use your browser on a PC instead of your app. Only when you know that everything is right, you fill in what is needed in your app.
Another advice is to look at the randomnerdtutorials (Google for it). He has really good stuff at his site, also covering your hardware and even talking about AI.
Cheers, Ghica.

diyhouse

unread,
Oct 6, 2018, 2:59:05 PM10/6/18
to mitappinv...@googlegroups.com
Hi Ghica many tx for your thoughts,.. The basic URL I am using is :-

"GET http://www.ic2pro.com:80/Wire/connector/set?id=68f27691-57a7-4c4c-a402&TEMPERATURE=22.69 HTTP/1.1"


I use the following Code to create this as follows:-

   eth.println("GET http://" + String(server) + ":" + String(port) + "/Wire/connector/set?id=" + devId + "&TEMPERATURE=" + temperature + " HTTP/1.1");

Followed by:-

    eth.println("Authorization: Basic " + auth);

    eth.println("Connection: close");

    eth.println();


Now I have tried so many variations of this line I have lost count,. including many different "client/eth.read" statments to see what is being returned,. these generally result in a 502 error or a 400 Error,.. as the 400 Error is a not found I have stuck with variations that give 502 errors,.. as this to me infers as you say there is something wrong with the presentation of the data,.. regrettably I am unable to identify what...

I have tried the HTTP line directly into a browser,. ( without the GET ) with different OS's,. different browsers, and different networks,.. however I am unsure how the "Authorization: basic Auth-base64code" line is able to follow in order to satisfy the login protocol etc. needless to say the single http line gives a 502 error.


Does there exist a python or something test script,.. that gives something that work to a test login?? Am I doing something just plain silly that has not hit me in the face...

Thanks for input.

Rgds

Ghica

unread,
Oct 7, 2018, 10:35:57 AM10/7/18
to MIT App Inventor Forum
I still think that this is not the right forum to ask your question. The documentation for your chip, google, etc. should provide you with answers how to make a basic setup. Then, if you know that, connecting to App Inventor should be easy.
Cheers, Ghica

Ghica

unread,
Oct 7, 2018, 10:38:08 AM10/7/18
to MIT App Inventor Forum
And, if I use your url, I get bad gateway, as expected. Which means your url is not right.
Cheers, Ghica

diyhouse

unread,
Oct 7, 2018, 1:37:07 PM10/7/18
to MIT App Inventor Forum
That is interesting to note that you to find the url incorrect,.. but to the best of my knowledge this is what comes from the test temperature Auduino examples,.. and yes it matches the code,.. ( as far as I can see ),.. do you have any tried and tested/working  examples that I maybe able to try, and compare to see where I am going wrong?
Many tx for your help.

Ghica

unread,
Oct 7, 2018, 3:22:19 PM10/7/18
to MIT App Inventor Forum

diyhouse

unread,
Oct 7, 2018, 3:45:16 PM10/7/18
to MIT App Inventor Forum
Yes,.. absolutely,... this was the base for my project,.. and all my dev. work has been based around this project,.. and its core code. only changing the devID and auth,.. made up of emailaddress:APIpasswd ( not login passwd ).

Juan Antonio

unread,
Oct 7, 2018, 5:06:39 PM10/7/18
to MIT App Inventor Forum
Hello diyhouse,

on the internet there is information about the W5100 shield, many years ago I did a tutorial of W5100, it's a bit long, it's in Spanish, maybe you might be interested in the code.

http://kio4.com/arduino/55Ethernet.htm About ESP8266-12E and humidity sensor in IoT, I did this tutorial, also in Spanish.

Ghica

unread,
Oct 7, 2018, 5:20:03 PM10/7/18
to MIT App Inventor Forum
Maybe you can post your .aia then.
Cheers, Ghica

Ghica

unread,
Oct 7, 2018, 5:26:21 PM10/7/18
to MIT App Inventor Forum
And, did you verify that step 5 and 6 of this tutorial run OK?

diyhouse

unread,
Oct 12, 2018, 10:34:44 AM10/12/18
to MIT App Inventor Forum
Guys,.. Many Tx for the links,.. There are some nice projects here, google translate works fine for the essence of the projects),.. the ethernet card one does not submit to ic2pro,.. but I have found that my submission gets to the ic2pro Server as I had the incorrect "auth" string,.. and connection was failing,.....  Once I corrected this,. the connection failure message went away.

BTW do you have some test URLs... so I may validate what is being sent is correct,.. are there any test perl scripts available?

Are there any tools that validate what is being submitted to the server..

Many Tx

Ghica

unread,
Oct 12, 2018, 12:48:16 PM10/12/18
to MIT App Inventor Forum
Again, you are in the wrong forum for test scripts or for finding out what you are sending to the server. Only when you have that fixed, we can help you to fix the AI app.
This is an App Inventor forum, not a ic2pro forum. Probably they have a forum too.

If you did the tutorial I gave you a link to, and did every detail, everything should be OK, even the AI app.
But if this is failing somewhere, maybe you can tell us what is going wrong and where, with as much detail as can can give.
Cheers, Ghica.

diyhouse

unread,
Oct 17, 2018, 3:24:23 PM10/17/18
to MIT App Inventor Forum
Guys,.. yes I have taken your advice and have been seeking help else where,... and the position I have got to is that what I am doing,.. Should work,...

the 502 bad gateway responses are technically incorrect,.. as I should be getting 401 errors relating to authentication required...

for example:-
submitting the following URL: into a web browser as suggested


Should give an authentication error, not a 502 bad gateway I am told.

clearly authentication is missing, but if the server responds with an 502 bad gateway,.. which is not the problem (correct answer would be 401 Authentication Required). As the "GET" api follows this up with the Host and authentication lines...

So it seems that this server is not responding as expected, at least from the point of view I am looking at,... but what also does not make sense is why other people are not seeing a problem,... is there something clever/unique  about putting a delay between the submitted lines or something,... that I am not aware of.

Who are the folks that control the ic2pro server? does anyone know how to contact these people?
many tx


Reply all
Reply to author
Forward
0 new messages