This commit is contained in:
Luc
2018-07-04 18:56:39 +02:00
parent c95fe416f0
commit 02bd840a7a
228 changed files with 35651 additions and 10005 deletions

View File

@@ -1,340 +0,0 @@
/*
GenLinkedList.h - V1.1 - Generic LinkedList implementation
Works better with FIFO, because LIFO will need to
search the entire List to find the last one;
For instructions, go to https://github.com/ivanseidel/LinkedList
Created by Ivan Seidel Gomes, March, 2013.
Released into the public domain.
Changelog: 2015/10/05: [Luc] Change false to NULL for pointers
*/
#ifndef GenLinkedList_h
#define GenLinkedList_h
template<class T>
struct ListNode {
T data;
ListNode<T> *next;
};
template <typename T>
class GenLinkedList
{
protected:
int _size;
ListNode<T> *root;
ListNode<T> *last;
// Helps "get" method, by saving last position
ListNode<T> *lastNodeGot;
int lastIndexGot;
// isCached should be set to FALSE
// every time the list suffer changes
bool isCached;
ListNode<T>* getNode(int index);
public:
GenLinkedList();
~GenLinkedList();
/*
Returns current size of GenLinkedList
*/
virtual int size();
/*
Adds a T object in the specified index;
Unlink and link the GenLinkedList correcly;
Increment _size
*/
virtual bool add(int index, T);
/*
Adds a T object in the end of the GenLinkedList;
Increment _size;
*/
virtual bool add(T);
/*
Adds a T object in the start of the GenLinkedList;
Increment _size;
*/
virtual bool unshift(T);
/*
Set the object at index, with T;
Increment _size;
*/
virtual bool set(int index, T);
/*
Remove object at index;
If index is not reachable, returns false;
else, decrement _size
*/
virtual T remove(int index);
/*
Remove last object;
*/
virtual T pop();
/*
Remove first object;
*/
virtual T shift();
/*
Get the index'th element on the list;
Return Element if accessible,
else, return false;
*/
virtual T get(int index);
/*
Clear the entire array
*/
virtual void clear();
};
// Initialize GenLinkedList with false values
template<typename T>
GenLinkedList<T>::GenLinkedList()
{
root=NULL;
last=NULL;
_size=0;
lastNodeGot = root;
lastIndexGot = 0;
isCached = false;
}
// Clear Nodes and free Memory
template<typename T>
GenLinkedList<T>::~GenLinkedList()
{
ListNode<T>* tmp;
while(root!=NULL) {
tmp=root;
root=root->next;
delete tmp;
}
last = NULL;
_size=0;
isCached = false;
}
/*
Actually "logic" coding
*/
template<typename T>
ListNode<T>* GenLinkedList<T>::getNode(int index)
{
int _pos = 0;
ListNode<T>* current = root;
// Check if the node trying to get is
// immediately AFTER the previous got one
if(isCached && lastIndexGot <= index) {
_pos = lastIndexGot;
current = lastNodeGot;
}
while(_pos < index && current) {
current = current->next;
_pos++;
}
// Check if the object index got is the same as the required
if(_pos == index) {
isCached = true;
lastIndexGot = index;
lastNodeGot = current;
return current;
}
return NULL;
}
template<typename T>
int GenLinkedList<T>::size()
{
return _size;
}
template<typename T>
bool GenLinkedList<T>::add(int index, T _t)
{
if(index >= _size) {
return add(_t);
}
if(index == 0) {
return unshift(_t);
}
ListNode<T> *tmp = new ListNode<T>(),
*_prev = getNode(index-1);
tmp->data = _t;
tmp->next = _prev->next;
_prev->next = tmp;
_size++;
isCached = false;
return true;
}
template<typename T>
bool GenLinkedList<T>::add(T _t)
{
ListNode<T> *tmp = new ListNode<T>();
tmp->data = _t;
tmp->next = NULL;
if(root) {
// Already have elements inserted
last->next = tmp;
last = tmp;
} else {
// First element being inserted
root = tmp;
last = tmp;
}
_size++;
isCached = false;
return true;
}
template<typename T>
bool GenLinkedList<T>::unshift(T _t)
{
if(_size == 0) {
return add(_t);
}
ListNode<T> *tmp = new ListNode<T>();
tmp->next = root;
tmp->data = _t;
root = tmp;
_size++;
isCached = false;
return true;
}
template<typename T>
bool GenLinkedList<T>::set(int index, T _t)
{
// Check if index position is in bounds
if(index < 0 || index >= _size) {
return false;
}
getNode(index)->data = _t;
return true;
}
template<typename T>
T GenLinkedList<T>::pop()
{
if(_size <= 0) {
return T();
}
isCached = false;
if(_size >= 2) {
ListNode<T> *tmp = getNode(_size - 2);
T ret = tmp->next->data;
delete(tmp->next);
tmp->next = NULL;
last = tmp;
_size--;
return ret;
} else {
// Only one element left on the list
T ret = root->data;
delete(root);
root = NULL;
last = NULL;
_size = 0;
return ret;
}
}
template<typename T>
T GenLinkedList<T>::shift()
{
if(_size <= 0) {
return T();
}
if(_size > 1) {
ListNode<T> *_next = root->next;
T ret = root->data;
delete(root);
root = _next;
_size --;
isCached = false;
return ret;
} else {
// Only one left, then pop()
return pop();
}
}
template<typename T>
T GenLinkedList<T>::remove(int index)
{
if (index < 0 || index >= _size) {
return T();
}
if(index == 0) {
return shift();
}
if (index == _size-1) {
return pop();
}
ListNode<T> *tmp = getNode(index - 1);
ListNode<T> *toDelete = tmp->next;
T ret = toDelete->data;
tmp->next = tmp->next->next;
delete(toDelete);
_size--;
isCached = false;
return ret;
}
template<typename T>
T GenLinkedList<T>::get(int index)
{
ListNode<T> *tmp = getNode(index);
return (tmp ? tmp->data : T());
}
template<typename T>
void GenLinkedList<T>::clear()
{
while(size() > 0) {
shift();
}
}
#endif

View File

@@ -1,209 +0,0 @@
/*
bridge.cpp - esp3d bridge serial/tcp class
Copyright (c) 2014 Luc Lebosse. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "bridge.h"
#include "command.h"
#include "webinterface.h"
#ifdef TCP_IP_DATA_FEATURE
WiFiServer * data_server;
WiFiClient serverClients[MAX_SRV_CLIENTS];
#endif
bool BRIDGE::header_sent = false;
String BRIDGE::buffer_web = "";
void BRIDGE::print (const __FlashStringHelper *data, tpipe output)
{
String tmp = data;
BRIDGE::print(tmp.c_str(), output);
}
void BRIDGE::print (String & data, tpipe output)
{
BRIDGE::print(data.c_str(), output);
}
void BRIDGE::print (const char * data, tpipe output)
{
switch(output) {
case SERIAL_PIPE:
header_sent = false;
ESP_SERIAL_OUT.print(data);
break;
#ifdef TCP_IP_DATA_FEATURE
case TCP_PIPE:
header_sent = false;
BRIDGE::send2TCP(data);
break;
#endif
case WEB_PIPE:
if (!header_sent) {
web_interface->web_server.setContentLength(CONTENT_LENGTH_UNKNOWN);
web_interface->web_server.sendHeader("Content-Type","text/html");
web_interface->web_server.sendHeader("Cache-Control","no-cache");
web_interface->web_server.send(200);
header_sent = true;
}
buffer_web+=data;
if (buffer_web.length() > 1200) {
//send data
web_interface->web_server.sendContent(buffer_web);
//reset buffer
buffer_web="";
}
break;
default:
break;
}
}
void BRIDGE::println (const __FlashStringHelper *data, tpipe output)
{
BRIDGE::print(data,output);
#ifdef TCP_IP_DATA_FEATURE
BRIDGE::print("\r",output);
#endif
BRIDGE::print("\n",output);
}
void BRIDGE::println (String & data, tpipe output)
{
BRIDGE::print(data,output);
#ifdef TCP_IP_DATA_FEATURE
BRIDGE::print("\r",output);
#endif
BRIDGE::print("\n",output);
}
void BRIDGE::println (const char * data, tpipe output)
{
BRIDGE::print(data,output);
#ifdef TCP_IP_DATA_FEATURE
BRIDGE::print("\r",output);
#endif
BRIDGE::print("\n",output);
}
void BRIDGE::flush (tpipe output)
{
switch(output) {
case SERIAL_PIPE:
ESP_SERIAL_OUT.flush();
break;
#ifdef TCP_IP_DATA_FEATURE
case TCP_PIPE:
break;
#endif
case WEB_PIPE:
if(header_sent) {
//send data
web_interface->web_server.sendContent(buffer_web);
//close line
web_interface->web_server.sendContent("");
}
break;
default:
break;
}
header_sent = false;
buffer_web = String();
}
#ifdef TCP_IP_DATA_FEATURE
void BRIDGE::send2TCP(const __FlashStringHelper *data)
{
String tmp = data;
BRIDGE::send2TCP(tmp.c_str());
}
void BRIDGE::send2TCP(String data)
{
BRIDGE::send2TCP(data.c_str());
}
void BRIDGE::send2TCP(const char * data)
{
for(uint8_t i = 0; i < MAX_SRV_CLIENTS; i++) {
if (serverClients[i] && serverClients[i].connected()) {
serverClients[i].write(data, strlen(data));
delay(0);
}
}
}
#endif
bool BRIDGE::processFromSerial2TCP()
{
uint8_t i;
//check UART for data
if(ESP_SERIAL_OUT.available()) {
size_t len = ESP_SERIAL_OUT.available();
uint8_t sbuf[len];
ESP_SERIAL_OUT.readBytes(sbuf, len);
#ifdef TCP_IP_DATA_FEATURE
if (WiFi.getMode()!=WIFI_OFF ) {
//push UART data to all connected tcp clients
for(i = 0; i < MAX_SRV_CLIENTS; i++) {
if (serverClients[i] && serverClients[i].connected()) {
serverClients[i].write(sbuf, len);
delay(0);
}
}
}
#endif
//process data if any
COMMAND::read_buffer_serial(sbuf, len);
return true;
} else {
return false;
}
}
#ifdef TCP_IP_DATA_FEATURE
void BRIDGE::processFromTCP2Serial()
{
uint8_t i,data;
//check if there are any new clients
if (data_server->hasClient()) {
for(i = 0; i < MAX_SRV_CLIENTS; i++) {
//find free/disconnected spot
if (!serverClients[i] || !serverClients[i].connected()) {
if(serverClients[i]) {
serverClients[i].stop();
}
serverClients[i] = data_server->available();
continue;
}
}
//no free/disconnected spot so reject
WiFiClient serverClient = data_server->available();
serverClient.stop();
}
//check clients for data
//to avoid any pollution if Uploading file to SDCard
if ((web_interface->blockserial) == false) {
for(i = 0; i < MAX_SRV_CLIENTS; i++) {
if (serverClients[i] && serverClients[i].connected()) {
if(serverClients[i].available()) {
//get data from the tcp client and push it to the UART
while(serverClients[i].available()) {
data = serverClients[i].read();
ESP_SERIAL_OUT.write(data);
COMMAND::read_buffer_tcp(data);
}
}
}
}
}
}
#endif

View File

@@ -1,49 +0,0 @@
/*
bridge.h - esp3d bridge serial/tcp class
Copyright (c) 2014 Luc Lebosse. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef BRIDGE_H
#define BRIDGE_H
#include <WiFiServer.h>
#include "config.h"
#ifdef TCP_IP_DATA_FEATURE
extern WiFiServer * data_server;
#endif
class BRIDGE
{
public:
static bool header_sent;
static String buffer_web;
static bool processFromSerial2TCP();
static void print (const __FlashStringHelper *data, tpipe output);
static void print (String & data, tpipe output);
static void print (const char * data, tpipe output);
static void println (const __FlashStringHelper *data, tpipe output);
static void println (String & data, tpipe output);
static void println (const char * data, tpipe output);
static void flush (tpipe output);
#ifdef TCP_IP_DATA_FEATURE
static void processFromTCP2Serial();
static void send2TCP(const __FlashStringHelper *data);
static void send2TCP(String data);
static void send2TCP(const char * data);
#endif
};
#endif

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,43 +0,0 @@
/*
command.h - ESP3D configuration class
Copyright (c) 2014 Luc Lebosse. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef COMMAND_h
#define COMMAND_h
#include <Arduino.h>
#include "bridge.h"
class COMMAND
{
public:
static String buffer_serial;
static String buffer_tcp;
static void read_buffer_serial(uint8_t *b, size_t len);
static void read_buffer_serial(uint8_t b);
#ifdef TCP_IP_DATA_FEATURE
static void read_buffer_tcp(uint8_t b);
#endif
static bool check_command(String buffer, tpipe output, bool handlelockserial = true);
static bool execute_command(int cmd,String cmd_params, tpipe output, level_authenticate_type auth_level = LEVEL_GUEST);
static String get_param(String & cmd_params, const char * id, bool withspace = false);
static bool isadmin(String & cmd_params);
static bool isuser(String & cmd_params);
};
#endif

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,430 +0,0 @@
/*
config.h - ESP3D configuration class
Copyright (c) 2014 Luc Lebosse. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//definition
#define UNKNOWN_FW 0
#define REPETIER4DV 1
#define MARLIN 2
#define MARLINKIMBRA 3
#define SMOOTHIEWARE 4
#define REPETIER 5
#ifdef ARDUINO_ARCH_ESP32
#include "FS.h"
#include "SPIFFS.h"
#define WIFI_NONE_SLEEP WIFI_PS_NONE
#define WIFI_MODEM_SLEEP WIFI_PS_MAX_MODEM
#define WIFI_PHY_MODE_11B WIFI_PROTOCOL_11B
#define WIFI_PHY_MODE_11G WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G
#define WIFI_PHY_MODE_11N WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N
#define AUTH_OPEN WIFI_AUTH_OPEN
#define AUTH_WEP WIFI_AUTH_WEP
#define AUTH_WPA_PSK WIFI_AUTH_WPA_PSK
#define AUTH_WPA2_PSK WIFI_AUTH_WPA2_PSK
#define AUTH_WPA_WPA2_PSK WIFI_AUTH_WPA_WPA2_PSK
#define ENC_TYPE_NONE AUTH_OPEN
#define FS_FILE File
#define FS_DIR File
#define ESP_SERIAL_OUT Serial
#define SD_FILE_READ FILE_READ
#define SPIFFS_FILE_READ FILE_READ
#define SD_FILE_WRITE FILE_WRITE
#define SPIFFS_FILE_WRITE FILE_WRITE
#else
#define FS_DIR fs::Dir
#define FS_FILE fs::File
#define ESP_SERIAL_OUT Serial
#define SD_FILE_READ FILE_READ
#define SPIFFS_FILE_READ "r"
#define SD_FILE_WRITE FILE_WRITE
#define SPIFFS_FILE_WRITE "w"
#endif
#define MAX_FW_ID REPETIER
//number of clients allowed to use data port at once
#define MAX_SRV_CLIENTS 1
//comment to disable
//MDNS_FEATURE: this feature allow type the name defined
//in web browser by default: http:\\esp8266.local and connect
#define MDNS_FEATURE
//SSDD_FEATURE: this feature is a discovery protocol, supported on Windows out of the box
#define SSDP_FEATURE
//NETBIOS_FEATURE: this feature is a discovery protocol, supported on Windows out of the box
#define NETBIOS_FEATURE
#ifdef ARDUINO_ARCH_ESP32
#ifdef SSDP_FEATURE
#undef SSDP_FEATURE
#endif
#ifdef NETBIOS_FEATURE
#undef NETBIOS_FEATURE
#endif
#endif
//CAPTIVE_PORTAL_FEATURE: In SoftAP redirect all unknow call to main page
#define CAPTIVE_PORTAL_FEATURE
//AUTHENTICATION_FEATURE: protect pages by login password
//#define AUTHENTICATION_FEATURE
//WEB_UPDATE_FEATURE: allow to flash fw using web UI
#define WEB_UPDATE_FEATURE
//SERIAL_COMMAND_FEATURE: allow to send command by serial
#define SERIAL_COMMAND_FEATURE
//TCP_IP_DATA_FEATURE: allow to connect serial from TCP/IP
#define TCP_IP_DATA_FEATURE
//RECOVERY_FEATURE: allow to use GPIO2 pin as hardware reset for EEPROM, add 8s to boot time to let user to jump GPIO2 to GND
//#define RECOVERY_FEATURE
#ifdef RECOVERY_FEATURE
//pin used to reset setting
#define RESET_CONFIG_PIN 2
#endif
//DIRECT_PIN_FEATURE: allow to access pin using ESP201 command
#define DIRECT_PIN_FEATURE
//INFO_MSG_FEATURE: catch the Info msg and filter it to specific table
#define INFO_MSG_FEATURE
//ERROR_MSG_FEATURE: catch the error msg and filter it to specific table
#define ERROR_MSG_FEATURE
//STATUS_MSG_FEATURE: catch the status msg and filter it to specific table
#define STATUS_MSG_FEATURE
//Serial rx buffer size is 256 but can be extended
#define SERIAL_RX_BUFFER_SIZE 512
#ifdef ARDUINO_ARCH_ESP32
#ifdef SSDP_FEATURE
#undef SSDP_FEATURE
#endif
#ifdef NETBIOS_FEATURE
#undef NETBIOS_FEATURE
#endif
#endif
//DEBUG Flag do not do this when connected to printer !!!
//be noted all upload may failed if enabled
//#define DEBUG_ESP3D
//#define DEBUG_OUTPUT_SPIFFS
//#define DEBUG_OUTPUT_SERIAL
//#define DEBUG_OUTPUT_TCP
//store performance result in storestring variable : info_msg / status_msg
//#define DEBUG_PERFORMANCE
#define DEBUG_PERF_VARIABLE (web_interface->info_msg)
/*
#ifndef FS_NO_GLOBALS
#define FS_NO_GLOBALS
#endif
#include <FS.h>
#define DEBUG_ESP3D(string) { FS_FILE logfile = SPIFFS.open("/log.txt", "a+");logfile.print(string);logfile.close();}
*/
#ifdef DEBUG_ESP3D
#ifdef DEBUG_OUTPUT_SPIFFS
#ifndef FS_NO_GLOBALS
#define FS_NO_GLOBALS
#endif
#include <FS.h>
#define DEBUG_PIPE NO_PIPE
#define LOG(string) { FS_FILE logfile = SPIFFS.open("/log.txt", "a+");logfile.print(string);logfile.close();}
#endif
#ifdef DEBUG_OUTPUT_SERIAL
#define LOG(string) {ESP_SERIAL_OUT.print(string);}
#define DEBUG_PIPE SERIAL_PIPE
#endif
#ifdef DEBUG_OUTPUT_TCP
#include "bridge.h"
#define LOG(string) {BRIDGE::send2TCP(string);}
#define DEBUG_PIPE TCP_PIPE
#endif
#else
#define LOG(string) {}
#define DEBUG_PIPE NO_PIPE
#endif
#ifndef CONFIG_h
#define CONFIG_h
#include <Arduino.h>
#ifdef ARDUINO_ARCH_ESP8266
extern "C" {
#include "user_interface.h"
}
#else
//Nothing here
#endif
#include "wificonf.h"
//version and sources location
#define FW_VERSION "1.0"
#define REPOSITORY "https://github.com/luc-github/ESP3D"
typedef enum {
NO_PIPE = 0,
SERIAL_PIPE = 2,
SERIAL1_PIPE = 3,
#ifdef TCP_IP_DATA_FEATURE
TCP_PIPE = 4,
#endif
WEB_PIPE = 5
} tpipe;
typedef enum {
LEVEL_GUEST = 0,
LEVEL_USER = 1,
LEVEL_ADMIN = 2
} level_authenticate_type;
#define NO_SD 0
#define SD_DIRECTORY 1
#define EXT_DIRECTORY 2
//flags
#define AP_MODE 1
#define CLIENT_MODE 2
#define DHCP_MODE 1
#define STATIC_IP_MODE 2
//position in EEPROM
//AP mode = 1; Station client mode = 2
#define EP_WIFI_MODE 0 //1 byte = flag
#define EP_STA_SSID 1 //33 bytes 32+1 = string ; warning does not support multibyte char like chinese
#define EP_STA_PASSWORD 34 //65 bytes 64 +1 = string ;warning does not support multibyte char like chinese
#define EP_STA_IP_MODE 99 //1 byte = flag
#define EP_STA_IP_VALUE 100 //4 bytes xxx.xxx.xxx.xxx
#define EP_STA_MASK_VALUE 104 //4 bytes xxx.xxx.xxx.xxx
#define EP_STA_GATEWAY_VALUE 108 //4 bytes xxx.xxx.xxx.xxx
#define EP_BAUD_RATE 112 //4 bytes = int
#define EP_STA_PHY_MODE 116 //1 byte = flag
#define EP_SLEEP_MODE 117 //1 byte = flag
#define EP_CHANNEL 118 //1 byte = flag
#define EP_AUTH_TYPE 119 //1 byte = flag
#define EP_SSID_VISIBLE 120 //1 byte = flag
#define EP_WEB_PORT 121 //4 bytes = int
#define EP_DATA_PORT 125 //4 bytes = int
#define EP_REFRESH_PAGE_TIME 129 //1 bytes = flag
#define EP_HOSTNAME 130//33 bytes 32+1 = string ; warning does not support multibyte char like chinese
#define EP_XY_FEEDRATE 164//4 bytes = int
#define EP_Z_FEEDRATE 168//4 bytes = int
#define EP_E_FEEDRATE 172//4 bytes = int
#define EP_ADMIN_PWD 176//21 bytes 20+1 = string ; warning does not support multibyte char like chinese
#define EP_USER_PWD 197//21 bytes 20+1 = string ; warning does not support multibyte char like chinese
#define EP_AP_SSID 218 //33 bytes 32+1 = string ; warning does not support multibyte char like chinese
#define EP_AP_PASSWORD 251 //65 bytes 64 +1 = string ;warning does not support multibyte char like chinese
#define EP_AP_IP_VALUE 316 //4 bytes xxx.xxx.xxx.xxx
#define EP_AP_MASK_VALUE 320 //4 bytes xxx.xxx.xxx.xxx
#define EP_AP_GATEWAY_VALUE 324 //4 bytes xxx.xxx.xxx.xxx
#define EP_AP_IP_MODE 329 //1 byte = flag
#define EP_AP_PHY_MODE 330 //1 byte = flag
#define EP_DATA_STRING 331 //129 bytes 128+1 = string ; warning does not support multibyte char like chinese
#define EP_REFRESH_PAGE_TIME2 460 //1 bytes = flag
#define EP_TARGET_FW 461 //1 bytes = flag
#define EP_TIMEZONE 462//1 bytes = flag
#define EP_TIME_ISDST 463//1 bytes = flag
#define EP_TIME_SERVER1 464//129 bytes 128+1 = string ; warning does not support multibyte char like chinese
#define EP_TIME_SERVER2 593 //129 bytes 128+1 = string ; warning does not support multibyte char like chinese
#define EP_TIME_SERVER3 722 //129 bytes 128+1 = string ; warning does not support multibyte char like chinese
#define EP_IS_DIRECT_SD 850//1 bytes = flag
#define EP_PRIMARY_SD 851//1 bytes = flag
#define EP_SECONDARY_SD 852//1 bytes = flag
#define EP_DIRECT_SD_CHECK 853//1 bytes = flag
#define EP_SD_CHECK_UPDATE_AT_BOOT 854//1 bytes = flag
#define LAST_EEPROM_ADDRESS 855
//next available is 855
//space left 1024 - 855 = 169
//default values
#define DEFAULT_WIFI_MODE AP_MODE
const char DEFAULT_AP_SSID [] PROGMEM = "ESP3D";
const char DEFAULT_AP_PASSWORD [] PROGMEM = "12345678";
const char DEFAULT_STA_SSID [] PROGMEM = "ESP3D";
const char DEFAULT_STA_PASSWORD [] PROGMEM = "12345678";
const byte DEFAULT_STA_IP_MODE = DHCP_MODE;
const byte DEFAULT_AP_IP_MODE = STATIC_IP_MODE;
const byte DEFAULT_IP_VALUE[] = {192, 168, 0, 1};
const byte DEFAULT_MASK_VALUE[] = {255, 255, 255, 0};
#define DEFAULT_GATEWAY_VALUE DEFAULT_IP_VALUE
const long DEFAULT_BAUD_RATE = 115200;
const char M117_[] PROGMEM = "M117 ";
#define DEFAULT_PHY_MODE WIFI_PHY_MODE_11G
#define DEFAULT_SLEEP_MODE WIFI_MODEM_SLEEP
#define DEFAULT_CHANNEL 11
#define DEFAULT_AUTH_TYPE AUTH_WPA_PSK
#define DEFAULT_SSID_VISIBLE 1
#define DEFAULT_MAX_CONNECTIONS 4
#define DEFAULT_BEACON_INTERVAL 100
const int DEFAULT_WEB_PORT = 80;
const int DEFAULT_DATA_PORT = 8888;
#define DEFAULT_REFRESH_PAGE_TIME 3
const int DEFAULT_XY_FEEDRATE=1000;
const int DEFAULT_Z_FEEDRATE =100;
const int DEFAULT_E_FEEDRATE=400;
const char DEFAULT_ADMIN_PWD [] PROGMEM = "admin";
const char DEFAULT_USER_PWD [] PROGMEM = "user";
const char DEFAULT_ADMIN_LOGIN [] PROGMEM = "admin";
const char DEFAULT_USER_LOGIN [] PROGMEM = "user";
const char DEFAULT_TIME_SERVER1 [] PROGMEM = "time.nist.gov";
const char DEFAULT_TIME_SERVER2 [] PROGMEM = "0.pool.ntp.org";
const char DEFAULT_TIME_SERVER3 [] PROGMEM = "1.pool.ntp.org";
#define DEFAULT_TIME_ZONE 0
#define DEFAULT_TIME_DST 0
#define DEFAULT_PRIMARY_SD 1
#define DEFAULT_SECONDARY_SD 2
#define DEFAULT_DIRECT_SD_CHECK 0
#define DEFAULT_SD_CHECK_UPDATE_AT_BOOT 1
#define DEFAULT_IS_DIRECT_SD 0
const uint16_t Setting[][2] = {
{EP_WIFI_MODE, LEVEL_ADMIN},//0
{EP_STA_SSID, LEVEL_ADMIN},//1
{EP_STA_PASSWORD, LEVEL_ADMIN},//2
{EP_STA_IP_MODE, LEVEL_ADMIN},//3
{EP_STA_IP_VALUE, LEVEL_ADMIN},//4
{EP_STA_MASK_VALUE, LEVEL_ADMIN},//5
{EP_STA_GATEWAY_VALUE, LEVEL_ADMIN},//6
{EP_BAUD_RATE, LEVEL_ADMIN},//7
{EP_STA_PHY_MODE, LEVEL_ADMIN},//8
{EP_SLEEP_MODE, LEVEL_ADMIN},//9
{EP_CHANNEL, LEVEL_ADMIN},//10
{EP_AUTH_TYPE, LEVEL_ADMIN},//11
{EP_SSID_VISIBLE, LEVEL_ADMIN},//12
{EP_WEB_PORT, LEVEL_ADMIN},//13
{EP_DATA_PORT, LEVEL_ADMIN},//14
{EP_REFRESH_PAGE_TIME, LEVEL_USER},//15
{EP_HOSTNAME, LEVEL_ADMIN},//16
{EP_XY_FEEDRATE, LEVEL_USER},//17
{EP_Z_FEEDRATE, LEVEL_USER},//18
{EP_E_FEEDRATE, LEVEL_USER},//19
{EP_ADMIN_PWD, LEVEL_ADMIN},//20
{EP_USER_PWD, LEVEL_USER},//21
{EP_AP_SSID, LEVEL_ADMIN},//22
{EP_AP_PASSWORD, LEVEL_ADMIN},//23
{EP_AP_IP_VALUE, LEVEL_ADMIN},//24
{EP_AP_MASK_VALUE, LEVEL_ADMIN},//25
{EP_AP_GATEWAY_VALUE, LEVEL_ADMIN},//26
{EP_AP_IP_MODE, LEVEL_ADMIN},//27
{EP_AP_PHY_MODE, LEVEL_ADMIN},//28
{EP_DATA_STRING, LEVEL_USER},//29
{EP_REFRESH_PAGE_TIME2, LEVEL_USER},//30
{EP_TARGET_FW, LEVEL_USER},//31
{EP_TIMEZONE, LEVEL_USER},//32
{EP_TIME_ISDST, LEVEL_USER},//33
{EP_TIME_SERVER1, LEVEL_USER},//34
{EP_TIME_SERVER2, LEVEL_USER},//35
{EP_TIME_SERVER3, LEVEL_USER},//36
{EP_IS_DIRECT_SD, LEVEL_USER},//37
{EP_PRIMARY_SD, LEVEL_USER},//38
{EP_SECONDARY_SD, LEVEL_USER},//39
{EP_DIRECT_SD_CHECK, LEVEL_USER}, //40
{EP_SD_CHECK_UPDATE_AT_BOOT, LEVEL_USER} //41
};
#define AUTH_ENTRY_NB 42
//values
#define DEFAULT_MAX_REFRESH 120
#define DEFAULT_MIN_REFRESH 0
#define DEFAULT_MAX_XY_FEEDRATE 9999
#define DEFAULT_MIN_XY_FEEDRATE 1
#define DEFAULT_MAX_Z_FEEDRATE 9999
#define DEFAULT_MIN_Z_FEEDRATE 1
#define DEFAULT_MAX_E_FEEDRATE 9999
#define DEFAULT_MIN_E_FEEDRATE 1
#define DEFAULT_MAX_WEB_PORT 65001
#define DEFAULT_MIN_WEB_PORT 1
#define DEFAULT_MAX_DATA_PORT 65001
#define DEFAULT_MIN_DATA_PORT 1
#define MAX_TRY 2000
//sizes
#define EEPROM_SIZE 1024 //max is 1024
#define MAX_SSID_LENGTH 32
#define MIN_SSID_LENGTH 1
#define MAX_PASSWORD_LENGTH 64
//min size of password is 0 or upper than 8 char
//so let set min is 0
#define MIN_PASSWORD_LENGTH 0
#define MAX_LOCAL_PASSWORD_LENGTH 16
#define MIN_LOCAL_PASSWORD_LENGTH 1
#define MAX_DATA_LENGTH 128
#define MIN_DATA_LENGTH 0
#define IP_LENGTH 4
#define INTEGER_LENGTH 4
#define MAX_HOSTNAME_LENGTH 32
#define MIN_HOSTNAME_LENGTH 1
#define WL_MAC_ADDR_LENGTH 6
class CONFIG
{
public:
static bool is_direct_sd;
static bool read_string(int pos, char byte_buffer[], int size_max);
static bool read_string(int pos, String & sbuffer, int size_max);
static bool read_buffer(int pos, byte byte_buffer[], int size_buffer);
static bool read_byte(int pos, byte * value);
static bool write_string(int pos, const char * byte_buffer);
static bool write_string(int pos, const __FlashStringHelper *str);
static bool write_buffer(int pos, const byte * byte_buffer, int size_buffer);
static bool write_byte(int pos, const byte value);
static bool reset_config();
static void print_config(tpipe output, bool plaintext);
static bool SetFirmwareTarget(uint8_t fw);
static void InitFirmwareTarget();
static void InitDirectSD();
static void InitPins();
static bool InitBaudrate();
static bool InitExternalPorts();
static bool check_update_presence();
static uint8_t GetFirmwareTarget();
static const char* GetFirmwareTargetName();
static const char* GetFirmwareTargetShortName();
static bool isHostnameValid(const char * hostname);
static bool isSSIDValid(const char * ssid);
static bool isPasswordValid(const char * password);
static bool isLocalPasswordValid(const char * password);
static bool isIPValid(const char * IP);
static char * intTostr(int value);
static String formatBytes(uint32_t bytes);
static char * mac2str(uint8_t mac [WL_MAC_ADDR_LENGTH]);
static byte split_ip (const char * ptr,byte * part);
static void esp_restart();
private:
static uint8_t FirmwareTarget;
};
#endif

