Skip to content

Pb with aREST Library (M.Schwarz) #98

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

Closed
BomberX opened this issue Dec 24, 2016 · 3 comments
Closed

Pb with aREST Library (M.Schwarz) #98

BomberX opened this issue Dec 24, 2016 · 3 comments

Comments

@BomberX
Copy link

BomberX commented Dec 24, 2016

Hello

First of all thanks for this nice piece of work to provide a good driver for the SSD1306.
I'm having an issue when trying to compile it along with the M.Schwarz aREST library (see https://github.com/marcoschwartz/aREST) to use it for a ESP8266 domotic project.
It seems there is a conflict problem at compilation time, but I'm not sure it is coming from Marco's library or from this one. To reproduce, install aREST library and try to integrate one of your sample code in the example files from Marco, like the one below:

/*
  This a simple example of the aREST Library for the ESP8266 WiFi chip.
  See the README file for more details.

  Written in 2015 by Marco Schwartz under a GPL license.
*/

// Import required libraries
#include <ESP8266WiFi.h>
#include <aREST.h>
#include "SSD1306.h" // alias for `#include "SSD1306Wire.h"`
// Include the UI lib
#include "OLEDDisplayUi.h"

SSD1306  display(0x3c, D3, D5);
OLEDDisplayUi ui ( &display );

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

// WiFi parameters
const char* ssid = "your_wifi_network_name";
const char* password = "your_wifi_network_password";

// The port to listen for incoming TCP connections
#define LISTEN_PORT           80

// Create an instance of the server
WiFiServer server(LISTEN_PORT);

// Variables to be exposed to the API
int temperature;
int humidity;

// Declare functions to be exposed to the API
int ledControl(String command);

void setup(void)
{
  // Start Serial
  Serial.begin(115200);

  // Init variables and expose them to REST API
  temperature = 24;
  humidity = 40;
  rest.variable("temperature",&temperature);
  rest.variable("humidity",&humidity);

  // Function to be exposed
  rest.function("led",ledControl);

  // 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(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");

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

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

    ui.init();

  display.flipScreenVertically();
}

void loop() {

  // Handle REST calls
  WiFiClient client = server.available();
  if (!client) {
    return;
  }
  while(!client.available()){
    delay(1);
  }
  rest.handle(client);

}

// Custom function accessible by the API
int ledControl(String command) {

  // Get state from command
  int state = command.toInt();

  digitalWrite(6,state);
  return 1;
}

We got the following compilation error:
"error: ArialMT_Plain_10 causes a section type conflict with __c
const char ArialMT_Plain_10[] PROGMEM ={ "

@agalloch21
Copy link

remove all "PROGMEM" in OLEDDisplayFonts.h and now it worked for me.

And this link may help.#2078

@stale
Copy link

stale bot commented May 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 18, 2019
@marcelstoer marcelstoer added stale and removed wontfix labels May 24, 2019
@stale stale bot removed the stale label May 24, 2019
@stale
Copy link

stale bot commented Nov 20, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 20, 2019
@stale stale bot closed this as completed Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants