-
Notifications
You must be signed in to change notification settings - Fork 88
/
Config.h.example
89 lines (73 loc) · 3.58 KB
/
Config.h.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#pragma once
#define _SHINE_CONFIG_H_
// ---------------------------------------------------------------
// Build configuration area start
// ---------------------------------------------------------------
// Define used modbus version used by your invertor here. Currently
// only 120 (v1.20), 124 (v1.24) and 305 (v3.05) versions are supported.
// Also SPF5000ES (Probably SPF3000ES too) coded as 5000 supported.
// New protocols can be easily defined by adding new Growatt<version>.cpp/h
// files and then specifying the protocol there. See existing procol files
// for reference.
#define GROWATT_MODBUS_VERSION 124
// Setting this define to 0 will disable the MQTT functionality
#define MQTT_SUPPORTED 1
// Setting this define to 1 will ping the default gateway periodically
// if the ping is not successful, the wifi connection will be reestablished
#define PINGER_SUPPORTED 0
// Setting this define to 1 will enable the debug output via the serial port.
// The serial port is the same used for the communication to the inverter.
// Enabling this feature can cause problems with the inverter communication!
// For ShineWiFi-S everything seems to work perfect even though this flag is set
// #define ENABLE_SERIAL_DEBUG
// define this will enable a web page (<ip>/debug) where debug messages can be displayed
#define ENABLE_WEB_DEBUG
// define this will enable Remote Debug
// #define ENABLE_TELNET_DEBUG
#if defined(ENABLE_SERIAL_DEBUG) || defined(ENABLE_WEB_DEBUG) || defined(ENABLE_TELNET_DEBUG)
// to debug Modbus output turn this on (this is very verbose)
// #define DEBUG_MODBUS_OUTPUT
#endif
// Enable TLS connection from stick to broker. Make sure to update port and hostname to match the cert
// of the mqtt broker as well. Change this CERT to your custom mqtt cert.
//#define MQTTS_BROKER_CA_CERT "-----BEGIN CERTIFICATE-----\n" \
// "MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/\n" \
// "....\n" \
// "Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ\n" \
// "-----END CERTIFICATE-----\n"
// Setting this flag to 1 will simulate the inverter
// This could be helpful if it is night and the inverter is not working or
// during development where the stick is not connected to the inverter
// if Simulating the Inverter we've to set a Device Type this could be ShineWiFi_X or ShineWiFi_S
#define SIMULATE_INVERTER 0
#define SIMULATE_DEVICE ShineWiFi_X
// Data of the Wifi access point
// Default IP 192.168.4.1
// Hold down the Button for a few seconds to enter Access Point mode
#define HOSTNAME "Growatt"
#define APPassword "growsolar"
// Username and password for firmware update
#define UPDATE_USER "admin"
#define UPDATE_PASSWORD "admin"
// For boards without any button you can detect double resets with the Double reset detector by setting this to 1
#define ENABLE_DOUBLE_RESET 0
// Timer definitions:
// REFRESH_TIMER: Modbus polling rate [ms]
// RETRY_TIMER: Determines the time between reconnection [ms]
// LED_TIMER: Led blinking rate [ms]
// BUTTON_TIMER: enter config mode after 5*BUTTON_TIMER [ms]
#define REFRESH_TIMER 5000 // 5s default
#define WIFI_RETRY_TIMER 120000 // 120s default
#define LED_TIMER 500 // 0.5s default
#define BUTTON_TIMER 500 // 0.5s default
#if PINGER_SUPPORTED == 1
#define GATEWAY_IP IPAddress(192, 168, 178, 1)
#endif
#define LED_GN 0 // GPIO0
#define LED_RT 2 // GPIO2
#define LED_BL 16 // GPIO16
// Add support for the AP button on the normal Shine Stick. You can
// redefine AP_BUTTON_PRESSED to whatever condition you like for your stick.
#if ENABLE_AP_BUTTON == 1
#define AP_BUTTON_PRESSED analogRead(A0)<50
#endif