View File

@@ -1,18 +0,0 @@
<HTML>
<HEAD>
<title>404 page</title>
</HEAD>
<BODY STYLE="background-color: lightblue;">
<CENTER>
<H1>
<svg width='24' height='24' viewBox='0 0 1300 1200'>
<g transform='translate(50,1200) scale(1, -1)'>
<path fill='red' d='M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5q0 -120 65 -225 l587 587q-105 65 -225 65zM965 819l-584 -584q104 -62 219 -62q116 0 214.5 57t155.5 155.5t57 214.5q0 115 -62 219z' />
</g>
</svg>404 Error, unknown page!</H1>
<H2>What are you doing here ?</H2>
You are not supposed to find this location...
</CENTER>
</BODY>
</HTML>

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

Binary file not shown.

View File

@@ -1,74 +0,0 @@
[
{
"name": "",
"glyph": "",
"filename": "",
"target": "",
"class": "",
"index": 0
},
{
"name": "",
"glyph": "",
"filename": "",
"target": "",
"class": "",
"index": 1
},
{
"name": "",
"glyph": "",
"filename": "",
"target": "",
"class": "",
"index": 2
},
{
"name": "",
"glyph": "",
"filename": "",
"target": "",
"class": "",
"index": 3
},
{
"name": "",
"glyph": "",
"filename": "",
"target": "",
"class": "",
"index": 4
},
{
"name": "",
"glyph": "",
"filename": "",
"target": "",
"class": "",
"index": 5
},
{
"name": "",
"glyph": "",
"filename": "",
"target": "",
"class": "",
"index": 6
},
{
"name": "",
"glyph": "",
"filename": "",
"target": "",
"class": "",
"index": 7
},
{
"name": "",
"glyph": "",
"filename": "",
"target": "",
"class": "",
"index": 8
}
]

