-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prebuild images with DS18b20 and DHT22 support? #1350
Comments
If I understand correctly, you are looking to have BLE gateway + DHT22 + ds18b20 on ESP32 ? |
yes. correct. but i have to find a mean for the temp and had a ds1820 (waterproof, long cable) and dht22 lying around. maybe the sensors disabled by default in the prebuild binaries? OpenMQTTGateway/main/User_config.h Line 320 in 47108d8
|
Do you think you could install platformio and upload a build ? |
as a last resort i prepared myself to do my own build. are your prebuild binaries without sensors? tasmata has a binary with all sensor for the webinstaller. i can build a binary with arduino, or visual studio/plattform-io. |
If you need a combination of sensors/gateway you need indeed to build yourself, only the most common builds are proposed out of the box
We are taking a different approach with OMG, make available only what is necessary in the code, this is why there is binaries dedicated to one board or another. The goal is to leverage the full capabilities of the board without extra code that the board will never use and that could cause instability. [env:esp32dev-ble-dht-ds]
platform = ${com.esp32_platform}
board = esp32dev
board_build.partitions = min_spiffs.csv
lib_deps =
${com-esp.lib_deps}
${libraries.ble}
${libraries.wifimanager32}
${libraries.dht}
${libraries.unifiedsensor}
${libraries.decoder}
build_flags =
${com-esp.build_flags}
'-DOMG_VERSION="v1.1.1"'
'-DZgatewayBT="BT"'
'-DZsensorDHT="DHT"'
'-DZsensorDS1820="DS1820"'
'-DTimeBtwRead=100'
'-DMQTT_USER="username"'
'-DMQTT_PASS="password"'
'-DMQTT_SERVER="192.168.1.55"' |
Hi @ozett, Have a look at the default Lolin Lite environment in platformio.ini - There you see the default definition which is also being used for the pre-built binary. You can duplicate this environment definition for further customisation, or add the additional required libraries and build-flags definitions to it directly, as shown by @1technophile's example above, i.e. the
libraries, and the
build-flags. Discovery and MQTT will be activated for all the environments, unless specifically undefined for individual environments or globally. This way you can customise any build environments to suit individual needs, then build and upload them to your board, without having to uncomment/set the definitions in the individual config files, then having to comment/unset them again for other board builds. Maybe you can show us your final environment definition. |
thanks for quick reply. my direct changes seems enough (as a dirty hack ) to get this two sensors into the build? i have still hopes that someone provide also "all-sensor"-binaries , like tasmota, thanks for quick help, i will try now.. |
I'm not sure, as you only seem to have the Let us know how you get on. |
did not help, googling throws a lot of this error. |
Yes, creating your own Also have a look at the left side of VSC and select the Platformio icon. There, under Project Tasks you can see all the environments, including your custom environment. Expanding your environment there you will the the BUILD and UPLOAD options. Just two pinters: |
i resetted user_config.h to defaults, that helped with the lib (screenshot below)
i took all you pointed out straight from the developers first aid. i am not that expert to see this little differences at first glance. thanks for all the hints. (will try another one) |
I just created the same environment here, and yes, the
also needs to be included for the DS18b20 for a correct build. |
So in your own custom *_env.ini file you should have your custom environment like this
You can also add the relevant WiFi and MQTT credentials there if you don't want to go through the AP gateway set up, but need to fully define all the relevant required build_flags, for them to fully work and to avoid errors.
Or you leave them all out for going through the set up for WiFi and MQTT broker. Then selecting this environment in the Platformio Project Tasks, you will see where you can select to Build and Upload. |
thanks, its compiling. will add your build-options for wifi and run again... |
The config/pinouts options for the DHT22 are in Since I've never connected any sensors to my gateways, let alone a DS1820, I'm not sure if it might not also need the onewire library, but assuming it does. Could you add to your environment?. Are you getting the DHT22 values correctly in the MQTT messages? |
i think it was installed as dependency, but i can also configure explicity. 🏃 on the same pins the sensors work fine with tasmota is there a way to debug/log anything about the DHT or the DS1820 sensor? |
error with userconfig.h, even if the docs say, that it should work that way? EDIT: some includpath missing or wrong? |
cannot find DHT lib in the platform.io registry. EDIT: What to do? |
The library which is being used for the DHT family is https://github.com/adafruit/DHT-sensor-library with version 1.3.2, as the newer version actually caused issues with the DHT22 sensor not being recognised. https://community.openmqttgateway.com/t/dht22-sensor-not-showing/2045/21 Let's concentrate on the DHT22 sensor first, as I also have this one and it was working fine for me during the above issue testing with the reverted library. The only necessary steps to include it should be the added libraries and build_flags in your environment ${libraries.unifiedsensor} no other changes in any other files. Just to make sure, you are using the latest version of OpenMQTTGateway 1.1.1? Could you copy and past your full environment definition again, commenting out your WiFi and MQTT credetials, to make sure the environment set up is fine? You can also use the Project Task Upload and Monitor to see the serial monitoring in the Platformio terminal to see what is going on . |
if it will ever work, it will be the same difficulty to keep up with development, the part from my custom platform.io.ini
looks by names, that the adafruit lib is likely not build, but the one-wire-lib is. |
Could you comment out this line or delete it and rebuild. As this is only for the BLE connection to define the time between the BLE scanning, I'm wondering if 100 ms are enough to get proper sensor readings. |
i put integrating sensors on hold. |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 7 days since being marked as stale. |
Before submitting a problem please check the troubleshooting section
https://docs.openmqttgateway.com/upload/troubleshoot.html
Describe the bug
i flashed a lolin-lite board with your prebuild binary and the webinstaller
i jumperd a dht22 and a ds18b20 sensor to the default pins
dht22 (GPIO16) ds18b20 (gpio2) (also VCC and GND for both)
and can not find an sign of life from the sensor.
no mqtt topic appeared
To Reproduce
Steps to reproduce the behavior:
Expected behavior
i exptected to find some information about htis sensors on the serial log
i expected to find new mqtt-topics added ../DHTtoMQTT/#
i expected to find new mqtt-topics added ../CLIMAtoMQTT/#
found nothing.
Screenshots
used this pin-numbering
Additional context
hard to debug, the log is somehow short.
how can i debug pin errors?
how to debug the discovery of the sensos
maybe the prebuild images does not supoort this sensors?
i cannot find some information. Maybe they must be activated via MQTT-Topic commands?
at the moment i assume, that they are somehow automatically discovered and activated by the firmware...
or not?
The text was updated successfully, but these errors were encountered: