edit_config_param.html 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link rel="icon" href="favicon.ico" type="image/x-icon">
  5. <title>Edit Config</title>
  6. <meta charset="utf-8">
  7. <style>
  8. h1 {font-size: 2em;}
  9. h2 {font-size: 1.5em; margin-block-start: 0.0em; margin-block-end: 0.2em;}
  10. h3 {font-size: 1.2em;}
  11. h4 {
  12. margin-bottom: 0;
  13. }
  14. p {font-size: 1em;}
  15. table {
  16. border: 0pt;
  17. border-collapse: collapse;
  18. }
  19. tr {
  20. border-bottom: 1px solid lightgray;
  21. }
  22. td {
  23. padding: 10px;
  24. }
  25. .button {
  26. padding: 5px 20px;
  27. width: 211px;
  28. font-size: 16px;
  29. }
  30. textarea {
  31. font-size: 14px;
  32. }
  33. .description {
  34. color: black;
  35. font-size: 80%;
  36. }
  37. .disabled {
  38. color:lightgrey;
  39. }
  40. .smallSelect {
  41. width: 30px;
  42. }
  43. .invalid-input {
  44. background-color: #FFAA00;
  45. }
  46. .hidden {
  47. display: none;
  48. }
  49. .expert {
  50. background-color: #ffc5c5;
  51. }
  52. .indent1 {
  53. padding-left: 40px;
  54. }
  55. .indent2 {
  56. padding-left: 69px;
  57. }
  58. </style>
  59. </head>
  60. <body style="font-family: arial; padding: 0px 10px;">
  61. <h2>Configuration</h2>
  62. <input type="checkbox" id="ExpertModus_enabled" value="1" onclick = 'UpdateExpertModus()' unchecked><label for="ExpertModus_enabled"> Expert Mode </label>
  63. <button class="button" id="Edit_Config_Direct" onclick="editConfigDirect()" style="display:none">Edit Config.ini direct</button>
  64. <p></p>
  65. <div id = "divall" style="display:none">
  66. <table>
  67. <tr>
  68. <th width="350px" style="text-align: left;">
  69. Parameter
  70. </th>
  71. <th style="text-align: left;">
  72. Value
  73. </th>
  74. <th style="text-align: left;">
  75. Information
  76. </th>
  77. </tr>
  78. <tr>
  79. <td colspan="3" style="padding-left: 20px;"><h4>TakeImage</h4></td>
  80. </tr>
  81. <tr>
  82. <td class="indent1">
  83. <input type="checkbox" id="MakeImage_LogImageLocation_enabled" value="1" onclick = 'InvertEnableItem("MakeImage", "LogImageLocation")' unchecked >
  84. <label for=MakeImage_LogImageLocation_enabled><class id="MakeImage_LogImageLocation_text" style="color:black;">LogImageLocation</class></label>
  85. </td>
  86. <td>
  87. <input type="text" name="name" id="MakeImage_LogImageLocation_value1">
  88. </td>
  89. <td class="description">
  90. Location to store raw images for logging
  91. </td>
  92. </tr>
  93. <tr>
  94. <td class="indent1">
  95. <input type="checkbox" id="MakeImage_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("MakeImage", "LogfileRetentionInDays")' unchecked >
  96. <label for=MakeImage_LogfileRetentionInDays_enabled><class id="MakeImage_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class></label>
  97. </td>
  98. <td>
  99. <input type="number" id="MakeImage_LogfileRetentionInDays_value1" size="13" min="0" step="1">
  100. </td>
  101. <td class="description">
  102. Time to keep the raw image (in days, resp. "0" = forever)
  103. </td>
  104. </tr>
  105. <tr class="expert" id="ex1">
  106. <td class="indent1">
  107. <class id="MakeImage_WaitBeforeTakingPicture_text" style="color:black;">WaitBeforeTakingPicture</class>
  108. </td>
  109. <td>
  110. <input type="number" id="MakeImage_WaitBeforeTakingPicture_value1" size="13" min="0" step="any">
  111. </td>
  112. <td class="description">
  113. Wait time between illumination switch on and take the picture (in seconds)
  114. </td>
  115. </tr>
  116. <tr class="expert" id="ex2">
  117. <td class="indent1">
  118. <class id="MakeImage_ImageQuality_text" style="color:black;">ImageQuality</class>
  119. </td>
  120. <td>
  121. <input type="number" id="MakeImage_ImageQuality_value1" size="13" min="0" max="63">
  122. </td>
  123. <td class="description">
  124. Quality index for picture (default = "12" - "0" high ... "63" low) <br>
  125. Remark: values smaller than 12 can result in a reboot, as the bigger sized JPEG might not fit in the available RAM!
  126. </td>
  127. </tr>
  128. <tr class="expert" id="ex3">
  129. <td class="indent1">
  130. <class id="MakeImage_ImageSize_text" style="color:black;">ImageSize</class>
  131. </td>
  132. <td>
  133. <select id="MakeImage_ImageSize_value1">
  134. <option value="VGA" selected>VGA</option>
  135. <option value="QVGA" >QVGA</option>
  136. </select>
  137. </td>
  138. <td class="description">
  139. Picture size camera (default = "VGA")
  140. </td>
  141. </tr>
  142. <tr class="expert" id="LEDIntensity_ex3">
  143. <td class="indent1">
  144. <class id="MakeImage_LEDIntensity_text" style="color:black;">LEDIntensity</class>
  145. </td>
  146. <td>
  147. <input type="number" id="MakeImage_LEDIntensity_value1" size="13" min="0" max="100">
  148. </td>
  149. <td style="font-size: 80%;">
  150. Internal LED Flash Intensity (PWM from 0% - 100%). <br>
  151. Remark: as the camera autoillumination settings are used, this is rather for energy saving, than reducing reflections.
  152. </td>
  153. </tr>
  154. <tr class="expert" id="Brightness_ex3">
  155. <td class="indent1">
  156. <class id="MakeImage_Brightness_text" style="color:black;">Brightness</class>
  157. </td>
  158. <td>
  159. <input type="number" id="MakeImage_Brightness_value1" size="13" min="-2" max="2">
  160. </td>
  161. <td style="font-size: 80%;">
  162. Image Brightness (-2 .. 2 - default = "0")
  163. </td>
  164. </tr>
  165. <tr class="expert" id="Contrast_ex3">
  166. <td class="indent1">
  167. <class id="MakeImage_Contrast_text" style="color:black;">Contrast</class>
  168. </td>
  169. <td>
  170. <input type="number" id="MakeImage_Contrast_value1" size="13" min="-2" max="2">
  171. </td>
  172. <td style="font-size: 80%;">
  173. Image Contrast (-2 .. 2 - default = "0") <br>
  174. Remark: camera driver is not fully supporting this setting yet (no impact on image)
  175. </td>
  176. </tr>
  177. <tr class="expert" id="Saturation_ex3">
  178. <td class="indent1">
  179. <class id="MakeImage_Saturation_text" style="color:black;">Saturation</class>
  180. </td>
  181. <td>
  182. <input type="number" id="MakeImage_Saturation_value1" size="13" min="-2" max="2">
  183. </td>
  184. <td style="font-size: 80%;">
  185. Image Saturation (-2 .. 2 - default = "0") <br>
  186. Remark: camera driver is not fully supporting this setting yet (no impact on image)
  187. </td>
  188. </tr>
  189. <tr class="expert" id="MakeImage_FixedExposure_ex10">
  190. <td class="indent1">
  191. <class id="MakeImage_FixedExposure_text" style="color:black;">FixedExposure</class>
  192. </td>
  193. <td>
  194. <select id="MakeImage_FixedExposure_value1">
  195. <option value="true" selected>true</option>
  196. <option value="false" >false</option>
  197. </select>
  198. </td>
  199. <td style="font-size: 80%;">
  200. Fixes the illumination setting of camera at the startup and uses this later --> individual round is faster
  201. </td>
  202. </tr>
  203. <tr class="expert" id="ex4">
  204. <td colspan="3" style="padding-left: 20px;"><h4>Alignment</h4></td>
  205. </tr>
  206. <tr class="expert" id="ex6">
  207. <td class="indent1">
  208. <class id="Alignment_SearchFieldX_text" style="color:black;">SearchFieldX</class>
  209. </td>
  210. <td>
  211. <input type="number" name="name" id="Alignment_SearchFieldX_value1" size="13" min="1" step="1">
  212. </td>
  213. <td style="font-size: 80%;">
  214. x size (width) in which the reference is searched (default = "20")
  215. </td>
  216. </tr>
  217. <tr class="expert" id="ex8">
  218. <td class="indent1">
  219. <class id="Alignment_SearchFieldY_text" style="color:black;">SearchFieldY</class>
  220. </td>
  221. <td>
  222. <input type="number" name="name" id="Alignment_SearchFieldY_value1" size="13" min="1">
  223. </td>
  224. <td style="font-size: 80%;">
  225. y size (height) in which the reference is searched (default = "20")
  226. </td>
  227. </tr>
  228. <tr class="expert" id="AlignmentAlgo_ex8">
  229. <td class="indent1">
  230. <input type="checkbox" id="Alignment_AlignmentAlgo_enabled" value="1" onclick = 'InvertEnableItem("Alignment", "AlignmentAlgo")' unchecked >
  231. <label for=Alignment_AlignmentAlgo_enabled><class id="Alignment_AlignmentAlgo_text" style="color:black;">AlignmentAlgo</class></label>
  232. </td>
  233. <td>
  234. <select id="Alignment_AlignmentAlgo_value1">
  235. <option value="default" selected>Default</option>
  236. <option value="highAccuracy" >HighAccuracy</option>
  237. <option value="fast" >Fast</option>
  238. </select>
  239. </td>
  240. <td style="font-size: 80%;">
  241. "Default" = use only R-Channel, "HighAccuracy" = use all Channels (RGB, 3x slower), <br> "Fast" (First time RGB, then only check if image is shifted)
  242. </td>
  243. </tr>
  244. <tr id="Category_Digits_ex4">
  245. <td colspan="3" style="padding-left: 20px;">
  246. <h4><input type="checkbox" id="Category_Digits_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked >
  247. <label for=Category_Digits_enabled>Digits</h4></label>
  248. </td>
  249. </tr>
  250. <tr>
  251. <td class="indent1">
  252. <class id="Digits_Model_text" style="color:black;">Model</class>
  253. </td>
  254. <td>
  255. <select id="Digits_Model_value1">
  256. </select>
  257. </td>
  258. <td style="font-size: 80%;">
  259. Path to CNN model file for image recognition. Check the <a href="https://github.com/jomjol/AI-on-the-edge-device/wiki/Choosing-the-Model" target="_blank">documentation</a> for details.
  260. </td>
  261. </tr>
  262. <tr class="expert" id="ex91">
  263. <td class="indent1">
  264. <input type="checkbox" id="Digits_CNNGoodThreshold_enabled" value="1" onclick = 'InvertEnableItem("Digits", "CNNGoodThreshold")' unchecked >
  265. <label for=Digits_CNNGoodThreshold_enabled><class id="Digits_CNNGoodThreshold_text" style="color:black;">CNNGoodThreshold</class></label>
  266. </td>
  267. <td>
  268. <input width="40px" type="number" id="Digits_CNNGoodThreshold_value1" min="0" max="1" step="0.1">
  269. </td>
  270. <td style="font-size: 80%;">
  271. EXPERIMENTAL - NOT WORKING FOR ALL CNNs! - Threshold above which the classification should be to accept the value (only for digits meaningfull)
  272. </td>
  273. </tr>
  274. <tr>
  275. <td class="indent1">
  276. <input type="checkbox" id="Digits_LogImageLocation_enabled" value="1" onclick = 'InvertEnableItem("Digits", "LogImageLocation")' unchecked >
  277. <label for=Digits_LogImageLocation_enabled><class id="Digits_LogImageLocation_text" style="color:black;">LogImageLocation</class></label>
  278. </td>
  279. <td>
  280. <input type="text" name="name" id="Digits_LogImageLocation_value1">
  281. </td>
  282. <td style="font-size: 80%;">
  283. Location to store separated digits for logging
  284. </td>
  285. </tr>
  286. <tr>
  287. <td class="indent1">
  288. <input type="checkbox" id="Digits_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("Digits", "LogfileRetentionInDays")' unchecked >
  289. <label for=Digits_LogfileRetentionInDays_enabled><class id="Digits_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class></label>
  290. </td>
  291. <td>
  292. <input type="number" id="Digits_LogfileRetentionInDays_value1" min="0" step="1">
  293. </td>
  294. <td style="font-size: 80%;">
  295. Time to keep the separated digit images (in days, resp. "0" = forever)
  296. </td>
  297. </tr>
  298. <!--
  299. <tr class="expert" id="ex9">
  300. <td class="indent1">
  301. <class id="Digits_ModelInputSize_text" style="color:black;">ModelInputSize</class>
  302. </td>
  303. <td>
  304. x: <input type="number" id="Digits_ModelInputSize_value1" class="smallSelect" min="1" step="1">
  305. y: <input type="number" id="Digits_ModelInputSize_value2" class="smallSelect" min="1" step="1">
  306. </td>
  307. <td style="font-size: 80%;">
  308. Size of the input image for the CNN model
  309. </td>
  310. </tr>
  311. -->
  312. <tr id="Category_Analog_ex4">
  313. <td colspan="3" style="padding-left: 20px;">
  314. <h4><input type="checkbox" id="Category_Analog_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked >
  315. <label for=Category_Analog_enabled>Analog</h4></label>
  316. </td>
  317. </tr>
  318. <tr>
  319. <td class="indent1">
  320. <class id="Analog_Model_text" style="color:black;">Model</class>
  321. </td>
  322. <td>
  323. <select id="Analog_Model_value1">
  324. </select>
  325. </td>
  326. <td style="font-size: 80%;"> Path to CNN model file for image recognition. Check the <a href="https://github.com/jomjol/AI-on-the-edge-device/wiki/Choosing-the-Model" target="_blank">documentation</a> for details.</td>
  327. </tr>
  328. <tr>
  329. <td class="indent1">
  330. <input type="checkbox" id="Analog_LogImageLocation_enabled" value="1" onclick = 'InvertEnableItem("Analog", "LogImageLocation")' unchecked >
  331. <label for=Analog_LogImageLocation_enabled><class id="Analog_LogImageLocation_text" style="color:black;">LogImageLocation</class>
  332. </label>
  333. </td>
  334. <td> <input type="text" name="name" id="Analog_LogImageLocation_value1"> </td>
  335. <td style="font-size: 80%;"> Location to store separated digits for logging </td>
  336. </tr>
  337. <tr>
  338. <td class="indent1">
  339. <input type="checkbox" id="Analog_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("Analog", "LogfileRetentionInDays")' unchecked >
  340. <label for=Analog_LogfileRetentionInDays_enabled><class id="Analog_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class></label></td>
  341. <td> <input type="number" id="Analog_LogfileRetentionInDays_value1" min="0" step="1"> </td>
  342. <td style="font-size: 80%;"> Time to keep the separated digit images (in days, resp. "0" = forever) </td>
  343. </tr>
  344. <!--
  345. <tr class="expert" id="ex10">
  346. <td class="indent1"> </td>
  347. <td> <class id="Analog_ModelInputSize_text" style="color:black;">ModelInputSize</class> </td>
  348. <td>
  349. x: <input type="number" id="Analog_ModelInputSize_value1" class="smallSelect" min="1" step="1">
  350. y: <input type="number" id="Analog_ModelInputSize_value2" class="smallSelect" min="1" step="1">
  351. </td>
  352. <td style="font-size: 80%;"> Size of the input image for the CNN model </td>
  353. </tr>
  354. -->
  355. <tr>
  356. <td colspan="3" style="padding-left: 20px;"><h4>PostProcessing</h4></td>
  357. </tr>
  358. <tr>
  359. <td class="indent1">
  360. <input type="checkbox" id="PostProcessing_PreValueUse_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "PreValueUse")' unchecked >
  361. <label for=PostProcessing_PreValueUse_enabled><class id="PostProcessing_PreValueUse_text" style="color:black;">PreValueUse</class></label>
  362. </td>
  363. <td>
  364. <select id="PostProcessing_PreValueUse_value1">
  365. <option value="true" selected>true</option>
  366. <option value="false" >false</option>
  367. </select>
  368. </td>
  369. <td style="font-size: 80%;">
  370. Enable to use the previous read value for consistency checks - also on reboots
  371. </td>
  372. </tr>
  373. <tr class="expert" id="ex11">
  374. <td class="indent1">
  375. <input type="checkbox" id="PostProcessing_PreValueAgeStartup_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "PreValueAgeStartup")' unchecked >
  376. <label for=PostProcessing_PreValueAgeStartup_enabled><class id="PostProcessing_PreValueAgeStartup_text" style="color:black;">PreValueAgeStartup</class></label>
  377. </td>
  378. <td>
  379. <input type="number" id="PostProcessing_PreValueAgeStartup_value1" size="13" min="0">
  380. </td>
  381. <td style="font-size: 80%;">
  382. Time (in minutes), how long a previous read value is valid after reboot (default = 720 min)
  383. </td>
  384. </tr>
  385. <tr>
  386. <td class="indent1">
  387. <input type="checkbox" id="PostProcessing_AllowNegativeRates_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "AllowNegativeRates")' unchecked >
  388. <label for=PostProcessing_AllowNegativeRates_enabled><class id="PostProcessing_AllowNegativeRates_text" style="color:black;">AllowNegativeRates</class></label>
  389. </td>
  390. <td>
  391. <select id="PostProcessing_AllowNegativeRates_value1">
  392. <option value="true" selected>true</option>
  393. <option value="false" >false</option>
  394. </select>
  395. </td>
  396. <td style="font-size: 80%;">
  397. Set on "false" to ensure, that only positive changes are accepted (typically for counter)
  398. </td>
  399. </tr>
  400. <tr class="expert" id="ex12">
  401. <td class="indent1">
  402. <input type="checkbox" id="PostProcessing_ErrorMessage_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "ErrorMessage")' unchecked >
  403. <label for=PostProcessing_ErrorMessage_enabled><class id="PostProcessing_ErrorMessage_text" style="color:black;">ErrorMessage</class></label>
  404. </td>
  405. <td>
  406. <select id="PostProcessing_ErrorMessage_value1">
  407. <option value="true" selected>true</option>
  408. <option value="false" >false</option>
  409. </select>
  410. </td>
  411. <td style="font-size: 80%;">
  412. Do not show error message in return value - in error case, the last valid number will be send out
  413. </td>
  414. </tr>
  415. <tr class="expert" id="ex1dddd">
  416. <td class="indent1">
  417. <input type="checkbox" id="PostProcessing_CheckDigitIncreaseConsistency_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "CheckDigitIncreaseConsistency")' unchecked >
  418. <label for=PostProcessing_CheckDigitIncreaseConsistency_enabled><class id="PostProcessing_CheckDigitIncreaseConsistency_text" style="color:black;">CheckDigitIncreaseConsistency</class></label>
  419. </td>
  420. <td>
  421. <select id="PostProcessing_CheckDigitIncreaseConsistency_value1">
  422. <option value="true" selected>true</option>
  423. <option value="false" >false</option>
  424. </select>
  425. </td>
  426. <td style="font-size: 80%;">
  427. Enable additional consistency check - especially zero crossing check between digits
  428. </td>
  429. </tr>
  430. <tr>
  431. <td class="indent1" colspan="3">
  432. <br>
  433. <b>Postprocessing Individual Parameters:
  434. <select id="Numbers_value1" onchange="numberChanged()">
  435. <option value="0" selected>default</option>
  436. <option value="1" >NT</option>
  437. <option value="2" >HT</option>
  438. </select></b>
  439. </td>
  440. </tr>
  441. <tr>
  442. <td class="indent1">
  443. <input type="checkbox" id="PostProcessing_DecimalShift_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "DecimalShift")' unchecked >
  444. <label for=PostProcessing_DecimalShift_enabled><class id="PostProcessing_DecimalShift_text" style="color:black;">DecimalShift</class></label>
  445. </td>
  446. <td>
  447. <input type="number" id="PostProcessing_DecimalShift_value1" step="1">
  448. </td>
  449. <td style="font-size: 80%;">
  450. Shift the digit separator within the digital digits (positiv and negativ)
  451. </td>
  452. </tr>
  453. <tr>
  454. <td class="indent1">
  455. <input type="checkbox" id="PostProcessing_MaxRateValue_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "MaxRateValue")' unchecked >
  456. <label for=PostProcessing_MaxRateValue_enabled><class id="PostProcessing_MaxRateValue_text" style="color:black;">MaxRateValue</class></label>
  457. </td>
  458. <td>
  459. <input type="number" id="PostProcessing_MaxRateValue_value1" size="13" min="0" step="any">
  460. </td>
  461. <td style="font-size: 80%;">
  462. Maximum change of a reading - if threated as absolute or relative change see next parameter.
  463. </td>
  464. </tr>
  465. <tr>
  466. <td class="indent1">
  467. <input type="checkbox" id="PostProcessing_MaxRateType_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "MaxRateType")' unchecked >
  468. <label for=PostProcessing_MaxRateType_enabled><class id="PostProcessing_MaxRateType_text" style="color:black;">MaxRateType</class></label>
  469. </td>
  470. <td>
  471. <select id="PostProcessing_MaxRateType_value1">
  472. <option value="AbsoluteChange" >AbsoluteChange</option>
  473. <option value="RateChange" selected>RateChange</option>
  474. </select>
  475. </td>
  476. <td style="font-size: 80%;">
  477. Defines if the change rate compared to the previous value is calculated as absolute change (AbsoluteChange) or as rate normalized to the intervall (RateChange = change/minute).
  478. </td>
  479. </tr>
  480. <tr>
  481. <td class="indent1">
  482. <input type="checkbox" id="PostProcessing_ExtendedResolution_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "ExtendedResolution")' unchecked >
  483. <label for=PostProcessing_ExtendedResolution_enabled><class id="PostProcessing_ExtendedResolution_text" style="color:black;">ExtendedResolution</class></label>
  484. </td>
  485. <td>
  486. <select id="PostProcessing_ExtendedResolution_value1">
  487. <option value="true" >true</option>
  488. <option value="false" selected>false</option>
  489. </select>
  490. </td>
  491. <td style="font-size: 80%;">
  492. Enable to use the after point resolution for the last analog counter
  493. </td>
  494. </tr>
  495. <tr>
  496. <td id="ex121" class="indent1">
  497. <input type="checkbox" id="PostProcessing_IgnoreLeadingNaN_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "IgnoreLeadingNaN")' unchecked >
  498. <label for=PostProcessing_IgnoreLeadingNaN_enabled><class id="PostProcessing_IgnoreLeadingNaN_text" style="color:black;">IgnoreLeadingNaN</class></label>
  499. </td>
  500. <td>
  501. <select id="PostProcessing_IgnoreLeadingNaN_value1">
  502. <option value="true" >true</option>
  503. <option value="false" selected>false</option>
  504. </select>
  505. </td>
  506. <td style="font-size: 80%;">
  507. Leading "N"'s will be deleted before further processing
  508. </td>
  509. </tr>
  510. <tr>
  511. <td colspan="3" style="padding-left: 20px;">
  512. <h4>
  513. <input type="checkbox" id="Category_MQTT_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked >
  514. <label for=Category_MQTT_enabled>MQTT</label>
  515. </h4>
  516. </td>
  517. </tr>
  518. <tr>
  519. <td class="indent1">
  520. <input type="checkbox" id="MQTT_Uri_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "Uri")' unchecked >
  521. <label for=MQTT_Uri_enabled><class id="MQTT_Uri_text" style="color:black;">Uri</class></label>
  522. </td>
  523. <td>
  524. <input type="text" id="MQTT_Uri_value1">
  525. </td>
  526. <td style="font-size: 80%;">
  527. URI to the MQTT broker including port e.g.: mqtt://IP-Address:Port
  528. </td>
  529. </tr>
  530. <tr>
  531. <td class="indent1">
  532. <input type="checkbox" id="MQTT_MainTopic_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "MainTopic")' unchecked >
  533. <label for=MQTT_MainTopic_enabled><class id="MQTT_MainTopic_text" style="color:black;">MainTopic</class></label>
  534. </td>
  535. <td>
  536. <input type="text" id="MQTT_MainTopic_value1">
  537. </td>
  538. <td style="font-size: 80%;">
  539. MQTT main topic, under which the counters are published. <br>
  540. The single value will be published with the following key: MAINTOPIC/VALUE_NAME/PARAMETER where
  541. <ul>
  542. <li> VALUE_NAME is the name of the value (a meter might have more than one value) as defined during analog and digital ROI configuration (defaults to "main")</li>
  543. <li> and PARAMETERS are: value, rate, timestamp, error</li>
  544. </ul>
  545. The general connection status can be found in MAINTOPIC/CONNECTION
  546. </td>
  547. </tr>
  548. <tr>
  549. <td class="indent1">
  550. <input type="checkbox" id="MQTT_ClientID_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "ClientID")' unchecked >
  551. <label for=MQTT_ClientID_enabled><class id="MQTT_ClientID_text" style="color:black;">ClientID</class></label>
  552. </td>
  553. <td>
  554. <input type="text" id="MQTT_ClientID_value1">
  555. </td>
  556. <td style="font-size: 80%;">
  557. ClientID to connect to the MQTT broker
  558. </td>
  559. </tr>
  560. <tr>
  561. <td class="indent1">
  562. <input type="checkbox" id="MQTT_user_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "user")' unchecked >
  563. <label for=MQTT_user_enabled><class id="MQTT_user_text" style="color:black;">user</class></label>
  564. </td>
  565. <td>
  566. <input type="text" id="MQTT_user_value1">
  567. </td>
  568. <td style="font-size: 80%;">
  569. User for MQTT authentication
  570. </td>
  571. </tr>
  572. <tr>
  573. <td class="indent1">
  574. <input type="checkbox" id="MQTT_password_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "password")' unchecked >
  575. <label for=MQTT_password_enabled><class id="MQTT_password_text" style="color:black;">password</class></label>
  576. </td>
  577. <td>
  578. <input type="text" id="MQTT_password_value1">
  579. </td>
  580. <td style="font-size: 80%;">
  581. Password for MQTT authentication
  582. </td>
  583. </tr>
  584. <tr>
  585. <td class="indent1">
  586. <input type="checkbox" id="MQTT_SetRetainFlag_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "SetRetainFlag")' unchecked >
  587. <label for=MQTT_SetRetainFlag_enabled><class id="MQTT_SetRetainFlag_text" style="color:black;">Enable MQTT Retain Flag</class></label>
  588. </td>
  589. <td>
  590. <select id="MQTT_SetRetainFlag_value1">
  591. <option value="true" selected>true</option>
  592. <option value="false" >false</option>
  593. </select>
  594. </td>
  595. <td style="font-size: 80%;">
  596. Enable or disable the retain flag for all MQTT entries
  597. </td>
  598. </tr>
  599. <tr>
  600. <td colspan="3" style="padding-left: 20px;">
  601. <h4>
  602. <input type="checkbox" id="Category_InfluxDB_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked >
  603. <label for=Category_InfluxDB_enabled>InfluxDB (Remark: only InfluxDB v1.x is supported, v2.x has a changed interface)</label>
  604. </h4>
  605. </td>
  606. </tr>
  607. <tr>
  608. <td class="indent1">
  609. <input type="checkbox" id="InfluxDB_Uri_enabled" value="1" onclick = 'InvertEnableItem("InfluxDB", "Uri")' unchecked >
  610. <label for=InfluxDB_Uri_enabled><class id="InfluxDB_Uri_text" style="color:black;">Uri</class></label>
  611. </td>
  612. <td>
  613. <input type="text" id="InfluxDB_Uri_value1">
  614. </td>
  615. <td style="font-size: 80%;">
  616. URI of the HTTP interface to InfluxDB, without traililing slash, e.g. http://IP-Address:Port
  617. </td>
  618. </tr>
  619. <tr>
  620. <td class="indent1">
  621. <input type="checkbox" id="InfluxDB_Database_enabled" value="1" onclick = 'InvertEnableItem("InfluxDB", "Database")' unchecked >
  622. <label for=InfluxDB_Database_enabled><class id="InfluxDB_Database_text" style="color:black;">Database</class></label>
  623. </td>
  624. <td>
  625. <input type="text" id="InfluxDB_Database_value1">
  626. </td>
  627. <td style="font-size: 80%;">
  628. Database name in which to publish the read value.
  629. </td>
  630. </tr>
  631. <tr>
  632. <td class="indent1">
  633. <input type="checkbox" id="InfluxDB_Measurement_enabled" value="1" onclick = 'InvertEnableItem("InfluxDB", "Measurement")' unchecked >
  634. <label for=InfluxDB_Measurement_enabled><class id="InfluxDB_Measurement_text" style="color:black;">Measurement</class></label>
  635. </td>
  636. <td>
  637. <input type="text" id="InfluxDB_Measurement_value1">
  638. </td>
  639. <td style="font-size: 80%;">
  640. Measurement name to use to publish the read value.
  641. </td>
  642. </tr>
  643. <tr>
  644. <td class="indent1">
  645. <input type="checkbox" id="InfluxDB_user_enabled" value="1" onclick = 'InvertEnableItem("InfluxDB", "user")' unchecked >
  646. <label for=InfluxDB_user_enabled><class id="InfluxDB_user_text" style="color:black;">user</class></label>
  647. </td>
  648. <td>
  649. <input type="text" id="InfluxDB_user_value1">
  650. </td>
  651. <td style="font-size: 80%;">
  652. User for InfluxDB authentication
  653. </td>
  654. </tr>
  655. <tr>
  656. <td class="indent1">
  657. <input type="checkbox" id="InfluxDB_password_enabled" value="1" onclick = 'InvertEnableItem("InfluxDB", "password")' unchecked >
  658. <label for=InfluxDB_password_enabled><class id="InfluxDB_password_text" style="color:black;">password</class></label>
  659. </td>
  660. <td>
  661. <input type="text" id="InfluxDB_password_value1">
  662. </td>
  663. <td style="font-size: 80%;">
  664. Password for InfluxDB authentication
  665. </td>
  666. </tr>
  667. <tr>
  668. <td colspan="3" style="padding-left: 20px;"><h4>AutoTimer</h4></td>
  669. </tr>
  670. <tr class="expert" id="ex13">
  671. <td class="indent1">
  672. <class id="AutoTimer_AutoStart_text" style="color:black;">AutoStart</class>
  673. </td>
  674. <td>
  675. <select id="AutoTimer_AutoStart_value1">
  676. <option value="true" selected>true</option>
  677. <option value="false" >false</option>
  678. </select>
  679. </td>
  680. <td style="font-size: 80%;">
  681. Start the image recognition immediatly after power up. false is basically for debugging.
  682. </td>
  683. </tr>
  684. <tr>
  685. <td class="indent1">
  686. <class id="AutoTimer_Intervall_text" style="color:black;">Intervall</class>
  687. </td>
  688. <td>
  689. <input type="number" id="AutoTimer_Intervall_value1" size="13" min="3" step="any">
  690. </td>
  691. <td style="font-size: 80%;">
  692. Intervall in which the counter is read (in minutes). Number must be greater than 3 minutes.
  693. </td>
  694. </tr>
  695. <tr>
  696. <td colspan="3" style="padding-left: 20px;">
  697. <h4><input type="checkbox" id="Category_GPIO_enabled" value="1" onclick='UpdateAfterCategoryCheck()' unchecked >
  698. <label for=Category_GPIO_enabled>GPIO Settings
  699. <span class="GPIO_Item" > - Enabling GPIO handler, disable by default integrated flash light. Please enable it with GPIO4 (internal flash LED) settings or GPIO12 (external LED).</span></label>
  700. </h4>
  701. </td>
  702. </tr>
  703. <!------------- GPIO0 begin ------------------>
  704. <tr class="expert" class="GPIO_IO0 GPIO_item">
  705. <td class="indent1">
  706. <input type="checkbox" id="GPIO_IO0_enabled" value="1" onclick = 'InvertEnableItem("GPIO", "IO0")' unchecked>
  707. <label for=GPIO_IO0_enabled><span id="GPIO_IO0_text">GPIO 0 state</span></label>
  708. </td>
  709. <td>
  710. <select id="GPIO_IO0_value1">
  711. <option value="input">input</option>
  712. <option value="input-pullup">input pullup</option>
  713. <option value="input-pulldown">input pulldown</option>
  714. <option value="output">output</option>
  715. </select>
  716. </td>
  717. <td class="description">
  718. GPIO 0 Usable with restrictions.<br>
  719. <b>Must be disabled when camera is used.</b><br>
  720. <b>Pin is used to activate flash mode and must therefore be HIGH when booting.</b>
  721. </td>
  722. </tr>
  723. <tr class="expert" class="GPIO_IO0 GPIO_item">
  724. <td class="indent2">
  725. <span id="GPIO_IO0_text" class="GPIO_IO0 GPIO_item">GPIO 0 use interrupt</span>
  726. </td>
  727. <td>
  728. <select id="GPIO_IO0_value2">
  729. <option value="disabled">disabled</option>
  730. <option value="rising-edge">rising edge</option>
  731. <option value="falling-edge">falling edge</option>
  732. <option value="rising-and-falling">rising and falling</option>
  733. <option value="low-level-trigger">low level trigger</option>
  734. <option value="high-level-trigger">high level trigger</option>
  735. </select>
  736. </td>
  737. <td class="description">
  738. GPIO 0 enable interrupt trigger
  739. </td>
  740. </tr>
  741. <tr class="expert" class="GPIO_IO0 GPIO_item">
  742. <td class="indent2">
  743. <span class="GPIO_IO0 GPIO_item">GPIO 0 PWM duty resolution</span>
  744. </td>
  745. <td><input type="number" id="GPIO_IO0_value3" min="1" max="20"></td>
  746. <td class="description">
  747. GPIO 0 LEDC PWM duty resolution in bit
  748. </td>
  749. </tr>
  750. <tr class="expert" class="GPIO_IO0 GPIO_item">
  751. <td class="indent2">
  752. <span class="GPIO_IO0 GPIO_item">GPIO 0 enable MQTT</span>
  753. </td>
  754. <td><input type="checkbox" id="GPIO_IO0_value4"></td>
  755. <td class="description">
  756. GPIO 0 enable MQTT publishing/subscribing
  757. </td>
  758. </tr>
  759. <tr class="expert" class="GPIO_IO0 GPIO_item">
  760. <td class="indent2">
  761. <span class="GPIO_IO0 GPIO_item">GPIO 0 enable HTTP</span>
  762. </td>
  763. <td><input type="checkbox" id="GPIO_IO0_value5"></td>
  764. <td class="description">
  765. GPIO 0 enable HTTP write/read
  766. </td>
  767. </tr>
  768. <tr class="expert" class="GPIO_IO0 GPIO_item">
  769. <td class="indent2">
  770. <span class="GPIO_IO0 GPIO_item">GPIO 0 name</span>
  771. </td>
  772. <td><input type="text" id="GPIO_IO0_value6"></td>
  773. <td class="description">
  774. GPIO 0 MQTT topic name (empty = GPIO0). Allowed characters (a-z, A-Z, 0-9, _, -)
  775. </td>
  776. </tr>
  777. <!------------- GPIO0 end ------------------>
  778. <!------------- GPIO1 begin ------------------>
  779. <tr class="expert" class="GPIO_IO1 GPIO_item">
  780. <td class="indent1">
  781. <input type="checkbox" id="GPIO_IO1_enabled" value="1" onclick = 'InvertEnableItem("GPIO", "IO1")' unchecked>
  782. <label=GPIO_IO1_enabled><span id="GPIO_IO1_text" class="GPIO_IO1 GPIO_item">GPIO 1 state</span>
  783. </td>
  784. <td>
  785. <select id="GPIO_IO1_value1">
  786. <option value="input">input</option>
  787. <option value="input-pullup">input pullup</option>
  788. <option value="input-pulldown">input pulldown</option>
  789. <option value="output">output</option>
  790. </select>
  791. </td>
  792. <td class="description">
  793. GPIO 1 <br><span style="color: blue">Used by default for serial communication as TX pin.<br>Required for seriales monitor.</span>
  794. </td>
  795. </tr>
  796. <tr class="expert" class="GPIO_IO1 GPIO_item">
  797. <td class="indent2">
  798. <span class="GPIO_IO1 GPIO_item" class="expert">GPIO 1 use interrupt</span>
  799. </td>
  800. <td>
  801. <select id="GPIO_IO1_value2">
  802. <option value="disabled">disabled</option>
  803. <option value="rising-edge" disabled>rising edge</option>
  804. <option value="falling-edge" disabled>falling edge</option>
  805. <option value="rising-and-falling">rising and falling</option>
  806. <option value="low-level-trigger">low level trigger</option>
  807. <option value="high-level-trigger">high level trigger</option>
  808. </select>
  809. </td>
  810. <td class="description">
  811. GPIO 1 enable interrupt trigger
  812. </td>
  813. </tr>
  814. <tr class="expert" class="GPIO_IO1 GPIO_item">
  815. <td class="indent2">
  816. <span class="GPIO_IO1 GPIO_item">GPIO 1 PWM duty resolution</span>
  817. </td>
  818. <td><input type="number" id="GPIO_IO1_value3" min="1" max="20"></td>
  819. <td class="description">
  820. GPIO 1 LEDC PWM duty resolution in bit
  821. </td>
  822. </tr>
  823. <tr class="expert" class="GPIO_IO1 GPIO_item">
  824. <td class="indent2">
  825. <span class="GPIO_IO1 GPIO_item">GPIO 1 enable MQTT</span>
  826. </td>
  827. <td><input type="checkbox" id="GPIO_IO1_value4"></td>
  828. <td class="description">
  829. GPIO 1 enable MQTT publishing/subscribing
  830. </td>
  831. </tr>
  832. <tr class="expert" class="GPIO_IO1 GPIO_item">
  833. <td class="indent2">
  834. <span class="GPIO_IO1 GPIO_item">GPIO 1 enable HTTP</span>
  835. </td>
  836. <td><input type="checkbox" id="GPIO_IO1_value5"></td>
  837. <td class="description">
  838. GPIO 1 enable HTTP write/read
  839. </td>
  840. </tr>
  841. <tr class="expert" class="GPIO_IO1 GPIO_item">
  842. <td class="indent2">
  843. <span class="GPIO_IO1 GPIO_item" class="expert">GPIO 1 name</span>
  844. </td>
  845. <td><input type="text" id="GPIO_IO1_value6"></td>
  846. <td class="description">
  847. GPIO 1 MQTT topic name (empty = GPIO1). Allowed characters (a-z, A-Z, 0-9, _, -)
  848. </td>
  849. </tr>
  850. <!------------- GPIO1 end ------------------>
  851. <!------------- GPIO3 begin ------------------>
  852. <tr class="expert" class="GPIO_IO3 GPIO_item">
  853. <td class="indent1">
  854. <input type="checkbox" id="GPIO_IO3_enabled" value="1" onclick = 'InvertEnableItem("GPIO", "IO3")' unchecked>
  855. <label=GPIO_IO3_enabled><span id="GPIO_IO3_text" class="GPIO_IO3 GPIO_item">GPIO 3 state</span>
  856. </td>
  857. <td>
  858. <select id="GPIO_IO3_value1">
  859. <option value="input">input</option>
  860. <option value="input-pullup">input pullup</option>
  861. <option value="input-pulldown">input pulldown</option>
  862. <option value="output">output</option>
  863. </select>
  864. </td>
  865. <td class="description">
  866. GPIO 3 <span style="color: blue">Used by default for serial communication as RX pin.</span>
  867. </td>
  868. </tr>
  869. <tr class="expert" class="GPIO_IO3 GPIO_item">
  870. <td class="indent2">
  871. <span class="GPIO_IO3 GPIO_item">GPIO 3 use interrupt</span>
  872. </td>
  873. <td>
  874. <select id="GPIO_IO3_value2">
  875. <option value="disabled">disabled</option>
  876. <option value="rising-edge" disabled>rising edge</option>
  877. <option value="falling-edge" disabled>falling edge</option>
  878. <option value="rising-and-falling">rising and falling</option>
  879. <option value="low-level-trigger">low level trigger</option>
  880. <option value="high-level-trigger">high level trigger</option>
  881. </select>
  882. </td>
  883. <td class="description">
  884. GPIO 3 Used by default for serial communication as RX pin.
  885. </td>
  886. </tr>
  887. <tr class="expert" class="GPIO_IO3 GPIO_item">
  888. <td class="indent2">
  889. <span class="GPIO_IO3 GPIO_item">GPIO 3 PWM duty resolution</span>
  890. </td>
  891. <td><input type="number" id="GPIO_IO3_value3" min="1" max="20"></td>
  892. <td class="description">
  893. GPIO 3 LEDC PWM duty resolution in bit
  894. </td>
  895. </tr>
  896. <tr class="expert" class="GPIO_IO3 GPIO_item">
  897. <td class="indent2">
  898. <span class="GPIO_IO3 GPIO_item">GPIO 3 enable MQTT</span>
  899. </td>
  900. <td><input type="checkbox" id="GPIO_IO3_value4"></td>
  901. <td class="description">
  902. GPIO 3 enable MQTT publishing/subscribing
  903. </td>
  904. </tr>
  905. <tr class="expert" class="GPIO_IO3 GPIO_item">
  906. <td class="indent2">
  907. <span class="GPIO_IO3 GPIO_item">GPIO 3 enable HTTP</span>
  908. </td>
  909. <td><input type="checkbox" id="GPIO_IO3_value5"></td>
  910. <td class="description">
  911. GPIO 3 enable HTTP write/read
  912. </td>
  913. </tr>
  914. <tr class="expert" class="GPIO_IO3 GPIO_item">
  915. <td class="indent2">
  916. <span class="GPIO_IO3 GPIO_item">GPIO 3 name</span>
  917. </td>
  918. <td><input type="text" id="GPIO_IO3_value6"></td>
  919. <td class="description">
  920. GPIO 3 MQTT topic name (empty = GPIO3). Allowed characters (a-z, A-Z, 0-9, _, -)
  921. </td>
  922. </tr>
  923. <!------------- GPIO3 end ------------------>
  924. <!------------- GPIO4 begin ------------------>
  925. <tr class="GPIO_IO4 GPIO_item">
  926. <td class="indent1">
  927. <input type="checkbox" id="GPIO_IO4_enabled" value="1" onclick = 'InvertEnableItem("GPIO", "IO4")' unchecked>
  928. <label for=GPIO_IO4_enabled><span id="GPIO_IO4_text" class="GPIO_IO4 GPIO_item">GPIO 4 state</span></label>
  929. </td>
  930. <td>
  931. <select id="GPIO_IO4_value1">
  932. <option value="input">input</option>
  933. <option value="input-pullup">input pullup</option>
  934. <option value="input-pulldown">input pulldown</option>
  935. <option value="output">output</option>
  936. <option value="built-in-led">built-in led flash light</option>
  937. </select>
  938. </td>
  939. <td class="description">
  940. GPIO 4 Usable with restrictions.<br>
  941. <b>Pin is used for build-in flash light.</b>
  942. </td>
  943. </tr>
  944. <tr class="expert" class="GPIO_IO4 GPIO_item">
  945. <td class="indent2">
  946. <span class="GPIO_IO4 GPIO_item">GPIO 4 use interrupt</span>
  947. </td>
  948. <td>
  949. <select id="GPIO_IO4_value2">
  950. <option value="disabled">disabled</option>
  951. <option value="rising-edge">rising edge</option>
  952. <option value="falling-edge">falling edge</option>
  953. <option value="rising-and-falling">rising and falling</option>
  954. <option value="low-level-trigger">low level trigger</option>
  955. <option value="high-level-trigger">high level trigger</option>
  956. </select>
  957. </td>
  958. <td class="description">
  959. GPIO 4 enable interrupt trigger
  960. </td>
  961. </tr>
  962. <tr class="expert" class="GPIO_IO4 GPIO_item">
  963. <td class="indent2">
  964. <span class="GPIO_IO4 GPIO_item">GPIO 4 PWM duty resolution</span>
  965. </td>
  966. <td><input type="number" id="GPIO_IO4_value3" min="1" max="20"></td>
  967. <td class="description">
  968. GPIO 4 LEDC PWM duty resolution in bit
  969. </td>
  970. </tr>
  971. <tr class="expert" class="GPIO_IO4 GPIO_item">
  972. <td class="indent2">
  973. <span class="GPIO_IO4 GPIO_item">GPIO 4 enable MQTT</span>
  974. </td>
  975. <td><input type="checkbox" id="GPIO_IO4_value4"></td>
  976. <td class="description">
  977. GPIO 4 enable MQTT publishing/subscribing
  978. </td>
  979. </tr>
  980. <tr class="expert" class="GPIO_IO4 GPIO_item">
  981. <td class="indent2">
  982. <span class="GPIO_IO4 GPIO_item">GPIO 4 enable HTTP</span>
  983. </td>
  984. <td><input type="checkbox" id="GPIO_IO4_value5"></td>
  985. <td class="description">
  986. GPIO 4 enable HTTP write/read
  987. </td>
  988. </tr>
  989. <tr class="expert" class="GPIO_IO4 GPIO_item">
  990. <td class="indent2">
  991. <span class="GPIO_IO4 GPIO_item">GPIO 4 name</span>
  992. </td>
  993. <td><input type="text" id="GPIO_IO4_value6"></td>
  994. <td class="description">
  995. GPIO 4 MQTT topic name (empty = GPIO4). Allowed characters (a-z, A-Z, 0-9, _, -)
  996. </td>
  997. </tr>
  998. <!------------- GPIO4 end ------------------>
  999. <!------------- GPIO12 begin ------------------>
  1000. <tr class="GPIO_IO12 GPIO_item">
  1001. <td class="indent1">
  1002. <input type="checkbox" id="GPIO_IO12_enabled" value="1" onclick = 'InvertEnableItem("GPIO", "IO12")' unchecked>
  1003. <label for=GPIO_IO12_enabled><span class="GPIO_IO12 GPIO_item" id="GPIO_IO12_text">GPIO 12 state</span></label>
  1004. </td>
  1005. <td>
  1006. <select id="GPIO_IO12_value1">
  1007. <option value="input">input</option>
  1008. <option value="input-pullup">input pullup</option>
  1009. <option value="input-pulldown">input pulldown</option>
  1010. <option value="output">output</option>
  1011. <option value="external-flash-ws281x">external flash light ws281x controlled</option>
  1012. </select>
  1013. </td>
  1014. <td class="description">
  1015. GPIO 12 is usable without restrictions
  1016. </td>
  1017. </tr>
  1018. <tr class="expert" class="GPIO_IO12 GPIO_item">
  1019. <td class="indent2">
  1020. <span class="GPIO_IO12 GPIO_item">GPIO 12 use interrupt</span>
  1021. </td>
  1022. <td>
  1023. <select class="GPIO_IO12 GPIO_item" id="GPIO_IO12_value2">
  1024. <option value="disabled">disabled</option>
  1025. <option value="rising-edge">rising edge</option>
  1026. <option value="falling-edge">falling edge</option>
  1027. <option value="rising-and-falling">rising and falling</option>
  1028. <option value="low-level-trigger">low level trigger</option>
  1029. <option value="high-level-trigger">high level trigger</option>
  1030. </select>
  1031. </td>
  1032. <td class="description">
  1033. GPIO 12 enable interrupt trigger
  1034. </td>
  1035. </tr>
  1036. <tr class="expert" class="GPIO_IO12 GPIO_item">
  1037. <td class="indent2">
  1038. <span class="GPIO_IO12 GPIO_item">GPIO 12 PWM duty resolution</span>
  1039. </td>
  1040. <td><input type="number" id="GPIO_IO12_value3" min="1" max="20"></td>
  1041. <td class="description">
  1042. GPIO 12 LEDC PWM duty resolution in bit
  1043. </td>
  1044. </tr>
  1045. <tr class="expert" class="GPIO_IO12 GPIO_item">
  1046. <td class="indent2">
  1047. <span class="GPIO_IO12 GPIO_item">GPIO 12 enable MQTT</span>
  1048. </td>
  1049. <td><input type="checkbox" id="GPIO_IO12_value4"></td>
  1050. <td class="description">
  1051. GPIO 12 enable MQTT publishing/subscribing
  1052. </td>
  1053. </tr>
  1054. <tr class="expert" class="GPIO_IO12 GPIO_item">
  1055. <td class="indent2">
  1056. <span class="GPIO_IO12 GPIO_item">GPIO 12 enable HTTP</span>
  1057. </td>
  1058. <td><input type="checkbox" id="GPIO_IO12_value5"></td>
  1059. <td class="description">
  1060. GPIO 12 enable HTTP write/read
  1061. </td>
  1062. </tr>
  1063. <tr class="expert" class="GPIO_IO12 GPIO_item">
  1064. <td class="indent2">
  1065. <span class="GPIO_IO12 GPIO_item">GPIO 12 name</span>
  1066. </td>
  1067. <td><input type="text" id="GPIO_IO12_value6"></td>
  1068. <td class="description">
  1069. GPIO 12 MQTT topic name (empty = GPIO12). Allowed characters (a-z, A-Z, 0-9, _, -)
  1070. </td>
  1071. </tr>
  1072. <tr class="GPIO_IO12 GPIO_item" id="wstypeex3">
  1073. <td class="indent1">
  1074. <span class="GPIO_IO12 GPIO_item" id="GPIO_LEDType_text">LED-Type</span>
  1075. </td>
  1076. <td class="GPIO_IO12 GPIO_item">
  1077. <select class="GPIO_IO12 GPIO_item" id="GPIO_LEDType_value1">
  1078. <option value="WS2812" selected>WS2812</option>
  1079. <option value="WS2812B">WS2812B</option>
  1080. <option value="SK6812">SK6812 (not tested)</option>
  1081. <option value="WS2813">WS2813 (not tested)</option>
  1082. </select>
  1083. </td>
  1084. <td class="description">
  1085. Type of WS2812x, that is connected to GPIO12
  1086. </td>
  1087. </tr>
  1088. <tr class="GPIO_IO12 GPIO_item" id="LEDANZex8" >
  1089. <td class="indent1">
  1090. <span class="GPIO_IO12 GPIO_item" id="GPIO_LEDNumbers_text">Numbers of LEDs</span>
  1091. </td>
  1092. <td>
  1093. <input type="number" name="name" id="GPIO_LEDNumbers_value1" size="13" min="1">
  1094. </td>
  1095. <td style="font-size: 80%;">
  1096. Number of LEDs on the external LED-stripe
  1097. </td>
  1098. </tr>
  1099. <tr class="GPIO_IO12 GPIO_item" id="LEDRGBex9">
  1100. <td class="indent1">
  1101. <span class="GPIO_IO12 GPIO_item" id="GPIO_LEDColor_text">LED Color</span>
  1102. </td>
  1103. <td class="GPIO_IO12 GPIO_item">
  1104. R <input class="smallSelect" class="GPIO_IO12 GPIO_item" id="GPIO_LEDColor_value1" size="12">
  1105. G <input class="smallSelect" class="GPIO_IO12 GPIO_item" id="GPIO_LEDColor_value2" size="12">
  1106. B <input class="smallSelect" class="GPIO_IO12 GPIO_item" id="GPIO_LEDColor_value3" size="12">
  1107. </td>
  1108. <td style="font-size: 80%;">
  1109. Color of LEDs in (R)ed, (G)reen (B)lue from 0...255
  1110. </td>
  1111. </tr>
  1112. <!------------- GPIO12 end ------------------>
  1113. <!------------- GPIO13 begin ------------------>
  1114. <tr class="expert" class="GPIO_IO13 GPIO_item">
  1115. <td class="indent1">
  1116. <input type="checkbox" id="GPIO_IO13_enabled" value="1" onclick = 'InvertEnableItem("GPIO", "IO13")' unchecked>
  1117. <label=GPIO_IO13_enabled><span id="GPIO_IO13_text">GPIO 13 state</span>
  1118. </td>
  1119. <td>
  1120. <select id="GPIO_IO13_value1">
  1121. <option value="input">input</option>
  1122. <option value="input-pullup">input pullup</option>
  1123. <option value="input-pulldown">input pulldown</option>
  1124. <option value="output">output</option>
  1125. </select>
  1126. </td>
  1127. <td class="description">
  1128. GPIO 13 is usable without restrictions
  1129. </td>
  1130. </tr>
  1131. <tr class="expert" class="GPIO_IO13 GPIO_item">
  1132. <td class="indent2">
  1133. <span class="GPIO_IO13 GPIO_item">GPIO 13 use interrupt</span>
  1134. </td>
  1135. <td>
  1136. <select id="GPIO_IO13_value2">
  1137. <option value="disabled">disabled</option>
  1138. <option value="rising-edge" disabled>rising edge</option>
  1139. <option value="falling-edge" disabled>falling edge</option>
  1140. <option value="rising-and-falling">rising and falling</option>
  1141. <option value="low-level-trigger">low level trigger</option>
  1142. <option value="high-level-trigger">high level trigger</option>
  1143. </select>
  1144. </td>
  1145. <td class="description">
  1146. GPIO 13 enable interrupt trigger
  1147. </td>
  1148. </tr>
  1149. <tr class="expert" class="GPIO_IO13 GPIO_item">
  1150. <td class="indent2">
  1151. <span class="GPIO_IO13 GPIO_item">GPIO 13 PWM duty resolution</span>
  1152. </td>
  1153. <td><input type="number" id="GPIO_IO13_value3" min="1" max="20"></td>
  1154. <td class="description">
  1155. GPIO 13 LEDC PWM duty resolution in bit
  1156. </td>
  1157. </tr>
  1158. <tr class="expert" class="GPIO_IO13 GPIO_item">
  1159. <td class="indent2">
  1160. <span class="GPIO_IO13 GPIO_item">GPIO 13 enable MQTT</span>
  1161. </td>
  1162. <td><input type="checkbox" id="GPIO_IO13_value4"></td>
  1163. <td class="description">
  1164. GPIO 13 enable MQTT publishing/subscribing
  1165. </td>
  1166. </tr>
  1167. <tr class="expert" class="GPIO_IO13 GPIO_item">
  1168. <td class="indent2">
  1169. <span class="GPIO_IO13 GPIO_item">GPIO 13 enable HTTP</span>
  1170. </td>
  1171. <td><input type="checkbox" id="GPIO_IO13_value5"></td>
  1172. <td class="description">
  1173. GPIO 13 enable HTTP write/read
  1174. </td>
  1175. </tr>
  1176. <tr class="expert" class="GPIO_IO13 GPIO_item">
  1177. <td class="indent2">
  1178. <span class="GPIO_IO13 GPIO_item">GPIO 13 name</span>
  1179. </td>
  1180. <td><input type="text" id="GPIO_IO13_value6"></td>
  1181. <td class="description">
  1182. GPIO 13 MQTT topic name (empty = GPIO13). Allowed characters (a-z, A-Z, 0-9, _, -)
  1183. </td>
  1184. </tr>
  1185. <!------------- GPIO13 end ------------------>
  1186. <tr>
  1187. <td colspan="3" style="padding-left: 20px;"><h4>Debug</h4></td>
  1188. </tr>
  1189. <tr>
  1190. <td class="indent1">
  1191. <input type="checkbox" id="Debug_Logfile_enabled" value="1" onclick = 'InvertEnableItem("Debug", "Logfile")' unchecked >
  1192. <label for=Debug_Logfile_enabled><class id="Debug_Logfile_text" style="color:black;">Logfile</class></label>
  1193. </td>
  1194. <td>
  1195. <select id="Debug_Logfile_value1">
  1196. <option value="true" selected>true</option>
  1197. <option value="false" >false</option>
  1198. </select>
  1199. </td>
  1200. <td class="description">
  1201. Turn on/off the extended logging
  1202. </td>
  1203. </tr>
  1204. <tr>
  1205. <td class="indent1">
  1206. <input type="checkbox" id="Debug_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("Debug", "LogfileRetentionInDays")' unchecked >
  1207. <label for=Debug_LogfileRetentionInDays_enabled><class id="Debug_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class></label>
  1208. </td>
  1209. <td>
  1210. <input type="number" id="Debug_LogfileRetentionInDays_value1" size="13" min="0" step="1">
  1211. </td>
  1212. <td class="description">
  1213. Time to keep the log files (in days - "0" = forever)
  1214. </td>
  1215. </tr>
  1216. <tr>
  1217. <td colspan="3" style="padding-left: 20px;"><h4>System</h4></td>
  1218. </tr>
  1219. <tr>
  1220. <td class="indent1">
  1221. <input type="checkbox" id="System_TimeZone_enabled" value="1" onclick = 'InvertEnableItem("System", "TimeZone")' unchecked >
  1222. <label for=System_TimeZone_enabled><class id="System_TimeZone_text" style="color:black;">TimeZone</class></label>
  1223. </td>
  1224. <td>
  1225. <input type="text" id="System_TimeZone_value1">
  1226. </td>
  1227. <td class="description">
  1228. Time zone in POSIX syntax (Europe/Berlin = "CET-1CEST,M3.5.0,M10.5.0/3" - incl. daylight saving)
  1229. </td>
  1230. </tr>
  1231. <tr class="expert" id="ex16">
  1232. <td class="indent1">
  1233. <input type="checkbox" id="System_TimeServer_enabled" value="1" onclick = 'InvertEnableItem("System", "TimeServer")' unchecked >
  1234. <label for=System_TimeServer_enabled><class id="System_TimeServer_text" style="color:black;">TimeServer</class></label>
  1235. </td>
  1236. <td>
  1237. <input type="text" id="System_TimeServer_value1">
  1238. </td>
  1239. <td class="description">
  1240. Time server to synchronize system time (default: "pool.ntp.org" - used if nothing is specified)
  1241. </td>
  1242. </tr>
  1243. <tr class="expert" id="System_Hostname">
  1244. <td class="indent1">
  1245. <input type="checkbox" id="System_Hostname_enabled" value="1" onclick = 'InvertEnableItem("System", "Hostname")' unchecked >
  1246. <label for=System_Hostname_enabled><class id="System_Hostname_text" style="color:black;">Hostname</class></label>
  1247. </td>
  1248. <td>
  1249. <input type="text" id="System_Hostname_value1">
  1250. <td class="description">
  1251. Hostname for server - will be transfered to wlan.ini at next startup)
  1252. </td>
  1253. </tr>
  1254. </table>
  1255. <p>
  1256. <button class="button" onclick="saveTextAsFile()">Update Config.ini</button>
  1257. </p>
  1258. <p>
  1259. </p>
  1260. <div id="doreboot">
  1261. <p>
  1262. <button class="button" id="Edit_Config_Direct" onclick="editConfigDirect()" style="display:none">Edit Config.ini direct</button>
  1263. <button class="button" id="reboot" type="button" onclick="doReboot()">Reboot to activate updates</button>
  1264. </p>
  1265. </div>
  1266. </div>
  1267. <script type="text/javascript" src="./gethost.js"></script>
  1268. <script type="text/javascript" src="./readconfigcommon.js"></script>
  1269. <script type="text/javascript" src="./readconfigparam.js"></script>
  1270. <script type="text/javascript">
  1271. var canvas = document.getElementById('canvas'),
  1272. basepath = "http://192.168.178.22";
  1273. param;
  1274. category;
  1275. NUNBERSAkt = -1;
  1276. NUMBERS;
  1277. function LoadConfigNeu() {
  1278. var isInitialSetup = getParameterByName('InitialSetup');
  1279. if (isInitialSetup === 'true')
  1280. {
  1281. document.getElementById("reboot").style.display = "none";
  1282. }
  1283. basepath = getbasepath();
  1284. if (!loadConfig(basepath)) {
  1285. alert("Config.ini could not be loaded!\nPlease reload the page.");
  1286. return;
  1287. }
  1288. ParseConfig();
  1289. param = getConfigParameters();
  1290. category = getConfigCategory();
  1291. InitIndivParameter();
  1292. UpdateInput();
  1293. UpdateInputIndividual();
  1294. UpdateExpertModus();
  1295. document.getElementById("divall").style.display = '';
  1296. }
  1297. function InitIndivParameter()
  1298. {
  1299. NUMBERS = getNUMBERInfo();
  1300. var _index = document.getElementById("Numbers_value1");
  1301. while (_index.length)
  1302. _index.remove(0);
  1303. for (var i = 0; i < NUMBERS.length; ++i){
  1304. var option = document.createElement("option");
  1305. option.text = NUMBERS[i]["name"];
  1306. option.value = i;
  1307. _index.add(option);
  1308. }
  1309. _index.selectedIndex = 0;
  1310. }
  1311. function getParameterByName(name, url = window.location.href) {
  1312. name = name.replace(/[\[\]]/g, '\\$&');
  1313. var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
  1314. results = regex.exec(url);
  1315. if (!results) return null;
  1316. if (!results[2]) return '';
  1317. return decodeURIComponent(results[2].replace(/\+/g, ' '));
  1318. }
  1319. function WriteParameter(_param, _category, _cat, _name, _optional, _number = -1){
  1320. let anzpara = _param[_cat][_name].anzParam;
  1321. if (_number > -1) {
  1322. if ((NUMBERS[_number] == undefined) || (NUMBERS[_number][_cat] == undefined) || (NUMBERS[_number][_cat][_name] == undefined))
  1323. return;
  1324. if (_optional) {
  1325. document.getElementById(_cat+"_"+_name+"_enabled").checked = NUMBERS[_number][_cat][_name]["enabled"];
  1326. for (var j = 1; j <= anzpara; ++j) {
  1327. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !NUMBERS[_number][_cat][_name]["enabled"];
  1328. }
  1329. }
  1330. document.getElementById(_cat+"_"+_name+"_text").style="color:black;"
  1331. setEnabled(_cat+"_"+_name, true);
  1332. for (var j = 1; j <= anzpara; ++j) {
  1333. let element = document.getElementById(_cat+"_"+_name+"_value"+j);
  1334. if (element.tagName.toLowerCase() == "select") {
  1335. var textToFind = NUMBERS[_number][_cat][_name]["value"+j];
  1336. if (textToFind == undefined)
  1337. continue;
  1338. _isFound = false;
  1339. element.selectedIndex = -1;
  1340. for (var i = 0; i < element.options.length; i++) {
  1341. if (element.options[i].value.toLowerCase() === textToFind.toLowerCase()) {
  1342. element.selectedIndex = i;
  1343. _isFound = true;
  1344. break;
  1345. }
  1346. }
  1347. if (!_isFound)
  1348. {
  1349. _zw_txt = "In the selectd field the value '" + textToFind + "' in the parameter '";
  1350. _zw_txt = _zw_txt + _cat + "' in the field '" + _name + "' is invalid.\nPLEASE CHECK BEFORE SAVING!";
  1351. alert(_zw_txt);
  1352. }
  1353. }
  1354. else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) {
  1355. element.checked = NUMBERS[_number][_cat][_name]["value"+j] == "true";
  1356. }
  1357. else {
  1358. element.value = NUMBERS[_number][_cat][_name]["value"+j];
  1359. }
  1360. }
  1361. }
  1362. else {
  1363. if (_optional) {
  1364. document.getElementById(_cat+"_"+_name+"_enabled").checked = _param[_cat][_name]["enabled"];
  1365. for (var j = 1; j <= anzpara; ++j) {
  1366. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !_param[_cat][_name]["enabled"];
  1367. }
  1368. }
  1369. document.getElementById(_cat+"_"+_name+"_text").style="color:black;"
  1370. setEnabled(_cat+"_"+_name, true);
  1371. for (var j = 1; j <= anzpara; ++j) {
  1372. let element = document.getElementById(_cat+"_"+_name+"_value"+j);
  1373. if (element.tagName.toLowerCase() == "select") {
  1374. var textToFind = _param[_cat][_name]["value"+j];
  1375. if (textToFind == undefined)
  1376. continue;
  1377. _isFound = false;
  1378. element.selectedIndex = -1;
  1379. for (var i = 0; i < element.options.length; i++) {
  1380. if (element.options[i].value.toLowerCase() === textToFind.toLowerCase()) {
  1381. element.selectedIndex = i;
  1382. _isFound = true;
  1383. break;
  1384. }
  1385. }
  1386. if (!_isFound)
  1387. {
  1388. _zw_txt = "In the selectd field the value '" + textToFind + "' in the section '";
  1389. _zw_txt = _zw_txt + _cat + "' in the field '" + _name + "' is invalid.\nPLEASE CHECK BEFORE SAVING!";
  1390. alert(_zw_txt);
  1391. }
  1392. }
  1393. else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) {
  1394. element.checked = _param[_cat][_name]["value"+j] == "true";
  1395. }
  1396. else {
  1397. element.value = _param[_cat][_name]["value"+j];
  1398. }
  1399. }
  1400. }
  1401. ///////////////// am Ende, falls Kategorie als gesamtes nicht ausgewählt --> deaktivieren
  1402. if (_category[_cat]["enabled"] == false)
  1403. {
  1404. if (_optional) {
  1405. document.getElementById(_cat+"_"+_name+"_enabled").disabled = true;
  1406. for (var j = 1; j <= anzpara; ++j) {
  1407. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = true;
  1408. }
  1409. }
  1410. document.getElementById(_cat+"_"+_name+"_text").style="color: gray;"
  1411. setEnabled(_cat+"_"+_name, false);
  1412. }
  1413. EnDisableItem(_category[_cat]["enabled"], _param, _category, _cat, _name, _optional, _number);
  1414. }
  1415. function InvertEnableItem(_cat, _param)
  1416. {
  1417. _zw = _cat + "_" + _param + "_enabled";
  1418. _isOn = document.getElementById(_zw).checked;
  1419. _color = "color:lightgrey;";
  1420. if (_isOn) {
  1421. _color = "color:black;";
  1422. }
  1423. _zw = _cat + "_" + _param + "_text";
  1424. document.getElementById(_zw).disabled = !_isOn;
  1425. document.getElementById(_zw).style = _color;
  1426. setEnabled(_cat + "_" + _param, _isOn);
  1427. for (var j = 1; j <= param[_cat][_param]["anzParam"]; ++j) {
  1428. document.getElementById(_cat+"_"+_param+"_value"+j).disabled = !_isOn;
  1429. document.getElementById(_cat+"_"+_param+"_value"+j).style=_color;
  1430. }
  1431. }
  1432. function setEnabled(className, enabled) {
  1433. _color = "color:lightgrey;";
  1434. if (enabled) {
  1435. _color = "color:black;";
  1436. }
  1437. let elements = document.getElementsByClassName(className);
  1438. for (i = 0; i < elements.length; i++) {
  1439. if (enabled) {
  1440. elements[i].classList.remove("disabled");
  1441. } else {
  1442. elements[i].classList.add("disabled");
  1443. }
  1444. let inputs = elements[i].getElementsByTagName("input");
  1445. for (j = 0; j < inputs.length; j++) {
  1446. if (inputs[j].id.endsWith("_enabled"))
  1447. continue;
  1448. inputs[j].style = _color
  1449. if (enabled) {
  1450. inputs[j].removeAttribute("disabled");
  1451. } else {
  1452. inputs[j].setAttribute("disabled", "disabled");
  1453. }
  1454. }
  1455. }
  1456. }
  1457. function setVisible(className, visible) {
  1458. let elements = document.getElementsByClassName(className);
  1459. for (i = 0; i < elements.length; i++) {
  1460. if (visible) {
  1461. elements[i].classList.remove("hidden");
  1462. } else {
  1463. elements[i].classList.add("hidden");
  1464. }
  1465. }
  1466. }
  1467. function EnDisableItem(_status, _param, _category, _cat, _name, _optional, _number = -1)
  1468. {
  1469. _status = _category[_cat]["enabled"];
  1470. _color = "color:lightgrey;";
  1471. if (_status) {
  1472. _color = "color:black;";
  1473. }
  1474. if (_optional) {
  1475. document.getElementById(_cat+"_"+_name+"_enabled").disabled = !_status;
  1476. document.getElementById(_cat+"_"+_name+"_enabled").style=_color;
  1477. }
  1478. if (_number == -1){
  1479. if (!_param[_cat][_name]["enabled"]) {
  1480. _status = false;
  1481. _color = "color:lightgrey;";
  1482. }
  1483. }
  1484. else
  1485. if (!NUMBERS[_number][_cat][_name]["enabled"]) {
  1486. _status = false;
  1487. _color = "color:lightgrey;";
  1488. }
  1489. document.getElementById(_cat+"_"+_name+"_text").disabled = !_status;
  1490. document.getElementById(_cat+"_"+_name+"_text").style = _color;
  1491. setEnabled(_cat+"_"+_name, _status);
  1492. for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) {
  1493. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !_status;
  1494. document.getElementById(_cat+"_"+_name+"_value"+j).style=_color;
  1495. }
  1496. }
  1497. function ReadParameter(_param, _cat, _name, _optional, _number = -1){
  1498. if (_number > -1) {
  1499. if (_cat == "Digits")
  1500. _cat = "digit";
  1501. if (_cat == "Analog")
  1502. _cat = "analog";
  1503. if ((NUMBERS[_number] == undefined) || (NUMBERS[_number][_cat] == undefined) || (NUMBERS[_number][_cat][_name] == undefined))
  1504. return;
  1505. if (_optional) {
  1506. NUMBERS[_number][_cat][_name]["enabled"] = document.getElementById(_cat+"_"+_name+"_enabled").checked;
  1507. }
  1508. for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) {
  1509. let element = document.getElementById(_cat+"_"+_name+"_value"+j);
  1510. if (element.tagName.toLowerCase() == "select") {
  1511. NUMBERS[_number][_cat][_name]["value"+j] = element.selectedIndex > -1 ? element.options[element.selectedIndex].value : "";
  1512. }
  1513. else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) {
  1514. NUMBERS[_number][_cat][_name]["value"+j] = element.checked;
  1515. }
  1516. else {
  1517. if ((NUMBERS[_number][_cat][_name].checkRegExList != null) && (NUMBERS[_number][_cat][_name].checkRegExList[j-1] != null)) {
  1518. if (!element.value.match(NUMBERS[_cat][_name].checkRegExList[j-1])) {
  1519. element.classList.add("invalid-input");
  1520. } else {
  1521. element.classList.remove("invalid-input");
  1522. }
  1523. }
  1524. NUMBERS[_number][_cat][_name]["value"+j] = element.value;
  1525. }
  1526. }
  1527. }
  1528. else
  1529. {
  1530. if (_optional) {
  1531. _param[_cat][_name]["enabled"] = document.getElementById(_cat+"_"+_name+"_enabled").checked;
  1532. }
  1533. for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) {
  1534. let element = document.getElementById(_cat+"_"+_name+"_value"+j);
  1535. if (element.tagName.toLowerCase() == "select") {
  1536. _param[_cat][_name]["value"+j] = element.selectedIndex > -1 ? element.options[element.selectedIndex].value : "";
  1537. }
  1538. else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) {
  1539. _param[_cat][_name]["value"+j] = element.checked;
  1540. }
  1541. else {
  1542. if ((_param[_cat][_name].checkRegExList != null) && (_param[_cat][_name].checkRegExList[j-1] != null)) {
  1543. if (!element.value.match(_param[_cat][_name].checkRegExList[j-1])) {
  1544. element.classList.add("invalid-input");
  1545. } else {
  1546. element.classList.remove("invalid-input");
  1547. }
  1548. }
  1549. _param[_cat][_name]["value"+j] = element.value;
  1550. }
  1551. }
  1552. }
  1553. }
  1554. function UpdateInputIndividual()
  1555. {
  1556. if (NUNBERSAkt != -1)
  1557. {
  1558. ReadParameter(param, "PostProcessing", "DecimalShift", true, NUNBERSAkt)
  1559. ReadParameter(param, "PostProcessing", "MaxRateValue", true, NUNBERSAkt)
  1560. ReadParameter(param, "PostProcessing", "MaxRateType", true, NUNBERSAkt)
  1561. ReadParameter(param, "PostProcessing", "ExtendedResolution", true, NUNBERSAkt)
  1562. ReadParameter(param, "PostProcessing", "IgnoreLeadingNaN", true, NUNBERSAkt)
  1563. }
  1564. var sel = document.getElementById("Numbers_value1");
  1565. NUNBERSAkt = sel.selectedIndex;
  1566. WriteParameter(param, category, "PostProcessing", "DecimalShift", true, NUNBERSAkt);
  1567. WriteParameter(param, category, "PostProcessing", "MaxRateValue", true, NUNBERSAkt);
  1568. WriteParameter(param, category, "PostProcessing", "MaxRateType", true, NUNBERSAkt);
  1569. WriteParameter(param, category, "PostProcessing", "ExtendedResolution", true, NUNBERSAkt);
  1570. WriteParameter(param, category, "PostProcessing", "IgnoreLeadingNaN", true, NUNBERSAkt);
  1571. }
  1572. function UpdateInput() {
  1573. document.getElementById("Category_Analog_enabled").checked = category["Analog"]["enabled"];
  1574. document.getElementById("Category_Digits_enabled").checked = category["Digits"]["enabled"];
  1575. document.getElementById("Category_MQTT_enabled").checked = category["MQTT"]["enabled"];
  1576. document.getElementById("Category_GPIO_enabled").checked = category["GPIO"]["enabled"];
  1577. document.getElementById("Category_InfluxDB_enabled").checked = category["InfluxDB"]["enabled"];
  1578. setVisible("GPIO_item", category["GPIO"]["enabled"]);
  1579. WriteParameter(param, category, "MakeImage", "LogImageLocation", true);
  1580. WriteParameter(param, category, "MakeImage", "LogfileRetentionInDays", true);
  1581. WriteParameter(param, category, "MakeImage", "WaitBeforeTakingPicture", false);
  1582. WriteParameter(param, category, "MakeImage", "ImageQuality", false);
  1583. WriteParameter(param, category, "MakeImage", "Brightness", false);
  1584. WriteParameter(param, category, "MakeImage", "Contrast", false);
  1585. WriteParameter(param, category, "MakeImage", "Saturation", false);
  1586. WriteParameter(param, category, "MakeImage", "LEDIntensity", false);
  1587. WriteParameter(param, category, "MakeImage", "ImageSize", false);
  1588. WriteParameter(param, category, "MakeImage", "FixedExposure", false);
  1589. WriteParameter(param, category, "Alignment", "SearchFieldX", false);
  1590. WriteParameter(param, category, "Alignment", "SearchFieldY", false);
  1591. WriteParameter(param, category, "Alignment", "AlignmentAlgo", true);
  1592. WriteParameter(param, category, "Digits", "CNNGoodThreshold", true);
  1593. WriteParameter(param, category, "Digits", "LogImageLocation", true);
  1594. WriteParameter(param, category, "Digits", "LogfileRetentionInDays", true);
  1595. // WriteParameter(param, category, "Digits", "ModelInputSize", false);
  1596. WriteParameter(param, category, "Analog", "LogImageLocation", true);
  1597. WriteParameter(param, category, "Analog", "LogfileRetentionInDays", true);
  1598. // WriteParameter(param, category, "Analog", "ModelInputSize", false);
  1599. WriteParameter(param, category, "PostProcessing", "PreValueUse", true);
  1600. WriteParameter(param, category, "PostProcessing", "PreValueAgeStartup", true);
  1601. WriteParameter(param, category, "PostProcessing", "AllowNegativeRates", true);
  1602. WriteParameter(param, category, "PostProcessing", "ErrorMessage", true);
  1603. WriteParameter(param, category, "PostProcessing", "CheckDigitIncreaseConsistency", true);
  1604. WriteParameter(param, category, "MQTT", "Uri", true);
  1605. WriteParameter(param, category, "MQTT", "MainTopic", true);
  1606. WriteParameter(param, category, "MQTT", "ClientID", true);
  1607. WriteParameter(param, category, "MQTT", "user", true);
  1608. WriteParameter(param, category, "MQTT", "password", true);
  1609. WriteParameter(param, category, "MQTT", "SetRetainFlag", true);
  1610. WriteParameter(param, category, "InfluxDB", "Uri", true);
  1611. WriteParameter(param, category, "InfluxDB", "Database", true);
  1612. WriteParameter(param, category, "InfluxDB", "Measurement", true);
  1613. WriteParameter(param, category, "InfluxDB", "user", true);
  1614. WriteParameter(param, category, "InfluxDB", "password", true);
  1615. WriteParameter(param, category, "GPIO", "IO0", true);
  1616. WriteParameter(param, category, "GPIO", "IO1", true);
  1617. WriteParameter(param, category, "GPIO", "IO3", true);
  1618. WriteParameter(param, category, "GPIO", "IO4", true);
  1619. WriteParameter(param, category, "GPIO", "IO12", true);
  1620. WriteParameter(param, category, "GPIO", "IO13", true);
  1621. WriteParameter(param, category, "GPIO", "LEDType", false);
  1622. WriteParameter(param, category, "GPIO", "LEDNumbers", false);
  1623. WriteParameter(param, category, "GPIO", "LEDColor", false);
  1624. WriteParameter(param, category, "AutoTimer", "AutoStart", false);
  1625. WriteParameter(param, category, "AutoTimer", "Intervall", false);
  1626. WriteParameter(param, category, "Debug", "Logfile", true);
  1627. WriteParameter(param, category, "Debug", "LogfileRetentionInDays", true);
  1628. WriteParameter(param, category, "System", "TimeZone", true);
  1629. WriteParameter(param, category, "System", "Hostname", true);
  1630. WriteParameter(param, category, "System", "TimeServer", true);
  1631. WriteModelFiles();
  1632. }
  1633. function WriteModelFiles()
  1634. {
  1635. list_tflite = getTFLITEList();
  1636. var _indexDig = document.getElementById("Digits_Model_value1");
  1637. var _indexAna = document.getElementById("Analog_Model_value1");
  1638. while (_indexDig.length)
  1639. _indexDig.remove(0);
  1640. while (_indexAna.length)
  1641. _indexAna.remove(0);
  1642. for (var i = 0; i < list_tflite.length; ++i){
  1643. var optionDig = document.createElement("option");
  1644. var optionAna = document.createElement("option");
  1645. var text = list_tflite[i].replace("/config/", "");
  1646. if (list_tflite[i].includes("/dig-")) { // Its a digital file, only show in the digital list box
  1647. optionDig.text = text;
  1648. optionDig.value = list_tflite[i];
  1649. _indexDig.add(optionDig);
  1650. }
  1651. else if (list_tflite[i].includes("/ana-")) { // Its a digital file, only show in the analog list box
  1652. optionAna.text = text;
  1653. optionAna.value = list_tflite[i];
  1654. _indexAna.add(optionAna);
  1655. }
  1656. else { // all other files, show in both list boxes
  1657. optionDig.text = text;
  1658. optionDig.value = list_tflite[i];
  1659. _indexDig.add(optionDig);
  1660. optionAna.text = text;
  1661. optionAna.value = list_tflite[i];
  1662. _indexAna.add(optionAna);
  1663. }
  1664. }
  1665. WriteParameter(param, category, "Analog", "Model", false);
  1666. WriteParameter(param, category, "Digits", "Model", false);
  1667. }
  1668. function ReadParameterAll()
  1669. {
  1670. category["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked;
  1671. category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
  1672. category["MQTT"]["enabled"] = document.getElementById("Category_MQTT_enabled").checked;
  1673. category["InfluxDB"]["enabled"] = document.getElementById("Category_InfluxDB_enabled").checked;
  1674. category["GPIO"]["enabled"] = document.getElementById("Category_GPIO_enabled").checked;
  1675. ReadParameter(param, "MakeImage", "LogImageLocation", true);
  1676. ReadParameter(param, "MakeImage", "LogfileRetentionInDays", true);
  1677. ReadParameter(param, "MakeImage", "WaitBeforeTakingPicture", false);
  1678. ReadParameter(param, "MakeImage", "ImageQuality", false);
  1679. ReadParameter(param, "MakeImage", "Brightness", false);
  1680. ReadParameter(param, "MakeImage", "Contrast", false);
  1681. ReadParameter(param, "MakeImage", "Saturation", false);
  1682. ReadParameter(param, "MakeImage", "LEDIntensity", false);
  1683. ReadParameter(param, "MakeImage", "ImageSize", false);
  1684. ReadParameter(param, "MakeImage", "FixedExposure", false);
  1685. ReadParameter(param, "Alignment", "SearchFieldX", false);
  1686. ReadParameter(param, "Alignment", "SearchFieldY", false);
  1687. ReadParameter(param, "Alignment", "AlignmentAlgo", true);
  1688. ReadParameter(param, "Digits", "Model", false);
  1689. ReadParameter(param, "Digits", "CNNGoodThreshold", true);
  1690. ReadParameter(param, "Digits", "LogImageLocation", true);
  1691. ReadParameter(param, "Digits", "LogfileRetentionInDays", true);
  1692. // ReadParameter(param, "Digits", "ModelInputSize", false);
  1693. ReadParameter(param, "Analog", "Model", false);
  1694. ReadParameter(param, "Analog", "LogImageLocation", true);
  1695. ReadParameter(param, "Analog", "LogfileRetentionInDays", true);
  1696. // ReadParameter(param, "Analog", "ModelInputSize", false);
  1697. ReadParameter(param, "PostProcessing", "PreValueUse", true);
  1698. ReadParameter(param, "PostProcessing", "PreValueAgeStartup", true);
  1699. ReadParameter(param, "PostProcessing", "AllowNegativeRates", true);
  1700. ReadParameter(param, "PostProcessing", "ErrorMessage", true);
  1701. ReadParameter(param, "PostProcessing", "CheckDigitIncreaseConsistency", true);
  1702. ReadParameter(param, "MQTT", "Uri", true);
  1703. ReadParameter(param, "MQTT", "MainTopic", true);
  1704. ReadParameter(param, "MQTT", "ClientID", true);
  1705. ReadParameter(param, "MQTT", "user", true);
  1706. ReadParameter(param, "MQTT", "password", true);
  1707. ReadParameter(param, "MQTT", "SetRetainFlag", true);
  1708. ReadParameter(param, "InfluxDB", "Uri", true);
  1709. ReadParameter(param, "InfluxDB", "Database", true);
  1710. ReadParameter(param, "InfluxDB", "Measurement", true);
  1711. ReadParameter(param, "InfluxDB", "user", true);
  1712. ReadParameter(param, "InfluxDB", "password", true);
  1713. ReadParameter(param, "GPIO", "IO0", true);
  1714. ReadParameter(param, "GPIO", "IO1", true);
  1715. ReadParameter(param, "GPIO", "IO3", true);
  1716. ReadParameter(param, "GPIO", "IO4", true);
  1717. ReadParameter(param, "GPIO", "IO12", true);
  1718. ReadParameter(param, "GPIO", "IO13", true);
  1719. ReadParameter(param, "GPIO", "LEDType", false);
  1720. ReadParameter(param, "GPIO", "LEDNumbers", false);
  1721. ReadParameter(param, "GPIO", "LEDColor", false);
  1722. // Folgende Zeilen sind für Abwärtskompatibität < v9.0.0 notwendig (manchmal parameter auskommentiert)
  1723. param["GPIO"]["LEDType"]["enabled"] = true;
  1724. param["GPIO"]["LEDNumbers"]["enabled"] = true;
  1725. param["GPIO"]["LEDColor"]["enabled"] = true;
  1726. param["GPIO"]["LEDType"]["found"] = true;
  1727. param["GPIO"]["LEDNumbers"]["found"] = true;
  1728. param["GPIO"]["LEDColor"]["found"] = true;
  1729. ReadParameter(param, "AutoTimer", "AutoStart", false);
  1730. ReadParameter(param, "AutoTimer", "Intervall", false);
  1731. ReadParameter(param, "Debug", "Logfile", true);
  1732. ReadParameter(param, "Debug", "LogfileRetentionInDays", true);
  1733. ReadParameter(param, "System", "TimeZone", true);
  1734. ReadParameter(param, "System", "Hostname", true);
  1735. ReadParameter(param, "System", "TimeServer", true);
  1736. UpdateInputIndividual();
  1737. // FormatDecimalValue(param, "PostProcessing", "MaxRateValue");
  1738. }
  1739. function FormatDecimalValue(_param, _cat, _name) {
  1740. for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) {
  1741. var _val = _param[_cat][_name]["value"+j];
  1742. _val = _val.replace(",", ".");
  1743. _param[_cat][_name]["value"+j] = _val;
  1744. }
  1745. }
  1746. function UpdateAfterCategoryCheck() {
  1747. ReadParameterAll();
  1748. category["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked;
  1749. category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
  1750. category["MQTT"]["enabled"] = document.getElementById("Category_MQTT_enabled").checked;
  1751. category["InfluxDB"]["enabled"] = document.getElementById("Category_InfluxDB_enabled").checked;
  1752. category["GPIO"]["enabled"] = document.getElementById("Category_GPIO_enabled").checked;
  1753. UpdateInput();
  1754. UpdateInputIndividual();
  1755. }
  1756. function UpdateExpertModus()
  1757. {
  1758. // var _style = 'display:none;';
  1759. var _style_pur = 'none';
  1760. var _hidden = true;
  1761. if (document.getElementById("ExpertModus_enabled").checked) {
  1762. // _style = '';
  1763. _style_pur = '';
  1764. _hidden = false;
  1765. document.getElementById("Edit_Config_Direct").style.display = "";
  1766. }
  1767. else
  1768. {
  1769. document.getElementById("Edit_Config_Direct").style.display = "none";
  1770. }
  1771. const expert = document.querySelectorAll(".expert");
  1772. for (var i = 0; i < expert.length; i++) {
  1773. expert[i].style.display = _style_pur;
  1774. // document.getElementById(expert[i].id).style = _style;
  1775. }
  1776. // Enable / Disable die Optionen in den Menues für die Auswahl. Falls kein Expertenmodus soll nur ein Wert (built-in-led oder externan-flash-ws281x) möglich sein
  1777. Array.from(document.querySelector("#GPIO_IO4_value1").options).forEach(function(option_element) {
  1778. if (option_element.value != "built-in-led")
  1779. option_element.hidden = _hidden;
  1780. });
  1781. Array.from(document.querySelector("#GPIO_IO12_value1").options).forEach(function(option_element) {
  1782. if (option_element.value != "external-flash-ws281x")
  1783. option_element.hidden = _hidden;
  1784. });
  1785. }
  1786. function saveTextAsFile()
  1787. {
  1788. ReadParameterAll();
  1789. if (document.getElementsByClassName("invalid-input").length > 0) {
  1790. alert("Settings cannot be saved. Please check your entries.");
  1791. return;
  1792. }
  1793. if (confirm("Are you sure you want to update \"config.ini\"?")) {
  1794. ReadParameterAll();
  1795. WriteConfigININew();
  1796. SaveConfigToServer(basepath);
  1797. alert("Config.ini is updated!")
  1798. }
  1799. }
  1800. function doReboot() {
  1801. if (confirm("Are you sure you want to reboot the ESP32?")) {
  1802. var stringota = "/reboot";
  1803. window.location = stringota;
  1804. window.location.href = stringota;
  1805. window.location.assign(stringota);
  1806. window.location.replace(stringota);
  1807. }
  1808. }
  1809. function editConfigDirect() {
  1810. if (confirm("Did you save your changes?")) {
  1811. var stringota = "/edit_config.html";
  1812. window.location = stringota;
  1813. window.location.href = stringota;
  1814. window.location.assign(stringota);
  1815. window.location.replace(stringota);
  1816. }
  1817. }
  1818. function numberChanged()
  1819. {
  1820. UpdateInputIndividual();
  1821. }
  1822. LoadConfigNeu();
  1823. </script>
  1824. </body>
  1825. </html>