Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
372 commits
Select commit Hold shift + click to select a range
b7243e9
Merge branch 'develop' of https://github.com/SUPLA/arduino into SUPLA…
klew Feb 22, 2020
8f0a5ce
Merge branch 'SUPLA-develop'
klew Feb 22, 2020
19897b8
fixed default port selection for secured and insecured connections
klew Feb 23, 2020
552e493
Added error handling for HC_SR04 sensor
klew Feb 23, 2020
7942cdb
Fixed "No SSL" example
klew Feb 23, 2020
d5d8862
Merge pull request #23 from klew/master
przemyslawzygmunt Feb 23, 2020
6864c36
Added error handling for PZEM elecitricty meters. Added "resetStorage…
klew Feb 27, 2020
6ee983a
Updated readme - testing
klew Mar 1, 2020
8fbb9df
Extracted setting of ssid and password of esp_wifi.h to public methods
klew Mar 2, 2020
35f26f0
Updated prints in esp_wifi and SuplaDevice. Added new status for lack of
klew Mar 3, 2020
44d6c52
Extacted channel class to cpp
klew Mar 3, 2020
cebd54b
ChannelExtended extracted to cpp file
klew Mar 3, 2020
c34a89e
Extracted Element and WillTrigger to cpp
klew Mar 4, 2020
9e4a54c
Ethernet interface will be reset if connection with server can't be
klew Mar 4, 2020
44f5440
Supla statuses updated
klew Mar 5, 2020
89721da
client.connect() method returns int, not bool
klew Mar 7, 2020
55d4a88
Added check if DHCP succeeded in Ethernet Shield
klew Mar 8, 2020
9e6844c
RGBW base element (triggers, and other enhancements)
klew Mar 13, 2020
88f5e74
Added three phase support for 3x PZEMv3
klew Mar 13, 2020
6dc63b4
getChannelType() added
klew Mar 13, 2020
c571a63
Changed folder structure to Arduino 1.5 lib format
klew Mar 15, 2020
2a0e9fd
Added HW serial option for PZEM sensors
klew Mar 15, 2020
c4e47d0
Additional file moved to supla/ folder
klew Mar 15, 2020
6a4c708
Moved timer functions to separate file
klew Mar 17, 2020
b36d5f6
Added missing file for timer
klew Mar 17, 2020
1c96cb4
Enabled timers for Element objects
klew Mar 20, 2020
44e8e44
Fixed compilation for SuplaSomfy
klew Mar 23, 2020
1916756
RGBW update to new library
klew Apr 7, 2020
d8c5cba
SuplaDevice cleanup from RGBW and dimmer code
klew Apr 7, 2020
741bab4
Added virtual binary sensor that can be changed in SW
klew Apr 13, 2020
6580d38
Extracted actions and events to separate file
klew Apr 25, 2020
a1fe3bb
Fixed style. Fix for millis(). Added implementation for
klew Apr 30, 2020
a45010b
Added BME280 implementation
klew Apr 30, 2020
7f51921
Fixed colorBrightness and brightness order in constructor in example
klew May 26, 2020
79e4b37
Fixed esp_timer name conflict with new ESP32 board versions
klew May 27, 2020
14bd9a3
Added setter for software version
klew Jun 12, 2020
d2b6e5d
Added getter for current status
klew Jun 12, 2020
854e4a5
Merge pull request #25 from klew/master
przemyslawzygmunt Jun 22, 2020
659a48d
Updated supla-common base to develop-v2.3
klew Jul 13, 2020
9349e87
Added setTimeout method to network inteface
klew Jul 13, 2020
f6b8f80
Channel state implementation for ESP8266 board
klew Jul 16, 2020
cabc53d
Update readme.md
klew Jul 17, 2020
63ed46f
Added channel state for Arduino Mega Ethernet Shield.
klew Jul 17, 2020
2942d5e
Merge branch 'master' of github.com:klew/arduino
klew Jul 17, 2020
4514da6
First version of support for roller shutter (on standard and bistable…
klew Aug 8, 2020
dba48f0
Added actions for roller shutter
klew Aug 8, 2020
9ca399e
SuplaDevice cleanup (removed old roller shutter and relay
klew Aug 8, 2020
4601994
Renamed examples (removed "Supla_" prefix). Fixed compilation for few of
klew Aug 8, 2020
e5feb87
Fixed bug in rgbw_base for TOGGLE_W
klew Aug 28, 2020
16122e7
Storage for roller shutters added. Support for EEPROM/Flash and Adafruit
klew Sep 8, 2020
eb1cb77
Added external library dependency information
klew Sep 8, 2020
3965034
Added const cast for FRAM library (compilation fix for ESP)
klew Sep 8, 2020
07b2771
Memory optimizations (usage of F() macro, removed not needed variables)
klew Sep 9, 2020
9fa3dae
Moved Impulse Counter to new framework
klew Sep 11, 2020
ac73026
SuplaDevice files cleanup. Compilation fix
klew Sep 11, 2020
786367d
Corrected RollerShutter and ImpulseCounter examples
klew Sep 11, 2020
f58f34b
Fixed compilation problem for electricity_meter
klew Sep 11, 2020
93a2999
Fixed ImpulseCounter example
klew Sep 13, 2020
10bad6a
Added option to trigger Impulse Counter reset to 0 via button
klew Sep 13, 2020
6d821ab
Update readme.md
klew Sep 14, 2020
4c091e2
Added missing colon
klew Sep 15, 2020
0b1bb1f
Added Supla::Clock which reads time from Supla server
klew Sep 16, 2020
079bda1
Extracted relay.cpp
klew Sep 16, 2020
a603198
Light relay with time setting for light (draft)
klew Sep 19, 2020
9e032e6
Merge branch 'master' of github.com:klew/arduino
klew Sep 19, 2020
68c5969
Temporarly removed SuplaSomfy example
klew Sep 19, 2020
0dc640e
Updated supla-common
klew Sep 19, 2020
4dd1df4
Commented out part of proto.h which is not compiling on Arduino Mega
klew Sep 19, 2020
15c76b3
Fixed compilation problem on ESP
klew Sep 19, 2020
a9c1637
Renamed willTrigger to addAction (changed order or parameters and base
klew Sep 19, 2020
5758a77
Merge branch 'master' into light_relay
klew Sep 23, 2020
e6afe5d
Added method for handling CALCFG messages
klew Sep 23, 2020
60fa8aa
Added "disableChannelState()" method to remove (i) icon from selected
klew Sep 23, 2020
606df07
Merge pull request #26 from klew/master
przemyslawzygmunt Sep 25, 2020
281578f
Fixed RollerShutter bug with STEP_BY_STEP action after startup
klew Sep 27, 2020
cdf8964
Merge branch 'master' into light_relay
klew Sep 27, 2020
925dcce
Added support for light source lifespan data for relay. Extracted
klew Sep 29, 2020
0ebbb94
Relays improvements: option to keep state among resets, option to
klew Sep 30, 2020
e8ecb38
Added storage write offset to debug print
klew Oct 2, 2020
93a75e8
Removed not needed comments
klew Oct 2, 2020
c75a0ac
Added storage element state section validation
klew Oct 3, 2020
7e5ec1e
Adjusted VirtualRelay to new options from Relay
klew Oct 4, 2020
947c8f1
Changed default EEPROM write period to 3 min. Added method to configure
klew Oct 5, 2020
0ff2866
Fixed bug in unset channel flag method
klew Oct 5, 2020
adb0dda
Added return statements in clock's function
klew Oct 18, 2020
348bcd5
Added support for reading data from Afore Inverted from its http status
klew Oct 21, 2020
1d001e8
Added example for Afore inverter
klew Oct 24, 2020
bfb0f2c
Disabled "duration ms" in turnOff received from Supla server for Relay
klew Nov 4, 2020
4beaffc
Formatting
klew Nov 4, 2020
3ed1c5c
Addded MOVE_UP and MOVE_DOWN actions for roller shutter
klew Nov 4, 2020
73c1257
Added MOVE_UP_OR_STOP and MOVE_DOWN_OR_STOP actions for roller shutter
klew Nov 4, 2020
c08a649
Added operation timeout (=60s) for roller shutter to switch off relays
klew Nov 4, 2020
9a88765
Added fetching data from Fronius inverter with example
klew Nov 6, 2020
e52d4b8
Added option to disable "channel state" function for element with two
klew Nov 8, 2020
df9980a
Added support for reading multiple Fronius devices from one interface
klew Nov 8, 2020
1ca40f1
Split button.h to .cpp
klew Nov 10, 2020
d578d22
Moved button handling to timers to avoid blocking operations in main
klew Nov 10, 2020
3289d65
add SHT3x sensor
krycha88 Nov 11, 2020
37c65d7
add Si7021 sensor
krycha88 Nov 11, 2020
e4ffa04
add Si7021 sensor for Sonoff
krycha88 Nov 11, 2020
07e9ea0
Refactoring SHT3x
krycha88 Nov 12, 2020
960b81c
Refactoring Si7021
krycha88 Nov 12, 2020
e06a600
Refactoring Si7021 for sonoff
krycha88 Nov 12, 2020
7f2ad3b
Added reset of WiFi connection if module wasn't able to connect with
klew Nov 13, 2020
0a88172
Added support for ON_HOLD and ON_CLICK_1 - ON_CLICK_9 events
klew Nov 13, 2020
d687ee1
Add MAX 6675 K sensor
krycha88 Nov 13, 2020
29568ee
repace -111 to TEMPERATURE_NOT_AVAILABLE
krycha88 Nov 13, 2020
975db27
Added multiclick for bistable button
klew Nov 13, 2020
a6619e9
Compilation warnings cleanup
klew Nov 16, 2020
0e42480
Added getter for current position of roller shutter
klew Nov 16, 2020
4ccf782
Memory reduction for Arduino Mega for electricity meter,
klew Nov 16, 2020
a5aea7e
Draft of button sequence/rhythm detection
klew Nov 16, 2020
345d1ca
supla-common rebase
klew Nov 16, 2020
208d843
Compilation warning cleanup
klew Nov 16, 2020
51306d4
Merge branch 'common-changes'
klew Nov 16, 2020
298e898
Added ON_CLICK_10
klew Nov 17, 2020
d4837c7
Merge branch 'master' into button-sequence
klew Nov 20, 2020
ffa196a
Added ON_CRAZY_CLICKER (for >= 10 multiclick)
klew Nov 20, 2020
fb3eaef
Added sequence button example
klew Nov 20, 2020
1b919cd
Relay will always reserve storage capacity, so it will not require whole
klew Dec 17, 2020
7fb5f53
Added Supla::Io to all relevant classes
klew Dec 28, 2020
ae3dc89
Added ScheduleSave to Storage class that is used by relay and roller
klew Dec 29, 2020
2834ac2
Update readme.md
klew Dec 30, 2020
042fea0
Merge pull request #28 from klew/master
przemyslawzygmunt Dec 31, 2020
fa01e64
Merge branch 'master' of github.com:klew/arduino
klew Jan 2, 2021
080ac34
Added "setRefreshRate(seconds)" method to modify how often sensor should
klew Jan 2, 2021
9945afb
Directory structure adjustment for Arduino library manager
klew Jan 5, 2021
ec931d8
Added structure for gtest.
klew Jan 5, 2021
feb103d
Added travis script for running tests
klew Jan 5, 2021
16fe65d
Updeted linux dist version
klew Jan 5, 2021
3a53c72
Testing: Failing test example
klew Jan 5, 2021
71a4f7b
Changed test running command and removed failing test
klew Jan 5, 2021
326285a
Update library.properties
klew Jan 5, 2021
9561e2f
Merged ESP32Wifi with ESPWifi classes.
klew Jan 6, 2021
53333ce
Merge branch 'master' of github.com:klew/arduino
klew Jan 6, 2021
6b76117
Added connection timeout during fetching data from Afore and Fronius PV
klew Jan 6, 2021
b3d894a
Create .drone.yml
klew Jan 7, 2021
31103dd
Testing drone
klew Jan 7, 2021
53b2723
Update .drone.yml
klew Jan 7, 2021
8f31ece
Moved ESP32 timer methods to Ticker
klew Jan 8, 2021
7503219
Merge branch 'master' of github.com:klew/supla-arduino
klew Jan 8, 2021
734bbfa
Update .drone.yml
klew Jan 8, 2021
a732073
Update .drone.yml
klew Jan 8, 2021
32d8e54
Added few tests for Channel class.
klew Jan 8, 2021
abdd860
Merge pull request #27 from krycha88/develop
przemyslawzygmunt Jan 9, 2021
cfab8ee
Additional Channel tests
klew Jan 9, 2021
54f3652
Merge remote-tracking branch 'upstream/develop'
klew Jan 9, 2021
38d1460
Update HC_SR04.h
ermaya Jan 9, 2021
be9d82a
Add files via upload
ermaya Jan 9, 2021
e96ad39
Additional Channel test
klew Jan 9, 2021
65c83df
Update HC_SR04.h
ermaya Jan 10, 2021
f086a16
Update HC_SR04_Distance_sensor_extended.ino
ermaya Jan 10, 2021
2730050
Update HC_SR04.h
ermaya Jan 10, 2021
63ee4af
Removed not needed code (and list of pointers) from Channel class (small
klew Jan 11, 2021
d3b2874
Update HC_SR04_Distance_sensor_extended.ino
ermaya Jan 11, 2021
e8c1205
Update HC_SR04.h
ermaya Jan 11, 2021
55546ce
Channel and ChannelExtended tests
klew Jan 11, 2021
0933e2e
Added getters for channel values
klew Jan 13, 2021
c0ede10
Moved Element::getChannel() method to public section
klew Jan 13, 2021
324bde6
Merge pull request #31 from klew/master
przemyslawzygmunt Jan 13, 2021
94c6d95
Modified examples, so they will compile on all supported boards without
klew Jan 13, 2021
bae20e5
Updated Arduino libraray author value
klew Jan 13, 2021
a64308c
Added getSecondaryChannel method
klew Jan 13, 2021
ca019bc
Added Supla::Io::Tests
klew Jan 14, 2021
72c4056
Merge pull request #32 from klew/master
przemyslawzygmunt Jan 14, 2021
f66fd3a
Added mocks for srpc, millis
klew Jan 15, 2021
76f8a30
Renamed Triggerable->ActionHandler
klew Jan 15, 2021
41da422
Moved addAction memory allocations from predefined array to dynamic
klew Jan 17, 2021
c224569
Added getter for storedDurationMs for Relay
klew Jan 17, 2021
1e8ff1f
Extracted cpp for VirtualRelay
klew Jan 18, 2021
ae3c221
Compilation fix
klew Jan 18, 2021
5ba9959
Added ability to call action on Channel level.
klew Jan 19, 2021
d66ffa2
Moved elements with one channel to ChannelElement structure
klew Jan 19, 2021
49ec770
Added PinStatusLed support (to inform about other pin value).
klew Jan 20, 2021
943af10
Added status LED to impulse counter example
klew Jan 20, 2021
1372a44
Added PinStatusLed to RollerShutter example
klew Jan 20, 2021
fdf61a1
Added triggering actions in InternalPinOutput
klew Jan 20, 2021
4defd51
Merge branch 'develop' of https://github.com/ermaya/arduino into erma…
klew Jan 20, 2021
ff20c98
Merge branch 'ermaya-develop' into develop
klew Jan 20, 2021
e94bd48
Merge pull request #39 from SUPLA/develop
klew Jan 20, 2021
e1c6f0b
Adjusted new example to recent changes
klew Jan 20, 2021
10a4371
Moved crc16 file to supla folder.
klew Jan 20, 2021
37c860a
Moved ChannelExtended tests outside ChannelTests
klew Jan 20, 2021
6f759cf
Added ON_SECONDARY_CHANNEL_CHANGE
klew Jan 21, 2021
636a596
Added baseline for Conditions in addAction
klew Jan 22, 2021
8c20717
Compilation fix
klew Jan 23, 2021
84d6f72
Removed WhileLess
klew Jan 23, 2021
e590c2b
Added conditions for addAction: OnLess, OnLessEq, OnGreater,
klew Jan 23, 2021
028d1ef
Added example for garage parking assist light which is using conditions
klew Jan 23, 2021
fa7ee8e
Added access to sensors list under DS18B20
klew Jan 24, 2021
8f176a3
Added proper handling of RGBW on/off action from mobile app.
klew Jan 26, 2021
5aecf01
Added storage handling for rgbw, rgb, and dimmer
klew Jan 27, 2021
81b121b
Tests for rgbw
klew Jan 27, 2021
98a9938
RGBW tests
klew Jan 27, 2021
5625f12
Tests for RGBW storage
klew Jan 27, 2021
a4e8d0b
Added tests for dimmer and rgb base classes
klew Jan 28, 2021
5f3fb18
Added repeated ON_HOLD action for button (configured by
klew Jan 28, 2021
ac90aa8
Added RGBWLeds, RGBLeds, DimmerLeds - to control light via PWM signal
klew Jan 29, 2021
59f0778
Added ESP32 specific "analogWrite" implementation for RGBW, RGB, Dimmer
klew Jan 29, 2021
cf1fa22
Added Button to RGBW example
klew Jan 29, 2021
e76419c
Fixed ITERATE_DIM_ALL for Dimmer
klew Jan 31, 2021
86ecf38
Fix for roller shutters with opening time >32s on Arduino Mega
klew Feb 6, 2021
243ef0b
Modified RGBW classes so they will not use separate colorBrightness pin
klew Feb 8, 2021
1d63885
Changed default fade time for RGBW to 500 ms
klew Feb 8, 2021
c5936d6
Added delay(0) in few places to help software WDT get some air time
klew Feb 10, 2021
66ab551
Extracted HC_SR04 to cpp
klew Feb 10, 2021
7fa8101
RGBW PWM scalling in range to 1023
klew Feb 11, 2021
c293e8f
Added averaging for HC_SR04 sensor
klew Feb 11, 2021
e43c70f
Simple button tests
klew Feb 11, 2021
6feb639
Simple button tests
klew Feb 11, 2021
65842c6
Added configurable EEPROM size for ESP boards.
klew Feb 14, 2021
544324c
ValidityTimeSec support for channels
klew Feb 15, 2021
36eea8c
Adjusted srpc mock to "c" value changed method
klew Feb 16, 2021
1bca499
Tests for SuplaDeviceClass, few mocks added.
klew Feb 18, 2021
6af21ab
Added more tests for SuplaDeviceClass.
klew Feb 19, 2021
4d302aa
Drone: -j32
klew Feb 19, 2021
61e407f
Added cleanup fixtures to remove dependencies between test runs.
klew Feb 19, 2021
845f650
Try some perl script instead of ts for timestamp
klew Feb 19, 2021
770f917
Added slack notifications to drone
klew Feb 22, 2021
5deaa6c
Drone slack integration template adjustment
klew Feb 22, 2021
1e64411
Fixed bug when SuplaDevice stuck when no reply to device registration
klew Feb 22, 2021
3562c37
Failed test - drone check
klew Feb 22, 2021
0be0d09
Removed timestamps from drone
klew Feb 22, 2021
87a5a1b
Enabled slack notifications on build failure
klew Feb 22, 2021
ed3c80d
Fix drone
klew Feb 22, 2021
fca93f9
Removed failing test
klew Feb 22, 2021
102f194
SuplaDevice - successful startup test
klew Feb 23, 2021
4dee3ab
SuplaDevice tests
klew Feb 26, 2021
95b2244
Added drone build duration
klew Feb 26, 2021
3541c2f
Drone: time
klew Feb 26, 2021
076e6f6
Merge pull request #33 from klew/master
przemyslawzygmunt Mar 1, 2021
58faf67
Merge pull request #40 from klew/develop
klew Mar 2, 2021
7700c7c
Exclude pull request from slack notif
klew Mar 2, 2021
4c53949
Merge pull request #41 from klew/develop
klew Mar 2, 2021
758358c
SuplaDevice statuses cleanup and reorganization
klew Mar 4, 2021
9719cbd
Restored values 10 and 17 for important device status values.
klew Mar 8, 2021
f85ae26
SolarEdge support - first not working draft
klew Mar 13, 2021
4121eec
addAction conditions should ignore invalid values of channels
klew Mar 15, 2021
ae7fb1b
Fixed signed/unsigned declarations for electricity meter and impulse
klew Mar 18, 2021
c2360b7
Fixed compilation for esp32
klew Mar 18, 2021
1db5368
Fixed test compilation
klew Mar 18, 2021
393d78f
Library version increment => 2.3.4.
klew Mar 22, 2021
7828c6d
Merge pull request #35 from klew/master
przemyslawzygmunt Mar 23, 2021
451fc87
Readme update
klew Mar 24, 2021
28c7bd3
Added corrections to sensor channels
klew Mar 24, 2021
643bbc6
Tests update
klew Mar 25, 2021
0273f7f
Readme update
klew Mar 26, 2021
65d036d
OnInvalid condition added (triggers actions when sensor value is invalid
klew Mar 26, 2021
bc75b62
ON_LONG_CLICK_x added to Button for mulitclicks after long press of a
klew Mar 28, 2021
5214981
Merge pull request #36 from klew/master
przemyslawzygmunt Mar 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
kind: pipeline
name: default

steps:
- name: compilation
image: rikorose/gcc-cmake
commands:
- mkdir extras/test/build
- cd extras/test/build
- cmake ..
- make -j32

- name: test
image: rikorose/gcc-cmake
commands:
- cd extras/test/build
- ./supladevicetests --gtest_repeat=50 --gtest_shuffle

- name: slack
image: plugins/slack
settings:
webhook:
from_secret: slack_webhook
channel: github
username: drone

# here's the template :)
# notice that the repo endpoint is hardcoded to `https://github.com/`.
# you may adjust it accordingly.
template: >
{{#if build.pull }}
*{{#success build.status}}✔{{ else }}✘{{/success}} {{ uppercasefirst build.status }}*: <https://github.com/{{ repo.owner }}/{{ repo.name }}/pull/{{ build.pull }}|Pull Request #{{ build.pull }}> in {{since build.created}}
{{else}}
*{{#success build.status}}✔{{ else }}✘{{/success}} {{ uppercasefirst build.status }}: Build #{{ build.number }}* (type: `{{ build.event }}`) in {{since build.created}}
{{/if}}

Commit: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commit/{{ build.commit }}|{{ truncate build.commit 8 }}> at: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commits/{{ build.branch }}|{{repo.owner}}/{{repo.name}}/{{ build.branch }}> by: {{ build.author }}

<{{ build.link }}|Visit build page ↗>
when:
status: [success, failure]
event:
exclude:
- pull_request

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extras/test/build/
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
os: linux
dist: xenial
sudo: false
language: cpp

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6

script:
- mkdir extras/test/build
- cd extras/test/build
- CXX=/usr/bin/g++-6 CC=/usr/bin/gcc-6 cmake ..
- make
- ./supladevicetests
91 changes: 91 additions & 0 deletions _clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 8
UseTab: Never
...

1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-cayman
74 changes: 74 additions & 0 deletions examples/Afore/Afore.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
Copyright (C) AC SOFTWARE SP. Z O.O.

This program 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 2
of the License, or (at your option) any later version.
This program 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 program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#include <SuplaDevice.h>
#include <supla/pv/afore.h>

// Choose proper network interface for your card:
#ifdef ARDUINO_ARCH_AVR
// Arduino Mega with EthernetShield W5100:
#include <supla/network/ethernet_shield.h>
// Ethernet MAC address
uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
Supla::EthernetShield ethernet(mac);

// Arduino Mega with ENC28J60:
// #include <supla/network/ENC28J60.h>
// Supla::ENC28J60 ethernet(mac);
#elif defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
// ESP8266 and ESP32 based board:
#include <supla/network/esp_wifi.h>
Supla::ESPWifi wifi("your_wifi_ssid", "your_wifi_password");
#endif

void setup() {

Serial.begin(115200);

// Replace the falowing GUID with value that you can retrieve from https://www.supla.org/arduino/get-guid
char GUID[SUPLA_GUID_SIZE] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

// Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

/*
* Having your device already registered at cloud.supla.org,
* you want to change CHANNEL sequence or remove any of them,
* then you must also remove the device itself from cloud.supla.org.
* Otherwise you will get "Channel conflict!" error.
*/

// CHANNEL0
// Put IP address of your Afore inverter, then port, and last parametere is base64 encoded "login:password"
// You can use any online base64 encoder to convert your login and password, i.e. https://www.base64encode.org/
new Supla::PV::Afore(IPAddress(192, 168, 0, 59), 80, "bG9naW46cGFzc3dvcmQ=");

/*
* Server address is available at https://cloud.supla.org
* If you do not have an account, you can create it at https://cloud.supla.org/account/create
* SUPLA and SUPLA CLOUD are free of charge
*/

SuplaDevice.begin(GUID, // Global Unique Identifier
"svr1.supla.org", // SUPLA server address
"email@address", // Email address used to login to Supla Cloud
AUTHKEY); // Authorization key
}

void loop() {
SuplaDevice.iterate();
}

89 changes: 89 additions & 0 deletions examples/DHT/DHT.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
Copyright (C) AC SOFTWARE SP. Z O.O.

This program 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 2
of the License, or (at your option) any later version.
This program 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 program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#include <SuplaDevice.h>
#include <supla/sensor/DHT.h>

// Choose proper network interface for your card:
#ifdef ARDUINO_ARCH_AVR
// Arduino Mega with EthernetShield W5100:
#include <supla/network/ethernet_shield.h>
// Ethernet MAC address
uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
Supla::EthernetShield ethernet(mac);

// Arduino Mega with ENC28J60:
// #include <supla/network/ENC28J60.h>
// Supla::ENC28J60 ethernet(mac);
#elif defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
// ESP8266 and ESP32 based board:
#include <supla/network/esp_wifi.h>
Supla::ESPWifi wifi("your_wifi_ssid", "your_wifi_password");
#endif

/*
* This example requires DHT sensor library installed.
* https://github.com/adafruit/DHT-sensor-library
*/

#define DHT1PIN 24
#define DHT1TYPE DHT22
#define DHT2PIN 25
#define DHT2TYPE DHT22

void setup() {

Serial.begin(115200);

// Replace the falowing GUID with value that you can retrieve from https://www.supla.org/arduino/get-guid
char GUID[SUPLA_GUID_SIZE] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

// Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

/*
* Having your device already registered at cloud.supla.org,
* you want to change CHANNEL sequence or remove any of them,
* then you must also remove the device itself from cloud.supla.org.
* Otherwise you will get "Channel conflict!" error.
*/

// This example adds two DHT22 sensors.

// CHANNEL0 - DHT22 Sensor
new Supla::Sensor::DHT(DHT1PIN, DHT1TYPE);

// CHANNEL1 - DHT22 Sensor
new Supla::Sensor::DHT(DHT2PIN, DHT2TYPE);

/*
* SuplaDevice Initialization.
* Server address is available at https://cloud.supla.org
* If you do not have an account, you can create it at https://cloud.supla.org/account/create
* SUPLA and SUPLA CLOUD are free of charge
*
*/

SuplaDevice.begin(GUID, // Global Unique Identifier
"svr1.supla.org", // SUPLA server address
"email@address", // Email address used to login to Supla Cloud
AUTHKEY); // Authorization key

}

void loop() {
SuplaDevice.iterate();
}
Loading