Giter Club home page Giter Club logo

Comments (9)

ubidefeo avatar ubidefeo commented on May 24, 2024

hi @GitHubRea
Not really clear what the issue is.
If you are referring to the constant not being recognised this might be a minor issue.
Does the code compile and run properly?
If it does not compile and run then it's indeed a bug :)

Also, could you post the code in a snippet?
that allows us to test it doing copy/paste :)

from arduino-ide.

GitHubRea avatar GitHubRea commented on May 24, 2024

Hello ubidefeo
sorry the delay.

here the code.
Thx

#include <SPI.h>
#include <WiFiNINA.h>

char ssid[] = "xxx";
char pass[] = "xxx";
int status = WL_IDLE_STATUS;
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x7D, 0x54 };

WiFiServer server(80);

void setup() {
  // initialize serial:
  Serial.begin(9600);
  Serial.println("Attempting to connect to WPA network...");
  Serial.print("SSID: ");
  Serial.println(ssid);

  status = WiFi.begin(ssid, pass);
  if ( status != WL_CONNECTED) { 
    Serial.println("Couldn't get a wifi connection");
    while(true);
  } 
  else {
    server.begin();
    Serial.print("Connected to wifi. My address:");
    IPAddress myAddress = WiFi.localIP();
    Serial.println(myAddress);

  }
}

void loop(void) {
WiFiClient client = server.available();

//two variables to hold your temperatures
float temperatureIndoor;
float temperatureOutdoor;

if (client) {
    Serial.println("new client");
    //an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        Serial.write(c);
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connnection: close");
          client.println();
          
          temperatureIndoor = 22.77;
          temperatureOutdoor = 15.55;
        
          client.print("{\"arduino\":[{\"location\":\"indoor\",\"celsius\":\"");
          client.print(temperatureIndoor);
          client.print("\"},");
          client.print("{\"location\":\"outdoor\",\"celsius\":\"");
          client.print(temperatureOutdoor);
        
          client.print("\"}]}");
          client.println();
          break;
        }
        if (c == '\n') {
          currentLineIsBlank = true;
        } 
        else if (c != '\r') {
          //you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();
    Serial.println("client disonnected");
  }
}

from arduino-ide.

ubidefeo avatar ubidefeo commented on May 24, 2024

@GitHubRea
It is working for me out of the box.
If you cannot compile or the IDE cannot see library definitions it might mean that you haven't installed any cores yet.
Check the README on the main GitHub page for this project and you'll see.
Let me know if this fixes your issue

The Arduino Pro IDE does not provide pre-installed cores, to have board support you have to install a core by using the menu

Tools -> Board Manager...

from arduino-ide.

GitHubRea avatar GitHubRea commented on May 24, 2024

Hello ubidefeo,
you are right, it is not possible to compile. But I installed the needed core and library.(see attachments)
I am using the MKR Wifi 1010 port.

ArduinoProIde_1.pdf
ArduinoProIde_2.pdf

Thanks for the effort!

from arduino-ide.

ubidefeo avatar ubidefeo commented on May 24, 2024

unfortunately I cannot reproduce the issue,
let's see if someone else has an idea of what could be troubling your setup

from arduino-ide.

GitHubRea avatar GitHubRea commented on May 24, 2024

Hello I am so sorry,

I found the problem for my issue.
I saved the project to an other folder, not in the Arduino basic root.
ArduinoIdePro_library.pdf
And in this project folder there is no library folder included.
I copied the library folder in this project folder. After that it was compiling.

So I think I should handle my projects in the installed root of Arduino.
ArduinoIdePro_correctFolder.pdf
What do you think?

Thanks a lot!

from arduino-ide.

GitHubRea avatar GitHubRea commented on May 24, 2024

... is it possible to set the folder root of library somewhere in the ProIDE.
Because in standard IDE it is possible to save setches in other folders.
Thx and sorry for my boor english.

from arduino-ide.

ubidefeo avatar ubidefeo commented on May 24, 2024

@GitHubRea
I know it's been a long time, but this works for me on the latest Alpha 0.1.4

we're cleaning up old issues.
@per1234 I saw you can still replicate this, I have noticed that as soon as you trigger the Language Server by selecting a board it starts working for me

from arduino-ide.

per1234 avatar per1234 commented on May 24, 2024

I am able to reproduce the issue of the incorrect language server results for the WiFiNINA library with older versions of the IDE (e.g. 2.0.0-beta.3), but not with 2.0.0-beta.12.

So I'll close this as fixed. If anyone is able to still reproduce the issue with the latest version of the IDE, please comment here with full details and I'll investigate.

Note: While attempting to bisect, I had annoying experiences of the bad state persisting into later IDE versions until I cleared the data folders, after which I could no longer reproduce the issue with those later IDE versions.

from arduino-ide.

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.