-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with connection to internet to Adafruit IO server #174
Comments
There sounds like an issieu with both IAS and adafruit IO wanting to make use of the WIFI at the same time. Have you tried using "IAS.WiFiDisconnect();" to free the connection for adafruits " io.connect;" ? |
Sure, using "IAS.WiFiDisconnect();" is the first thing that came to my mind, and it did not work too. As I noticed later, the origin of problem seems unclear to me, because if the problem is IAS and adafruit IO wanting to make use of the WIFI at the same time, then the problem will appear after I call IAS, but what happens, is that even if IAS.begin() is called in code after Adafruit IO code related to connection, the connection fails. |
Could you put up a link to the adafruit library you are using? |
yes sure |
Looking at the code of the adafruit library i see it uses MQTT to communicate with the adafruit server. (forgot to ask, but im presuming an ESP32 here) Do not use the " setCallHomeInterval();" as this will cause problems with the MQTT connection to the adafruit.io service. Instead, use IAS.CallHome(); in your code at the apropriate time (whenever you decide to update). Also use a delay after IAS.begin so the code has some time to finish running. |
I am using ESP8266. `IOTAppStory IAS(COMPDATE, MODEBUTTON); // Initialize IotAppStory IAS.begin(); Even if Those 2 lines are After calling adafruit io, the connection of adafruit does not proceed.This means, that the code is being stuck in while loop before even it reaches IAS.begin(): ` In previous trials, I started my code with IAS.begin() and other necessary functions. It worked nicely and I could upload codes over internet, but when adafruit connection code comes, it never connects to server. so what appears to me, that IAS.begin() can corrupt adafruit connection regardless where IAS.begin() was called, and this is very strange point. Also as I could see, adafruit call does not corrupt IAS.begin(). |
We have had several connection issieus resembling this behavior with ppl using MQTT connections in the past, usually the awnser to this was seperating the use of the wifi connections. Could you add delay(2000); after IAS.begin(); |
If this doesnt work, would you mind posting a barebones version of your code so we can have a look at it here? |
Hi @mamech any progress with this issue? |
Sorry for long silence. I was just busy with some things. I am preparing backbone version, but just I noticed that its performance little bit different from the problem happening with original code. Anyway I will make some more tests and give you the code with my remarks. |
ok after several trials, the backbone version has somewhat different performance from the full code I was testing before, but from what I see now, Adafruit io connects well weather before or after the IAS call, the problem only now happens with IAS itself if it is called after adafruit connection. `// Adafruit IO Publish Example /************************** Configuration ***********************************/ // edit the config.h tab and enter your Adafruit IO credentials #include <IOTAppStory.h> // IotAppStory.com library /************************ Example Starts Here *******************************/ // this int will hold the current count for our sketch // set up the 'counter' feed void setup() { // start the serial connection // wait for serial monitor to open Serial.println("Connecting to Adafruit IO"); // connect to io.adafruit.com // wait for a connection // we are connected IOTAppStory IAS(COMPDATE, MODEBUTTON); // Initialize IotAppStory IAS.begin(); // Run IOTAppStory } void loop() { // io.run(); is required for all sketches. // save count to the 'counter' feed on Adafruit IO // increment the count by 1 // Adafruit IO is rate limited for publishing, so a delay is required in }` |
by the way, I updated Adafruit io library to be 4.0.2 |
@mamech |
Hi there
First of all I should show my appreciation of the nice idea and nice service of IoTAppStory, really helpful.
I tried to integrate a code I develop for IoT application using Adafruit IO server with your IoTAppStory. I noticed the following problem.
I connect to AdafruitIO using:```
and it connects smoothly, but if I call IAS.begin(); before or even after the above shown code, the connection to adafruit IO never happens and it keep trying forever.
I think that this may be due some internal declarations from IAS.begin() . What looks weird to me, is that that IAS.begin() is blocking connection to server wherever it is called, even if it is called after code that is used for connection. Dos this mean that something happens during compilation that corrupts any sort of internet connection other than the one used with IoTAppStory?
The text was updated successfully, but these errors were encountered: