├── .gitignore ├── LICENSE ├── NiMH_battery_charger_logger2.pdf ├── charger2.json ├── charger2.sql ├── images ├── 2020-03-11.212437.shot.png ├── 2020-03-12.130635.shot.png ├── 2020-03-24.124024.shot.png ├── 2020-03-24.164721.shot.png ├── 2020-03-28.190610.shot.png └── 2020-03-30.115437.shot.png └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.backup -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /NiMH_battery_charger_logger2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msillano/NiMH_charger_logger/b29a164dd1b54601108913b8942b531f2c29f2e8/NiMH_battery_charger_logger2.pdf -------------------------------------------------------------------------------- /charger2.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "e4b5f6.297b9a08", 4 | "type": "tab", 5 | "label": "Flow 1", 6 | "disabled": false, 7 | "info": "" 8 | }, 9 | { 10 | "id": "19fd9486.38d54b", 11 | "type": "csv", 12 | "z": "e4b5f6.297b9a08", 13 | "name": "", 14 | "sep": ";", 15 | "hdrin": "", 16 | "hdrout": false, 17 | "multi": "one", 18 | "ret": "\\r\\n", 19 | "temp": "nsec, ahbatt, ic, vrd, vb, deltav, ri, tbatt, deltat", 20 | "skip": "0", 21 | "strings": false, 22 | "x": 1530, 23 | "y": 1420, 24 | "wires": [ 25 | [ 26 | "f22eae6f.41a27" 27 | ] 28 | ], 29 | "info": "note:\nColumns must be compatibe with first row, values are topic." 30 | }, 31 | { 32 | "id": "dc4ab095.0486b", 33 | "type": "file", 34 | "z": "e4b5f6.297b9a08", 35 | "name": "to CSV file", 36 | "filename": "", 37 | "appendNewline": false, 38 | "createDir": true, 39 | "overwriteFile": "false", 40 | "encoding": "utf8", 41 | "x": 1770, 42 | "y": 1300, 43 | "wires": [ 44 | [] 45 | ] 46 | }, 47 | { 48 | "id": "f22eae6f.41a27", 49 | "type": "function", 50 | "z": "e4b5f6.297b9a08", 51 | "name": "logging format", 52 | "func": "\nif (flow.get(\"LOGGING\") === \"CSV\") {\n msg.filename = flow.get(\"filename\");\n// dots to commas\n msg.payload = msg.payload.replace(/\\./g, ',');\n return [msg, []];\n}\nif (flow.get(\"LOGGING\") === \"MYSQL\") {\n var rid = flow.get(\"tbid\");\n msg.topic = \"INSERT IGNORE INTO `batteries`.`\"+rid+\"` \"; \n msg.topic += \"VALUES ( \"+ msg.payload.replace(/\\;/g, ',') +\");\";\n return [[], msg];\n}", 53 | "outputs": 2, 54 | "noerr": 0, 55 | "x": 1560, 56 | "y": 1340, 57 | "wires": [ 58 | [ 59 | "dc4ab095.0486b" 60 | ], 61 | [ 62 | "27f670c6.df078" 63 | ] 64 | ], 65 | "info": "Standard timestamps can't be used to build filenames, but sometimes it is useful to have a time indication in a unique file name (logs, data, etc.)\nThis node creates timestamps to be used in filenames.\n### How it works\nThis node adds 3 new functions to Date()\n * pad2(n) returns like \"03\"\n * yyyymmdd() returns like \"20200310\"\n * yyyymmddThhmmss() returns like \"D20200310T104655\"\n\n### How use it\n**input:** a trigger msg (any)\n\n**output:** msg.payload = timestamp by yyyymmddThhmmss()\n" 66 | }, 67 | { 68 | "id": "2b54a48d.dec83c", 69 | "type": "function", 70 | "z": "e4b5f6.297b9a08", 71 | "name": "scheduler: Store esect, cmin, csec Put clock1, clock2", 72 | "func": "\nvar esec = Math.round((Date.now() - flow.get(\"starttime\"))/1000);\nvar n = 10;\nif (isNaN(esec)){\n esec = 1;\n flow.set(\"starttime\", Date.now());\n}\nvar tmin = (esec/60).toFixed(0);\nvar tsec = (esec % 60).toFixed(0);\nflow.set(\"esect\", esec);\nflow.set(\"cmin\", tmin);\nflow.set(\"csec\", tsec);\nif (((esec % n) === 0) && (flow.get(\"run\") === 1)){\n var msg2 = { payload: esec, topic: 'nsec'};\n return[[], msg2];\n} \nif ((esec % n) === 5){\n var msg1 = { payload: esec, topic: 'nsec'};\n return[msg1, []];\n} \n", 73 | "outputs": 2, 74 | "noerr": 0, 75 | "x": 560, 76 | "y": 160, 77 | "wires": [ 78 | [ 79 | "8737239d.b28fc" 80 | ], 81 | [ 82 | "1d6df75c.90cd79" 83 | ] 84 | ] 85 | }, 86 | { 87 | "id": "fad89d90.94f5d", 88 | "type": "inject", 89 | "z": "e4b5f6.297b9a08", 90 | "name": "base clock 1 sec", 91 | "topic": "", 92 | "payload": "", 93 | "payloadType": "date", 94 | "repeat": "1", 95 | "crontab": "", 96 | "once": true, 97 | "onceDelay": "2", 98 | "x": 230, 99 | "y": 160, 100 | "wires": [ 101 | [ 102 | "2b54a48d.dec83c" 103 | ] 104 | ] 105 | }, 106 | { 107 | "id": "bd4bfc34.293d8", 108 | "type": "config", 109 | "z": "e4b5f6.297b9a08", 110 | "name": "", 111 | "properties": [ 112 | { 113 | "p": "UD18DROP", 114 | "pt": "flow", 115 | "to": "0.910", 116 | "tot": "num" 117 | }, 118 | { 119 | "p": "MODE", 120 | "pt": "flow", 121 | "to": "CV", 122 | "tot": "str" 123 | }, 124 | { 125 | "p": "LOGGING", 126 | "pt": "flow", 127 | "to": "CSV", 128 | "tot": "str" 129 | }, 130 | { 131 | "p": "ITICKLE", 132 | "pt": "flow", 133 | "to": "80", 134 | "tot": "num" 135 | }, 136 | { 137 | "p": "VSET1", 138 | "pt": "flow", 139 | "to": "500", 140 | "tot": "num" 141 | }, 142 | { 143 | "p": "Tlimit", 144 | "pt": "flow", 145 | "to": "45", 146 | "tot": "num" 147 | }, 148 | { 149 | "p": "dTlimit", 150 | "pt": "flow", 151 | "to": "1,5", 152 | "tot": "num" 153 | }, 154 | { 155 | "p": "dVlimit", 156 | "pt": "flow", 157 | "to": "-2", 158 | "tot": "num" 159 | }, 160 | { 161 | "p": "CFG_VBMAX", 162 | "pt": "flow", 163 | "to": "5.0", 164 | "tot": "num" 165 | } 166 | ], 167 | "active": true, 168 | "x": 190, 169 | "y": 100, 170 | "wires": [], 171 | "info": "Stores some configuration values.\n \n* **User options**\n - MODE one of: STEST (static test), TRICKLE, SLOW, FAST, AUTO (FAST+SLOW), CV (constant tension).\n - LOGGING one of CSV, MYSQL, NONE\n \n* **Setup values**\n - UD18DROP (default 0.31).[V] Tuning: measure it on UD18 @Iset = 0, Vset=5. Set 0 if UD18 not used\n - ITRICKLE value 0.03C... 0.05C, default 80 mA\n - VSET1 RD6006 V_SET (default 5 V),. error condition\n - Tlimit (default 45) Max temperatore [°C], error condition\n - dTlimit (default 1.5) Max deltaT/min [*C/min] to detect end charge\n - dVlimit (default -0.02) Max -deltaV/min [V/min] to detect end charge\n - CFG_VBMAX (default 1.70) Max battery tension [V] end charge condition (for 3 pack: 1.60 x 3 = 4.8)\n* **RT variables intialization**" 172 | }, 173 | { 174 | "id": "1d6df75c.90cd79", 175 | "type": "link out", 176 | "z": "e4b5f6.297b9a08", 177 | "name": "data_clk", 178 | "links": [ 179 | "baf2d535.bbb398" 180 | ], 181 | "x": 855, 182 | "y": 180, 183 | "wires": [] 184 | }, 185 | { 186 | "id": "8737239d.b28fc", 187 | "type": "link out", 188 | "z": "e4b5f6.297b9a08", 189 | "name": "gui_clk", 190 | "links": [ 191 | "13313975.80e4d7", 192 | "da802f39.f72c5" 193 | ], 194 | "x": 855, 195 | "y": 140, 196 | "wires": [] 197 | }, 198 | { 199 | "id": "baf2d535.bbb398", 200 | "type": "link in", 201 | "z": "e4b5f6.297b9a08", 202 | "name": "data polling", 203 | "links": [ 204 | "1d6df75c.90cd79" 205 | ], 206 | "x": 115, 207 | "y": 1440, 208 | "wires": [ 209 | [ 210 | "a06f9cd3.12c19", 211 | "fa99e8d7.99a3d8" 212 | ] 213 | ] 214 | }, 215 | { 216 | "id": "cdb464d0.f91508", 217 | "type": "comment", 218 | "z": "e4b5f6.297b9a08", 219 | "name": "Data polling - logging", 220 | "info": "", 221 | "x": 140, 222 | "y": 1280, 223 | "wires": [] 224 | }, 225 | { 226 | "id": "1c17cf03.c3a521", 227 | "type": "function", 228 | "z": "e4b5f6.297b9a08", 229 | "name": "reset start time, error", 230 | "func": "var tmp = Date.now();\nflow.set(\"starttime\", tmp);\nmsg.payload = tmp;\nflow.set(\"csec\",0);\nflow.set(\"cmin\",0);\nflow.set(\"error\",0);\n", 231 | "outputs": 0, 232 | "noerr": 0, 233 | "x": 580, 234 | "y": 260, 235 | "wires": [] 236 | }, 237 | { 238 | "id": "98803d03.984e", 239 | "type": "modbus-flex-write", 240 | "z": "e4b5f6.297b9a08", 241 | "name": "", 242 | "showStatusActivities": false, 243 | "showErrors": false, 244 | "server": "2b92a888.1890a8", 245 | "x": 570, 246 | "y": 340, 247 | "wires": [ 248 | [], 249 | [ 250 | "15ba506d.65f27" 251 | ] 252 | ] 253 | }, 254 | { 255 | "id": "4fce9597.627d5c", 256 | "type": "function", 257 | "z": "e4b5f6.297b9a08", 258 | "name": "FC16: writes Vset Iset", 259 | "func": "// startup\n\nflow.set(\"usemode\", flow.get(\"MODE\"));\nmsg.payload = { 'value' : [flow.get('VSET1'), flow.get('iset') ], 'fc': 16, 'unitid': 1, 'address': 8, 'quantity': 2 };\nreturn msg;", 260 | "outputs": 1, 261 | "noerr": 0, 262 | "x": 300, 263 | "y": 340, 264 | "wires": [ 265 | [ 266 | "98803d03.984e", 267 | "1c17cf03.c3a521" 268 | ] 269 | ] 270 | }, 271 | { 272 | "id": "52cf9b0b.afe0b4", 273 | "type": "modbus-flex-write", 274 | "z": "e4b5f6.297b9a08", 275 | "name": "", 276 | "showStatusActivities": false, 277 | "showErrors": false, 278 | "server": "2b92a888.1890a8", 279 | "x": 570, 280 | "y": 460, 281 | "wires": [ 282 | [ 283 | "f38376cb.6eec18" 284 | ], 285 | [ 286 | "7fad3453.b216bc" 287 | ] 288 | ] 289 | }, 290 | { 291 | "id": "71480cd9.20d194", 292 | "type": "function", 293 | "z": "e4b5f6.297b9a08", 294 | "name": "FC 6: set OUT ON", 295 | "func": "msg.payload = { 'value': 1, 'fc': 6, 'unitid': 1, 'address': 18 , 'quantity': 1 };\nreturn msg;", 296 | "outputs": 1, 297 | "noerr": 0, 298 | "x": 290, 299 | "y": 460, 300 | "wires": [ 301 | [ 302 | "52cf9b0b.afe0b4" 303 | ] 304 | ] 305 | }, 306 | { 307 | "id": "15ba506d.65f27", 308 | "type": "function", 309 | "z": "e4b5f6.297b9a08", 310 | "name": "FC3: get ah ", 311 | "func": "msg.payload = { 'fc': 3, 'unitid': 1, 'address':38, 'quantity': 2 }\nreturn msg;", 312 | "outputs": 1, 313 | "noerr": 0, 314 | "x": 270, 315 | "y": 400, 316 | "wires": [ 317 | [ 318 | "48d0cc58.fc7454" 319 | ] 320 | ] 321 | }, 322 | { 323 | "id": "48d0cc58.fc7454", 324 | "type": "modbus-flex-getter", 325 | "z": "e4b5f6.297b9a08", 326 | "name": "", 327 | "showStatusActivities": false, 328 | "showErrors": false, 329 | "logIOActivities": false, 330 | "server": "2b92a888.1890a8", 331 | "useIOFile": false, 332 | "ioFile": "", 333 | "useIOForPayload": false, 334 | "x": 570, 335 | "y": 400, 336 | "wires": [ 337 | [ 338 | "c372fb3c.6d2058" 339 | ], 340 | [ 341 | "71480cd9.20d194" 342 | ] 343 | ] 344 | }, 345 | { 346 | "id": "c372fb3c.6d2058", 347 | "type": "function", 348 | "z": "e4b5f6.297b9a08", 349 | "name": "set ah offset", 350 | "func": "var tmp =(msg.payload[0]*65536 + msg.payload[1])/1000;\nflow.set(\"startah\", tmp);\nmsg.payload = tmp;\nreturn msg\n", 351 | "outputs": 1, 352 | "noerr": 0, 353 | "x": 790, 354 | "y": 380, 355 | "wires": [ 356 | [] 357 | ] 358 | }, 359 | { 360 | "id": "576727ba.334348", 361 | "type": "comment", 362 | "z": "e4b5f6.297b9a08", 363 | "name": "START stuff", 364 | "info": "", 365 | "x": 110, 366 | "y": 240, 367 | "wires": [] 368 | }, 369 | { 370 | "id": "be720855.10cb88", 371 | "type": "mysql", 372 | "z": "e4b5f6.297b9a08", 373 | "mydb": "df1c70e1.a4ee", 374 | "name": "send record", 375 | "x": 990, 376 | "y": 480, 377 | "wires": [ 378 | [ 379 | "7b3e6ff5.938b4" 380 | ] 381 | ] 382 | }, 383 | { 384 | "id": "7b3e6ff5.938b4", 385 | "type": "function", 386 | "z": "e4b5f6.297b9a08", 387 | "name": "query: new table", 388 | "func": "msg.topic = \"CREATE TABLE IF NOT EXISTS `batteries`.`\"+flow.get(\"tbid\")+\"` (\";\nmsg.topic += \"`time` INT NOT NULL ,\";\nmsg.topic += \"`charge` DECIMAL( 10, 3 ) NOT NULL ,\";\nmsg.topic += \"`iout` DECIMAL( 10, 3 ) NOT NULL ,\";\nmsg.topic += \"`vout` DECIMAL( 10, 3 ) NOT NULL ,\";\nmsg.topic += \"`vbat` DECIMAL( 10, 3 ) NOT NULL ,\";\nmsg.topic += \"`deltav` DECIMAL( 10, 3 ) NOT NULL ,\";\nmsg.topic += \"`ri` DECIMAL( 10, 3 ) NOT NULL ,\";\nmsg.topic += \"`temp` DECIMAL( 10, 3 ) NOT NULL ,\";\nmsg.topic += \"`deltat` DECIMAL( 10, 3 ) NOT NULL ,\";\nmsg.topic += \"PRIMARY KEY ( `time` )\";\nmsg.topic += \") ENGINE = INNODB;\";\nreturn msg;\n// 200;0.000;0.001;0.03;-0.28;0.0;0.000;2.4;0.00\n// nsec, ahbatt, ic, vrd, vb, deltav, ri, tbatt, deltat", 389 | "outputs": 1, 390 | "noerr": 0, 391 | "x": 1180, 392 | "y": 480, 393 | "wires": [ 394 | [ 395 | "a2e87e43.4ef27" 396 | ] 397 | ] 398 | }, 399 | { 400 | "id": "27f670c6.df078", 401 | "type": "mysql", 402 | "z": "e4b5f6.297b9a08", 403 | "mydb": "df1c70e1.a4ee", 404 | "name": "to DB", 405 | "x": 1750, 406 | "y": 1360, 407 | "wires": [ 408 | [] 409 | ] 410 | }, 411 | { 412 | "id": "f38376cb.6eec18", 413 | "type": "function", 414 | "z": "e4b5f6.297b9a08", 415 | "name": "start log msg", 416 | "func": "Date.prototype.pad2 = function(n) { \n return (n < 10 ? '0' : '') + n;\n}\nDate.prototype.yyyymmdd = function() {\n return this.getFullYear()+this.pad2(this.getMonth() + 1)+this.pad2(this.getDate());\n};\nDate.prototype.yyyymmddThhmmss = function() {\n return \"D\"+this.yyyymmdd()+\"T\"+ this.pad2(this.getHours())+ this.pad2(this.getMinutes())+ this.pad2(this.getSeconds());\n};\n// startup \n var tmp = new Date().yyyymmddThhmmss();\n flow.set(\"filename\", \"D:/User/Documents/progetti2020/NiMh battery charger/work/R\"+tmp+\".csv\" );\n flow.set(\"tbid\", tmp);\n // only for test\n // flow.set(\"iset\", 0);\n flow.set(\"starttime\", NaN);\n\nif (flow.get(\"LOGGING\") == \"CSV\") {\n msg.payload = \"sec;Q[mAh];Ic[A];Vrd[V];Vb[V];deltaV[mV/min];Ri[Ω];Tbatt[°C];deltaT[°C/min] \\r\\n\";\n msg.filename = flow.get(\"filename\");\n return [msg, []];\n}\nif (flow.get(\"LOGGING\") == \"MYSQL\") {\n msg.topic = \"INSERT IGNORE INTO batteries.battery \"; \n // msg.topic += \"( `timestamp`, `description`, `capacity`, `force`, `r_intern`, `i_charge`)\";\n msg.topic += \"VALUES ( '\"+flow.get(\"tbid\")+\"','\"+flow.get(\"btype\")+\"','\"+flow.get(\"bcap\");\n msg.topic += \"','\"+flow.get(\"icap\")+\"','\"+flow.get(\"iset\")/1000+\"','\"+flow.get(\"CFG_VSET\")/100+\"', null, null );\";\n return [[], msg];\n}", 417 | "outputs": 2, 418 | "noerr": 0, 419 | "x": 790, 420 | "y": 440, 421 | "wires": [ 422 | [ 423 | "d8990d3e.88bc5" 424 | ], 425 | [ 426 | "be720855.10cb88" 427 | ] 428 | ], 429 | "info": "Standard timestamps can't be used to build filenames, but sometimes it is useful to have a time indication in a unique file name (logs, data, etc.)\nThis node creates timestamps to be used in filenames.\n### How it works\nThis node adds 3 new functions to Date()\n * pad2(n) returns like \"03\"\n * yyyymmdd() returns like \"20200310\"\n * yyyymmddThhmmss() returns like \"D20200310T104655\"\n\n### How use it\n**input:** a trigger msg (any)\n\n**output:** msg.payload = timestamp by yyyymmddThhmmss()\n" 430 | }, 431 | { 432 | "id": "d8990d3e.88bc5", 433 | "type": "file", 434 | "z": "e4b5f6.297b9a08", 435 | "name": "to CSV file", 436 | "filename": "", 437 | "appendNewline": false, 438 | "createDir": true, 439 | "overwriteFile": "false", 440 | "encoding": "utf8", 441 | "x": 990, 442 | "y": 400, 443 | "wires": [ 444 | [] 445 | ] 446 | }, 447 | { 448 | "id": "a2e87e43.4ef27", 449 | "type": "mysql", 450 | "z": "e4b5f6.297b9a08", 451 | "mydb": "df1c70e1.a4ee", 452 | "name": "to DB", 453 | "x": 1350, 454 | "y": 480, 455 | "wires": [ 456 | [] 457 | ] 458 | }, 459 | { 460 | "id": "c5c33802.78cb58", 461 | "type": "ui_button", 462 | "z": "e4b5f6.297b9a08", 463 | "name": "", 464 | "group": "ffb283b5.7f0cf", 465 | "order": 2, 466 | "width": "3", 467 | "height": "2", 468 | "passthru": false, 469 | "label": "{{msg.topic}}", 470 | "tooltip": "", 471 | "color": "", 472 | "bgcolor": "{{msg.background}}", 473 | "icon": "", 474 | "payload": "click", 475 | "payloadType": "str", 476 | "topic": "", 477 | "x": 430, 478 | "y": 2280, 479 | "wires": [ 480 | [ 481 | "9e8c5958.cf3728" 482 | ] 483 | ] 484 | }, 485 | { 486 | "id": "3a0d72e2.9bb53e", 487 | "type": "ui_text_input", 488 | "z": "e4b5f6.297b9a08", 489 | "name": "", 490 | "label": "Capacity mAh", 491 | "tooltip": "", 492 | "group": "ffb283b5.7f0cf", 493 | "order": 3, 494 | "width": "2", 495 | "height": "1", 496 | "passthru": false, 497 | "mode": "number", 498 | "delay": "0", 499 | "topic": "", 500 | "x": 380, 501 | "y": 2440, 502 | "wires": [ 503 | [ 504 | "5c973569.72044c" 505 | ] 506 | ] 507 | }, 508 | { 509 | "id": "13eaffd9.35aaa", 510 | "type": "ui_text_input", 511 | "z": "e4b5f6.297b9a08", 512 | "name": "", 513 | "label": "Battery type", 514 | "tooltip": "infos about the battery", 515 | "group": "ffb283b5.7f0cf", 516 | "order": 1, 517 | "width": "5", 518 | "height": "1", 519 | "passthru": false, 520 | "mode": "text", 521 | "delay": "0", 522 | "topic": "", 523 | "x": 370, 524 | "y": 2560, 525 | "wires": [ 526 | [ 527 | "fd04fdf.24527" 528 | ] 529 | ] 530 | }, 531 | { 532 | "id": "21505e12.4e3f52", 533 | "type": "ui_dropdown", 534 | "z": "e4b5f6.297b9a08", 535 | "name": "", 536 | "label": "Iset", 537 | "tooltip": "", 538 | "place": "Select option", 539 | "group": "ffb283b5.7f0cf", 540 | "order": 4, 541 | "width": "3", 542 | "height": "1", 543 | "passthru": false, 544 | "options": [ 545 | { 546 | "label": "C/40", 547 | "value": 0.025, 548 | "type": "num" 549 | }, 550 | { 551 | "label": "C/33", 552 | "value": 0.0303, 553 | "type": "num" 554 | }, 555 | { 556 | "label": "C/20", 557 | "value": 0.05, 558 | "type": "num" 559 | }, 560 | { 561 | "label": "C/10", 562 | "value": 0.1, 563 | "type": "num" 564 | }, 565 | { 566 | "label": "C/8", 567 | "value": 0.125, 568 | "type": "num" 569 | }, 570 | { 571 | "label": "C/5", 572 | "value": 0.2, 573 | "type": "num" 574 | }, 575 | { 576 | "label": "C/3", 577 | "value": 0.333, 578 | "type": "num" 579 | }, 580 | { 581 | "label": "C/2", 582 | "value": 0.5, 583 | "type": "num" 584 | }, 585 | { 586 | "label": "C/1.2", 587 | "value": 0.8333, 588 | "type": "num" 589 | }, 590 | { 591 | "label": "C", 592 | "value": 1, 593 | "type": "num" 594 | }, 595 | { 596 | "label": "1.2C", 597 | "value": 1.2, 598 | "type": "num" 599 | } 600 | ], 601 | "payload": "", 602 | "topic": "", 603 | "x": 350, 604 | "y": 2500, 605 | "wires": [ 606 | [ 607 | "f819f5a5.ece678" 608 | ] 609 | ] 610 | }, 611 | { 612 | "id": "9e8c5958.cf3728", 613 | "type": "function", 614 | "z": "e4b5f6.297b9a08", 615 | "name": "toggle", 616 | "func": "\n\nif (( msg.payload == \"click\") && (flow.get(\"run\")) === 0){\n flow.set(\"run\",1) ;\n msg.payload = 1;\n} \nif ( msg.payload == \"on\"){\n flow.set(\"run\",1) ;\n msg.payload = 1;\n}\nif (( msg.payload == \"click\") && (flow.get(\"run\")) == 1){\n flow.set(\"run\", 0) ;\n msg.payload = 0;\n if (flow.get(\"error\") === 0) {\n flow.set(\"error\", 128) ;\n }\n}\nif ( msg.payload == \"off\") {\n flow.set(\"run\", 0) ;\n msg.payload = 0;\n if (flow.get(\"error\") === 0) {\n flow.set(\"error\", 128) ;\n }\n} \nreturn msg;\n", 617 | "outputs": 1, 618 | "noerr": 0, 619 | "x": 210, 620 | "y": 2360, 621 | "wires": [ 622 | [ 623 | "767c5593.c99dcc", 624 | "2d678ef.0ab9672" 625 | ] 626 | ] 627 | }, 628 | { 629 | "id": "767c5593.c99dcc", 630 | "type": "switch", 631 | "z": "e4b5f6.297b9a08", 632 | "name": "start / stop msg", 633 | "property": "payload", 634 | "propertyType": "msg", 635 | "rules": [ 636 | { 637 | "t": "eq", 638 | "v": "0", 639 | "vt": "num" 640 | }, 641 | { 642 | "t": "eq", 643 | "v": "1", 644 | "vt": "num" 645 | } 646 | ], 647 | "checkall": "false", 648 | "repair": false, 649 | "outputs": 2, 650 | "x": 400, 651 | "y": 2360, 652 | "wires": [ 653 | [ 654 | "2d2a0523.c2bb3a" 655 | ], 656 | [ 657 | "1b39e463.e84abc" 658 | ] 659 | ] 660 | }, 661 | { 662 | "id": "5c973569.72044c", 663 | "type": "function", 664 | "z": "e4b5f6.297b9a08", 665 | "name": "store", 666 | "func": "flow.set(\"bcap\", msg.payload);\nvar tmp =(msg.payload * flow.get(\"icap\"));\nflow.set(\"CFG_MAXTIME\", Math.round(90/ flow.get(\"icap\")));\nflow.set(\"iset\", tmp);\nmsg.payload = tmp ;\n", 667 | "outputs": 1, 668 | "noerr": 0, 669 | "x": 570, 670 | "y": 2440, 671 | "wires": [ 672 | [ 673 | "a693e8f2.f617f8" 674 | ] 675 | ] 676 | }, 677 | { 678 | "id": "f819f5a5.ece678", 679 | "type": "function", 680 | "z": "e4b5f6.297b9a08", 681 | "name": "store", 682 | "func": "flow.set(\"icap\", msg.payload);\nflow.set(\"CFG_MAXTIME\", Math.round(90 / msg.payload));\nvar tmp =(msg.payload * flow.get(\"bcap\"));\nflow.set(\"iset\", tmp);\nmsg.payload = tmp;\n", 683 | "outputs": 1, 684 | "noerr": 0, 685 | "x": 570, 686 | "y": 2500, 687 | "wires": [ 688 | [ 689 | "a693e8f2.f617f8" 690 | ] 691 | ] 692 | }, 693 | { 694 | "id": "d52f4ce3.6e8d5", 695 | "type": "comment", 696 | "z": "e4b5f6.297b9a08", 697 | "name": "GUI user commands", 698 | "info": "1- executes START/STOP comands\n2- stores user values on flow variables", 699 | "x": 130, 700 | "y": 2220, 701 | "wires": [] 702 | }, 703 | { 704 | "id": "fd04fdf.24527", 705 | "type": "function", 706 | "z": "e4b5f6.297b9a08", 707 | "name": "store", 708 | "func": "flow.set(\"btype\", msg.payload);\n", 709 | "outputs": 0, 710 | "noerr": 0, 711 | "x": 570, 712 | "y": 2560, 713 | "wires": [] 714 | }, 715 | { 716 | "id": "2d678ef.0ab9672", 717 | "type": "function", 718 | "z": "e4b5f6.297b9a08", 719 | "name": "button look", 720 | "func": "if (flow.get(\"run\") ==1) {\n msg.background =\"TURQUOISE\";\n msg.topic = \"STOP\";\n} else {\n msg.background =\"LIME\";\n msg.topic = \"START\";\n}\n// msg.enabled = flow.get(\"bmode\");\nreturn msg;", 721 | "outputs": 1, 722 | "noerr": 0, 723 | "x": 230, 724 | "y": 2280, 725 | "wires": [ 726 | [ 727 | "c5c33802.78cb58" 728 | ] 729 | ] 730 | }, 731 | { 732 | "id": "2d2a0523.c2bb3a", 733 | "type": "link out", 734 | "z": "e4b5f6.297b9a08", 735 | "name": "stop", 736 | "links": [ 737 | "8e6a4d6f.38734", 738 | "db7f7cf2.a98ec" 739 | ], 740 | "x": 535, 741 | "y": 2340, 742 | "wires": [] 743 | }, 744 | { 745 | "id": "b5ce06b5.832fc8", 746 | "type": "link in", 747 | "z": "e4b5f6.297b9a08", 748 | "name": "start stuff", 749 | "links": [ 750 | "1b39e463.e84abc" 751 | ], 752 | "x": 135, 753 | "y": 340, 754 | "wires": [ 755 | [ 756 | "4fce9597.627d5c" 757 | ] 758 | ] 759 | }, 760 | { 761 | "id": "1b39e463.e84abc", 762 | "type": "link out", 763 | "z": "e4b5f6.297b9a08", 764 | "name": "start", 765 | "links": [ 766 | "b5ce06b5.832fc8" 767 | ], 768 | "x": 535, 769 | "y": 2380, 770 | "wires": [] 771 | }, 772 | { 773 | "id": "344551f3.a27b4e", 774 | "type": "function", 775 | "z": "e4b5f6.297b9a08", 776 | "name": "Format RT data", 777 | "func": "// if (flow.get(\"vbatt\")){\nvar tmp =flow.get(\"vb\");\nif (tmp)\n var msg1 = { payload: tmp.toFixed(2), topic: ' V'};\ntmp =flow.get(\"ic\");\nif(tmp)\n var msg2 = { payload: tmp.toFixed(3), topic: ' A'};\ntmp =flow.get(\"ahbatt\");\nif (tmp)\n var msg3 = { payload: tmp.toFixed(3), topic: ' Ah'};\nvar msg4 = { payload: flow.get(\"tbatt\"), topic: ' °C'};\nreturn ([msg1, msg2, msg3, msg4]);\n// }\n", 778 | "outputs": 4, 779 | "noerr": 0, 780 | "x": 520, 781 | "y": 1960, 782 | "wires": [ 783 | [ 784 | "4c045299.1306dc" 785 | ], 786 | [ 787 | "f21eb790.6ed928" 788 | ], 789 | [ 790 | "a8f914dd.9c2a38" 791 | ], 792 | [ 793 | "a8d2c3e4.c1c92" 794 | ] 795 | ] 796 | }, 797 | { 798 | "id": "f21eb790.6ed928", 799 | "type": "ui_text", 800 | "z": "e4b5f6.297b9a08", 801 | "group": "70ca806d.d7591", 802 | "order": 3, 803 | "width": "4", 804 | "height": "1", 805 | "name": "I", 806 | "label": "", 807 | "format": "{{msg.payload}} {{msg.topic}}", 808 | "layout": "row-right", 809 | "x": 870, 810 | "y": 1980, 811 | "wires": [] 812 | }, 813 | { 814 | "id": "a8f914dd.9c2a38", 815 | "type": "ui_text", 816 | "z": "e4b5f6.297b9a08", 817 | "group": "70ca806d.d7591", 818 | "order": 2, 819 | "width": "4", 820 | "height": "1", 821 | "name": "Ah", 822 | "label": "", 823 | "format": "{{msg.payload}} {{msg.topic}}", 824 | "layout": "row-right", 825 | "x": 870, 826 | "y": 2020, 827 | "wires": [] 828 | }, 829 | { 830 | "id": "a8d2c3e4.c1c92", 831 | "type": "ui_text", 832 | "z": "e4b5f6.297b9a08", 833 | "group": "70ca806d.d7591", 834 | "order": 4, 835 | "width": "4", 836 | "height": "1", 837 | "name": "T", 838 | "label": "", 839 | "format": "{{msg.payload}} {{msg.topic}}", 840 | "layout": "row-right", 841 | "x": 870, 842 | "y": 2060, 843 | "wires": [] 844 | }, 845 | { 846 | "id": "4c045299.1306dc", 847 | "type": "ui_text", 848 | "z": "e4b5f6.297b9a08", 849 | "group": "70ca806d.d7591", 850 | "order": 1, 851 | "width": "4", 852 | "height": "1", 853 | "name": "V", 854 | "label": "", 855 | "format": "{{msg.payload}} {{msg.topic}}", 856 | "layout": "row-right", 857 | "x": 870, 858 | "y": 1940, 859 | "wires": [] 860 | }, 861 | { 862 | "id": "3c7e789e.4b10e8", 863 | "type": "inject", 864 | "z": "e4b5f6.297b9a08", 865 | "name": "manual reset chart", 866 | "topic": "", 867 | "payload": "0", 868 | "payloadType": "num", 869 | "repeat": "", 870 | "crontab": "", 871 | "once": false, 872 | "onceDelay": "0.2", 873 | "x": 250, 874 | "y": 2140, 875 | "wires": [ 876 | [ 877 | "4f723be3.8901c4" 878 | ] 879 | ] 880 | }, 881 | { 882 | "id": "4f723be3.8901c4", 883 | "type": "function", 884 | "z": "e4b5f6.297b9a08", 885 | "name": "reset chart msg", 886 | "func": "msg.payload = [];\nreturn msg;", 887 | "outputs": 1, 888 | "noerr": 0, 889 | "x": 520, 890 | "y": 2100, 891 | "wires": [ 892 | [ 893 | "b370b423.588528" 894 | ] 895 | ] 896 | }, 897 | { 898 | "id": "35f5fa8e.bd0ac6", 899 | "type": "comment", 900 | "z": "e4b5f6.297b9a08", 901 | "name": "loop GUI refresh", 902 | "info": "1- updates values on screen\n2- updates chart (only running)\n3- formats status line", 903 | "x": 120, 904 | "y": 1720, 905 | "wires": [] 906 | }, 907 | { 908 | "id": "865c88ed.ad9a08", 909 | "type": "function", 910 | "z": "e4b5f6.297b9a08", 911 | "name": "status message", 912 | "func": "var messg = flow.get(\"cmin\") + \":\"+ flow.get(\"csec\");\nmessg += ' / '+ Math.floor(flow.get(\"CFG_MAXTIME\")/60).toFixed(0) + ':' +(flow.get(\"CFG_MAXTIME\")%60).toFixed(0);\nmessg += ':0 ';\nif (flow.get(\"run\")===0)\n messg += ' stopped';\nelse\n messg += ' running';\nvar endC = flow.get(\"error\");\nif (( endC & 1) == 1)\n messg += ' OVP';\nif (( endC & 2) == 2)\n messg += ' OCP';\nif (( endC & 4) == 4)\n messg += ' by RD6006';\nif (( endC & 8) == 8)\n messg += ' max Charge';\nif (( endC & 16) == 16)\n messg += ' max Time';\nif (( endC & 32) == 32)\n messg += ' max Temperature';\nif (( endC & 64) == 64)\n messg += ' max Vbatt';\nif ((endC & 128) == 128)\n messg += ' by user';\nif ((endC & 256) == 256)\n messg += ' max deltaT';\nif ((endC & 512) == 512)\n messg += ' max deltaV';\n\nmsg.payload = messg;\nif (endC !== 0){\n var msg2 = { payload: \"off\", error: endC };\n return [msg, msg2];\n}\nelse\n return [msg];\n", 913 | "outputs": 2, 914 | "noerr": 0, 915 | "x": 520, 916 | "y": 1900, 917 | "wires": [ 918 | [ 919 | "7adb3e73.f3f1a" 920 | ], 921 | [ 922 | "a073f459.24c9a8", 923 | "9e8c5958.cf3728" 924 | ] 925 | ] 926 | }, 927 | { 928 | "id": "7adb3e73.f3f1a", 929 | "type": "ui_template", 930 | "z": "e4b5f6.297b9a08", 931 | "group": "70ca806d.d7591", 932 | "name": "status line", 933 | "order": 5, 934 | "width": 0, 935 | "height": 0, 936 | "format": "
\n", 937 | "storeOutMessages": false, 938 | "fwdInMessages": false, 939 | "templateScope": "local", 940 | "x": 860, 941 | "y": 1820, 942 | "wires": [ 943 | [] 944 | ] 945 | }, 946 | { 947 | "id": "86adc2f4.cd66a", 948 | "type": "function", 949 | "z": "e4b5f6.297b9a08", 950 | "name": "Format chart data", 951 | "func": "if (flow.get(\"run\")== 1){\nvar tmp = flow.get(\"vb\");\nif (tmp)\nvar msg1 = { payload: tmp.toFixed(2), topic: ' V'};\nvar tmp = flow.get(\"ic\");\nif (tmp)\nvar msg2 = { payload: tmp.toFixed(3), topic: ' A'};\nvar tmp = flow.get(\"ahbatt\");\nif (tmp)\nvar msg3 = { payload: tmp.toFixed(3), topic: ' Ah'};\nvar tmp = flow.get(\"tbatt\")/10;\nif (tmp)\nvar msg4 = { payload: tmp, topic: ' °C'};\nreturn([msg1, msg2, msg3, msg4]);\n}\nelse {\n return([]); \n}\n// return ([msg1, msg2, msg3, msg4]);", 952 | "outputs": 4, 953 | "noerr": 0, 954 | "x": 530, 955 | "y": 2040, 956 | "wires": [ 957 | [ 958 | "b370b423.588528" 959 | ], 960 | [ 961 | "b370b423.588528" 962 | ], 963 | [ 964 | "b370b423.588528" 965 | ], 966 | [ 967 | "b370b423.588528" 968 | ] 969 | ] 970 | }, 971 | { 972 | "id": "72eb1f7.a9381e", 973 | "type": "status", 974 | "z": "e4b5f6.297b9a08", 975 | "name": "ModBus status", 976 | "scope": [], 977 | "x": 240, 978 | "y": 1840, 979 | "wires": [ 980 | [ 981 | "87696c0e.4d562" 982 | ] 983 | ] 984 | }, 985 | { 986 | "id": "87696c0e.4d562", 987 | "type": "function", 988 | "z": "e4b5f6.297b9a08", 989 | "name": "ModBus error filter-format", 990 | "func": "var messg = flow.get(\"cmin\") + \":\"+ flow.get(\"csec\");\nmessg += ' / '+ flow.get(\"CFG_MAXTIME\").toFixed(0);\nmessg += ':0 ';\nmessg += \"\";\nif (msg.status.text == 'failure'){\n messg += \" MODBUS failure \"; \n msg.payload = messg; \n return msg;\n}\n\n", 991 | "outputs": 1, 992 | "noerr": 0, 993 | "x": 470, 994 | "y": 1840, 995 | "wires": [ 996 | [ 997 | "7adb3e73.f3f1a" 998 | ] 999 | ] 1000 | }, 1001 | { 1002 | "id": "c02c2281.1752d", 1003 | "type": "function", 1004 | "z": "e4b5f6.297b9a08", 1005 | "name": "mySQL error filter-format", 1006 | "func": "\nvar messg = flow.get(\"cmin\") + \":\"+ flow.get(\"csec\");\nmessg += ' / '+ flow.get(\"CFG_MAXTIME\").toFixed(0);\nmessg += ':0 ';\nmessg += \"\";\nif (msg.status.text != \"OK\"){\n messg += \" mySQL: \"+msg.status.text+\"\"; \n msg.payload = messg; \n return msg;\n}\n", 1007 | "outputs": 1, 1008 | "noerr": 0, 1009 | "x": 470, 1010 | "y": 1780, 1011 | "wires": [ 1012 | [ 1013 | "7adb3e73.f3f1a" 1014 | ] 1015 | ] 1016 | }, 1017 | { 1018 | "id": "4c3d0e17.a489", 1019 | "type": "status", 1020 | "z": "e4b5f6.297b9a08", 1021 | "name": "mysql status", 1022 | "scope": [], 1023 | "x": 230, 1024 | "y": 1780, 1025 | "wires": [ 1026 | [ 1027 | "c02c2281.1752d" 1028 | ] 1029 | ] 1030 | }, 1031 | { 1032 | "id": "a073f459.24c9a8", 1033 | "type": "debug", 1034 | "z": "e4b5f6.297b9a08", 1035 | "name": "", 1036 | "active": true, 1037 | "tosidebar": true, 1038 | "console": false, 1039 | "tostatus": false, 1040 | "complete": "false", 1041 | "x": 1110, 1042 | "y": 1900, 1043 | "wires": [] 1044 | }, 1045 | { 1046 | "id": "b370b423.588528", 1047 | "type": "ui_chart", 1048 | "z": "e4b5f6.297b9a08", 1049 | "name": "", 1050 | "group": "1d9d1c49.f32414", 1051 | "order": 0, 1052 | "width": "8", 1053 | "height": "4", 1054 | "label": "chart", 1055 | "chartType": "line", 1056 | "legend": "false", 1057 | "xformat": "HH:mm:ss", 1058 | "interpolate": "linear", 1059 | "nodata": "", 1060 | "dot": false, 1061 | "ymin": "", 1062 | "ymax": "", 1063 | "removeOlder": 1, 1064 | "removeOlderPoints": "", 1065 | "removeOlderUnit": "3600", 1066 | "cutout": 0, 1067 | "useOneColor": false, 1068 | "colors": [ 1069 | "#80ff00", 1070 | "#aec7e8", 1071 | "#ffbc80", 1072 | "#f9b5b7", 1073 | "#98df8a", 1074 | "#d62728", 1075 | "#ff9896", 1076 | "#9467bd", 1077 | "#c5b0d5" 1078 | ], 1079 | "useOldStyle": false, 1080 | "outputs": 1, 1081 | "x": 870, 1082 | "y": 2100, 1083 | "wires": [ 1084 | [] 1085 | ] 1086 | }, 1087 | { 1088 | "id": "13313975.80e4d7", 1089 | "type": "link in", 1090 | "z": "e4b5f6.297b9a08", 1091 | "name": "GUI refresh", 1092 | "links": [ 1093 | "8737239d.b28fc", 1094 | "c4ba7586.367e08" 1095 | ], 1096 | "x": 115, 1097 | "y": 1900, 1098 | "wires": [ 1099 | [ 1100 | "865c88ed.ad9a08", 1101 | "344551f3.a27b4e", 1102 | "86adc2f4.cd66a" 1103 | ] 1104 | ] 1105 | }, 1106 | { 1107 | "id": "db7f7cf2.a98ec", 1108 | "type": "link in", 1109 | "z": "e4b5f6.297b9a08", 1110 | "name": "chart stop", 1111 | "links": [ 1112 | "2d2a0523.c2bb3a" 1113 | ], 1114 | "x": 115, 1115 | "y": 2100, 1116 | "wires": [ 1117 | [ 1118 | "4f723be3.8901c4" 1119 | ] 1120 | ] 1121 | }, 1122 | { 1123 | "id": "c3336505.b9eb78", 1124 | "type": "ui_button", 1125 | "z": "e4b5f6.297b9a08", 1126 | "name": "", 1127 | "group": "7bba9908.2652d8", 1128 | "order": 3, 1129 | "width": "1", 1130 | "height": "1", 1131 | "passthru": false, 1132 | "label": "-", 1133 | "tooltip": "", 1134 | "color": "", 1135 | "bgcolor": "", 1136 | "icon": "", 1137 | "payload": "", 1138 | "payloadType": "str", 1139 | "topic": "", 1140 | "x": 810, 1141 | "y": 2280, 1142 | "wires": [ 1143 | [ 1144 | "e56bfbcb.1723f8" 1145 | ] 1146 | ] 1147 | }, 1148 | { 1149 | "id": "98f20580.086b68", 1150 | "type": "ui_button", 1151 | "z": "e4b5f6.297b9a08", 1152 | "name": "", 1153 | "group": "7bba9908.2652d8", 1154 | "order": 4, 1155 | "width": "1", 1156 | "height": "1", 1157 | "passthru": false, 1158 | "label": "+", 1159 | "tooltip": "", 1160 | "color": "", 1161 | "bgcolor": "", 1162 | "icon": "", 1163 | "payload": "", 1164 | "payloadType": "str", 1165 | "topic": "", 1166 | "x": 810, 1167 | "y": 2320, 1168 | "wires": [ 1169 | [ 1170 | "bb381beb.c8a068" 1171 | ] 1172 | ] 1173 | }, 1174 | { 1175 | "id": "be8943ca.d193a", 1176 | "type": "ui_button", 1177 | "z": "e4b5f6.297b9a08", 1178 | "name": "", 1179 | "group": "7bba9908.2652d8", 1180 | "order": 5, 1181 | "width": "1", 1182 | "height": "1", 1183 | "passthru": false, 1184 | "label": "field", 1185 | "tooltip": "", 1186 | "color": "", 1187 | "bgcolor": "", 1188 | "icon": "", 1189 | "payload": "", 1190 | "payloadType": "str", 1191 | "topic": "", 1192 | "x": 810, 1193 | "y": 2360, 1194 | "wires": [ 1195 | [ 1196 | "620179ff.da2a28" 1197 | ] 1198 | ] 1199 | }, 1200 | { 1201 | "id": "489fb4de.81233c", 1202 | "type": "ui_button", 1203 | "z": "e4b5f6.297b9a08", 1204 | "name": "", 1205 | "group": "7bba9908.2652d8", 1206 | "order": 6, 1207 | "width": "1", 1208 | "height": "1", 1209 | "passthru": false, 1210 | "label": "done", 1211 | "tooltip": "", 1212 | "color": "", 1213 | "bgcolor": "", 1214 | "icon": "", 1215 | "payload": "", 1216 | "payloadType": "str", 1217 | "topic": "", 1218 | "x": 810, 1219 | "y": 2400, 1220 | "wires": [ 1221 | [ 1222 | "28e8b574.c71c6a" 1223 | ] 1224 | ] 1225 | }, 1226 | { 1227 | "id": "10276a3d.36e466", 1228 | "type": "comment", 1229 | "z": "e4b5f6.297b9a08", 1230 | "name": "STOP stuff", 1231 | "info": "", 1232 | "x": 100, 1233 | "y": 860, 1234 | "wires": [] 1235 | }, 1236 | { 1237 | "id": "51b3c42c.329d6c", 1238 | "type": "modbus-flex-write", 1239 | "z": "e4b5f6.297b9a08", 1240 | "name": "", 1241 | "showStatusActivities": false, 1242 | "showErrors": false, 1243 | "server": "2b92a888.1890a8", 1244 | "x": 570, 1245 | "y": 920, 1246 | "wires": [ 1247 | [], 1248 | [ 1249 | "5ff3b75f.fa2648" 1250 | ] 1251 | ] 1252 | }, 1253 | { 1254 | "id": "e0a5633f.d45cd", 1255 | "type": "function", 1256 | "z": "e4b5f6.297b9a08", 1257 | "name": "FC 6: set OUT OFF", 1258 | "func": "msg.payload = { 'value': 0, 'fc': 6, 'unitid': 1, 'address': 18 , 'quantity': 1 };\nreturn msg;", 1259 | "outputs": 1, 1260 | "noerr": 0, 1261 | "x": 330, 1262 | "y": 920, 1263 | "wires": [ 1264 | [ 1265 | "51b3c42c.329d6c" 1266 | ] 1267 | ] 1268 | }, 1269 | { 1270 | "id": "8e6a4d6f.38734", 1271 | "type": "link in", 1272 | "z": "e4b5f6.297b9a08", 1273 | "name": "stop stuff", 1274 | "links": [ 1275 | "2d2a0523.c2bb3a", 1276 | "48d51327.a8869c" 1277 | ], 1278 | "x": 135, 1279 | "y": 920, 1280 | "wires": [ 1281 | [ 1282 | "e0a5633f.d45cd", 1283 | "8172710e.83a02" 1284 | ] 1285 | ] 1286 | }, 1287 | { 1288 | "id": "39b5d841.991bb8", 1289 | "type": "function", 1290 | "z": "e4b5f6.297b9a08", 1291 | "name": "Rule#1", 1292 | "func": "flow.set(\"usemode\", flow.get(\"MODE\"));\nif (flow.get(\"MODE\") == \"FAST\") {\n var tx = flow.get(\"tbatt\");\n if ((tx > 40) || (tx < 0))\n flow.set(\"usemode\", \"SLOW\");\n var vx = flow.get(\"vb\");\n if ((vx > 1.29) || (vx < 1.0))\n flow.set(\"usemode\", \"SLOW\");\n }\n\nreturn msg;", 1293 | "outputs": 1, 1294 | "noerr": 0, 1295 | "x": 1200, 1296 | "y": 760, 1297 | "wires": [ 1298 | [ 1299 | "f64f1b17.6a5f98" 1300 | ] 1301 | ] 1302 | }, 1303 | { 1304 | "id": "32b25e9f.ced142", 1305 | "type": "modbus-flex-write", 1306 | "z": "e4b5f6.297b9a08", 1307 | "name": "", 1308 | "showStatusActivities": false, 1309 | "showErrors": false, 1310 | "server": "2b92a888.1890a8", 1311 | "x": 570, 1312 | "y": 680, 1313 | "wires": [ 1314 | [], 1315 | [ 1316 | "8304d277.a8551" 1317 | ] 1318 | ] 1319 | }, 1320 | { 1321 | "id": "8a237c72.50a3a", 1322 | "type": "function", 1323 | "z": "e4b5f6.297b9a08", 1324 | "name": "FC 6: set Iout to zero", 1325 | "func": "msg.payload = { 'value': 0, 'fc': 6, 'unitid': 1, 'address': 9 , 'quantity': 1 };\nreturn msg;", 1326 | "outputs": 1, 1327 | "noerr": 0, 1328 | "x": 300, 1329 | "y": 680, 1330 | "wires": [ 1331 | [ 1332 | "32b25e9f.ced142" 1333 | ] 1334 | ] 1335 | }, 1336 | { 1337 | "id": "8304d277.a8551", 1338 | "type": "function", 1339 | "z": "e4b5f6.297b9a08", 1340 | "name": "FC3: get Vout, Iout", 1341 | "func": "msg.payload = { 'fc': 3, 'unitid': 1, 'address':10, 'quantity': 2 }\nreturn msg;", 1342 | "outputs": 1, 1343 | "noerr": 0, 1344 | "x": 290, 1345 | "y": 740, 1346 | "wires": [ 1347 | [ 1348 | "799952e2.04574c" 1349 | ] 1350 | ] 1351 | }, 1352 | { 1353 | "id": "799952e2.04574c", 1354 | "type": "modbus-flex-getter", 1355 | "z": "e4b5f6.297b9a08", 1356 | "name": "", 1357 | "showStatusActivities": false, 1358 | "showErrors": false, 1359 | "logIOActivities": false, 1360 | "server": "2b92a888.1890a8", 1361 | "useIOFile": false, 1362 | "ioFile": "", 1363 | "useIOForPayload": false, 1364 | "x": 570, 1365 | "y": 740, 1366 | "wires": [ 1367 | [ 1368 | "bd81328e.7c1d6" 1369 | ], 1370 | [] 1371 | ] 1372 | }, 1373 | { 1374 | "id": "bd81328e.7c1d6", 1375 | "type": "function", 1376 | "z": "e4b5f6.297b9a08", 1377 | "name": "is Iout = 0 ? if YES put vi, vb, ri ELSE loop", 1378 | "func": "var vi0 = msg.payload[0]/100;\nif (msg.payload[1] <= 7){\n flow.set(\"vi0\", vi0);\n var vb = vi0 - flow.get(\"UD18DROP\");\n flow.set(\"vb\", vb);\n var vrd = flow.get(\"vrd\");\n var ri = ((vrd - vi0)*1000)/flow.get(\"ic\"); \n flow.set(\"ri\", ri);\n var msg1 = { payload: vb, topic: 'vi'};\n var msg2 = { payload: vb.toFixed(2), topic: 'vb'};\n var msg3 = { payload: (ri/1000).toFixed(3), topic: 'ri'};\n return ([msg1, msg2, msg3, []]); \n } else {\n return [[], [], [], msg]; \n}", 1379 | "outputs": 4, 1380 | "noerr": 0, 1381 | "x": 880, 1382 | "y": 720, 1383 | "wires": [ 1384 | [], 1385 | [], 1386 | [ 1387 | "39b5d841.991bb8" 1388 | ], 1389 | [ 1390 | "449478e6.05dd38" 1391 | ] 1392 | ] 1393 | }, 1394 | { 1395 | "id": "c07e4009.0c064", 1396 | "type": "modbus-flex-write", 1397 | "z": "e4b5f6.297b9a08", 1398 | "name": "", 1399 | "showStatusActivities": false, 1400 | "showErrors": false, 1401 | "server": "2b92a888.1890a8", 1402 | "x": 830, 1403 | "y": 820, 1404 | "wires": [ 1405 | [], 1406 | [] 1407 | ] 1408 | }, 1409 | { 1410 | "id": "f64f1b17.6a5f98", 1411 | "type": "function", 1412 | "z": "e4b5f6.297b9a08", 1413 | "name": "FC 6: re-set required Iout", 1414 | "func": "var iset = flow.get(\"iset\");\nvar mode = flow.get(\"usemode\");\nvar tmp =(0.1 * flow.get(\"bcap\")); // C/10, slow limit\nswitch (mode) {\n case \"STEST\":\n flow.set(\"iset\", iset+50);\n break;\n case \"TRICKLE\":\n flow.set(\"iset\", flow.get(\"ITRICKLE\"));\n break;\n case \"SLOW\":\n if (iset > tmp) \n flow.set(\"iset\", tmp); \n break;\n case \"FAST\":\n if (iset <= tmp)\n flow.set(\"usemode\", \"SLOW\");\n break;\n case \"CV\":\n }\nmsg.payload = { 'value': flow.get(\"iset\"), 'fc': 6, 'unitid': 1, 'address': 9 , 'quantity': 1 };\nreturn msg;", 1415 | "outputs": 1, 1416 | "noerr": 0, 1417 | "x": 590, 1418 | "y": 820, 1419 | "wires": [ 1420 | [ 1421 | "c07e4009.0c064" 1422 | ] 1423 | ] 1424 | }, 1425 | { 1426 | "id": "449478e6.05dd38", 1427 | "type": "delay", 1428 | "z": "e4b5f6.297b9a08", 1429 | "name": "", 1430 | "pauseType": "delay", 1431 | "timeout": "100", 1432 | "timeoutUnits": "milliseconds", 1433 | "rate": "1", 1434 | "nbRateUnits": "1", 1435 | "rateUnits": "second", 1436 | "randomFirst": "1", 1437 | "randomLast": "5", 1438 | "randomUnits": "seconds", 1439 | "drop": false, 1440 | "x": 270, 1441 | "y": 800, 1442 | "wires": [ 1443 | [ 1444 | "8304d277.a8551" 1445 | ] 1446 | ] 1447 | }, 1448 | { 1449 | "id": "696af9b7.fa1b78", 1450 | "type": "function", 1451 | "z": "e4b5f6.297b9a08", 1452 | "name": "FC3: get RT registers A", 1453 | "func": "msg.payload = { 'fc': 3, 'unitid': 1, 'address':8, 'quantity': 11 }\nreturn msg;", 1454 | "outputs": 1, 1455 | "noerr": 0, 1456 | "x": 310, 1457 | "y": 560, 1458 | "wires": [ 1459 | [ 1460 | "7914deaa.5b7d5" 1461 | ] 1462 | ] 1463 | }, 1464 | { 1465 | "id": "7914deaa.5b7d5", 1466 | "type": "modbus-flex-getter", 1467 | "z": "e4b5f6.297b9a08", 1468 | "name": "", 1469 | "showStatusActivities": false, 1470 | "showErrors": false, 1471 | "logIOActivities": false, 1472 | "server": "2b92a888.1890a8", 1473 | "useIOFile": false, 1474 | "ioFile": "", 1475 | "useIOForPayload": false, 1476 | "x": 570, 1477 | "y": 560, 1478 | "wires": [ 1479 | [ 1480 | "8a28b135.23136" 1481 | ], 1482 | [ 1483 | "454a9f6d.a7c7f" 1484 | ] 1485 | ] 1486 | }, 1487 | { 1488 | "id": "8a28b135.23136", 1489 | "type": "function", 1490 | "z": "e4b5f6.297b9a08", 1491 | "name": "Save error, onoff. Put: vrd, ic", 1492 | "func": "var e = flow.get(\"error\");\nflow.set(\"error\", (e | msg.payload[8]));\n//\nflow.set(\"vrd\", msg.payload[2]/100);\nflow.set(\"ic\", msg.payload[3]/1000);\nflow.set(\"onoff\", msg.payload[10]);\n", 1493 | "outputs": 0, 1494 | "noerr": 0, 1495 | "x": 840, 1496 | "y": 560, 1497 | "wires": [] 1498 | }, 1499 | { 1500 | "id": "454a9f6d.a7c7f", 1501 | "type": "function", 1502 | "z": "e4b5f6.297b9a08", 1503 | "name": "FC3: get RT registers B", 1504 | "func": "msg.payload = { 'fc': 3, 'unitid': 1, 'address':32, 'quantity': 8 }\nreturn msg;", 1505 | "outputs": 1, 1506 | "noerr": 0, 1507 | "x": 310, 1508 | "y": 620, 1509 | "wires": [ 1510 | [ 1511 | "6057b35f.0b9d8c" 1512 | ] 1513 | ] 1514 | }, 1515 | { 1516 | "id": "6057b35f.0b9d8c", 1517 | "type": "modbus-flex-getter", 1518 | "z": "e4b5f6.297b9a08", 1519 | "name": "", 1520 | "showStatusActivities": false, 1521 | "showErrors": false, 1522 | "logIOActivities": false, 1523 | "server": "2b92a888.1890a8", 1524 | "useIOFile": false, 1525 | "ioFile": "", 1526 | "useIOForPayload": false, 1527 | "x": 570, 1528 | "y": 620, 1529 | "wires": [ 1530 | [ 1531 | "36d29228.68866e" 1532 | ], 1533 | [ 1534 | "8a237c72.50a3a" 1535 | ] 1536 | ] 1537 | }, 1538 | { 1539 | "id": "36d29228.68866e", 1540 | "type": "function", 1541 | "z": "e4b5f6.297b9a08", 1542 | "name": "Save and put tbatt, ahbatt", 1543 | "func": "\nvar tmp =((msg.payload[6]*65536 + msg.payload[7])/1000) - flow.get(\"startah\");\nflow.set(\"ahbatt\", tmp);\nflow.set(\"tbatt\", msg.payload[3]);\n", 1544 | "outputs": 0, 1545 | "noerr": 0, 1546 | "x": 830, 1547 | "y": 620, 1548 | "wires": [] 1549 | }, 1550 | { 1551 | "id": "fa99e8d7.99a3d8", 1552 | "type": "join", 1553 | "z": "e4b5f6.297b9a08", 1554 | "name": "", 1555 | "mode": "custom", 1556 | "build": "object", 1557 | "property": "payload", 1558 | "propertyType": "msg", 1559 | "key": "topic", 1560 | "joiner": "\\n", 1561 | "joinerType": "str", 1562 | "accumulate": false, 1563 | "timeout": "", 1564 | "count": "9", 1565 | "reduceRight": false, 1566 | "reduceExp": "", 1567 | "reduceInit": "", 1568 | "reduceInitType": "", 1569 | "reduceFixup": "", 1570 | "x": 1390, 1571 | "y": 1420, 1572 | "wires": [ 1573 | [ 1574 | "19fd9486.38d54b" 1575 | ] 1576 | ] 1577 | }, 1578 | { 1579 | "id": "5b1406dd.427208", 1580 | "type": "modbus-flex-write", 1581 | "z": "e4b5f6.297b9a08", 1582 | "name": "", 1583 | "showStatusActivities": false, 1584 | "showErrors": false, 1585 | "server": "2b92a888.1890a8", 1586 | "x": 610, 1587 | "y": 1480, 1588 | "wires": [ 1589 | [], 1590 | [ 1591 | "dffe9966.01f998" 1592 | ] 1593 | ] 1594 | }, 1595 | { 1596 | "id": "361a552f.f9bd8a", 1597 | "type": "function", 1598 | "z": "e4b5f6.297b9a08", 1599 | "name": "FC 6: set Iout to zero", 1600 | "func": "msg.payload = { 'value': 0, 'fc': 6, 'unitid': 1, 'address': 9 , 'quantity': 1 };\nreturn msg;", 1601 | "outputs": 1, 1602 | "noerr": 0, 1603 | "x": 340, 1604 | "y": 1480, 1605 | "wires": [ 1606 | [ 1607 | "5b1406dd.427208" 1608 | ] 1609 | ] 1610 | }, 1611 | { 1612 | "id": "dffe9966.01f998", 1613 | "type": "function", 1614 | "z": "e4b5f6.297b9a08", 1615 | "name": "FC3: get Vout, Iout", 1616 | "func": "msg.payload = { 'fc': 3, 'unitid': 1, 'address':10, 'quantity': 2 }\nreturn msg;", 1617 | "outputs": 1, 1618 | "noerr": 0, 1619 | "x": 330, 1620 | "y": 1540, 1621 | "wires": [ 1622 | [ 1623 | "21d85f91.57f5d" 1624 | ] 1625 | ] 1626 | }, 1627 | { 1628 | "id": "21d85f91.57f5d", 1629 | "type": "modbus-flex-getter", 1630 | "z": "e4b5f6.297b9a08", 1631 | "name": "", 1632 | "showStatusActivities": false, 1633 | "showErrors": false, 1634 | "logIOActivities": false, 1635 | "server": "2b92a888.1890a8", 1636 | "useIOFile": false, 1637 | "ioFile": "", 1638 | "useIOForPayload": false, 1639 | "x": 610, 1640 | "y": 1540, 1641 | "wires": [ 1642 | [ 1643 | "a7db52b4.53fb6" 1644 | ], 1645 | [] 1646 | ] 1647 | }, 1648 | { 1649 | "id": "a7db52b4.53fb6", 1650 | "type": "function", 1651 | "z": "e4b5f6.297b9a08", 1652 | "name": "is Iout = 0 ? if YES put vi, vb, ri ELSE loop", 1653 | "func": "var vi0 = msg.payload[0]/100;\nif (msg.payload[1] <= 7){\n flow.set(\"vi0\", vi0);\n var vb = vi0 - flow.get(\"UD18DROP\");\n flow.set(\"vb\", vb);\n var vrd = flow.get(\"vrd\");\n var ri = ((vrd - vi0)*1000)/flow.get(\"ic\"); \n flow.set(\"ri\", ri);\n var msg1 = { payload: vb, topic: 'vi'};\n var msg2 = { payload: vb.toFixed(2), topic: 'vb'};\n var msg3 = { payload: (ri/1000).toFixed(3), topic: 'ri'};\n return ([msg1, msg2, msg3, []]); \n } else {\n return [[], [], [], msg]; \n}", 1654 | "outputs": 4, 1655 | "noerr": 0, 1656 | "x": 920, 1657 | "y": 1520, 1658 | "wires": [ 1659 | [ 1660 | "2e2f3edb.7e51a2" 1661 | ], 1662 | [ 1663 | "fa99e8d7.99a3d8", 1664 | "1e6f9a95.4e2215" 1665 | ], 1666 | [ 1667 | "fa99e8d7.99a3d8" 1668 | ], 1669 | [ 1670 | "d759fa75.921ff8" 1671 | ] 1672 | ] 1673 | }, 1674 | { 1675 | "id": "f382aaeb.104718", 1676 | "type": "modbus-flex-write", 1677 | "z": "e4b5f6.297b9a08", 1678 | "name": "", 1679 | "showStatusActivities": false, 1680 | "showErrors": false, 1681 | "server": "2b92a888.1890a8", 1682 | "x": 1590, 1683 | "y": 1520, 1684 | "wires": [ 1685 | [], 1686 | [] 1687 | ] 1688 | }, 1689 | { 1690 | "id": "1e6f9a95.4e2215", 1691 | "type": "function", 1692 | "z": "e4b5f6.297b9a08", 1693 | "name": "FC 6: re-set required Iout", 1694 | "func": "var iset = flow.get(\"iset\");\nvar mode = flow.get(\"usemode\");\nswitch (mode) {\n case \"STEST\":\n flow.set(\"iset\", iset+50);\n break;\n case \"TRICKLE\":\n break;\n case \"SLOW\":\n break;\n case \"FAST\":\n break;\n case \"CV\":\n }\nmsg.payload = { 'value': flow.get(\"iset\"), 'fc': 6, 'unitid': 1, 'address': 9 , 'quantity': 1 };\nreturn msg;", 1695 | "outputs": 1, 1696 | "noerr": 0, 1697 | "x": 1330, 1698 | "y": 1520, 1699 | "wires": [ 1700 | [ 1701 | "f382aaeb.104718" 1702 | ] 1703 | ] 1704 | }, 1705 | { 1706 | "id": "d759fa75.921ff8", 1707 | "type": "delay", 1708 | "z": "e4b5f6.297b9a08", 1709 | "name": "", 1710 | "pauseType": "delay", 1711 | "timeout": "100", 1712 | "timeoutUnits": "milliseconds", 1713 | "rate": "1", 1714 | "nbRateUnits": "1", 1715 | "rateUnits": "second", 1716 | "randomFirst": "1", 1717 | "randomLast": "5", 1718 | "randomUnits": "seconds", 1719 | "drop": false, 1720 | "x": 310, 1721 | "y": 1600, 1722 | "wires": [ 1723 | [ 1724 | "dffe9966.01f998" 1725 | ] 1726 | ] 1727 | }, 1728 | { 1729 | "id": "a06f9cd3.12c19", 1730 | "type": "function", 1731 | "z": "e4b5f6.297b9a08", 1732 | "name": "FC3: get RT registers A", 1733 | "func": "msg.payload = { 'fc': 3, 'unitid': 1, 'address':8, 'quantity': 11 }\nreturn msg;", 1734 | "outputs": 1, 1735 | "noerr": 0, 1736 | "x": 350, 1737 | "y": 1340, 1738 | "wires": [ 1739 | [ 1740 | "9ea04fd3.8d853" 1741 | ] 1742 | ] 1743 | }, 1744 | { 1745 | "id": "9ea04fd3.8d853", 1746 | "type": "modbus-flex-getter", 1747 | "z": "e4b5f6.297b9a08", 1748 | "name": "", 1749 | "showStatusActivities": false, 1750 | "showErrors": false, 1751 | "logIOActivities": false, 1752 | "server": "2b92a888.1890a8", 1753 | "useIOFile": false, 1754 | "ioFile": "", 1755 | "useIOForPayload": false, 1756 | "x": 610, 1757 | "y": 1340, 1758 | "wires": [ 1759 | [ 1760 | "f4619f95.6846" 1761 | ], 1762 | [ 1763 | "e4b3511d.00b4b" 1764 | ] 1765 | ] 1766 | }, 1767 | { 1768 | "id": "f4619f95.6846", 1769 | "type": "function", 1770 | "z": "e4b5f6.297b9a08", 1771 | "name": "Save error, onoff. Put: vrd, ic", 1772 | "func": "var e = flow.get(\"error\");\nflow.set(\"vrd\", msg.payload[2]/100);\nflow.set(\"ic\", msg.payload[3]/1000);\nflow.set(\"error\", (e | msg.payload[8]));\nflow.set(\"onoff\", msg.payload[10]);\n// test only\nvar msg1 = { payload: (msg.payload[2]/100).toFixed(2), topic: 'vrd'};\nvar msg2 = { payload: (msg.payload[3]/1000).toFixed(3), topic: 'ic'};\nreturn[msg1, msg2];", 1773 | "outputs": 2, 1774 | "noerr": 0, 1775 | "x": 1140, 1776 | "y": 1320, 1777 | "wires": [ 1778 | [ 1779 | "fa99e8d7.99a3d8" 1780 | ], 1781 | [ 1782 | "fa99e8d7.99a3d8" 1783 | ] 1784 | ] 1785 | }, 1786 | { 1787 | "id": "e4b3511d.00b4b", 1788 | "type": "function", 1789 | "z": "e4b5f6.297b9a08", 1790 | "name": "FC3: get RT registers B", 1791 | "func": "msg.payload = { 'fc': 3, 'unitid': 1, 'address':32, 'quantity': 8 }\nreturn msg;", 1792 | "outputs": 1, 1793 | "noerr": 0, 1794 | "x": 350, 1795 | "y": 1400, 1796 | "wires": [ 1797 | [ 1798 | "bad03d54.4b26d" 1799 | ] 1800 | ] 1801 | }, 1802 | { 1803 | "id": "bad03d54.4b26d", 1804 | "type": "modbus-flex-getter", 1805 | "z": "e4b5f6.297b9a08", 1806 | "name": "", 1807 | "showStatusActivities": false, 1808 | "showErrors": false, 1809 | "logIOActivities": false, 1810 | "server": "2b92a888.1890a8", 1811 | "useIOFile": false, 1812 | "ioFile": "", 1813 | "useIOForPayload": false, 1814 | "x": 610, 1815 | "y": 1400, 1816 | "wires": [ 1817 | [ 1818 | "1b389e8b.9c8311" 1819 | ], 1820 | [ 1821 | "361a552f.f9bd8a" 1822 | ] 1823 | ] 1824 | }, 1825 | { 1826 | "id": "1b389e8b.9c8311", 1827 | "type": "function", 1828 | "z": "e4b5f6.297b9a08", 1829 | "name": "Save and put tbatt, ahbatt", 1830 | "func": "\nflow.set(\"tbatt\", msg.payload[3]);\nvar tmp =((msg.payload[6]*65536 + msg.payload[7])/1000)- flow.get(\"startah\");\n// var tmp = flow.get(\"startah\");\n// tmp += ((msg.payload[6]*65536 + msg.payload[7])/1000);\nflow.set(\"ahbatt\", tmp);\n// test only\nvar msg1= {payload : msg.payload[3], topic : \"tb\"}; // as number\nvar msg2= {payload : msg.payload[3], topic : \"tbatt\" }; // full\nvar msg3= {payload : tmp.toFixed(3), topic : \"ahbatt\"};\nreturn [msg1, msg2, msg3]; ", 1831 | "outputs": 3, 1832 | "noerr": 0, 1833 | "x": 870, 1834 | "y": 1380, 1835 | "wires": [ 1836 | [ 1837 | "77a64dad.25d6b4" 1838 | ], 1839 | [ 1840 | "fa99e8d7.99a3d8" 1841 | ], 1842 | [ 1843 | "fa99e8d7.99a3d8" 1844 | ] 1845 | ] 1846 | }, 1847 | { 1848 | "id": "77a64dad.25d6b4", 1849 | "type": "ring-buffer", 1850 | "z": "e4b5f6.297b9a08", 1851 | "name": "", 1852 | "capacity": "14", 1853 | "order": "old-to-new", 1854 | "sendOnlyIfFull": false, 1855 | "pushAfterClear": false, 1856 | "extra": false, 1857 | "perTopic": false, 1858 | "x": 1080, 1859 | "y": 1360, 1860 | "wires": [ 1861 | [ 1862 | "34df12b1.4f106e" 1863 | ] 1864 | ] 1865 | }, 1866 | { 1867 | "id": "34df12b1.4f106e", 1868 | "type": "function", 1869 | "z": "e4b5f6.297b9a08", 1870 | "name": "deltaT", 1871 | "func": "var deltat = 0;\nif (msg.payload[13]){\n deltat = ((msg.payload[13]+ msg.payload[12]- msg.payload[0]- msg.payload[1])/4);\n}\nflow.set(\"deltat\", deltat);\nmsg.payload = deltat.toFixed(2);\nmsg.topic = \"deltat\";\nreturn msg;", 1872 | "outputs": 1, 1873 | "noerr": 0, 1874 | "x": 1210, 1875 | "y": 1360, 1876 | "wires": [ 1877 | [ 1878 | "fa99e8d7.99a3d8" 1879 | ] 1880 | ] 1881 | }, 1882 | { 1883 | "id": "2e2f3edb.7e51a2", 1884 | "type": "ring-buffer", 1885 | "z": "e4b5f6.297b9a08", 1886 | "name": "", 1887 | "capacity": "14", 1888 | "order": "old-to-new", 1889 | "sendOnlyIfFull": false, 1890 | "pushAfterClear": false, 1891 | "extra": false, 1892 | "perTopic": false, 1893 | "x": 1000, 1894 | "y": 1460, 1895 | "wires": [ 1896 | [ 1897 | "9481371d.4daac8" 1898 | ] 1899 | ] 1900 | }, 1901 | { 1902 | "id": "9481371d.4daac8", 1903 | "type": "function", 1904 | "z": "e4b5f6.297b9a08", 1905 | "name": "deltaV", 1906 | "func": "var deltav = 0.00;\nif (msg.payload[13]){\n deltav = (250*(msg.payload[13]+ msg.payload[12]- msg.payload[0]- msg.payload[1]));\n}\nflow.set(\"deltav\", deltav);\nmsg.payload = deltav.toFixed(1);\nmsg.topic = \"deltav\";\nreturn msg;", 1907 | "outputs": 1, 1908 | "noerr": 0, 1909 | "x": 1130, 1910 | "y": 1460, 1911 | "wires": [ 1912 | [ 1913 | "fa99e8d7.99a3d8" 1914 | ] 1915 | ] 1916 | }, 1917 | { 1918 | "id": "25daf6a5.44cdfa", 1919 | "type": "comment", 1920 | "z": "e4b5f6.297b9a08", 1921 | "name": "start data processing", 1922 | "info": "", 1923 | "x": 130, 1924 | "y": 500, 1925 | "wires": [] 1926 | }, 1927 | { 1928 | "id": "7fad3453.b216bc", 1929 | "type": "delay", 1930 | "z": "e4b5f6.297b9a08", 1931 | "name": "", 1932 | "pauseType": "delay", 1933 | "timeout": "1000", 1934 | "timeoutUnits": "milliseconds", 1935 | "rate": "1", 1936 | "nbRateUnits": "1", 1937 | "rateUnits": "second", 1938 | "randomFirst": "1", 1939 | "randomLast": "5", 1940 | "randomUnits": "seconds", 1941 | "drop": false, 1942 | "x": 800, 1943 | "y": 500, 1944 | "wires": [ 1945 | [ 1946 | "696af9b7.fa1b78" 1947 | ] 1948 | ] 1949 | }, 1950 | { 1951 | "id": "ce3ab761.ce9c88", 1952 | "type": "serial out", 1953 | "z": "e4b5f6.297b9a08", 1954 | "name": "TX UD18 TESTER", 1955 | "serial": "4092feda.8b16c", 1956 | "x": 1310, 1957 | "y": 2340, 1958 | "wires": [] 1959 | }, 1960 | { 1961 | "id": "e56bfbcb.1723f8", 1962 | "type": "function", 1963 | "z": "e4b5f6.297b9a08", 1964 | "name": "[-] key code", 1965 | "func": "// 0x03: refresh screen\n// (WHreset] = [ff 55 11 03 01 00 00 00 00 51]\n// (TimeReset) [ff 55 11 03 03 00 00 00 00 53] \n// [+] ff 55 11 03 34 00 00 00 00 0c \nmsg.payload = Buffer.from([0xff, 0x55, 0x11, 0x03, 0x34, 0x00, 0x00, 0x00, 0x00, 0x0C ]);\nreturn msg;", 1966 | "outputs": 1, 1967 | "noerr": 0, 1968 | "x": 1030, 1969 | "y": 2280, 1970 | "wires": [ 1971 | [ 1972 | "ce3ab761.ce9c88" 1973 | ] 1974 | ] 1975 | }, 1976 | { 1977 | "id": "28e8b574.c71c6a", 1978 | "type": "function", 1979 | "z": "e4b5f6.297b9a08", 1980 | "name": "[ENTER] code", 1981 | "func": "\nmsg.payload = Buffer.from([0xff, 0x55, 0x11, 0x03, 0x32, 0x00, 0x00, 0x00, 0x00, 0x02 ]);\nreturn msg;", 1982 | "outputs": 1, 1983 | "noerr": 0, 1984 | "x": 1040, 1985 | "y": 2400, 1986 | "wires": [ 1987 | [ 1988 | "ce3ab761.ce9c88" 1989 | ] 1990 | ] 1991 | }, 1992 | { 1993 | "id": "620179ff.da2a28", 1994 | "type": "function", 1995 | "z": "e4b5f6.297b9a08", 1996 | "name": "[setup] code", 1997 | "func": "\nmsg.payload = Buffer.from([0xff, 0x55, 0x11, 0x03, 0x31, 0x00, 0x00, 0x00, 0x00, 0x01 ]);\nreturn msg;", 1998 | "outputs": 1, 1999 | "noerr": 0, 2000 | "x": 1030, 2001 | "y": 2360, 2002 | "wires": [ 2003 | [ 2004 | "ce3ab761.ce9c88" 2005 | ] 2006 | ] 2007 | }, 2008 | { 2009 | "id": "bb381beb.c8a068", 2010 | "type": "function", 2011 | "z": "e4b5f6.297b9a08", 2012 | "name": "[+] key code", 2013 | "func": "msg.payload = Buffer.from([0xff, 0x55, 0x11, 0x03, 0x33, 0x00, 0x00, 0x00, 0x00, 0x03 ]);\nreturn msg;", 2014 | "outputs": 1, 2015 | "noerr": 0, 2016 | "x": 1030, 2017 | "y": 2320, 2018 | "wires": [ 2019 | [ 2020 | "ce3ab761.ce9c88" 2021 | ] 2022 | ] 2023 | }, 2024 | { 2025 | "id": "2c461add.3ceda6", 2026 | "type": "comment", 2027 | "z": "e4b5f6.297b9a08", 2028 | "name": "Test end charge", 2029 | "info": "Polling for end charge conditions", 2030 | "x": 120, 2031 | "y": 1000, 2032 | "wires": [] 2033 | }, 2034 | { 2035 | "id": "e28a7186.376b4", 2036 | "type": "function", 2037 | "z": "e4b5f6.297b9a08", 2038 | "name": "test error conditions", 2039 | "func": "var errors = 0;\nif (flow.get(\"run\")==1) {\n errors = flow.get(\"error\");\n if (flow.get(\"onoff\") === 0) \n errors |= 4;\n // if (flow.get(\"bmode\") === 0) \n // errors |= 4;\n if (flow.get(\"ahbatt\") > 1.5 *flow.get(\"bcap\")) \n errors |= 8;\n if (flow.get(\"esect\") > flow.get(\"timemax\")) \n errors |= 16;\n //\n if (flow.get(\"tbatt\") > flow.get(\"Tlimit\")) \n errors |= 32;\n // --- test max Vbatt\n if ( flow.get(\"vb\") > flow.get(\"CFG_VBMAX\"))\n errors |= 64;\n if (flow.get(\"deltat\") > flow.get(\"dTlimit\")) \n errors |= 256;\n if ((flow.get(\"esect\")>30) && (flow.get(\"deltav\") < flow.get(\"dVlimit\"))) \n errors |= 512;\n \n flow.set(\"error\", errors); \n }\nmsg.payload = errors;\nreturn msg;", 2040 | "outputs": 1, 2041 | "noerr": 0, 2042 | "x": 290, 2043 | "y": 1060, 2044 | "wires": [ 2045 | [ 2046 | "e4fa8ac0.72eb88" 2047 | ] 2048 | ] 2049 | }, 2050 | { 2051 | "id": "e4fa8ac0.72eb88", 2052 | "type": "switch", 2053 | "z": "e4b5f6.297b9a08", 2054 | "name": "if any error", 2055 | "property": "payload", 2056 | "propertyType": "msg", 2057 | "rules": [ 2058 | { 2059 | "t": "eq", 2060 | "v": "0", 2061 | "vt": "num" 2062 | }, 2063 | { 2064 | "t": "gt", 2065 | "v": "0", 2066 | "vt": "num" 2067 | } 2068 | ], 2069 | "checkall": "false", 2070 | "repair": false, 2071 | "outputs": 2, 2072 | "x": 530, 2073 | "y": 1060, 2074 | "wires": [ 2075 | [], 2076 | [ 2077 | "48d51327.a8869c" 2078 | ] 2079 | ] 2080 | }, 2081 | { 2082 | "id": "8172710e.83a02", 2083 | "type": "function", 2084 | "z": "e4b5f6.297b9a08", 2085 | "name": "RUN OFF", 2086 | "func": "flow.set(\"run\", 0);\nreturn msg;", 2087 | "outputs": 1, 2088 | "noerr": 0, 2089 | "x": 300, 2090 | "y": 880, 2091 | "wires": [ 2092 | [] 2093 | ] 2094 | }, 2095 | { 2096 | "id": "e143dbd9.5c2fd8", 2097 | "type": "mysql", 2098 | "z": "e4b5f6.297b9a08", 2099 | "mydb": "87c6018f.346ab", 2100 | "name": "update record", 2101 | "x": 980, 2102 | "y": 920, 2103 | "wires": [ 2104 | [] 2105 | ] 2106 | }, 2107 | { 2108 | "id": "5ff3b75f.fa2648", 2109 | "type": "function", 2110 | "z": "e4b5f6.297b9a08", 2111 | "name": "query: close", 2112 | "func": "if (flow.get(\"LOGGING\") === \"MYSQL\") {\n var rid = flow.get(\"tbid\");\n var etime = flow.get(\"cmin\") + \":\"+ flow.get(\"csec\");\n//\n msg.topic = \"UPDATE `batteries`.`battery` SET\";\n msg.topic +=\" `e_time` = '\"+etime+\"',\";\n msg.topic +=\" `ah` = '\"+flow.get(\"ahbatt\")+\"' \";\n msg.topic +=\" WHERE `battery`.`file` = '\"+ rid+\"' \";\n msg.topic +=\" LIMIT 1\" ;\n return msg;\n} else {\n return [[]];\n}", 2113 | "outputs": 1, 2114 | "noerr": 0, 2115 | "x": 790, 2116 | "y": 920, 2117 | "wires": [ 2118 | [ 2119 | "e143dbd9.5c2fd8" 2120 | ] 2121 | ] 2122 | }, 2123 | { 2124 | "id": "48d51327.a8869c", 2125 | "type": "link out", 2126 | "z": "e4b5f6.297b9a08", 2127 | "name": "error", 2128 | "links": [ 2129 | "8e6a4d6f.38734" 2130 | ], 2131 | "x": 655, 2132 | "y": 1060, 2133 | "wires": [] 2134 | }, 2135 | { 2136 | "id": "da802f39.f72c5", 2137 | "type": "link in", 2138 | "z": "e4b5f6.297b9a08", 2139 | "name": "test end", 2140 | "links": [ 2141 | "8737239d.b28fc" 2142 | ], 2143 | "x": 135, 2144 | "y": 1060, 2145 | "wires": [ 2146 | [ 2147 | "e28a7186.376b4" 2148 | ] 2149 | ] 2150 | }, 2151 | { 2152 | "id": "6b9e475e.ffa0c8", 2153 | "type": "inject", 2154 | "z": "e4b5f6.297b9a08", 2155 | "name": "", 2156 | "topic": "", 2157 | "payload": "", 2158 | "payloadType": "date", 2159 | "repeat": "", 2160 | "crontab": "", 2161 | "once": true, 2162 | "onceDelay": "0.6", 2163 | "x": 230, 2164 | "y": 2020, 2165 | "wires": [ 2166 | [ 2167 | "344551f3.a27b4e", 2168 | "865c88ed.ad9a08" 2169 | ] 2170 | ] 2171 | }, 2172 | { 2173 | "id": "a99f3d2e.1fa5a", 2174 | "type": "inject", 2175 | "z": "e4b5f6.297b9a08", 2176 | "name": "", 2177 | "topic": "trigger", 2178 | "payload": "\"\"", 2179 | "payloadType": "str", 2180 | "repeat": "", 2181 | "crontab": "", 2182 | "once": true, 2183 | "onceDelay": "0.2", 2184 | "x": 160, 2185 | "y": 2500, 2186 | "wires": [ 2187 | [ 2188 | "3a0d72e2.9bb53e", 2189 | "21505e12.4e3f52", 2190 | "13eaffd9.35aaa" 2191 | ] 2192 | ] 2193 | }, 2194 | { 2195 | "id": "1678768a.448e89", 2196 | "type": "inject", 2197 | "z": "e4b5f6.297b9a08", 2198 | "name": "refresh", 2199 | "topic": "", 2200 | "payload": "", 2201 | "payloadType": "date", 2202 | "repeat": "4.3", 2203 | "crontab": "", 2204 | "once": true, 2205 | "onceDelay": "0.6", 2206 | "x": 840, 2207 | "y": 2540, 2208 | "wires": [ 2209 | [ 2210 | "a693e8f2.f617f8" 2211 | ] 2212 | ] 2213 | }, 2214 | { 2215 | "id": "9b7c436.9384fc", 2216 | "type": "ui_template", 2217 | "z": "e4b5f6.297b9a08", 2218 | "group": "7bba9908.2652d8", 2219 | "name": "", 2220 | "order": 2, 2221 | "width": "2", 2222 | "height": "6", 2223 | "format": "
\n FCOP 
\n
\n  ON
\n\n
\n TC 
\n
\n  {{msg.payload.tc}}
\n \n
\n OvrC 
\n
\n  {{msg.payload.c}}
\n \n
\n OvrV 
\n
\n   {{msg.payload.v}}
", 2224 | "storeOutMessages": false, 2225 | "fwdInMessages": false, 2226 | "templateScope": "local", 2227 | "x": 1240, 2228 | "y": 2520, 2229 | "wires": [ 2230 | [] 2231 | ] 2232 | }, 2233 | { 2234 | "id": "a693e8f2.f617f8", 2235 | "type": "function", 2236 | "z": "e4b5f6.297b9a08", 2237 | "name": "UD18 limits", 2238 | "func": "\nvar vtc = flow.get(\"CFG_MAXTIME\").toFixed(0);\nvar vbm = flow.get(\"CFG_VBMAX\").toFixed(2);\nvar vc;\nvar mode = flow.get(\"usemode\");\nswitch (mode) {\n case \"STEST\":\n // tmp += \"Over -C 2500
\";\n vc = 2500;\n break;\n case \"TRICKLE\":\n case \"SLOW\":\n case \"FAST\":\n case \"CV\":\n vc = (flow.get(\"iset\")+ 10).toFixed(0);\n }\n\nvar msg2 = { \"payload\": { \"tc\" : vtc, \"c\" : vc, \"v\" : vbm }};\nreturn msg2;\n", 2239 | "outputs": 1, 2240 | "noerr": 0, 2241 | "x": 1030, 2242 | "y": 2500, 2243 | "wires": [ 2244 | [ 2245 | "c4ba7586.367e08", 2246 | "9b7c436.9384fc", 2247 | "c4dbd2d8.3a778" 2248 | ] 2249 | ] 2250 | }, 2251 | { 2252 | "id": "c4dbd2d8.3a778", 2253 | "type": "debug", 2254 | "z": "e4b5f6.297b9a08", 2255 | "name": "", 2256 | "active": true, 2257 | "tosidebar": true, 2258 | "console": false, 2259 | "tostatus": false, 2260 | "complete": "payload", 2261 | "targetType": "msg", 2262 | "x": 1250, 2263 | "y": 2560, 2264 | "wires": [] 2265 | }, 2266 | { 2267 | "id": "71081431.d5ae9c", 2268 | "type": "comment", 2269 | "z": "e4b5f6.297b9a08", 2270 | "name": "UD18 - optional", 2271 | "info": "", 2272 | "x": 840, 2273 | "y": 2200, 2274 | "wires": [] 2275 | }, 2276 | { 2277 | "id": "c4ba7586.367e08", 2278 | "type": "link out", 2279 | "z": "e4b5f6.297b9a08", 2280 | "name": "data changed", 2281 | "links": [ 2282 | "13313975.80e4d7" 2283 | ], 2284 | "x": 1195, 2285 | "y": 2480, 2286 | "wires": [] 2287 | }, 2288 | { 2289 | "id": "b9171517.4d5308", 2290 | "type": "comment", 2291 | "z": "e4b5f6.297b9a08", 2292 | "name": "Common", 2293 | "info": "", 2294 | "x": 100, 2295 | "y": 40, 2296 | "wires": [] 2297 | }, 2298 | { 2299 | "id": "2b92a888.1890a8", 2300 | "type": "modbus-client", 2301 | "z": "", 2302 | "name": "RD6006", 2303 | "clienttype": "simpleser", 2304 | "bufferCommands": false, 2305 | "stateLogEnabled": false, 2306 | "tcpHost": "127.0.0.1", 2307 | "tcpPort": "14502", 2308 | "tcpType": "DEFAULT", 2309 | "serialPort": "COM7", 2310 | "serialType": "RTU-BUFFERD", 2311 | "serialBaudrate": "115200", 2312 | "serialDatabits": "8", 2313 | "serialStopbits": "1", 2314 | "serialParity": "none", 2315 | "serialConnectionDelay": "100", 2316 | "unit_id": "1", 2317 | "commandDelay": "5", 2318 | "clientTimeout": "3000", 2319 | "reconnectOnTimeout": true, 2320 | "reconnectTimeout": "2000", 2321 | "parallelUnitIdsAllowed": false 2322 | }, 2323 | { 2324 | "id": "df1c70e1.a4ee", 2325 | "type": "MySQLdatabase", 2326 | "z": "", 2327 | "host": "127.0.0.1", 2328 | "port": "3306", 2329 | "db": "batteries", 2330 | "tz": "" 2331 | }, 2332 | { 2333 | "id": "ffb283b5.7f0cf", 2334 | "type": "ui_group", 2335 | "z": "", 2336 | "name": "Group 2", 2337 | "tab": "653d7645.59fcb8", 2338 | "order": 2, 2339 | "disp": false, 2340 | "width": "8", 2341 | "collapse": false 2342 | }, 2343 | { 2344 | "id": "70ca806d.d7591", 2345 | "type": "ui_group", 2346 | "z": "", 2347 | "name": "rtdat", 2348 | "tab": "653d7645.59fcb8", 2349 | "order": 1, 2350 | "disp": false, 2351 | "width": "8", 2352 | "collapse": false 2353 | }, 2354 | { 2355 | "id": "1d9d1c49.f32414", 2356 | "type": "ui_group", 2357 | "z": "", 2358 | "name": "Group 3", 2359 | "tab": "653d7645.59fcb8", 2360 | "order": 3, 2361 | "disp": false, 2362 | "width": "8", 2363 | "collapse": false 2364 | }, 2365 | { 2366 | "id": "7bba9908.2652d8", 2367 | "type": "ui_group", 2368 | "z": "", 2369 | "name": "UD18", 2370 | "tab": "653d7645.59fcb8", 2371 | "order": 4, 2372 | "disp": true, 2373 | "width": "2", 2374 | "collapse": false 2375 | }, 2376 | { 2377 | "id": "4092feda.8b16c", 2378 | "type": "serial-port", 2379 | "z": "", 2380 | "serialport": "COM6", 2381 | "serialbaud": "115200", 2382 | "databits": "8", 2383 | "parity": "none", 2384 | "stopbits": "1", 2385 | "waitfor": "0xff", 2386 | "dtr": "none", 2387 | "rts": "none", 2388 | "cts": "none", 2389 | "dsr": "none", 2390 | "newline": "36", 2391 | "bin": "bin", 2392 | "out": "count", 2393 | "addchar": "", 2394 | "responsetimeout": "3000" 2395 | }, 2396 | { 2397 | "id": "87c6018f.346ab", 2398 | "type": "MySQLdatabase", 2399 | "z": "a6941e78.e5a6b", 2400 | "host": "127.0.0.1", 2401 | "port": "3306", 2402 | "db": "batteries", 2403 | "tz": "+1" 2404 | }, 2405 | { 2406 | "id": "653d7645.59fcb8", 2407 | "type": "ui_tab", 2408 | "z": "", 2409 | "name": "Charger02", 2410 | "icon": "dashboard", 2411 | "order": 2, 2412 | "disabled": false, 2413 | "hidden": false 2414 | } 2415 | ] -------------------------------------------------------------------------------- /charger2.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 3.2.0.1 3 | -- http://www.phpmyadmin.net 4 | -- 5 | -- Host: localhost 6 | -- Generato il: 30 mar, 2020 at 11:59 AM 7 | -- Versione MySQL: 5.0.45 8 | -- Versione PHP: 5.3.0 9 | 10 | SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; 11 | 12 | 13 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 14 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 15 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 16 | /*!40101 SET NAMES utf8 */; 17 | 18 | -- 19 | -- Database: `batteries` 20 | -- 21 | 22 | -- -------------------------------------------------------- 23 | 24 | -- 25 | -- Struttura della tabella `battery` 26 | -- 27 | 28 | CREATE TABLE IF NOT EXISTS `battery` ( 29 | `file` char(24) collate utf8_bin NOT NULL, 30 | `description` char(250) collate utf8_bin NOT NULL, 31 | `capacity` int(11) NOT NULL, 32 | `force` decimal(10,3) NOT NULL, 33 | `iout` decimal(10,3) NOT NULL, 34 | `vout` decimal(10,3) NOT NULL, 35 | `e_time` char(20) collate utf8_bin default NULL, 36 | `ah` decimal(10,3) default NULL, 37 | PRIMARY KEY (`file`) 38 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; 39 | -------------------------------------------------------------------------------- /images/2020-03-11.212437.shot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msillano/NiMH_charger_logger/b29a164dd1b54601108913b8942b531f2c29f2e8/images/2020-03-11.212437.shot.png -------------------------------------------------------------------------------- /images/2020-03-12.130635.shot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msillano/NiMH_charger_logger/b29a164dd1b54601108913b8942b531f2c29f2e8/images/2020-03-12.130635.shot.png -------------------------------------------------------------------------------- /images/2020-03-24.124024.shot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msillano/NiMH_charger_logger/b29a164dd1b54601108913b8942b531f2c29f2e8/images/2020-03-24.124024.shot.png -------------------------------------------------------------------------------- /images/2020-03-24.164721.shot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msillano/NiMH_charger_logger/b29a164dd1b54601108913b8942b531f2c29f2e8/images/2020-03-24.164721.shot.png -------------------------------------------------------------------------------- /images/2020-03-28.190610.shot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msillano/NiMH_charger_logger/b29a164dd1b54601108913b8942b531f2c29f2e8/images/2020-03-28.190610.shot.png -------------------------------------------------------------------------------- /images/2020-03-30.115437.shot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msillano/NiMH_charger_logger/b29a164dd1b54601108913b8942b531f2c29f2e8/images/2020-03-30.115437.shot.png -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # NiMH battery charger logger 2.0 # 2 | This is an experimental charger and data logger for NiMH batteries and packs, to get data and graphics about the charging process. 3 | 4 | ![](images/2020-03-28.190610.shot.png) 5 | 6 | It uses the RD6006 power supply and the UD18 Digital tester (optional). It is implemented as **node-red** flow. 7 | 8 | Data can be exported as CSV file or as mySQL tables. 9 | ![](images/2020-03-24.164721.shot.png) 10 | 11 | The full project documentation is in file [NiMH battery charger logger2.pdf](NiMH_battery_charger_logger2.pdf). 12 | 13 | ## References ## 14 | 15 | - NiMH charger logger ver.1 [https://github.com/msillano/NiMH_charger_logger/tree/version.1](https://github.com/msillano/NiMH_charger_logger/tree/version.1) 16 | 17 | - RD6006 Assembly, protocol, node-red test [https://github.com/msillano/RD6006-Super-power-supply](https://github.com/msillano/RD6006-Super-power-supply) 18 | 19 | - UD18 protocol and node-red test [https://github.com/msillano/UD18-protocol-and-node-red](https://github.com/msillano/UD18-protocol-and-node-red) 20 | 21 | - About NiMH batteries and e3DHW Power Management System [https://github.com/msillano/e3DHW-PMS](https://github.com/msillano/e3DHW-PMS) 22 | --------------------------------------------------------------------------------