mirror of
https://github.com/anklimov/lighthub
synced 2025-12-08 12:49:50 +03:00
extracted MY_CONFIG_SERVER
small fixes
This commit is contained in:
13
README.md
13
README.md
@@ -78,3 +78,16 @@ First attempt to use platformio toolchain for compiling (work not completed yet)
|
|||||||
Please, open /variants/arduino_due_x/variant.cpp file, then edit USART0_Handler method definition like this
|
Please, open /variants/arduino_due_x/variant.cpp file, then edit USART0_Handler method definition like this
|
||||||
|
|
||||||
void USART0_Handler(void) __attribute__((weak));
|
void USART0_Handler(void) __attribute__((weak));
|
||||||
|
|
||||||
|
# Platformio
|
||||||
|
First of all install platformio framework. http://docs.platformio.org/en/latest/installation.html
|
||||||
|
git clone https://github.com/anklimov/lighthub.git
|
||||||
|
pio init --ide clion // prepare CMake build files for Intellij CLion IDE, look list if suppoerted ide here: http://docs.platformio.org/en/latest/ide.html
|
||||||
|
pio run -e due // this will build firmware for arduino due board
|
||||||
|
rm -Rf .piolibdeps // this will clean libraries folder. Try it if you have compilation problem
|
||||||
|
pio run -e megaatmega2560 //build for arduino mega
|
||||||
|
pio run -e due -t upload //build and upload firmware to arduino due
|
||||||
|
|
||||||
|
|
||||||
|
export PLATFORMIO_BUILD_FLAGS="-DMY_CONFIG_SERVER=192.168.1.1 -DWATCH_DOG_TICKER_DISABLE=1"
|
||||||
|
set ip address for your configuration server and completely disable wdt feature for AVR.
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ Config webserver
|
|||||||
#include <ArduinoHttpClient.h>
|
#include <ArduinoHttpClient.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WATCH_DOG_TICKER_DISABLE
|
#if defined(WATCH_DOG_TICKER_DISABLE)
|
||||||
#define wdt_en() wdt_disable()
|
#define wdt_en() wdt_disable()
|
||||||
#define wdt_dis() wdt_disable()
|
#define wdt_dis() wdt_disable()
|
||||||
#define wdt_res() wdt_disable()
|
#define wdt_res() wdt_disable()
|
||||||
@@ -161,7 +161,7 @@ extern Artnet *artnet;
|
|||||||
|
|
||||||
#define inprefix "/myhome/in/"
|
#define inprefix "/myhome/in/"
|
||||||
const char outprefix[] PROGMEM = "/myhome/s_out/";
|
const char outprefix[] PROGMEM = "/myhome/s_out/";
|
||||||
#define subprefix "/myhome/in/#"
|
const char subprefix[] PROGMEM = "/myhome/in/#";
|
||||||
|
|
||||||
aJsonObject *root = NULL;
|
aJsonObject *root = NULL;
|
||||||
aJsonObject *items = NULL;
|
aJsonObject *items = NULL;
|
||||||
@@ -755,6 +755,11 @@ void saveFlash(short n, char* str)
|
|||||||
void loadFlash(short n, char* str)
|
void loadFlash(short n, char* str)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
#ifndef MY_CONFIG_SERVER
|
||||||
|
#define CONFIG_SERVER "lazyhome.ru"
|
||||||
|
#else
|
||||||
|
#define CONFIG_SERVER QUOTE(MY_CONFIG_SERVER)
|
||||||
|
#endif
|
||||||
int getConfig (int arg_cnt, char **args)
|
int getConfig (int arg_cnt, char **args)
|
||||||
//(char *tokens)
|
//(char *tokens)
|
||||||
{
|
{
|
||||||
@@ -763,7 +768,7 @@ int getConfig (int arg_cnt, char **args)
|
|||||||
int returnCode =0;
|
int returnCode =0;
|
||||||
char ch;
|
char ch;
|
||||||
char URI [32];
|
char URI [32];
|
||||||
char server[32] = "lazyhome.ru";
|
char server[sizeof(CONFIG_SERVER)+21] = CONFIG_SERVER;
|
||||||
if (arg_cnt>0) {
|
if (arg_cnt>0) {
|
||||||
strncpy(server,args[1],sizeof(server)-1);
|
strncpy(server,args[1],sizeof(server)-1);
|
||||||
saveFlash(0,server);
|
saveFlash(0,server);
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ platform = atmelavr
|
|||||||
board = megaatmega2560
|
board = megaatmega2560
|
||||||
framework = arduino
|
framework = arduino
|
||||||
;lib_ldf_mode = chain+
|
;lib_ldf_mode = chain+
|
||||||
|
build_flags = !echo -n "-DPIO_SRC_REV="$(git rev-parse --short HEAD)
|
||||||
lib_deps =
|
lib_deps =
|
||||||
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
|
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
|
||||||
https://github.com/anklimov/DS2482_OneWire
|
https://github.com/anklimov/DS2482_OneWire
|
||||||
|
|||||||
Reference in New Issue
Block a user