Files
OpenMQTTGateway/dev/upload/builds.html
DigiH 8889d3720e deploy: 296248f64b
deploy: 2440c143c0

deploy: 2440c143c0

deploy: 296248f64b

deploy: 296248f64b

deploy: a0919bbba4

deploy: 6a4b38a0cb

deploy: 4c633da151

deploy: 5a07020144

deploy: 25af43bdeb

deploy: 771b792484

deploy: 771b792484

deploy: 7db2e93c28

deploy: 5421f0e995

deploy: 5421f0e995

deploy: 5421f0e995

deploy: 5421f0e995

deploy: 5421f0e995

deploy: fb42293631

deploy: fb42293631

deploy: fb42293631

deploy: fb42293631

deploy: fb42293631

deploy: 87b26c867f

deploy: 2fcfc0f6d2

deploy: 2fcfc0f6d2

deploy: 2fcfc0f6d2

deploy: 2fcfc0f6d2

deploy: 54b0eaeebf

deploy: 28b97183be

deploy: cf21aed90c

deploy: 5a36034a2f

deploy: 811bc1f608

deploy: 811bc1f608

deploy: 673a895d44

deploy: 673a895d44

deploy: ca9ef664ab

deploy: ca9ef664ab

deploy: 10d7f7465ddd65a1ddcb1bc32504889d85602c4b

deploy: 495e1ce6b42f0293e4cf35c41a6bdb0bd229fa07

deploy: ca9ef664ab

deploy: ca9ef664ab

deploy: ca9ef664ab

deploy: 5e01f40829

deploy: 5e01f40829

deploy: 5e01f40829

deploy: 5e01f40829

deploy: 5e01f40829

deploy: 7a8e8483fd

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: dfa94588d6

deploy: dfa94588d6

deploy: dfa94588d6

deploy: dfa94588d6

deploy: e27e055bf8

deploy: cbec4292de
2024-02-19 12:44:47 -06:00