View File

@@ -1,189 +0,0 @@
/*
This file is part of ESP3D Firmware for 3D printer.
ESP3D Firmware for 3D printer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ESP3D Firmware for 3D printer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this Firmware. If not, see <http://www.gnu.org/licenses/>.
This firmware is using the standard arduino IDE with module to support ESP8266:
https://github.com/esp8266/Arduino from Bootmanager
Latest version of the code and documentation can be found here :
https://github.com/luc-github/ESP3D
Main author: luc lebosse
*/
//be sure correct IDE and settings are used for ESP8266 or ESP32
#if !(defined( ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32))
#error Oops! Make sure you have 'ESP8266 or ESP32' compatible board selected from the 'Tools -> Boards' menu.
#endif
#include <EEPROM.h>
#include "config.h"
#include "wificonf.h"
#include "bridge.h"
#include "webinterface.h"
#include "command.h"
#ifdef ARDUINO_ARCH_ESP8266
#include "ESP8266WiFi.h"
#ifdef MDNS_FEATURE
#include <ESP8266mDNS.h>
#endif
#include <ESP8266WebServer.h>
#else
#include <WiFi.h>
#ifdef MDNS_FEATURE
#include <ESPmDNS.h>
#endif
#include "esp_wifi.h"
#include <WebServer.h>
#include "FS.h"
#include "SPIFFS.h"
#include "Update.h"
#endif
#include <WiFiClient.h>
#ifdef CAPTIVE_PORTAL_FEATURE
#include <DNSServer.h>
extern DNSServer dnsServer;
#endif
#ifdef SSDP_FEATURE
#ifdef ARDUINO_ARCH_ESP8266
#include <ESP8266SSDP.h>
#else
//#include <ESPSSDP.h>
#endif
#endif
#ifdef NETBIOS_FEATURE
#ifdef ARDUINO_ARCH_ESP8266
#include <ESP8266NetBIOS.h>
#else
//#include <ESPNetBIOS.h>
#endif
#endif
#ifndef FS_NO_GLOBALS
#define FS_NO_GLOBALS
#endif
#include <FS.h>
void setup()
{
bool breset_config=false;
bool directsd_check = false;
web_interface = NULL;
#ifdef TCP_IP_DATA_FEATURE
data_server = NULL;
#endif
// init:
#ifdef DEBUG_ESP3D
if (ESP_SERIAL_OUT.baudRate() != DEFAULT_BAUD_RATE)ESP_SERIAL_OUT.begin(DEFAULT_BAUD_RATE);
delay(2000);
LOG("\r\nDebug Serial set\r\n")
#endif
//WiFi.disconnect();
WiFi.mode(WIFI_OFF);
delay(8000);
CONFIG::InitDirectSD();
CONFIG::InitPins();
#ifdef RECOVERY_FEATURE
delay(8000);
//check if reset config is requested
if (digitalRead(RESET_CONFIG_PIN)==0) {
breset_config=true; //if requested =>reset settings
}
#endif
//check if EEPROM has value
if ( !CONFIG::InitBaudrate() || !CONFIG::InitExternalPorts()) {
breset_config=true; //cannot access to config settings=> reset settings
LOG("Error no EEPROM access\r\n")
}
//reset is requested
if(breset_config) {
//update EEPROM with default settings
if (ESP_SERIAL_OUT.baudRate() != DEFAULT_BAUD_RATE)ESP_SERIAL_OUT.begin(DEFAULT_BAUD_RATE);
#ifdef ARDUINO_ARCH_ESP8266
ESP_SERIAL_OUT.setRxBufferSize(SERIAL_RX_BUFFER_SIZE);
#endif
delay(2000);
ESP_SERIAL_OUT.println(F("M117 ESP EEPROM reset"));
#ifdef DEBUG_ESP3D
CONFIG::print_config(DEBUG_PIPE, true);
delay(1000);
#endif
CONFIG::reset_config();
delay(1000);
//put some default value to a void some exception at first start
WiFi.mode(WIFI_AP);
#ifdef ARDUINO_ARCH_ESP8266
WiFi.setPhyMode(WIFI_PHY_MODE_11G);
#else
esp_wifi_set_protocol(ESP_IF_WIFI_AP, WIFI_PHY_MODE_11G);
#endif
CONFIG::esp_restart();
}
#if defined(DEBUG_ESP3D) && defined(DEBUG_OUTPUT_SERIAL)
LOG("\r\n");
delay(500);
ESP_SERIAL_OUT.flush();
#endif
//get target FW
CONFIG::InitFirmwareTarget();
//Update is done if any so should be Ok
#ifdef ARDUINO_ARCH_ESP32
SPIFFS.begin(true);
#else
SPIFFS.begin();
#endif
//setup wifi according settings
if (!wifi_config.Setup()) {
ESP_SERIAL_OUT.println(F("M117 Safe mode 1"));
//try again in AP mode
if (!wifi_config.Setup(true)) {
ESP_SERIAL_OUT.println(F("M117 Safe mode 2"));
wifi_config.Safe_Setup();
}
}
delay(1000);
//setup servers
if (!wifi_config.Enable_servers()) {
ESP_SERIAL_OUT.println(F("M117 Error enabling servers"));
}
LOG("Setup Done\r\n");
}
//main loop
void loop()
{
//be sure wifi is on to proceed wifi function
if (WiFi.getMode()!=WIFI_OFF ) {
#ifdef CAPTIVE_PORTAL_FEATURE
if (WiFi.getMode()!=WIFI_STA ) {
dnsServer.processNextRequest();
}
#endif
//web requests
web_interface->web_server.handleClient();
#ifdef TCP_IP_DATA_FEATURE
BRIDGE::processFromTCP2Serial();
#endif
}
BRIDGE::processFromSerial2TCP();
//in case of restart requested
if (web_interface->restartmodule) {
CONFIG::esp_restart();
}
}

