Initial commit

This commit is contained in:
2024-10-30 21:12:51 +01:00
commit e0c4e28bb4
9 changed files with 187 additions and 0 deletions

15
src/config.h Normal file
View File

@ -0,0 +1,15 @@
// WiFi settings
#define WIFI_SSID "Your_SSID"
#define WIFI_PASSWORD "Your_Password"
// OctoPrint settings
#define OCTOPRINT_HOST "your.octoprint.local"
#define OCTOPRINT_PORT 9000
#define OCTOPRINT_API_KEY "Your_OctoPrint_API_Key"
#define OCTOPRINT_API_REFRESH_INTERVAL 30000
// OLED display settings
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
#define FRAMERATE 8

7
src/main.cpp Normal file
View File

@ -0,0 +1,7 @@
#include "config.h"
#include "setup.h"
void loop() {
// put your main code here, to run repeatedly:
}

35
src/setup.h Normal file
View File

@ -0,0 +1,35 @@
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ArduinoJson.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <OctoPrintAPI.h>
String printerOperational;
String printerPaused;
String printerPrinting;
String printerReady;
String printerText;
String printerHotend;
String printerTarget;
String payload;
WiFiClient client;
OctoprintApi api(client, ip, octoprint_httpPort, octoprint_apikey);
void setup() {
// Connect to wifi
Serial.begin(115200);
Serial.println("Connecting to WiFi...");
Serial.print("SSID: ");
Serial.println(WIFI_SSID);
Serial.print("OctoPrint URL: ");
Serial.println(OCTOPRINT_URL);
Serial.print("OctoPrint API Key: ");
Serial.println(OCTOPRINT_API_KEY);
}