203 lines
57 KiB
HTML

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>(Option 3) Upload your configurations | OpenMQTTGateway DEVELOPMENT SHA:2440c1 TEST ONLY</title>
<meta name="generator" content="VuePress 1.9.8">
<link rel="icon" type="image/png" sizes="32x32" href="/dev/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/dev/favicon-16x16.png">
<link rel="icon" href="/dev/img/Openmqttgateway_logo_mini.png">
<link rel="manifest" href="/dev/manifest.json">
<link rel="apple-touch-icon" sizes="180x180" href="/dev/apple-touch-icon.png">
<link rel="mask-icon" href="/dev/icons/safari-pinned-tab.svg" color="#3eaf7c">
<script type="module" src="https://unpkg.com/esp-web-tools@3.4.2/dist/web/install-button.js?module"></script>
<meta name="description" content="One gateway, many technologies: MQTT gateway for ESP8266, ESP32, Sonoff RF Bridge or Arduino with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, beacons detection, mi flora / mi jia / LYWSD02/ Mi Scale compatibility, SMS &amp; LORA.">
<meta name="theme-color" content="#3eaf7c">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="msapplication-TileImage" content="/favicon-144x144.png">
<meta name="msapplication-TileColor" content="#000000">
<link rel="preload" href="/dev/assets/css/0.styles.a0b2d6bb.css" as="style"><link rel="preload" href="/dev/assets/js/app.37616211.js" as="script"><link rel="preload" href="/dev/assets/js/2.fdf4d158.js" as="script"><link rel="preload" href="/dev/assets/js/44.24c08f06.js" as="script"><link rel="prefetch" href="/dev/assets/js/10.dd089e98.js"><link rel="prefetch" href="/dev/assets/js/11.d490c4a0.js"><link rel="prefetch" href="/dev/assets/js/12.3d9627b5.js"><link rel="prefetch" href="/dev/assets/js/13.8fdadc95.js"><link rel="prefetch" href="/dev/assets/js/14.53be8b0a.js"><link rel="prefetch" href="/dev/assets/js/15.9e7f640d.js"><link rel="prefetch" href="/dev/assets/js/16.167136e7.js"><link rel="prefetch" href="/dev/assets/js/17.1b24f802.js"><link rel="prefetch" href="/dev/assets/js/18.6002f660.js"><link rel="prefetch" href="/dev/assets/js/19.367029ed.js"><link rel="prefetch" href="/dev/assets/js/20.ea752e98.js"><link rel="prefetch" href="/dev/assets/js/21.18d93d02.js"><link rel="prefetch" href="/dev/assets/js/22.fe03e80f.js"><link rel="prefetch" href="/dev/assets/js/23.b3fe4fb1.js"><link rel="prefetch" href="/dev/assets/js/24.7aba9723.js"><link rel="prefetch" href="/dev/assets/js/25.3066b3ef.js"><link rel="prefetch" href="/dev/assets/js/26.69e1040e.js"><link rel="prefetch" href="/dev/assets/js/27.470891bf.js"><link rel="prefetch" href="/dev/assets/js/28.7bb3bf3e.js"><link rel="prefetch" href="/dev/assets/js/29.2c556663.js"><link rel="prefetch" href="/dev/assets/js/3.34967994.js"><link rel="prefetch" href="/dev/assets/js/30.ce1f59b8.js"><link rel="prefetch" href="/dev/assets/js/31.5f0a3678.js"><link rel="prefetch" href="/dev/assets/js/32.245763a7.js"><link rel="prefetch" href="/dev/assets/js/33.1eca4c74.js"><link rel="prefetch" href="/dev/assets/js/34.e9ee0ad9.js"><link rel="prefetch" href="/dev/assets/js/35.27d21c4b.js"><link rel="prefetch" href="/dev/assets/js/36.f55fd62f.js"><link rel="prefetch" href="/dev/assets/js/37.07a9d001.js"><link rel="prefetch" href="/dev/assets/js/38.4e8718a0.js"><link rel="prefetch" href="/dev/assets/js/39.e533c21d.js"><link rel="prefetch" href="/dev/assets/js/4.0b272843.js"><link rel="prefetch" href="/dev/assets/js/40.7e581684.js"><link rel="prefetch" href="/dev/assets/js/41.81202049.js"><link rel="prefetch" href="/dev/assets/js/42.ef29de3b.js"><link rel="prefetch" href="/dev/assets/js/43.9da33982.js"><link rel="prefetch" href="/dev/assets/js/45.26e87af9.js"><link rel="prefetch" href="/dev/assets/js/46.39554abd.js"><link rel="prefetch" href="/dev/assets/js/47.7be7d795.js"><link rel="prefetch" href="/dev/assets/js/48.4984bc04.js"><link rel="prefetch" href="/dev/assets/js/49.c8f0c8da.js"><link rel="prefetch" href="/dev/assets/js/5.805ba45a.js"><link rel="prefetch" href="/dev/assets/js/50.88b3398c.js"><link rel="prefetch" href="/dev/assets/js/51.7fb4b9e4.js"><link rel="prefetch" href="/dev/assets/js/52.547bcf23.js"><link rel="prefetch" href="/dev/assets/js/6.a203e05b.js"><link rel="prefetch" href="/dev/assets/js/7.bfb27966.js"><link rel="prefetch" href="/dev/assets/js/8.237c9201.js"><link rel="prefetch" href="/dev/assets/js/9.9ace8522.js">
<link rel="stylesheet" href="/dev/assets/css/0.styles.a0b2d6bb.css">
</head>
<body>
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/dev/" class="home-link router-link-active"><!----> <span class="site-name">OpenMQTTGateway DEVELOPMENT SHA:2440c1 TEST ONLY</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://shop.theengs.io/" target="_blank" rel="noopener noreferrer" class="nav-link external">
Shop🆕
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://1technophile.blogspot.com" target="_blank" rel="noopener noreferrer" class="nav-link external">
Blog
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="/dev/" class="nav-link">
Docs
</a></div><div class="nav-item"><a href="https://community.openmqttgateway.com" target="_self" class="nav-link external">
Community
<!----></a></div><div class="nav-item"><a href="https://compatible.openmqttgateway.com/index.php/devices" target="_self" class="nav-link external">
Devices
<!----></a></div><div class="nav-item"><a href="/dev/upload/web-install.html" class="nav-link">
Upload
</a></div><div class="nav-item"><a href="https://app.theengs.io/" target="_blank" rel="noopener noreferrer" class="nav-link external">
Theengs
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <a href="https://github.com/1technophile/OpenMQTTGateway" target="_blank" rel="noopener noreferrer" class="repo-link">
GitHub
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://shop.theengs.io/" target="_blank" rel="noopener noreferrer" class="nav-link external">
Shop🆕
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://1technophile.blogspot.com" target="_blank" rel="noopener noreferrer" class="nav-link external">
Blog
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="/dev/" class="nav-link">
Docs
</a></div><div class="nav-item"><a href="https://community.openmqttgateway.com" target="_self" class="nav-link external">
Community
<!----></a></div><div class="nav-item"><a href="https://compatible.openmqttgateway.com/index.php/devices" target="_self" class="nav-link external">
Devices
<!----></a></div><div class="nav-item"><a href="/dev/upload/web-install.html" class="nav-link">
Upload
</a></div><div class="nav-item"><a href="https://app.theengs.io/" target="_blank" rel="noopener noreferrer" class="nav-link external">
Theengs
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <a href="https://github.com/1technophile/OpenMQTTGateway" target="_blank" rel="noopener noreferrer" class="repo-link">
GitHub
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav> <ul class="sidebar-links"><li><a href="/dev/" aria-current="page" class="sidebar-link">0 - What is it for 🏠</a></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>1 - Prerequisites🧭</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>2 - Set it up 🔨</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>3 - Upload ➡️</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/dev/upload/web-install.html" class="sidebar-link">(Option 1) Upload from the web</a></li><li><a href="/dev/upload/binaries.html" class="sidebar-link">(Option 2) Upload ready-to-go binaries</a></li><li><a href="/dev/upload/builds.html" aria-current="page" class="active sidebar-link">(Option 3) Upload your configurations</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/dev/upload/builds.html#introduction" class="sidebar-link">Introduction</a></li><li class="sidebar-sub-header"><a href="/dev/upload/builds.html#configure-upload-with-platformio" class="sidebar-link">Configure &amp; Upload with PlatformIO</a></li><li class="sidebar-sub-header"><a href="/dev/upload/builds.html#configure-upload-with-arduino-ide" class="sidebar-link">Configure &amp; Upload with Arduino IDE</a></li><li class="sidebar-sub-header"><a href="/dev/upload/builds.html#api" class="sidebar-link">API</a></li></ul></li><li><a href="/dev/upload/gitpod.html" class="sidebar-link">(Option 4) Build from the web</a></li><li><a href="/dev/upload/portal.html" class="sidebar-link">Wifi and MQTT configuration</a></li><li><a href="/dev/upload/advanced-configuration.html" class="sidebar-link">Advanced configuration of the gateway</a></li><li><a href="/dev/upload/troubleshoot.html" class="sidebar-link">Troubleshooting</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>4 - Use ✈️</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>5 - Integrate 🎉</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>6 - Participate 💻</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="option-3-upload-your-configurations"><a href="#option-3-upload-your-configurations" class="header-anchor">#</a> (Option 3) Upload your configurations</h1> <h2 id="introduction"><a href="#introduction" class="header-anchor">#</a> Introduction</h2> <p>This section is useful if you want to do advanced configuration of your project or if you choose an Arduino. Indeed the ESP hardware family can be loaded directly without any configuration from your desktop.</p> <p>Advanced configuration means changing the default pins, the MQTT topics, and all the expert parameters that you can find in <a href="https://github.com/1technophile/OpenMQTTGateway/blob/development/main/User_config.h" target="_blank" rel="noopener noreferrer"><code>User_config.h</code><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> and in all <a href="https://github.com/1technophile/OpenMQTTGateway/tree/development/main" target="_blank" rel="noopener noreferrer"><code>config_XX.h</code><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> files. If you don't have to change the default parameters except Wi-Fi and MQTT broker settings, you don't need advanced configuration; you can go directly to the <a href="/dev/upload/binaries.html">Upload Binaries</a> section instead.</p> <p>To make advanced configurations to OpenMQTTGateway, you have the choice between two development environments:</p> <ul><li><a href="https://platformio.org/" target="_blank" rel="noopener noreferrer">PlatformIO<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://www.arduino.cc/en/Main/Software" target="_blank" rel="noopener noreferrer">Arduino IDE<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <p>I recommend using PlatformIO; this way you will not have to search for all the necessary libraries and adequate forks/revisions. If you really want to use Arduino IDE, you need to download the libraries listed <a href="https://github.com/1technophile/OpenMQTTGateway/blob/d2dd6138558909b71cc44f69665340247bd5f356/platformio.ini#L55" target="_blank" rel="noopener noreferrer">here<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> at the version or revision specified.</p> <h2 id="configure-upload-with-platformio"><a href="#configure-upload-with-platformio" class="header-anchor">#</a> Configure &amp; Upload with PlatformIO</h2> <ul><li>Download the <a href="https://github.com/1technophile/OpenMQTTGateway/releases" target="_blank" rel="noopener noreferrer">CODE<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> from github.</li> <li>Open the <code>OpenMQTTGateway</code> folder</li></ul> <p>You will find inside the folder a <code>platformio.ini</code> config file. PlatformIO uses this file to define how to build OMG for different kinds of hardware. Not just that, but it also specifies which modules to turn on and off. And there's more: it also lets you configure the settings of those modules.</p> <p>PlatformIO config files work on the concept of overriding. At first, a very simple base &quot;environment&quot; is specified that specifies common variables shared by all situations:</p> <div class="language-ini line-numbers-mode"><pre class="language-ini"><code><span class="token section"><span class="token punctuation">[</span><span class="token section-name selector">env</span><span class="token punctuation">]</span></span>
<span class="token key attr-name">framework</span> <span class="token punctuation">=</span> <span class="token value attr-value">arduino</span>
<span class="token key attr-name">lib_deps</span> <span class="token punctuation">=</span>
${libraries.pubsubclient}
${libraries.arduinojson}
${libraries.arduinolog}
<span class="token key attr-name">build_flags</span> <span class="token punctuation">=</span>
-w ; supress all warnings
<span class="token comment">; '-DLOG_LEVEL=LOG_LEVEL_TRACE' ; Enable trace level logging</span>
<span class="token key attr-name">monitor_speed</span> <span class="token punctuation">=</span> <span class="token value attr-value">115200</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div><p>Later &quot;environments&quot; get more specific, but inherit everything that was defined in this common environment:</p> <div class="language-ini line-numbers-mode"><pre class="language-ini"><code><span class="token section"><span class="token punctuation">[</span><span class="token section-name selector">com-esp</span><span class="token punctuation">]</span></span>
<span class="token key attr-name">lib_deps</span> <span class="token punctuation">=</span>
${env.lib_deps} ; Inherit all the library dependencies from [env]
${libraries.wifimanager} ; Add another library dependency on top of them
<span class="token key attr-name">build_flags</span> <span class="token punctuation">=</span>
${env.build_flags} ; Inherit all the build flags from [env]
<span class="token key attr-name">'-DsimpleReceiving</span><span class="token punctuation">=</span><span class="token value attr-value">true' ; Add some of our own build flags</span>
<span class="token key attr-name">'-DZmqttDiscovery</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;HADiscovery&quot;'</span>
<span class="token key attr-name">'-DTRACE</span><span class="token punctuation">=</span><span class="token value attr-value">1'</span>
<span class="token comment">;'-DCORE_DEBUG_LEVEL=4'</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div><p>Here, build flags starting with &quot;-D&quot; let us set configuration values you would normally find in <code>User_config.h</code> and <code>config_xx.h</code> files by specifying them here, overriding the default values set in those files. To include special characters, you can triple escape them with a backslash like so:</p> <div class="language-ini line-numbers-mode"><pre class="language-ini"><code> <span class="token key attr-name">'-Dwifi_password</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;Cato\\\'sYounger\\\$on&quot;' ; Cato'sYounger$on</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>The different listed configurations in <code>platformio.ini</code> represent some standard environments and boards. For example, the environment</p> <div class="language-ini line-numbers-mode"><pre class="language-ini"><code><span class="token section"><span class="token punctuation">[</span><span class="token section-name selector">env:nodemcuv2-pilight</span><span class="token punctuation">]</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>sets the default settings for ESP8266 (NodeMCU v2) devices using the Plight module.</p> <h3 id="option-a-creating-a-portable-config-file"><a href="#option-a-creating-a-portable-config-file" class="header-anchor">#</a> <em>(Option A)</em> Creating a portable config file</h3> <p>You could make your configuration changes directly by editing the values in <code>User_config.h</code> (for main OMG settings) and <code>config_XX.h</code> (for module-specific settings). You could also make most of those changes by instead writing some -D build flags in <code>platformio.ini</code>. But for maximum portability, a feature of PlatformIO allows you to make your configurations by creating a new file and listing all of your overrides there. This way, you can pull the latest OMG code changes without losing your configurations, or having to re-enter them manually.</p> <p>To do this, create a file with a name ending in <code>_env.ini</code>, such as <code>production_env.ini</code>, into the root folder next to <code>platformio.ini</code>. PlatformIO will scan for all files ending in <code>_env.ini</code> and use it to override the default values in <code>platformio.ini</code>.</p> <p>At the top of your <code>*_env.ini</code> file, for example, put the following to enable the ESP8266 (NodeMCU v2) with the Pilight module.</p> <div class="language-ini line-numbers-mode"><pre class="language-ini"><code><span class="token section"><span class="token punctuation">[</span><span class="token section-name selector">platformio</span><span class="token punctuation">]</span></span>
<span class="token key attr-name">default_envs</span> <span class="token punctuation">=</span> <span class="token value attr-value">nodemcuv2-pilight</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><p>This will make this environment the default environment for this PlatformIO project. If another environment isn't specified when building, it will default to this one.</p> <p>For the rest of your config file, you can override the default configurations or add new configurations to existing environments in <code>platformio.ini</code>, or create a new environment. For example, if want to use both Pilight module and the BME280 module with an ESP8266, we can create a new environment. This is an example <code>my_env.ini</code> file that creates two new environments:</p> <div class="language-ini line-numbers-mode"><pre class="language-ini"><code><span class="token section"><span class="token punctuation">[</span><span class="token section-name selector">platformio</span><span class="token punctuation">]</span></span>
<span class="token key attr-name">default_envs</span> <span class="token punctuation">=</span> <span class="token value attr-value">nodemcuv2-pilight-bme280-ota</span>
<span class="token section"><span class="token punctuation">[</span><span class="token section-name selector">env:nodemcuv2-pilight-bme280</span><span class="token punctuation">]</span></span>
<span class="token key attr-name">extends</span> <span class="token punctuation">=</span> <span class="token value attr-value">env:nodemcuv2-pilight</span>
<span class="token key attr-name">lib_deps</span> <span class="token punctuation">=</span>
${env:nodemcuv2-pilight.lib_deps}
${libraries.bme280}
<span class="token key attr-name">build_flags</span> <span class="token punctuation">=</span>
${env:nodemcuv2-pilight.build_flags}
<span class="token key attr-name">'-DGateway_Name</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;OpenMQTTGateway&quot;'</span>
<span class="token key attr-name">'-DZsensorBME280</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;BME280&quot;'</span>
<span class="token key attr-name">'-DBase_Topic</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;rf/&quot;'</span>
<span class="token key attr-name">'-DESPWifiManualSetup</span><span class="token punctuation">=</span><span class="token value attr-value">true'</span>
<span class="token key attr-name">'-Dwifi_ssid</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;mynetwork&quot;'</span>
<span class="token key attr-name">'-Dwifi_password</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;Cato\\\'sYounger\\\$on&quot;' ; Cato'sYounger$on</span>
<span class="token key attr-name">'-DMQTT_USER</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;mqttusername&quot;'</span>
<span class="token key attr-name">'-DMQTT_PASS</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;mqttpassword&quot;'</span>
<span class="token key attr-name">'-DMQTT_SERVER</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;mqttserver.local&quot;'</span>
<span class="token key attr-name">'-Dgw_password</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;12345678&quot;'</span>
<span class="token key attr-name">'-DLED_RECEIVE</span><span class="token punctuation">=</span><span class="token value attr-value">LED_BUILTIN' ; Comment 1</span>
<span class="token key attr-name">'-DLED_RECEIVE_ON</span><span class="token punctuation">=</span><span class="token value attr-value">LOW' ; Comment 2</span>
<span class="token key attr-name">'-DRF_RECEIVER_GPIO</span><span class="token punctuation">=</span><span class="token value attr-value">13'</span>
<span class="token key attr-name">'-DRF_EMITTER_GPIO</span><span class="token punctuation">=</span><span class="token value attr-value">15'</span>
<span class="token key attr-name">'-DsimpleReceiving</span><span class="token punctuation">=</span><span class="token value attr-value">false'</span>
'-UZmqttDiscovery' ; Disable HA discovery
<span class="token key attr-name">monitor_speed</span> <span class="token punctuation">=</span> <span class="token value attr-value">115200</span>
<span class="token section"><span class="token punctuation">[</span><span class="token section-name selector">env:nodemcuv2-pilight-bme280-ota</span><span class="token punctuation">]</span></span>
<span class="token key attr-name">extends</span> <span class="token punctuation">=</span> <span class="token value attr-value">env:nodemcuv2-pilight-bme280</span>
<span class="token key attr-name">upload_protocol</span> <span class="token punctuation">=</span> <span class="token value attr-value">espota</span>
<span class="token key attr-name">upload_port</span> <span class="token punctuation">=</span> <span class="token value attr-value">OpenMQTTGateway.local</span>
<span class="token key attr-name">upload_flags</span> <span class="token punctuation">=</span>
<span class="token key attr-name">--auth</span><span class="token punctuation">=</span><span class="token value attr-value">otapassword</span>
<span class="token key attr-name">--port</span><span class="token punctuation">=</span><span class="token value attr-value">8266</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br></div></div><div class="custom-block warning"><p class="custom-block-title">Note</p> <p>Adding manual WiFi and MQTT credentials to an environment also requires to define
<code>'-DESPWifiManualSetup=true'</code>
for the credentials to be registered correctly.</p></div> <div class="custom-block warning"><p class="custom-block-title">Note</p> <p>Manual network configuration (IP, netmask, gateway, DNS) requires to define
<code>'-DNetworkAdvancedSetup=true'</code>
and related network parameters, e.g.:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>'-DNET_IP=&quot;192.168.1.99&quot;'
'-DNET_MASK=&quot;255.255.255.0&quot;'
'-DNET_GW=&quot;192.168.1.1&quot;'
'-DNET_DNS=&quot;1.1.1.1&quot;'
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div></div> <p>The first new environment we create, <code>nodemcuv2-pilight-bme280</code>, inherits the default <code>nodemcuv2-pilight</code> environment in <code>platformio.ini</code> with the <code>extends = env:nodemcuv2-pilight</code> line. In the <code>lib_deps</code> section, it imports all the <code>lib_deps</code> of <code>nodemcuv2-pilight</code> with the <code>${env:nodemcuv2-pilight.lib_deps}</code> line, and adds BME280 on top of it. (Since the environment we're extending already has this <code>lib_deps</code> attribute, specifying it again would normally replace it completely with our new attribute; instead, to keep its value but simply append to it, we import the original in the beginning of our <code>lib_deps</code> attribute.) In the <code>build_flags</code> section, it again imports all the <code>build_flags</code> of <code>nodemcuv2-pilight</code> and many of its own overrides, e.g. changing <code>Base_Topic</code> found in <code>User_config.h</code> from the default to &quot;rf/&quot; by using the <code>'-DBase_Topic=&quot;rf/&quot;'</code> line. It also unsets previously set configurations (i.e. <code>mqttDiscovery</code>) by using <code>'-UZmqttDiscovery'</code>. This environment will work over serial upload.</p> <p>The second new environment, <code>nodemcuv2-pilight-bme280-ota</code>, inherits everything we specified in the first environment (with the line <code>extends = env:nodemcuv2-pilight-bme280</code>), but modifies it to upload over OTA (Wi-Fi). We also specified this as the <code>default_env</code> in the beginning of the file, so PlatformIO will choose this environment to build and upload if we don't specify otherwise.</p> <p>The first time we're flashing OMG to the board, we can use the command <code>pio run --target upload --environment nodemcuv2-pilight-bme280</code> to specify that we want to build and run the <code>nodemcuv2-pilight-bme280</code> environment (over USB serial). Afterwards, we don't have to specify <code>--environment</code> (e.g. just run <code>pio run --target upload</code>) to run the default <code>nodemcuv2-pilight-bme280-ota</code> environment and update the code over the air.</p> <h3 id="option-b-editing-files-directly"><a href="#option-b-editing-files-directly" class="header-anchor">#</a> <em>(Option B)</em> Editing files directly</h3> <p>You can also modify the <code>User_config.h</code> file and your modules' <code>config_XX.h</code> files to your liking, and then edit the <code>platformio.ini</code> file to uncomment the <code>default_envs</code> lines corresponding to your board and chosen modules, like below:</p> <div class="language-ini line-numbers-mode"><pre class="language-ini"><code><span class="token comment">;default_envs = sonoff-basic-rfr3</span>
<span class="token comment">;default_envs = rfbridge</span>
<span class="token comment">;default_envs = esp32dev-all</span>
<span class="token key attr-name">default_envs</span> <span class="token punctuation">=</span> <span class="token value attr-value">esp32dev-rf</span>
<span class="token comment">;default_envs = esp32dev-ir</span>
<span class="token comment">;default_envs = esp32dev-ble</span>
<span class="token comment">;default_envs = ttgo-lora32-v1</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><p>If you don't know which <code>env</code> to activate, you can refer to <a href="../prerequisites/devices">devices</a>.</p> <p>If you want to add more sensors or gateways to one <code>default_envs</code> you can add the modules directly into your environment definition of your <code>.ini</code> files or uncomment them in <a href="https://github.com/1technophile/OpenMQTTGateway/blob/d2dd6138558909b71cc44f69665340247bd5f356/main/User_config.h#L84" target="_blank" rel="noopener noreferrer"><code>User_config.h</code><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>.</p> <p>Example to add IR to <code>esp32dev-rf</code> add the <code>build_flags</code> below to the env definition:</p> <div class="language-ini line-numbers-mode"><pre class="language-ini"><code> <span class="token key attr-name">'-DZgatewayIR</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;IR&quot;'</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><div class="language-ini line-numbers-mode"><pre class="language-ini"><code><span class="token section"><span class="token punctuation">[</span><span class="token section-name selector">env:esp32dev-rf</span><span class="token punctuation">]</span></span>
<span class="token key attr-name">platform</span> <span class="token punctuation">=</span> <span class="token value attr-value">${com.esp32_platform}</span>
<span class="token key attr-name">board</span> <span class="token punctuation">=</span> <span class="token value attr-value">esp32dev</span>
<span class="token key attr-name">lib_deps</span> <span class="token punctuation">=</span>
${com-esp.lib_deps}
${libraries.rc-switch}
<span class="token key attr-name">build_flags</span> <span class="token punctuation">=</span>
${com-esp.build_flags}
<span class="token key attr-name">'-DZgatewayRF</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;RF&quot;'</span>
<span class="token key attr-name">'-DZgatewayIR</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;IR&quot;'</span>
<span class="token key attr-name">'-DGateway_Name</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;OpenMQTTGateway_ESP32_RF_IR&quot;'</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><p>Once your configuration is done you can upload the program to your board by clicking on the white arrow at the blue bottom bar of your PIO editor or with the following command:
<code>pio run --target upload</code></p> <p>PIO will download the necessaries platform and libraries with the correct versions, build the code and upload it.</p> <p>If you encounter errors the first thing to do is to clean your environment by using the white dust bin in the blue bottom bar of your PIO editor or with the following command:
<code>pio run --target clean</code></p> <p>With some ESP it could be necessary to push the reset button when the upload begin.</p> <p>If you want to erase the settings stored in the ESP memory use:
<code>pio run --target erase</code>
This can be useful especially before the first upload or when you change the board partitions sizing.</p> <p>Once done the gateway should connect to your network and your broker, you should see it into the broker in the form of the following messages:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>home/OpenMQTTGateway/LWT Online
home/OpenMQTTGateway/version
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><p>With PIO you can also upload the firmware through Over the Air, so as to do that you can add the upload options flags used below, <code>upload_port</code> is the IP address of your ESP:</p> <div class="language-ini line-numbers-mode"><pre class="language-ini"><code><span class="token section"><span class="token punctuation">[</span><span class="token section-name selector">env:esp32-ble</span><span class="token punctuation">]</span></span>
<span class="token key attr-name">platform</span> <span class="token punctuation">=</span> <span class="token value attr-value">${com.esp32_platform}</span>
<span class="token key attr-name">board</span> <span class="token punctuation">=</span> <span class="token value attr-value">esp32dev</span>
<span class="token key attr-name">board_build.partitions</span> <span class="token punctuation">=</span> <span class="token value attr-value">min_spiffs.csv</span>
<span class="token key attr-name">lib_deps</span> <span class="token punctuation">=</span>
${com-esp.lib_deps}
${libraries.ble}
<span class="token key attr-name">build_flags</span> <span class="token punctuation">=</span>
${com-esp.build_flags}
<span class="token key attr-name">'-DZgatewayBT</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;BT&quot;'</span>
<span class="token key attr-name">'-DGateway_Name</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;OpenMQTTGateway_ESP32&quot;'</span>
<span class="token key attr-name">upload_protocol</span> <span class="token punctuation">=</span> <span class="token value attr-value">espota</span>
<span class="token key attr-name">upload_port</span> <span class="token punctuation">=</span> <span class="token value attr-value">192.168.1.22</span>
<span class="token key attr-name">upload_flags</span> <span class="token punctuation">=</span>
<span class="token key attr-name">--auth</span><span class="token punctuation">=</span><span class="token value attr-value">OTAPASSWORD</span>
<span class="token key attr-name">--port</span><span class="token punctuation">=</span><span class="token value attr-value">8266</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br></div></div><h2 id="configure-upload-with-arduino-ide"><a href="#configure-upload-with-arduino-ide" class="header-anchor">#</a> Configure &amp; Upload with Arduino IDE</h2> <ul><li>Download the <a href="https://github.com/1technophile/OpenMQTTGateway/releases" target="_blank" rel="noopener noreferrer">CODE<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> from github</li> <li>First download the last version of the Arduino IDE from the Arduino <a href="https://www.arduino.cc/en/Main/Software" target="_blank" rel="noopener noreferrer">website<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li>Add ESP32 boards by following this <a href="https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#installing-using-arduino-ide" target="_blank" rel="noopener noreferrer">tutorial<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li>Add ESP8266 boards by following this <a href="https://github.com/esp8266/Arduino#installing-with-boards-manager" target="_blank" rel="noopener noreferrer">tutorial<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li>Download the libraries package corresponding to your board and module wished into the same page (example esp32-m5stick-c-ble-libraries.zip)</li> <li>Unzip the libraries into your Arduino libraries folder (example D:/Users/XXXX/Documents/Arduino/libraries)</li> <li>If necessary replace the spaces into each library folder by _: example rename “ESP32 BLE Arduino” folder to “ESP32_BLE_Arduino”</li> <li>Open the file main.ino from OpenMQTTGateway/main folder with the Arduino IDE</li> <li>Change the settings and the desired gateways into <code>User_config.h</code> (uncomment the modules you want)</li></ul> <p><em>Example for the use of RF gateway:</em></p> <div class="language-cpp line-numbers-mode"><pre class="language-cpp"><code><span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">define</span> <span class="token macro-name">ZgatewayRF</span> <span class="token string">&quot;RF&quot;</span> <span class="token comment">//ESP8266, Arduino, ESP32</span></span>
<span class="token comment">//#define ZgatewayIR &quot;IR&quot; //ESP8266, Arduino, Sonoff RF Bridge</span>
<span class="token comment">//#define ZgatewayLORA &quot;LORA&quot; //ESP8266, Arduino, ESP32</span>
<span class="token comment">//#define ZgatewayPilight &quot;Pilight&quot; //ESP8266, Arduino, ESP32</span>
<span class="token comment">//#define ZgatewayBT &quot;BT&quot; //ESP8266, ESP32</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><ul><li>Change the pins or parameters corresponding to the modules chosen, for RF you can change the pins in config_RF.h</li> <li>Choose the board on the Arduino IDE</li> <li>Select the port corresponding to the board</li> <li>Note that for using BLE on ESP32 you will need to select <em>Minimal SPIFFS</em> into Tools-&gt;Partition Scheme</li> <li>Open the serial monitor and set 115200 baud</li> <li>Upload ➡️</li> <li>You should see the logs in the serial monitor</li></ul> <p>With an ESP if you did not set your network and MQTT parameters manually you can now open the <a href="/dev/upload/portal.html">web portal configuration</a>.</p> <h2 id="api"><a href="#api" class="header-anchor">#</a> API</h2> <p>With the V0.9 we added the support of json for receiving and publishing.
Per default Json reception and Json publication is activated, the previous simple reception mode is also activated to avoid regression on commands.</p> <p>You can deactivate Json or simple mode following theses instructions:</p> <div class="language-cpp line-numbers-mode"><pre class="language-cpp"><code><span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">define</span> <span class="token macro-name">jsonPublishing</span> <span class="token expression"><span class="token boolean">true</span> </span><span class="token comment">//define false if you don't want to use Json publishing (one topic for all the parameters)</span></span>
<span class="token comment">//example home/OpenMQTTGateway_ESP32_DEVKIT/BTtoMQTT/4XXXXXXXXXX4 {&quot;rssi&quot;:-63,&quot;servicedata&quot;:&quot;fe0000000000000000000000000000000000000000&quot;}</span>
<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">define</span> <span class="token macro-name">simplePublishing</span> <span class="token expression"><span class="token boolean">false</span> </span><span class="token comment">//define true if you want to use simple publishing (one topic for one parameter)</span></span>
<span class="token comment">//example</span>
<span class="token comment">// home/OpenMQTTGateway_ESP32_DEVKIT/BTtoMQTT/4XXXXXXXXXX4/rssi -63.0</span>
<span class="token comment">// home/OpenMQTTGateway_ESP32_DEVKIT/BTtoMQTT/4XXXXXXXXXX4/servicedata fe0000000000000000000000000000000000000000</span>
<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">define</span> <span class="token macro-name">simpleReceiving</span> <span class="token expression"><span class="token boolean">true</span> </span><span class="token comment">//define false if you don't want to use old way reception analysis</span></span>
<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">define</span> <span class="token macro-name">jsonReceiving</span> <span class="token expression"><span class="token boolean">true</span> </span><span class="token comment">//define false if you don't want to use Json reception analysis</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div><p>If you are using platformio you can also comment the definitions above and define your parameters into platformio.ini file by setting the following <code>build_flags</code>:</p> <div class="language-cpp line-numbers-mode"><pre class="language-cpp"><code> <span class="token char">'-DjsonPublishing=true'</span>
<span class="token char">'-DjsonReceiving=true'</span>
<span class="token char">'-DsimpleReceiving=true'</span>
<span class="token char">'-DsimplePublishing=true'</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><p>Note that depending on the environment the default platformio.ini has common option defined see sections:</p> <div class="language-ini line-numbers-mode"><pre class="language-ini"><code><span class="token section"><span class="token punctuation">[</span><span class="token section-name selector">com-arduino</span><span class="token punctuation">]</span></span>
<span class="token section"><span class="token punctuation">[</span><span class="token section-name selector">com-esp</span><span class="token punctuation">]</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><p>If you want to use HASS MQTT discovery you need to have
<code>#define jsonPublishing true</code>
&amp;
<code>#define ZmqttDiscovery &quot;HADiscovery&quot;</code>
uncommented.
Added to that auto discovery box should be selected into your Home Assistant MQTT integration configuration.</p> <p>With an ESP if you did not set your network and MQTT parameters manually you can now open the <a href="/dev/upload/portal.html">web portal configuration</a>.</p> <div class="custom-block warning"><p class="custom-block-title">Note</p> <p>simpleReceiving on Arduino boards doesn't accept 64 bits MQTT values, you can only send 32bits values from the MQTT broker.</p></div> <p><a href="https://hits.seeyoufarm.com" target="_blank" rel="noopener noreferrer"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fdocs.openmqttgateway.com%2Fupload%2Fbuilds.html&amp;count_bg=%2379C83D&amp;title_bg=%23555555&amp;icon=&amp;icon_color=%23E7E7E7&amp;title=hits&amp;edge_flat=false" alt="Hits"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/1technophile/OpenMQTTGateway/edit/development/docs/upload/builds.md" target="_blank" rel="noopener noreferrer">Edit this page</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="last-updated"><span class="prefix">Last Updated:</span> <span class="time">12/12/2023, 8:03:11 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/dev/upload/binaries.html" class="prev">
(Option 2) Upload ready-to-go binaries
</a></span> <span class="next"><a href="/dev/upload/gitpod.html">
(Option 4) Build from the web
</a>
</span></p></div> </main></div><div class="global-ui"></div></div>
<script src="/dev/assets/js/app.37616211.js" defer></script><script src="/dev/assets/js/2.fdf4d158.js" defer></script><script src="/dev/assets/js/44.24c08f06.js" defer></script>
</body>
</html>