View File

@@ -1,326 +0,0 @@
/*
nofile.h - ESP3D data file
Copyright (c) 2014 Luc Lebosse. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//data generated by https://github.com/AraHaan/bin2c
//bin2c Conversion Tool v0.14.0 - Windows - [FINAL].
#define PAGE_NOFILES_SIZE 4776
const char PAGE_NOFILES [] PROGMEM =
{
0x1F, 0x8B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0xED, 0x5C, 0x7D, 0x93, 0xDA, 0x46,
0x93, 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 0xE4, 0xAB, 0x4B, 0xF1, 0x03, 0x17, 0xF6, 0x3F, 0x96, 0xF9, 0x7F,
0x4B, 0x13, 0x97, 0xBB, 0x5F, 0x46, 0x00, 0x00
};

View File

@@ -1,139 +0,0 @@
/*
storestrings.cpp - rolling storage class
Copyright (c) 2014 Luc Lebosse. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "storestrings.h"
//Constructor
STORESTRINGS_CLASS::STORESTRINGS_CLASS (int maxsize, int maxstringlength)
{
//for rolling buffer
//if max size is reached then remove oldest one and add the new one
_maxsize=maxsize;
//to limit the storage space
_maxstringlength=maxstringlength;
//need space for the "..."
if (_maxstringlength<4 && _maxstringlength!=-1) {
_maxstringlength=4;
}
}
//Destructor
STORESTRINGS_CLASS::~STORESTRINGS_CLASS ()
{
// clear list and content
clear();
}
bool STORESTRINGS_CLASS::setsize(int size)
{
_maxsize=size;
return true;
}
bool STORESTRINGS_CLASS::setlength(int len)
{
if (len < 4) {
return false;
}
_maxstringlength = len;
return true;
}
//Clear list and content
void STORESTRINGS_CLASS::clear()
{
//while list is not empty
while(_charlist.size()) {
//remove element
char * str = _charlist.pop();
//destroy it
delete str;
}
}
bool STORESTRINGS_CLASS::add (const __FlashStringHelper *str)
{
String stmp;
stmp=str;
return add(stmp.c_str());
}
//Add element in storage
bool STORESTRINGS_CLASS::add (const char * string)
{
//if we reach max size
if (_maxsize==_charlist.size()) {
//remove oldest one
char * str = _charlist.shift();
delete str;
}
//add new one
//get size including \0 at the end
size_t size = strlen(string)+1;
bool need_resize=false;
if ( (_maxstringlength!=-1) && (size >_maxstringlength+1 )) {
need_resize = true;
size=_maxstringlength+1;
}
//reserve memory
char * ptr = new char[size*sizeof(char)];
//copy string to storage
if (need_resize) {
//copy maximum length minus 3
strncpy(ptr,string,_maxstringlength-3);
strcpy(ptr+_maxstringlength-3,"...");
} else {
//copy as it is
strcpy(ptr,string);
}
//add storage to list
_charlist.add(ptr);
return true;
}
//Remove element at pos position
bool STORESTRINGS_CLASS::remove(int pos)
{
//be sure index is in range
if (pos<0 && pos>(_charlist.size()-1)) {
return false;
}
//remove item from list
char * str = _charlist.remove(pos);
//destroy item
delete str;
return true;
}
//Get element at pos position
const char * STORESTRINGS_CLASS::get(int pos)
{
//be sure index is in range
if (pos<0 && pos>(_charlist.size()-1)) {
return NULL;
}
return (const char *) _charlist.get(pos);
}
//Get index for defined string
int STORESTRINGS_CLASS::get_index(const char * string)
{
//parse the list until it is found
for (int p=0; p<_charlist.size(); p++) {
if (strcmp ( _charlist.get(p), string)==0) {
return p;
}
}
//if not found return -1
return -1;
}

View File

@@ -1,61 +0,0 @@
/*
storestrings.h - rolling storage class
Copyright (c) 2014 Luc Lebosse. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef STORESTRINGS_h
#define STORESTRINGS_h
#include <Arduino.h>
#include "GenLinkedList.h"
class STORESTRINGS_CLASS
{
public:
STORESTRINGS_CLASS (int maxsize = -1, int maxstringlength=-1);
~STORESTRINGS_CLASS ();
bool add (const char * string);
inline bool add (String & string)
{
return add(string.c_str());
};
bool add (const __FlashStringHelper *str);
bool remove(int pos);
const char * get(int pos);
int get_index(const char * string);
void clear();
inline int size()
{
return _charlist.size();
};
bool setsize(int size);
bool setlength(int len);
inline int getsize()
{
return _maxsize;
};
inline int getlength()
{
return _maxstringlength;
};
private:
int _maxsize;
int _maxstringlength;
GenLinkedList<char *> _charlist;
};
#endif

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,90 +0,0 @@
/*
webinterface.h - ESP3D configuration class
Copyright (c) 2014 Luc Lebosse. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef WEBINTERFACE_h
#define WEBINTERFACE_h
#include <Arduino.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#ifndef FS_NO_GLOBALS
#define FS_NO_GLOBALS
#endif
#include <FS.h>
#ifdef ARDUINO_ARCH_ESP8266
#include <ESP8266WebServer.h>
#else
#include <WebServer.h>
#endif
#include "storestrings.h"
#define MAX_EXTRUDERS 4
struct auth_ip {
IPAddress ip;
level_authenticate_type level;
char userID[17];
char sessionID[17];
uint32_t last_time;
auth_ip * _next;
};
class WEBINTERFACE_CLASS
{
public:
WEBINTERFACE_CLASS (int port = 80);
~WEBINTERFACE_CLASS();
#ifdef ARDUINO_ARCH_ESP8266
ESP8266WebServer web_server;
#else
WebServer web_server;
#endif
FS_FILE fsUploadFile;
#ifdef ERROR_MSG_FEATURE
STORESTRINGS_CLASS error_msg;
#endif
#ifdef INFO_MSG_FEATURE
STORESTRINGS_CLASS info_msg;
#endif
#ifdef STATUS_MSG_FEATURE
STORESTRINGS_CLASS status_msg;
#endif
bool restartmodule;
String getContentType(String filename);
level_authenticate_type is_authenticated();
bool AddAuthIP(auth_ip * item);
bool blockserial;
#ifdef AUTHENTICATION_FEATURE
level_authenticate_type ResetAuthIP(IPAddress ip,const char * sessionID);
auth_ip * GetAuth(IPAddress ip,const char * sessionID);
bool ClearAuthIP(IPAddress ip, const char * sessionID);
char * create_session_ID();
#endif
uint8_t _upload_status;
private:
auth_ip * _head;
uint8_t _nb_ip;
};
extern WEBINTERFACE_CLASS * web_interface;
#endif

View File

@@ -1,505 +0,0 @@
/*
wificonf.cpp - ESP3D configuration class
Copyright (c) 2014 Luc Lebosse. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "wificonf.h"
#include "bridge.h"
#include "webinterface.h"
#ifdef ARDUINO_ARCH_ESP8266
#include "ESP8266WiFi.h"
#ifdef MDNS_FEATURE
#include <ESP8266mDNS.h>
#endif
#else
#include <WiFi.h>
#include "esp_wifi.h"
#ifdef MDNS_FEATURE
#include <ESPmDNS.h>
#endif
#endif
#include "IPAddress.h"
#ifdef CAPTIVE_PORTAL_FEATURE
#include <DNSServer.h>
DNSServer dnsServer;
const byte DNS_PORT = 53;
#endif
#ifdef ARDUINO_ARCH_ESP8266
#include <ESP8266WebServer.h>
#else
#include <WebServer.h>
#endif
#ifdef SSDP_FEATURE
#include <ESP8266SSDP.h>
#endif
#ifdef NETBIOS_FEATURE
#ifdef ARDUINO_ARCH_ESP8266
#include <ESP8266NetBIOS.h>
#else
#include <ESPNetBIOS.h>
#endif
#endif
#ifdef ARDUINO_ARCH_ESP8266
extern "C" {
#include "user_interface.h"
}
#endif
#ifdef TIMESTAMP_FEATURE
#include <time.h>
#endif
WIFI_CONFIG::WIFI_CONFIG()
{
iweb_port=DEFAULT_WEB_PORT;
idata_port=DEFAULT_DATA_PORT;
baud_rate=DEFAULT_BAUD_RATE;
sleep_mode=DEFAULT_SLEEP_MODE;
_hostname[0]=0;
}
int32_t WIFI_CONFIG::getSignal(int32_t RSSI)
{
if (RSSI <= -100) {
return 0;
}
if (RSSI >= -50) {
return 100;
}
return (2* (RSSI+100));
}
const char * WIFI_CONFIG::get_hostname()
{
String hname;
#ifdef ARDUINO_ARCH_ESP8266
hname = WiFi.hostname();
#else
hname = WiFi.getHostname();
#endif
if (hname.length()==0) {
if (!CONFIG::read_string(EP_HOSTNAME, _hostname, MAX_HOSTNAME_LENGTH)) {
strcpy(_hostname,get_default_hostname());
}
} else {
strcpy(_hostname,hname.c_str());
}
return _hostname;
}
const char * WIFI_CONFIG::get_default_hostname()
{
static char hostname[13];
uint8_t mac [WL_MAC_ADDR_LENGTH];
WiFi.macAddress(mac);
if (0>sprintf(hostname,"ESP_%02X%02X%02X",mac[3],mac[4],mac[5])) {
strcpy (hostname, "ESP8266");
}
return hostname;
}
//safe setup if no connection
void WIFI_CONFIG::Safe_Setup()
{
#ifdef CAPTIVE_PORTAL_FEATURE
dnsServer.stop();
delay(100);
#endif
WiFi.disconnect();
//setup Soft AP
WiFi.mode(WIFI_AP);
IPAddress local_ip (DEFAULT_IP_VALUE[0],DEFAULT_IP_VALUE[1],DEFAULT_IP_VALUE[2],DEFAULT_IP_VALUE[3]);
IPAddress gateway (DEFAULT_GATEWAY_VALUE[0],DEFAULT_GATEWAY_VALUE[1],DEFAULT_GATEWAY_VALUE[2],DEFAULT_GATEWAY_VALUE[3]);
IPAddress subnet (DEFAULT_MASK_VALUE[0],DEFAULT_MASK_VALUE[1],DEFAULT_MASK_VALUE[2],DEFAULT_MASK_VALUE[3]);
String ssid = FPSTR(DEFAULT_AP_SSID);
String pwd = FPSTR(DEFAULT_AP_PASSWORD);
WiFi.softAP(ssid.c_str(),pwd.c_str());
delay(500);
WiFi.softAPConfig( local_ip, gateway, subnet);
delay(1000);
ESP_SERIAL_OUT.println(F("M117 Safe mode started"));
}
//Read configuration settings and apply them
bool WIFI_CONFIG::Setup(bool force_ap)
{
char pwd[MAX_PASSWORD_LENGTH+1];
char sbuf[MAX_SSID_LENGTH+1];
char hostname [MAX_HOSTNAME_LENGTH+1];
//int wstatus;
IPAddress currentIP;
byte bflag=0;
byte bmode=0;
//system_update_cpu_freq(SYS_CPU_160MHZ);
//set the sleep mode
if (!CONFIG::read_byte(EP_SLEEP_MODE, &bflag )) {
LOG("Error read Sleep mode\r\n")
return false;
}
#ifdef ARDUINO_ARCH_ESP8266
WiFi.setSleepMode ((WiFiSleepType_t)bflag);
#else
esp_wifi_set_ps((wifi_ps_type_t)bflag);
#endif
sleep_mode=bflag;
if (force_ap) {
bmode = AP_MODE;
} else {
//AP or client ?
if (!CONFIG::read_byte(EP_WIFI_MODE, &bmode ) ) {
LOG("Error read wifi mode\r\n")
return false;
}
}
if (!CONFIG::read_string(EP_HOSTNAME, hostname, MAX_HOSTNAME_LENGTH)) {
strcpy(hostname,get_default_hostname());
}
//this is AP mode
if (bmode==AP_MODE) {
LOG("Set AP mode\r\n")
if(!CONFIG::read_string(EP_AP_SSID, sbuf, MAX_SSID_LENGTH)) {
return false;
}
if(!CONFIG::read_string(EP_AP_PASSWORD, pwd, MAX_PASSWORD_LENGTH)) {
return false;
}
ESP_SERIAL_OUT.print(FPSTR(M117_));
ESP_SERIAL_OUT.print(F("SSID "));
ESP_SERIAL_OUT.println(sbuf);
LOG("SSID ")
LOG(sbuf)
LOG("\r\n")
//DHCP or Static IP ?
if (!CONFIG::read_byte(EP_AP_IP_MODE, &bflag )) {
LOG("Error IP mode\r\n")
return false;
}
LOG("IP Mode: ")
LOG(CONFIG::intTostr(bflag))
LOG("\r\n")
if (bflag==STATIC_IP_MODE) {
byte ip_buf[4];
LOG("Static mode\r\n")
//get the IP
LOG("IP value:")
if (!CONFIG::read_buffer(EP_AP_IP_VALUE,ip_buf, IP_LENGTH)) {
LOG("Error\r\n")
return false;
}
IPAddress local_ip (ip_buf[0],ip_buf[1],ip_buf[2],ip_buf[3]);
LOG(local_ip.toString())
LOG("\r\nGW value:")
//get the gateway
if (!CONFIG::read_buffer(EP_AP_GATEWAY_VALUE,ip_buf, IP_LENGTH)) {
LOG("Error\r\n")
return false;
}
IPAddress gateway (ip_buf[0],ip_buf[1],ip_buf[2],ip_buf[3]);
LOG(gateway.toString())
LOG("\r\nMask value:")
//get the mask
if (!CONFIG::read_buffer(EP_AP_MASK_VALUE,ip_buf, IP_LENGTH)) {
LOG("Error Mask value\r\n")
return false;
}
IPAddress subnet (ip_buf[0],ip_buf[1],ip_buf[2],ip_buf[3]);
LOG(subnet.toString())
LOG("\r\n")
//apply according active wifi mode
LOG("Set IP\r\n")
WiFi.softAPConfig( local_ip, gateway, subnet);
delay(100);
}
LOG("Disable STA\r\n")
WiFi.enableSTA(false);
delay(100);
LOG("Set phy mode\r\n")
//setup PHY_MODE
if (!CONFIG::read_byte(EP_AP_PHY_MODE, &bflag )) {
return false;
}
#ifdef ARDUINO_ARCH_ESP32
esp_wifi_set_protocol(ESP_IF_WIFI_AP, bflag);
#endif
LOG("Set AP\r\n")
//setup Soft AP
WiFi.mode(WIFI_AP);
delay(50);
WiFi.softAP(sbuf, pwd);
delay(100);
#ifdef ARDUINO_ARCH_ESP8266
WiFi.setPhyMode((WiFiPhyMode_t)bflag);
#endif
delay(100);
LOG("Get current config\r\n")
//get current config
#ifdef ARDUINO_ARCH_ESP32
wifi_config_t conf;
esp_wifi_get_config(ESP_IF_WIFI_AP, &conf);
#else
struct softap_config apconfig;
wifi_softap_get_config(&apconfig);
#endif
//set the chanel
if (!CONFIG::read_byte(EP_CHANNEL, &bflag )) {
return false;
}
#ifdef ARDUINO_ARCH_ESP32
conf.ap.channel=bflag;
#else
apconfig.channel=bflag;
#endif
//set Authentification type
if (!CONFIG::read_byte(EP_AUTH_TYPE, &bflag )) {
return false;
}
#ifdef ARDUINO_ARCH_ESP32
conf.ap.authmode=(wifi_auth_mode_t)bflag;
#else
apconfig.authmode=(AUTH_MODE)bflag;
#endif
//set the visibility of SSID
if (!CONFIG::read_byte(EP_SSID_VISIBLE, &bflag )) {
return false;
}
#ifdef ARDUINO_ARCH_ESP32
conf.ap.ssid_hidden=!bflag;
#else
apconfig.ssid_hidden=!bflag;
#endif
//no need to add these settings to configuration just use default ones
#ifdef ARDUINO_ARCH_ESP32
conf.ap.max_connection=DEFAULT_MAX_CONNECTIONS;
conf.ap.beacon_interval=DEFAULT_BEACON_INTERVAL;
if (esp_wifi_set_config(ESP_IF_WIFI_AP, &conf)!=ESP_OK){
ESP_SERIAL_OUT.println(F("M117 Error Wifi AP!"));
delay(1000);
}
#else
apconfig.max_connection=DEFAULT_MAX_CONNECTIONS;
apconfig.beacon_interval=DEFAULT_BEACON_INTERVAL;
//apply settings to current and to default
if (!wifi_softap_set_config(&apconfig) || !wifi_softap_set_config_current(&apconfig)) {
ESP_SERIAL_OUT.println(F("M117 Error Wifi AP!"));
delay(1000);
}
#endif
} else {
LOG("Set STA mode\r\n")
if(!CONFIG::read_string(EP_STA_SSID, sbuf, MAX_SSID_LENGTH)) {
return false;
}
if(!CONFIG::read_string(EP_STA_PASSWORD, pwd, MAX_PASSWORD_LENGTH)) {
return false;
}
ESP_SERIAL_OUT.print(FPSTR(M117_));
ESP_SERIAL_OUT.print(F("SSID "));
ESP_SERIAL_OUT.println(sbuf);
LOG("SSID ")
LOG(sbuf)
LOG("\r\n")
if (!CONFIG::read_byte(EP_STA_IP_MODE, &bflag )) {
return false;
}
if (bflag==STATIC_IP_MODE) {
byte ip_buf[4];
//get the IP
if (!CONFIG::read_buffer(EP_STA_IP_VALUE,ip_buf, IP_LENGTH)) {
return false;
}
IPAddress local_ip (ip_buf[0],ip_buf[1],ip_buf[2],ip_buf[3]);
//get the gateway
if (!CONFIG::read_buffer(EP_STA_GATEWAY_VALUE,ip_buf, IP_LENGTH)) {
return false;
}
IPAddress gateway (ip_buf[0],ip_buf[1],ip_buf[2],ip_buf[3]);
//get the mask
if (!CONFIG::read_buffer(EP_STA_MASK_VALUE,ip_buf, IP_LENGTH)) {
return false;
}
IPAddress subnet (ip_buf[0],ip_buf[1],ip_buf[2],ip_buf[3]);
//apply according active wifi mode
WiFi.config( local_ip, gateway, subnet);
}
WiFi.enableAP(false);
delay(100);
//setup PHY_MODE
if (!CONFIG::read_byte(EP_STA_PHY_MODE, &bflag )) {
return false;
}
#ifdef ARDUINO_ARCH_ESP32
esp_wifi_set_protocol(ESP_IF_WIFI_STA, bflag);
#endif
//setup station mode
WiFi.mode(WIFI_STA);
delay(100);
#ifdef ARDUINO_ARCH_ESP8266
WiFi.setPhyMode((WiFiPhyMode_t)bflag);
#endif
WiFi.begin(sbuf, pwd);
delay(100);
byte i=0;
//try to connect
byte dot = 0;
String msg;
while (WiFi.status() != WL_CONNECTED && i<40) {
switch(WiFi.status()) {
case 1:
ESP_SERIAL_OUT.print(FPSTR(M117_));
ESP_SERIAL_OUT.println(F("No SSID found!"));
break;
case 4:
ESP_SERIAL_OUT.print(FPSTR(M117_));
ESP_SERIAL_OUT.println(F("No Connection!"));
break;
default:
ESP_SERIAL_OUT.print(FPSTR(M117_));
if (dot == 0)msg = F("Connecting");
dot++;
msg.trim();
msg +=F(".");
//for smoothieware to keep position
for (byte i= 0;i< 4-dot; i++)msg +=F(" ");
if (dot == 4)dot=0;
ESP_SERIAL_OUT.println(msg);
break;
}
delay(500);
i++;
}
if (WiFi.status() != WL_CONNECTED) {
ESP_SERIAL_OUT.print(FPSTR(M117_));
ESP_SERIAL_OUT.println(F("Not Connectied!"));
return false;
}
#ifdef ARDUINO_ARCH_ESP8266
WiFi.hostname(hostname);
#else
WiFi.setHostname(hostname);
#endif
}
//Get IP
if (WiFi.getMode()==WIFI_STA) {
currentIP=WiFi.localIP();
} else {
currentIP=WiFi.softAPIP();
}
ESP_SERIAL_OUT.print(FPSTR(M117_));
ESP_SERIAL_OUT.println(currentIP);
ESP_SERIAL_OUT.flush();
return true;
}
bool WIFI_CONFIG::Enable_servers()
{
//start web interface
web_interface = new WEBINTERFACE_CLASS(wifi_config.iweb_port);
//here the list of headers to be recorded
const char * headerkeys[] = {"Cookie"} ;
size_t headerkeyssize = sizeof(headerkeys)/sizeof(char*);
//ask server to track these headers
web_interface->web_server.collectHeaders(headerkeys, headerkeyssize );
#ifdef CAPTIVE_PORTAL_FEATURE
if (WiFi.getMode()!=WIFI_STA ) {
// if DNSServer is started with "*" for domain name, it will reply with
// provided IP to all DNS request
dnsServer.setErrorReplyCode(DNSReplyCode::NoError);
dnsServer.start(DNS_PORT, "*", WiFi.softAPIP());
}
#endif
web_interface->web_server.begin();
#ifdef TCP_IP_DATA_FEATURE
//start TCP/IP interface
data_server = new WiFiServer (wifi_config.idata_port);
data_server->begin();
data_server->setNoDelay(true);
#endif
#ifdef MDNS_FEATURE
// Set up mDNS responder:
//useless in AP mode and service consuming
if (WiFi.getMode()!=WIFI_AP ){
char hostname [MAX_HOSTNAME_LENGTH+1];
if (!CONFIG::read_string(EP_HOSTNAME, hostname, MAX_HOSTNAME_LENGTH)) {
strcpy(hostname,get_default_hostname());
}
if (!mdns.begin(hostname)) {
ESP_SERIAL_OUT.print(FPSTR(M117_));
ESP_SERIAL_OUT.println(F("Error with mDNS!"));
delay(1000);
} else {
// Check for any mDNS queries and send responses
delay(100);
wifi_config.mdns.addService("http", "tcp", wifi_config.iweb_port);
}
}
#endif
#if defined(SSDP_FEATURE) || defined(NETBIOS_FEATURE)
String shost;
if (!CONFIG::read_string(EP_HOSTNAME, shost, MAX_HOSTNAME_LENGTH)) {
shost=wifi_config.get_default_hostname();
}
#endif
#ifdef SSDP_FEATURE
String stmp;
SSDP.setSchemaURL("description.xml");
SSDP.setHTTPPort( wifi_config.iweb_port);
SSDP.setName(shost.c_str());
stmp=String(ESP.getChipId());
SSDP.setSerialNumber(stmp.c_str());
SSDP.setURL("/");
SSDP.setModelName("ESP8266 01");
SSDP.setModelNumber("01");
SSDP.setModelURL("http://espressif.com/en/products/esp8266/");
SSDP.setManufacturer("Espressif Systems");
SSDP.setManufacturerURL("http://espressif.com");
SSDP.setDeviceType("upnp:rootdevice");
if (WiFi.getMode()!=WIFI_AP )SSDP.begin();
#endif
#ifdef NETBIOS_FEATURE
//useless in AP mode and service consuming
if (WiFi.getMode()!=WIFI_AP )NBNS.begin(shost.c_str());
#endif
return true;
}
bool WIFI_CONFIG::Disable_servers()
{
#ifdef TCP_IP_DATA_FEATURE
data_server->stop();
#endif
#ifdef CAPTIVE_PORTAL_FEATURE
if (WiFi.getMode()!=WIFI_STA ) {
dnsServer.stop();
}
#endif
#ifdef NETBIOS_FEATURE
//useless in AP mode and service consuming
if (WiFi.getMode()!=WIFI_AP )NBNS.end();
#endif
web_interface->web_server.stop();
return true;
}
WIFI_CONFIG wifi_config;

View File

@@ -1,62 +0,0 @@
/*
wificonf.h - ESP3D configuration class
Copyright (c) 2014 Luc Lebosse. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef WIFICONF_H
#define WIFICONF_H
#include <Arduino.h>
#include "config.h"
#include "IPAddress.h"
#ifdef ARDUINO_ARCH_ESP8266
#include "ESP8266WiFi.h"
#ifdef MDNS_FEATURE
#include <ESP8266mDNS.h>
#endif
#else
#include <WiFi.h>
#ifdef MDNS_FEATURE
#include <ESPmDNS.h>
#endif
#endif
class WIFI_CONFIG
{
public:
// multicast DNS responder feature
#ifdef MDNS_FEATURE
MDNSResponder mdns;
#endif
WIFI_CONFIG();
int iweb_port;
int idata_port;
long baud_rate;
int sleep_mode;
int32_t getSignal(int32_t RSSI);
bool Setup(bool force_ap = false);
void Safe_Setup();
bool Enable_servers();
bool Disable_servers();
const char * get_default_hostname();
const char * get_hostname();
private:
char _hostname[33];
};
extern WIFI_CONFIG wifi_config;
#endif