Git Product home page Git Product logo

arest-esp8266's Issues

Unable to receive Rest request

#include <ESP8266WiFi.h>
#include <aREST.h>

// Create aREST instance
aREST rest = aREST();

// WiFi parameters
const char* ssid = "wifi_name";
const char* password = "password";

//#define LISTEN_PORT 80

WiFiServer server(88);

//udf
int testFunction(String value){
Serial.println("Received rest request");
}

void setup(void) {
// put your setup code here, to run once:

Serial.begin(115200);
rest.function("test", testFunction);

// Give name & ID to the device (ID should be 6 characters long)
rest.set_id("1");
rest.set_name("esp8266");

// Connect to WiFi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(700);
Serial.print(".");
Serial.print(WiFi.status());
}
Serial.println("");
Serial.println("WiFi connected");

// Start the server
server.begin(115200);
Serial.println("Server started");

// Print the IP address
Serial.println(WiFi.localIP());

}

void loop() {
// put your main code here, to run repeatedly:
// Handle REST calls
WiFiClient client = server.available();
if (!client) {
return;
}
while(!client.available()){
delay(1);
}
rest.handle(client);
}

code Gets compiled and uploaded but when i try to access the ip address of the board in a browser its shows
"This site can’t be reached #ipaddres# refused to connect".
and there is no output in a serial monitor

set mode from sketch

Hello.
first i want to say u did a great job here! keep on!

everytime i unplug my esp8266 for a power source i need to set the mode.
(http://192.168.1.9/mode/2/o)
the i can control the GPIO.
is it possible to set the mode right from the Arduino IDE sketch?

thank you!

not enough memory on nodemcu 0.9.6

When I open a terminal and run dofile("basic.lua") it works okay but I want to have it start on boot so I created init.lua with only the dofile. With that I get a not enough memory error related to aREST.lua. I didn't have this problem at all on my other esp loaded with nodemcu 0.9.5.

ESP8266 Not enough memory error

Hi,

I've tried to put the aREST.lua and the basic.lua file on my esp8266. With the last NodeMCU firmware released. This is the error i'm getting:

lua: error loading module 'aREST' from file 'aREST.lua': not enough memory

How to deal with it?

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.