Git Product home page Git Product logo

Comments (3)

khoih-prog avatar khoih-prog commented on June 7, 2024

Thanks for using the library.

Can you provide more information so that the issue you're experiencing can be duplicated, identified and debugged, if exists.

As you know, the process, even though seems simple, requires the perfect cooperation of every underlying layers, such as

  1. Nano-33-IoT core and hardware
  2. WiFiNINA_Generic/WiFiNINA library
  3. This WebSockets2 library
  4. Your home network: routers, settings, etc.
  5. The WebSockets Server you're connecting to
  6. many more

It's advisable that you isolate the issue to be related to 1., 2. and/or 3.by using another board, such as ESP8266/ESP32. If the problem persists, then you'll know it's possible 3-6. If this is the case, it's better that you post on the issue on ArduinoWebsockets Issue as it's ESP32/ESP8266 related.

You can also use this independent SimpleWebSocket example of WiFiWebServer Library to verify if the issue is related to this WebSockets2 library.

You have to post the whole sketch, so that other people can duplicate the issue. Otherwise, nobody can have psychic power to guess what's wrong or waste time to recreate, and the issue will be closed.

from websockets2_generic.

AdamMarciniak avatar AdamMarciniak commented on June 7, 2024

Hello, I'm using the example sketch but I've modified it to send a string message every 16ms.

I've tried using it on my ESP32 and it does not have the same problem. The ESP32 works perfectly fine and the data comes in smoothly and quickly. So this leads me to believe it's:
a) not my server
b) not my internet connection
c) possibly not the library? Maybe there's a problem all Arduino Nano 33 IOT's have that causes this?

I've tried using the WifiWebServer library example you suggested on the Nano 33 iot but it still has the same problem.

Here's some of the code I used from that example. I modified it to send data every 16ms.

void setup()
{
  Serial.begin(115200);
  while (!Serial);

  Serial.print("\nStarting SimpleWebSocket on " + String(BOARD_NAME));
  Serial.println(" with " + String(SHIELD_TYPE));

  // check for the presence of the shield
#if USE_WIFI_NINA
  if (WiFi.status() == WL_NO_MODULE)
#else
  if (WiFi.status() == WL_NO_SHIELD)
#endif
  {
    Serial.println(F("WiFi shield not present"));
    // don't continue
    while (true);
  }

#if USE_WIFI_NINA
  String fv = WiFi.firmwareVersion();
  if (fv < WIFI_FIRMWARE_LATEST_VERSION)
  {
    Serial.println(F("Please upgrade the firmware"));
  }
#endif

  // attempt to connect to WiFi network
  while ( status != WL_CONNECTED)
  {
    Serial.print(F("Connecting to SSID: "));
    Serial.println(ssid);
    // Connect to WPA/WPA2 network
    status = WiFi.begin(ssid, pass);
  }

  // you're connected now, so print out the data
  printWifiStatus();
  wsClient.begin("/capstone/ws?clientId=1");
}

void loop()
{
  

  while (wsClient.connected()) 
  {
    // send a hello #
    wsClient.beginMessage(TYPE_TEXT);
    wsClient.print("1,234,562,456,777");
    wsClient.endMessage();

 
    delay(16);
  }

  Serial.println("disconnected");
}

from websockets2_generic.

khoih-prog avatar khoih-prog commented on June 7, 2024

As I suspect, I now think this is the issue is deeper inside the WiFiNINA library and/or Nano-33-IoT.

Can you make a simple sketch using WiFiNINA to demonstrate the issue, then post on WiFiNINA Issue.

Also search there to see if there is similar issues/fixes.

Hope you find out a solution. Please update then.

I'm closing the issue now because it's not something related to this library.

from websockets2_generic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.