├── .github └── workflows │ └── platformio-build.yml ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── examples └── Example1.cpp ├── library.json └── src ├── ABBAurora.cpp ├── ABBAurora.h ├── ABBAuroraEnums.h ├── ABBAuroraStrings.cpp └── ABBAuroraStrings.h /.github/workflows/platformio-build.yml: -------------------------------------------------------------------------------- 1 | name: PlatformIO CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | strategy: 10 | matrix: 11 | example: [examples/Example1.cpp] 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Cache pip 16 | uses: actions/cache@v2 17 | with: 18 | path: ~/.cache/pip 19 | key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} 20 | restore-keys: ${{ runner.os }}-pip- 21 | - name: Cache PlatformIO 22 | uses: actions/cache@v2 23 | with: 24 | path: ~/.platformio 25 | key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} 26 | - name: Set up Python 27 | uses: actions/setup-python@v2 28 | - name: Install PlatformIO 29 | run: | 30 | python -m pip install --upgrade pip 31 | pip install --upgrade platformio 32 | - name: Install library dependencies 33 | run: pio lib -g install 44 440 34 | - name: Run PlatformIO 35 | run: pio ci --lib="." --board=esp32cam 36 | env: 37 | PLATFORMIO_CI_SRC: ${{ matrix.example }} 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | .pioenvs 3 | .piolibdeps 4 | .pio 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Continuous Integration (CI) is the practice, in software 2 | # engineering, of merging all developer working copies with a shared mainline 3 | # several times a day < http://docs.platformio.org/page/ci/index.html > 4 | # 5 | # Documentation: 6 | # 7 | # * Travis CI Embedded Builds with PlatformIO 8 | # < https://docs.travis-ci.com/user/integration/platformio/ > 9 | # 10 | # * PlatformIO integration with Travis CI 11 | # < http://docs.platformio.org/page/ci/travis.html > 12 | # 13 | # * User Guide for `platformio ci` command 14 | # < http://docs.platformio.org/page/userguide/cmd_ci.html > 15 | # 16 | # 17 | # Please choice one of the following templates (proposed below) and uncomment 18 | # it (remove "# " before each line) or use own configuration according to the 19 | # Travis CI documentation (see above). 20 | # 21 | language: python 22 | python: 23 | - "3.6" 24 | 25 | sudo: false 26 | cache: 27 | directories: 28 | - "~/.platformio" 29 | 30 | env: 31 | - PLATFORMIO_CI_SRC=examples/Example1.cpp 32 | 33 | install: 34 | - pip install -U platformio 35 | 36 | # Examples depend on libraries below, lets install it 37 | # 38 | # http://platformio.org/lib/show/440/Thread 39 | # http://platformio.org/lib/show/44/Time 40 | - platformio lib -g install 44 440 41 | 42 | script: 43 | - platformio ci --lib="." --board=esp32cam 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | (This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.) 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | {description} 474 | Copyright (C) {year} {fullname} 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 489 | USA 490 | 491 | Also add information on how to contact you by electronic and paper mail. 492 | 493 | You should also get your employer (if you work as a programmer) or your 494 | school, if any, to sign a "copyright disclaimer" for the library, if 495 | necessary. Here is a sample; alter the names: 496 | 497 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 498 | library `Frob' (a library for tweaking knobs) written by James Random 499 | Hacker. 500 | 501 | {signature of Ty Coon}, 1 April 1990 502 | Ty Coon, President of Vice 503 | 504 | That's all there is to it! 505 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/jrbenito/ABBAurora.svg?branch=master)](https://travis-ci.org/jrbenito/ABBAurora) 2 | # ABBAurora 3 | ABB Aurora protocol (also used by former PowerOne in their Aurora Inverters) for communication with inverters and other devices 4 | 5 | ## Introduction 6 | 7 | Aurora protocol is used by ABB to control/monitor their power devices (inverters, central inverters, etc) over a RS485 bus. Usually 8 | inverters are capable of Aurora Protocol as well as Modbus RTU protocol (ABB sells a converter from Modbus RTU to Modbus TCP/IP). 9 | 10 | This library intends to communicate with ABB Inverters using RS485/Aurora Protocol. Most of commands here were derived from an old 11 | document from Power One (this company was acquired by ABB year ago) and others were derived from projecs like [aurora monitor](http://auroramonitor.sourceforge.net/) 12 | and [Linux Aurora program](http://www.curtronics.com/Solar/AuroraData.html) from Curtis Blank. 13 | 14 | A documentation of the Aurora Inverter Communication Protocol can be found [here](https://www.drhack.it/images/PDF/AuroraCommunicationProtocol_4_2.pdf). 15 | 16 | ## Original work 17 | 18 | Original arduino sketches (example provided) were originally wrote by Mr. Davide Rosa who was kind enough to give me permission to 19 | modify as a library and share under LGPL v2.1. 20 | 21 | Originals can be found on [Davide's page](http://www.drhack.it/arduino/32-lettura-inverte-power-one-aurora.html). 22 | 23 | ## New Products 24 | 25 | Please notice that newer product report model codes not recognized by this library yet. Please, send pull requests or open a issue 26 | with register values returned by your product and its model and I will be glad to merge/implement it. 27 | 28 | ## Similar Work 29 | 30 | Other Arduino projects that uses Aurora protocol 31 | 32 | . [ArdaSol](https://github.com/hpieren/ArdaSol) 33 | . [PVIMon](https://github.com/H4ndl3/pvimon) 34 | -------------------------------------------------------------------------------- /examples/Example1.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Simple sketch that shows the basic usage of the ABBAurora class. 3 | * Example is from an ESP32 with a MAX485 as RS485 interface. 4 | */ 5 | #include 6 | #include 7 | 8 | #define RX2 16 9 | #define TX2 17 10 | #define INVERTER_ADDRESS 2 11 | #define TX_CONTROL_GPIO 4 12 | 13 | ABBAurora *inverter; 14 | void setup() 15 | { 16 | Serial.begin(115200); 17 | ABBAurora::setup(Serial2, RX2, TX2, TX_CONTROL_GPIO); 18 | inverter = new ABBAurora(INVERTER_ADDRESS); 19 | Serial.println("Setup done"); 20 | } 21 | 22 | void loop() 23 | { 24 | if (inverter->ReadVersion()) 25 | { 26 | Serial.print("Inverter Name: "); 27 | Serial.println(inverter->Version.Par1); 28 | } 29 | else 30 | { 31 | Serial.print("Inverter could not be reached"); 32 | delay(500); 33 | return; 34 | } 35 | 36 | if (inverter->ReadDSPValue(POWER_IN_1, MODULE_MESSUREMENT)) 37 | { 38 | Serial.print("Pin1 : "); 39 | Serial.print(inverter->DSP.Value); 40 | Serial.println(" W"); 41 | } 42 | 43 | if (inverter->ReadCumulatedEnergy(CURRENT_DAY)) 44 | { 45 | Serial.print("Energy: "); 46 | Serial.print(inverter->CumulatedEnergy.Energy); 47 | Serial.println(" Wh"); 48 | } 49 | } -------------------------------------------------------------------------------- /library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ABB Aurora", 3 | "description": "ABB (PowerOne) Aurora protocol for communication with Inverters and compatible devices.", 4 | "keywords": "RS485, Aurora, ABB, Inverter, PV", 5 | "authors": [ 6 | { 7 | "name": "Davide Rosa", 8 | "email": "info@drhack.it", 9 | "url": "http://www.drhack.it" 10 | }, 11 | { 12 | "name": "Josenivaldo Benito Junior", 13 | "email": "jrbenito@benito.qsl.br", 14 | "url": "https://benito.com.br", 15 | "maintainer": true 16 | } 17 | ], 18 | "repository": { 19 | "type": "git", 20 | "url": "https://github.com/jrbenito/ABBAurora.git" 21 | }, 22 | "version": "1.0.1", 23 | "licence": "LGPL", 24 | "examples": [ 25 | "examples/*.cpp" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /src/ABBAurora.cpp: -------------------------------------------------------------------------------- 1 | #include "ABBAurora.h" 2 | #include "ABBAuroraStrings.h" 3 | 4 | byte ABBAurora::TXPinControl; 5 | HardwareSerial *ABBAurora::serial; 6 | 7 | ABBAurora::ABBAurora(byte address) 8 | { 9 | Address = address; 10 | SendStatus = false; 11 | ReceiveStatus = false; 12 | clearReceiveData(); 13 | } 14 | void ABBAurora::setup(HardwareSerial &hardwareSerial, byte RXGpioPin, byte TXGpioPin, byte TXControllPin) 15 | { 16 | TXPinControl = TXControllPin; 17 | 18 | pinMode(TXPinControl, OUTPUT); 19 | digitalWrite(TXPinControl, LOW); 20 | 21 | serial = &hardwareSerial; 22 | serial->begin(19200, SERIAL_8N1, RXGpioPin, TXGpioPin, false, 500); 23 | } 24 | 25 | void ABBAurora::clearData(byte *data, byte len) 26 | { 27 | for (int i = 0; i < len; i++) 28 | { 29 | data[i] = 0; 30 | } 31 | } 32 | 33 | int ABBAurora::Crc16(byte *data, int offset, int count) 34 | { 35 | byte BccLo = 0xFF; 36 | byte BccHi = 0xFF; 37 | 38 | for (int i = offset; i < (offset + count); i++) 39 | { 40 | byte New = data[offset + i] ^ BccLo; 41 | byte Tmp = New << 4; 42 | New = Tmp ^ New; 43 | Tmp = New >> 5; 44 | BccLo = BccHi; 45 | BccHi = New ^ Tmp; 46 | Tmp = New << 3; 47 | BccLo = BccLo ^ Tmp; 48 | Tmp = New >> 4; 49 | BccLo = BccLo ^ Tmp; 50 | } 51 | 52 | return (int)word(~BccHi, ~BccLo); 53 | } 54 | 55 | bool ABBAurora::Send(byte address, byte param0, byte param1, byte param2, byte param3, byte param4, byte param5, byte param6) 56 | { 57 | 58 | SendStatus = false; 59 | ReceiveStatus = false; 60 | 61 | byte SendData[10]; 62 | SendData[0] = address; 63 | SendData[1] = param0; 64 | SendData[2] = param1; 65 | SendData[3] = param2; 66 | SendData[4] = param3; 67 | SendData[5] = param4; 68 | SendData[6] = param5; 69 | SendData[7] = param6; 70 | 71 | int crc = Crc16(SendData, 0, 8); 72 | SendData[8] = lowByte(crc); 73 | SendData[9] = highByte(crc); 74 | 75 | clearReceiveData(); 76 | 77 | for (int i = 0; i < this->MaxAttempt; i++) 78 | { 79 | digitalWrite(TXPinControl, RS485Transmit); 80 | delay(50); 81 | 82 | if (serial->write(SendData, sizeof(SendData)) != 0) 83 | { 84 | serial->flush(); 85 | SendStatus = true; 86 | 87 | digitalWrite(TXPinControl, RS485Receive); 88 | 89 | if (serial->readBytes(ReceiveData, sizeof(ReceiveData)) != 0) 90 | { 91 | if ((int)word(ReceiveData[7], ReceiveData[6]) == Crc16(ReceiveData, 0, 6)) 92 | { 93 | ReceiveStatus = true; 94 | break; 95 | } 96 | } 97 | } 98 | } 99 | return ReceiveStatus; 100 | } 101 | 102 | void ABBAurora::clearReceiveData() 103 | { 104 | clearData(ReceiveData, 8); 105 | } 106 | 107 | /** 108 | * Reads a single value of the digital signal procesor. 109 | * Not all values are supported by all models. 110 | * Read values are in following Units: 111 | * Voltage V 112 | * Current A 113 | * Power W 114 | * Temperature °C 115 | * 116 | **/ 117 | bool ABBAurora::ReadDSPValue(DSP_VALUE_TYPE type, DSP_GLOBAL global) 118 | { 119 | if ((((int)type >= 1 && (int)type <= 9) || ((int)type >= 21 && (int)type <= 63)) && ((int)global >= 0 && (int)global <= 1)) 120 | { 121 | DSP.ReadState = Send(this->Address, (byte)59, type, global, (byte)0, (byte)0, (byte)0, (byte)0); 122 | 123 | if (DSP.ReadState == false) 124 | { 125 | ReceiveData[0] = 255; 126 | ReceiveData[1] = 255; 127 | } 128 | } 129 | else 130 | { 131 | DSP.ReadState = false; 132 | clearReceiveData(); 133 | ReceiveData[0] = 255; 134 | ReceiveData[1] = 255; 135 | } 136 | 137 | DSP.TransmissionState = ReceiveData[0]; 138 | DSP.GlobalState = ReceiveData[1]; 139 | 140 | foo.asBytes[0] = ReceiveData[5]; 141 | foo.asBytes[1] = ReceiveData[4]; 142 | foo.asBytes[2] = ReceiveData[3]; 143 | foo.asBytes[3] = ReceiveData[2]; 144 | 145 | DSP.Value = foo.asFloat; 146 | 147 | return DSP.ReadState; 148 | } 149 | 150 | bool ABBAurora::ReadTimeDate() 151 | { 152 | TimeDate.ReadState = Send(this->Address, (byte)70, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 153 | 154 | if (TimeDate.ReadState == false) 155 | { 156 | ReceiveData[0] = 255; 157 | ReceiveData[1] = 255; 158 | } 159 | 160 | TimeDate.TransmissionState = ReceiveData[0]; 161 | TimeDate.GlobalState = ReceiveData[1]; 162 | TimeDate.Seconds = ((unsigned long)ReceiveData[2] << 24) + ((unsigned long)ReceiveData[3] << 16) + ((unsigned long)ReceiveData[4] << 8) + (unsigned long)ReceiveData[5]; 163 | return TimeDate.ReadState; 164 | } 165 | 166 | bool ABBAurora::ReadLastFourAlarms() 167 | { 168 | LastFourAlarms.ReadState = Send(this->Address, (byte)86, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 169 | 170 | if (LastFourAlarms.ReadState == false) 171 | { 172 | ReceiveData[0] = 255; 173 | ReceiveData[1] = 255; 174 | ReceiveData[2] = 255; 175 | ReceiveData[3] = 255; 176 | ReceiveData[4] = 255; 177 | ReceiveData[5] = 255; 178 | } 179 | 180 | LastFourAlarms.TransmissionState = ReceiveData[0]; 181 | LastFourAlarms.GlobalState = ReceiveData[1]; 182 | LastFourAlarms.Alarms1 = ReceiveData[2]; 183 | LastFourAlarms.Alarms2 = ReceiveData[3]; 184 | LastFourAlarms.Alarms3 = ReceiveData[4]; 185 | LastFourAlarms.Alarms4 = ReceiveData[5]; 186 | 187 | return LastFourAlarms.ReadState; 188 | } 189 | 190 | bool ABBAurora::ReadJunctionBoxState(byte nj) 191 | { 192 | return Send(this->Address, (byte)200, nj, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 193 | } 194 | 195 | bool ABBAurora::ReadJunctionBoxVal(byte nj, byte par) 196 | { 197 | return Send(this->Address, (byte)201, nj, par, (byte)0, (byte)0, (byte)0, (byte)0); 198 | } 199 | 200 | // Inverters 201 | 202 | bool ABBAurora::ReadSystemPN() 203 | { 204 | SystemPN.ReadState = Send(this->Address, (byte)52, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 205 | 206 | SystemPN.PN = String(String((char)ReceiveData[0]) + String((char)ReceiveData[1]) + String((char)ReceiveData[2]) + String((char)ReceiveData[3]) + String((char)ReceiveData[4]) + String((char)ReceiveData[5])); 207 | 208 | return SystemPN.ReadState; 209 | } 210 | 211 | bool ABBAurora::ReadSystemSerialNumber() 212 | { 213 | SystemSerialNumber.ReadState = Send(this->Address, (byte)63, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 214 | 215 | SystemSerialNumber.SerialNumber = String(String((char)ReceiveData[0]) + String((char)ReceiveData[1]) + String((char)ReceiveData[2]) + String((char)ReceiveData[3]) + String((char)ReceiveData[4]) + String((char)ReceiveData[5])); 216 | 217 | return SystemSerialNumber.ReadState; 218 | } 219 | 220 | bool ABBAurora::ReadManufacturingWeekYear() 221 | { 222 | ManufacturingWeekYear.ReadState = Send(this->Address, (byte)65, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 223 | 224 | if (ManufacturingWeekYear.ReadState == false) 225 | { 226 | ReceiveData[0] = 255; 227 | ReceiveData[1] = 255; 228 | } 229 | 230 | ManufacturingWeekYear.TransmissionState = ReceiveData[0]; 231 | ManufacturingWeekYear.GlobalState = ReceiveData[1]; 232 | ManufacturingWeekYear.Week = String(String((char)ReceiveData[2]) + String((char)ReceiveData[3])); 233 | ManufacturingWeekYear.Year = String(String((char)ReceiveData[4]) + String((char)ReceiveData[5])); 234 | 235 | return ManufacturingWeekYear.ReadState; 236 | } 237 | 238 | bool ABBAurora::ReadFirmwareRelease() 239 | { 240 | FirmwareRelease.ReadState = Send(this->Address, (byte)72, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 241 | 242 | if (FirmwareRelease.ReadState == false) 243 | { 244 | ReceiveData[0] = 255; 245 | ReceiveData[1] = 255; 246 | } 247 | 248 | FirmwareRelease.TransmissionState = ReceiveData[0]; 249 | FirmwareRelease.GlobalState = ReceiveData[1]; 250 | FirmwareRelease.Release = String(String((char)ReceiveData[2]) + "." + String((char)ReceiveData[3]) + "." + String((char)ReceiveData[4]) + "." + String((char)ReceiveData[5])); 251 | 252 | return FirmwareRelease.ReadState; 253 | } 254 | 255 | bool ABBAurora::ReadCumulatedEnergy(CUMULATED_ENERGY_TYPE par) 256 | { 257 | if ((int)par >= 0 && (int)par <= 6) 258 | { 259 | CumulatedEnergy.ReadState = Send(this->Address, (byte)78, par, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 260 | 261 | if (CumulatedEnergy.ReadState == false) 262 | { 263 | ReceiveData[0] = 255; 264 | ReceiveData[1] = 255; 265 | } 266 | } 267 | else 268 | { 269 | CumulatedEnergy.ReadState = false; 270 | clearReceiveData(); 271 | ReceiveData[0] = 255; 272 | ReceiveData[1] = 255; 273 | } 274 | 275 | CumulatedEnergy.TransmissionState = ReceiveData[0]; 276 | CumulatedEnergy.GlobalState = ReceiveData[1]; 277 | if (CumulatedEnergy.ReadState == true) 278 | { 279 | ulo.asBytes[0] = ReceiveData[5]; 280 | ulo.asBytes[1] = ReceiveData[4]; 281 | ulo.asBytes[2] = ReceiveData[3]; 282 | ulo.asBytes[3] = ReceiveData[2]; 283 | 284 | CumulatedEnergy.Energy = ulo.asUlong; 285 | } 286 | return CumulatedEnergy.ReadState; 287 | } 288 | 289 | bool ABBAurora::WriteBaudRateSetting(byte baudcode) 290 | { 291 | if ((int)baudcode >= 0 && (int)baudcode <= 3) 292 | { 293 | return Send(this->Address, (byte)85, baudcode, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 294 | } 295 | else 296 | { 297 | clearReceiveData(); 298 | return false; 299 | } 300 | } 301 | 302 | // Central 303 | bool ABBAurora::ReadFlagsSwitchCentral() 304 | { 305 | return Send(this->Address, (byte)67, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 306 | } 307 | 308 | bool ABBAurora::ReadCumulatedEnergyCentral(byte var, byte ndays_h, byte ndays_l, byte global) 309 | { 310 | return Send(this->Address, (byte)68, var, ndays_h, ndays_l, global, (byte)0, (byte)0); 311 | } 312 | 313 | bool ABBAurora::ReadFirmwareReleaseCentral(byte var) 314 | { 315 | return Send(this->Address, (byte)72, var, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 316 | } 317 | 318 | bool ABBAurora::ReadBaudRateSettingCentral(byte baudcode, byte serialline) 319 | { 320 | return Send(this->Address, (byte)85, baudcode, serialline, (byte)0, (byte)0, (byte)0, (byte)0); 321 | } 322 | 323 | bool ABBAurora::ReadSystemInfoCentral(byte var) 324 | { 325 | return Send(this->Address, (byte)101, var, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 326 | } 327 | 328 | bool ABBAurora::ReadJunctionBoxMonitoringCentral(byte cf, byte rn, byte njt, byte jal, byte jah) 329 | { 330 | return Send(this->Address, (byte)103, cf, rn, njt, jal, jah, (byte)0); 331 | } 332 | 333 | bool ABBAurora::ReadSystemPNCentral() 334 | { 335 | return Send(this->Address, (byte)105, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 336 | } 337 | 338 | bool ABBAurora::ReadSystemSerialNumberCentral() 339 | { 340 | return Send(this->Address, (byte)107, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 341 | } 342 | 343 | bool ABBAurora::ReadState() 344 | { 345 | State.ReadState = Send(this->Address, (byte)50, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 346 | 347 | if (State.ReadState == false) 348 | { 349 | ReceiveData[0] = 255; 350 | ReceiveData[1] = 255; 351 | ReceiveData[2] = 255; 352 | ReceiveData[3] = 255; 353 | ReceiveData[4] = 255; 354 | ReceiveData[5] = 255; 355 | } 356 | 357 | State.TransmissionState = ReceiveData[0]; 358 | State.GlobalState = ReceiveData[1]; 359 | State.InverterState = ReceiveData[2]; 360 | State.Channel1State = ReceiveData[3]; 361 | State.Channel2State = ReceiveData[4]; 362 | State.AlarmState = ReceiveData[5]; 363 | 364 | return State.ReadState; 365 | } 366 | 367 | bool ABBAurora::ReadVersion() 368 | { 369 | Version.ReadState = Send(this->Address, (byte)58, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0); 370 | 371 | if (Version.ReadState == false) 372 | { 373 | ReceiveData[0] = 255; 374 | ReceiveData[1] = 255; 375 | } 376 | 377 | Version.TransmissionState = ReceiveData[0]; 378 | Version.GlobalState = ReceiveData[1]; 379 | 380 | Version.Par1 = ABBAuroraStrings::VersionPart1(ReceiveData[2]); 381 | Version.Par2 = ABBAuroraStrings::VersionPart2(ReceiveData[3]); 382 | Version.Par3 = ABBAuroraStrings::VersionPart3(ReceiveData[4]); 383 | Version.Par4 = ABBAuroraStrings::VersionPart4(ReceiveData[5]); 384 | 385 | return Version.ReadState; 386 | } -------------------------------------------------------------------------------- /src/ABBAurora.h: -------------------------------------------------------------------------------- 1 | #ifndef ABBAurora_h 2 | #define ABBAurora_h 3 | #include 4 | #include 5 | #include 6 | 7 | //RS485 control 8 | #define RS485Transmit HIGH 9 | #define RS485Receive LOW 10 | 11 | class ABBAurora 12 | { 13 | private: 14 | int MaxAttempt = 1; 15 | static byte TXPinControl; 16 | static HardwareSerial *serial; 17 | 18 | void clearData(byte *data, byte len); 19 | 20 | int Crc16(byte *data, int offset, int count); 21 | 22 | bool Send(byte address, byte param0, byte param1, byte param2, byte param3, byte param4, byte param5, byte param6); 23 | 24 | union { 25 | byte asBytes[4]; 26 | float asFloat; 27 | } foo; 28 | 29 | union { 30 | byte asBytes[4]; 31 | unsigned long asUlong; 32 | } ulo; 33 | 34 | public: 35 | bool SendStatus = false; 36 | bool ReceiveStatus = false; 37 | byte Address = 0; 38 | byte ReceiveData[8]; 39 | 40 | static void setup(HardwareSerial &serial, byte RXGpioPin, byte TXGpioPin, byte TXControllPin); 41 | 42 | ABBAurora(byte address); 43 | 44 | void clearReceiveData(); 45 | 46 | typedef struct 47 | { 48 | byte TransmissionState; 49 | byte GlobalState; 50 | byte InverterState; 51 | byte Channel1State; 52 | byte Channel2State; 53 | byte AlarmState; 54 | bool ReadState; 55 | } DataState; 56 | 57 | DataState State; 58 | 59 | bool ReadState(); 60 | 61 | typedef struct 62 | { 63 | byte TransmissionState; 64 | byte GlobalState; 65 | String Par1; 66 | String Par2; 67 | String Par3; 68 | String Par4; 69 | bool ReadState; 70 | } DataVersion; 71 | 72 | DataVersion Version; 73 | 74 | bool ReadVersion(); 75 | 76 | typedef struct 77 | { 78 | byte TransmissionState; 79 | byte GlobalState; 80 | float Value; 81 | bool ReadState; 82 | } DataDSP; 83 | 84 | DataDSP DSP; 85 | 86 | bool ReadDSPValue(DSP_VALUE_TYPE type, DSP_GLOBAL global); 87 | 88 | typedef struct 89 | { 90 | byte TransmissionState; 91 | byte GlobalState; 92 | unsigned long Seconds; 93 | bool ReadState; 94 | } DataTimeDate; 95 | 96 | DataTimeDate TimeDate; 97 | 98 | bool ReadTimeDate(); 99 | 100 | typedef struct 101 | { 102 | byte TransmissionState; 103 | byte GlobalState; 104 | byte Alarms1; 105 | byte Alarms2; 106 | byte Alarms3; 107 | byte Alarms4; 108 | bool ReadState; 109 | } DataLastFourAlarms; 110 | 111 | DataLastFourAlarms LastFourAlarms; 112 | 113 | bool ReadLastFourAlarms(); 114 | 115 | bool ReadJunctionBoxState(byte nj); 116 | 117 | bool ReadJunctionBoxVal(byte nj, byte par); 118 | 119 | // Inverters 120 | typedef struct 121 | { 122 | String PN; 123 | bool ReadState; 124 | } DataSystemPN; 125 | 126 | DataSystemPN SystemPN; 127 | 128 | bool ReadSystemPN(); 129 | 130 | typedef struct 131 | { 132 | String SerialNumber; 133 | bool ReadState; 134 | } DataSystemSerialNumber; 135 | 136 | DataSystemSerialNumber SystemSerialNumber; 137 | 138 | bool ReadSystemSerialNumber(); 139 | 140 | typedef struct 141 | { 142 | byte TransmissionState; 143 | byte GlobalState; 144 | String Week; 145 | String Year; 146 | bool ReadState; 147 | } DataManufacturingWeekYear; 148 | 149 | DataManufacturingWeekYear ManufacturingWeekYear; 150 | 151 | bool ReadManufacturingWeekYear(); 152 | 153 | typedef struct 154 | { 155 | byte TransmissionState; 156 | byte GlobalState; 157 | String Release; 158 | bool ReadState; 159 | } DataFirmwareRelease; 160 | 161 | DataFirmwareRelease FirmwareRelease; 162 | 163 | bool ReadFirmwareRelease(); 164 | 165 | typedef struct 166 | { 167 | byte TransmissionState; 168 | byte GlobalState; 169 | unsigned long Energy; 170 | bool ReadState; 171 | } DataCumulatedEnergy; 172 | 173 | DataCumulatedEnergy CumulatedEnergy; 174 | 175 | bool ReadCumulatedEnergy(CUMULATED_ENERGY_TYPE par); 176 | 177 | bool WriteBaudRateSetting(byte baudcode); 178 | 179 | // Central 180 | bool ReadFlagsSwitchCentral(); 181 | 182 | bool ReadCumulatedEnergyCentral(byte var, byte ndays_h, byte ndays_l, byte global); 183 | 184 | bool ReadFirmwareReleaseCentral(byte var); 185 | 186 | bool ReadBaudRateSettingCentral(byte baudcode, byte serialline); 187 | 188 | bool ReadSystemInfoCentral(byte var); 189 | 190 | bool ReadJunctionBoxMonitoringCentral(byte cf, byte rn, byte njt, byte jal, byte jah); 191 | 192 | bool ReadSystemPNCentral(); 193 | 194 | bool ReadSystemSerialNumberCentral(); 195 | }; 196 | 197 | #endif 198 | -------------------------------------------------------------------------------- /src/ABBAuroraEnums.h: -------------------------------------------------------------------------------- 1 | #ifndef ABBAuroraEnums_h 2 | #define ABBAuroraEnums_h 3 | 4 | 5 | enum DSP_VALUE_TYPE 6 | { 7 | GRID_VOLTAGE = 1, 8 | GRID_CURRENT = 2, 9 | GRID_POWER = 3, 10 | FREQUENCY = 4, 11 | V_BULK = 5, 12 | I_LEAK_DC_DC = 6, 13 | I_LEAK_INVERTER = 7, 14 | POWER_IN_1 = 8, 15 | POWER_IN_2 = 9, 16 | TEMPERATURE_INVERTER = 21, 17 | TEMPERATURE_BOOSTER = 22, 18 | V_IN_1 = 23, 19 | I_IN_1 = 25, 20 | V_IN_2 = 26, 21 | I_IN_2 = 27, 22 | DC_DC_GRID_VOLTAGE = 28, 23 | DC_DC_GRID_FREQUENCY = 29, 24 | ISOLATION_RESISTANCE = 30, 25 | DC_DC_V_BULK = 31, 26 | AVERAGE_GRID_VOLTAGE = 32, 27 | V_BULK_MID = 33, 28 | POWER_PEAK = 34, 29 | POWER_PEAK_TODAY = 35, 30 | GRID_VOLTAGE_NEUTRAL = 36, 31 | WIND_GENERATOR_FREQENCY = 37, 32 | GRID_VOLTAGE_NEUTRAL_PHASE = 38, 33 | GRID_CURRENT_PHASE_R = 39, 34 | GRID_CURRENT_PHASE_S = 40, 35 | GRID_CURRENT_PHASE_T = 41, 36 | FREQUENCY_PHASE_R = 42, 37 | FREQUENCY_PHASE_S = 43, 38 | FREQUENCY_PHASE_T = 44, 39 | V_BULK_POSITIVE = 45, 40 | V_BULK_NEGATIVE = 46, 41 | TEMPERATURE_SUPERVISOR = 47, 42 | TEMPERATURE_ALIM = 48, 43 | TEMPERATURE_HEAT_SINK = 49, 44 | TEMPERATURE_1 = 50, 45 | TEMPERATURE_2 = 51, 46 | TEMPERATURE_3 = 52, 47 | FAN_SPEED_1 = 53, 48 | FAN_SPEED_2 = 54, 49 | FAN_SPEED_3 = 55, 50 | FAN_SPEED_4 = 56, 51 | FAN_SPEED_5 = 57, 52 | POWER_SATURATION_LIMIT = 58, 53 | V_PANEL_MICRO = 60, 54 | GRID_VOLTAGE_PHASE_R = 61, 55 | GRID_VOLTAGE_PHASE_S = 62, 56 | GRID_VOLTAGE_PHASE_T = 63 57 | 58 | }; 59 | 60 | enum DSP_GLOBAL 61 | { 62 | GLOBAL_MESSUREMENT = 1, 63 | MODULE_MESSUREMENT = 0, 64 | }; 65 | 66 | enum CUMULATED_ENERGY_TYPE 67 | { 68 | CURRENT_DAY = 0, 69 | CURRENT_WEEK = 1, 70 | CURRENT_MONTH = 3, 71 | CURRENT_YEAR = 4, 72 | TOTAL = 5, 73 | SINCE_RESET = 6 74 | }; 75 | #endif 76 | -------------------------------------------------------------------------------- /src/ABBAuroraStrings.cpp: -------------------------------------------------------------------------------- 1 | #include "ABBAuroraStrings.h" 2 | 3 | String ABBAuroraStrings::TransmissionState(byte id) 4 | { 5 | switch (id) 6 | { 7 | case 0: 8 | return F("Everything is OK."); 9 | case 51: 10 | return F("Command is not implemented"); 11 | case 52: 12 | return F("Variable does not exist"); 13 | case 53: 14 | return F("Variable value is out of range"); 15 | case 54: 16 | return F("EEprom not accessible"); 17 | case 55: 18 | return F("Not Toggled Service Mode"); 19 | case 56: 20 | return F("Can not send the command to internal micro"); 21 | case 57: 22 | return F("Command not Executed"); 23 | case 58: 24 | return F("The variable is not available, retry"); 25 | default: 26 | return F("Unknown"); 27 | } 28 | } 29 | 30 | String ABBAuroraStrings::GlobalState(byte id) 31 | { 32 | switch (id) 33 | { 34 | case 0: 35 | return F("Sending Parameters"); 36 | case 1: 37 | return F("Wait Sun / Grid"); 38 | case 2: 39 | return F("Checking Grid"); 40 | case 3: 41 | return F("Measuring Riso"); 42 | case 4: 43 | return F("DcDc Start"); 44 | case 5: 45 | return F("Inverter Start"); 46 | case 6: 47 | return F("Run"); 48 | case 7: 49 | return F("Recovery"); 50 | case 8: 51 | return F("Pausev"); 52 | case 9: 53 | return F("Ground Fault"); 54 | case 10: 55 | return F("OTH Fault"); 56 | case 11: 57 | return F("Address Setting"); 58 | case 12: 59 | return F("Self Test"); 60 | case 13: 61 | return F("Self Test Fail"); 62 | case 14: 63 | return F("Sensor Test + Meas.Riso"); 64 | case 15: 65 | return F("Leak Fault"); 66 | case 16: 67 | return F("Waiting for manual reset"); 68 | case 17: 69 | return F("Internal Error E026"); 70 | case 18: 71 | return F("Internal Error E027"); 72 | case 19: 73 | return F("Internal Error E028"); 74 | case 20: 75 | return F("Internal Error E029"); 76 | case 21: 77 | return F("Internal Error E030"); 78 | case 22: 79 | return F("Sending Wind Table"); 80 | case 23: 81 | return F("Failed Sending table"); 82 | case 24: 83 | return F("UTH Fault"); 84 | case 25: 85 | return F("Remote OFF"); 86 | case 26: 87 | return F("Interlock Fail"); 88 | case 27: 89 | return F("Executing Autotest"); 90 | case 30: 91 | return F("Waiting Sun"); 92 | case 31: 93 | return F("Temperature Fault"); 94 | case 32: 95 | return F("Fan Staucked"); 96 | case 33: 97 | return F("Int.Com.Fault"); 98 | case 34: 99 | return F("Slave Insertion"); 100 | case 35: 101 | return F("DC Switch Open"); 102 | case 36: 103 | return F("TRAS Switch Open"); 104 | case 37: 105 | return F("MASTER Exclusion"); 106 | case 38: 107 | return F("Auto Exclusion"); 108 | case 98: 109 | return F("Erasing Internal EEprom"); 110 | case 99: 111 | return F("Erasing External EEprom"); 112 | case 100: 113 | return F("Counting EEprom"); 114 | case 101: 115 | return F("Freeze"); 116 | default: 117 | return F("Unknown"); 118 | } 119 | } 120 | 121 | String ABBAuroraStrings::DcDcState(byte id) 122 | { 123 | switch (id) 124 | { 125 | case 0: 126 | return F("DcDc OFF"); 127 | case 1: 128 | return F("Ramp Start"); 129 | case 2: 130 | return F("MPPT"); 131 | case 3: 132 | return F("Not Used"); 133 | case 4: 134 | return F("Input OC"); 135 | case 5: 136 | return F("Input UV"); 137 | case 6: 138 | return F("Input OV"); 139 | case 7: 140 | return F("Input Low"); 141 | case 8: 142 | return F("No Parameters"); 143 | case 9: 144 | return F("Bulk OV"); 145 | case 10: 146 | return F("Communication Error"); 147 | case 11: 148 | return F("Ramp Fail"); 149 | case 12: 150 | return F("Internal Error"); 151 | case 13: 152 | return F("Input mode Error"); 153 | case 14: 154 | return F("Ground Fault"); 155 | case 15: 156 | return F("Inverter Fail"); 157 | case 16: 158 | return F("DcDc IGBT Sat"); 159 | case 17: 160 | return F("DcDc ILEAK Fail"); 161 | case 18: 162 | return F("DcDc Grid Fail"); 163 | case 19: 164 | return F("DcDc Comm.Error"); 165 | default: 166 | return F("Unknown"); 167 | } 168 | } 169 | 170 | String ABBAuroraStrings::InverterState(byte id) 171 | { 172 | switch (id) 173 | { 174 | case 0: 175 | return F("Stand By"); 176 | case 1: 177 | return F("Checking Grid"); 178 | case 2: 179 | return F("Run"); 180 | case 3: 181 | return F("Bulk OV"); 182 | case 4: 183 | return F("Out OC"); 184 | case 5: 185 | return F("IGBT Sat"); 186 | case 6: 187 | return F("Bulk UV"); 188 | case 7: 189 | return F("Degauss Error"); 190 | case 8: 191 | return F("No Parameters"); 192 | case 9: 193 | return F("Bulk Low"); 194 | case 10: 195 | return F("Grid OV"); 196 | case 11: 197 | return F("Communication Error"); 198 | case 12: 199 | return F("Degaussing"); 200 | case 13: 201 | return F("Starting"); 202 | case 14: 203 | return F("Bulk Cap Fail"); 204 | case 15: 205 | return F("Leak Fail"); 206 | case 16: 207 | return F("DcDc Fail"); 208 | case 17: 209 | return F("Ileak Sensor Fail"); 210 | case 18: 211 | return F("SelfTest: relay inverter"); 212 | case 19: 213 | return F("SelfTest : wait for sensor test"); 214 | case 20: 215 | return F("SelfTest : test relay DcDc + sensor"); 216 | case 21: 217 | return F("SelfTest : relay inverter fail"); 218 | case 22: 219 | return F("SelfTest timeout fail"); 220 | case 23: 221 | return F("SelfTest : relay DcDc fail"); 222 | case 24: 223 | return F("Self Test 1"); 224 | case 25: 225 | return F("Waiting self test start"); 226 | case 26: 227 | return F("Dc Injection"); 228 | case 27: 229 | return F("Self Test 2"); 230 | case 28: 231 | return F("Self Test 3"); 232 | case 29: 233 | return F("Self Test 4"); 234 | case 30: 235 | return F("Internal Error"); 236 | case 31: 237 | return F("Internal Error"); 238 | case 40: 239 | return F("Forbidden State"); 240 | case 41: 241 | return F("Input UC"); 242 | case 42: 243 | return F("Zero Power"); 244 | case 43: 245 | return F("Grid Not Present"); 246 | case 44: 247 | return F("Waiting Start"); 248 | case 45: 249 | return F("MPPT"); 250 | case 46: 251 | return F("Grid Fail"); 252 | case 47: 253 | return F("Input OC"); 254 | default: 255 | return F("Unknown"); 256 | } 257 | } 258 | 259 | String ABBAuroraStrings::AlarmState(byte id) 260 | { 261 | switch (id) 262 | { 263 | case 0: 264 | return F("No Alarm"); 265 | case 1: 266 | return F("Sun Low"); 267 | case 2: 268 | return F("Input OC"); 269 | case 3: 270 | return F("Input UV"); 271 | case 4: 272 | return F("Input OV"); 273 | case 5: 274 | return F("Sun Low"); 275 | case 6: 276 | return F("No Parameters"); 277 | case 7: 278 | return F("Bulk OV"); 279 | case 8: 280 | return F("Comm.Error"); 281 | case 9: 282 | return F("Output OC"); 283 | case 10: 284 | return F("IGBT Sat"); 285 | case 11: 286 | return F("Bulk UV"); 287 | case 12: 288 | return F("Internal error"); 289 | case 13: 290 | return F("Grid Fail"); 291 | case 14: 292 | return F("Bulk Low"); 293 | case 15: 294 | return F("Ramp Fail"); 295 | case 16: 296 | return F("Dc / Dc Fail"); 297 | case 17: 298 | return F("Wrong Mode"); 299 | case 18: 300 | return F("Ground Fault"); 301 | case 19: 302 | return F("Over Temp."); 303 | case 20: 304 | return F("Bulk Cap Fail"); 305 | case 21: 306 | return F("Inverter Fail"); 307 | case 22: 308 | return F("Start Timeout"); 309 | case 23: 310 | return F("Ground Fault"); 311 | case 24: 312 | return F("Degauss error"); 313 | case 25: 314 | return F("Ileak sens.fail"); 315 | case 26: 316 | return F("DcDc Fail"); 317 | case 27: 318 | return F("Self Test Error 1"); 319 | case 28: 320 | return F("Self Test Error 2"); 321 | case 29: 322 | return F("Self Test Error 3"); 323 | case 30: 324 | return F("Self Test Error 4"); 325 | case 31: 326 | return F("DC inj error"); 327 | case 32: 328 | return F("Grid OV"); 329 | case 33: 330 | return F("Grid UV"); 331 | case 34: 332 | return F("Grid OF"); 333 | case 35: 334 | return F("Grid UF"); 335 | case 36: 336 | return F("Z grid Hi"); 337 | case 37: 338 | return F("Internal error"); 339 | case 38: 340 | return F("Riso Low"); 341 | case 39: 342 | return F("Vref Error"); 343 | case 40: 344 | return F("Error Meas V"); 345 | case 41: 346 | return F("Error Meas F"); 347 | case 42: 348 | return F("Error Meas Z"); 349 | case 43: 350 | return F("Error Meas Ileak"); 351 | case 44: 352 | return F("Error Read V"); 353 | case 45: 354 | return F("Error Read I"); 355 | case 46: 356 | return F("Table fail"); 357 | case 47: 358 | return F("Fan Fail"); 359 | case 48: 360 | return F("UTH"); 361 | case 49: 362 | return F("Interlock fail"); 363 | case 50: 364 | return F("Remote Off"); 365 | case 51: 366 | return F("Vout Avg errror"); 367 | case 52: 368 | return F("Battery low"); 369 | case 53: 370 | return F("Clk fail"); 371 | case 54: 372 | return F("Input UC"); 373 | case 55: 374 | return F("Zero Power"); 375 | case 56: 376 | return F("Fan Stucked"); 377 | case 57: 378 | return F("DC Switch Open"); 379 | case 58: 380 | return F("Tras Switch Open"); 381 | case 59: 382 | return F("AC Switch Open"); 383 | case 60: 384 | return F("Bulk UV"); 385 | case 61: 386 | return F("Autoexclusion"); 387 | case 62: 388 | return F("Grid df / dt"); 389 | case 63: 390 | return F("Den switch Open"); 391 | case 64: 392 | return F("Jbox fail"); 393 | default: 394 | return F("Unknown"); 395 | } 396 | } 397 | 398 | String ABBAuroraStrings::VersionPart1(byte id) 399 | { 400 | switch ((char)id) 401 | { 402 | case 'i': 403 | return F("Aurora 2 kW indoor"); 404 | case 'o': 405 | return F("Aurora 2 kW outdoor"); 406 | case 'I': 407 | return F("Aurora 3.6 kW indoor"); 408 | case 'O': 409 | return F("Aurora 3.0 - 3.6 kW outdoor"); 410 | case '5': 411 | return F("Aurora 5.0 kW outdoor"); 412 | case '6': 413 | return F("Aurora 6 kW outdoor"); 414 | case 'P': 415 | return F("3 - phase interface (3G74)"); 416 | case 'C': 417 | return F("Aurora 50kW module"); 418 | case '4': 419 | return F("Aurora 4.2kW new"); 420 | case '3': 421 | return F("Aurora 3.6kW new"); 422 | case '2': 423 | return F("Aurora 3.3kW new"); 424 | case '1': 425 | return F("Aurora 3.0kW new"); 426 | case 'D': 427 | return F("Aurora 12.0kW"); 428 | case 'X': 429 | return F("Aurora 10.0kW"); 430 | default: 431 | return F("Unknown"); 432 | } 433 | } 434 | 435 | String ABBAuroraStrings::VersionPart2(byte id) 436 | { 437 | switch ((char)id) 438 | { 439 | case 'A': 440 | return F("UL1741"); 441 | case 'E': 442 | return F("VDE0126"); 443 | case 'S': 444 | return F("DR 1663 / 2000"); 445 | case 'I': 446 | return F("ENEL DK 5950"); 447 | case 'U': 448 | return F("UK G83"); 449 | case 'K': 450 | return F("AS 4777"); 451 | default: 452 | return F("Unknown"); 453 | } 454 | } 455 | 456 | String ABBAuroraStrings::VersionPart3(byte id) 457 | { 458 | 459 | switch ((char)id) 460 | { 461 | case 'N': 462 | return F("Transformerless Version"); 463 | case 'T': 464 | return F("Transformer Version"); 465 | default: 466 | return F("Unknown"); 467 | } 468 | } 469 | String ABBAuroraStrings::VersionPart4(byte id) 470 | { 471 | switch ((char)id) 472 | { 473 | case 'W': 474 | return F("Wind version"); 475 | case 'N': 476 | return F("PV version"); 477 | default: 478 | return F("Unknown"); 479 | } 480 | } -------------------------------------------------------------------------------- /src/ABBAuroraStrings.h: -------------------------------------------------------------------------------- 1 | #ifndef ABBAuroraStrings_h 2 | #define ABBAuroraStrings_h 3 | #include 4 | 5 | class ABBAuroraStrings { 6 | private: 7 | 8 | 9 | public: 10 | static String TransmissionState(byte id); 11 | static String GlobalState(byte id); 12 | static String DcDcState(byte id); 13 | static String InverterState(byte id); 14 | static String AlarmState(byte id); 15 | static String VersionPart1(byte id); 16 | static String VersionPart2(byte id); 17 | static String VersionPart3(byte id); 18 | static String VersionPart4(byte id); 19 | }; 20 | #endif 21 | --------------------------------------------------------------------------------