-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Adding DHT11 or DHT22 sensor support #112
Comments
I agree! I just ordered one of each, when they arrive I will work on support :) |
Adding as a reference |
DHT11 datasheet in english http://www.svet-el.si/download/Datasheet_DHT11.pdf |
Thanks! |
The code required to make this work requires too many process blocking delays https://github.com/adafruit/DHT-sensor-library/blob/master/DHT.cpp#L78-L139 |
Looks like support for this has landed firmata/arduino#44 (comment) so we can probably revisit this now :) |
Did something happen about this? I would need this too, but have no idea if/how i can use ConfigurableFirmata with Johnny-Five and Stepper-support |
@xFragger I haven't looked at this in a very long time, I will try to make some time this week :) |
yeah would be nice... i'm wondering.... johnnyfive checks for Firmata name (==AdvancedFirmata), but this would differ, when i use ConfigurableFirmate, right? Do i have to set the name myself so Advanced to use the steppersupport of five? |
Sorry, but I'm not sure I understand what you're asking. If you need ConfigurableFirmata, then test for that name and throw if it's not present—that part is easy. The hard part is knowing whether or not ConfigurableFirmata was compiled with the right support. Things like this are usually too much work for the average user. I'm not really sure how to approach this, so I'm open to whatever ideas you may have. |
Okay.... again :) |
As a temporary work around, you could if you rename ConfigurableFirmata to AdvancedFirmata. The name of the Firmata doesn't matter. Take ConfigurableFirmata.ino, add the DHT11 code (from the example) by adding the includes... make sure the DHT11 files are in the same directory as your sketch and name that AdvancedFirmata.ino. Also remove (don't include) features you may not be using such as OneWire or you risk running out of RAM if you're using an Arduino Uno, Leonardo or other board with limited SRAM. @rwaldron The stepper code in johnny-five should be updated to not specifically look for a specific firmata name (https://github.com/rwaldron/johnny-five/blob/master/lib/stepper.js#L117). It should instead look for the Stepper pin mode to be set when performing a capability query. Pin modes are used in configurable Firmata as indicators of which features are supported in the particular build. |
So the stepper support in advancedfirmata does work the same way as in configurable? Then i will give it a try... I think i've got enough memory on the nano v3 |
okay, managed to compile the ConfigurableFirmata with Stepper + DHT11 from examples..... but my stepper won't move anymore, with same js code, as for AdvancedFirmata.... How do i call the dht11 device (ext) ?
|
@soundanalogous heh, I actually didn't write that module, but this makes sense. I'll file a bug and maybe the original author can patch it or someone else here? |
@xFragger you need to add this line to setup: |
any update on this? |
my real life eats all the time... could not work on this these days, next for the next weeks..... so i'm out for the moment, sorry |
real life first np! thx |
Hi, I'm trying to add DHT11 measurements to my project. I am using ConfigurableFirmata with the DHT11Feature. Copied Then added these lines to my #include <utility/DHT11Feature.h>
DHT11Feature dht11; in #ifdef DHT11Feature_h
firmataExt.addFeature(dht11);
#endif in #ifdef DHT11Feature_h
// report dht11 values
dht11.report();
#endif Full gist here I have seen that using a custom sysex and setting the pin mode to 0x7e I could poll for DHT measurements, but haven't found a way to do it with Johnny-Five. Any ideas? |
There is currently no special DHT11 device class in Johnny-Five. If anything, there will be a Temperature class that allows for analog or i2c device profiles, but that's work that takes time so contributions would be welcome. |
@davoclavo I won't be home until Wednesday, but when I get home I can take a closer look. |
@davoclavo I was not able to confirm this. |
@rwaldron Great! I will contribute, but I don't yet fully understand the firmata protocol and the project. I am using a very similar sensor module. Because of its custom 1-wire protocol (handled by the dht11.cpp library), I guess we have to set the pinMode to a custom one (0x7E). If you have any idea on how to do this, it would be great! |
Not yet, but will post as much info as I can when I get home and dig in :) Thanks for your patience |
Hi, as far as I understand there is no humidity sensor support yet for arduino, right? |
@anaibol sorry, I haven't had the time to work on this that I had hoped to have. If there is an analog humidity sensor then it's already supported by the generic Sensor class, otherwise no support yet. |
@rwaldron Ok, thanks! Nice to meet you :) |
Noticed that there was some progress on the temperature sensor front, has anyone made any headway with the dht22? |
@derrickpelletier I haven't looked at that device, though I do have one in my pile. Is this a OneWire device? We already have a OneWire temperature device in the |
Could just add "humidity" as a property to all |
@BrianGenisio The product page on adafruit says
@rwaldron I think either having a |
I'd like to avoid classes that produce instances with inconsistent shape. (There may very well be existing classes that are like this, but those are bugs and need to be fixed) |
It looks like the DHT11Firmata extension uses the I think we need to send a PR to firmata.js along with this, to support The var ADDRESS = 0x7E,
var LENGTH = 5;
io.readReserved(ADDRESS, LENGTH, function(data) {
var pin = data[0];
var temp = read16(data[1], data[2]);
var humidity = read16(data[3], data[4]);
}); Or am I off in the weeds, drinking too much Gulden Draak on NYE? This doesn't feel right. What does (P.S. I don't always hack/program near midnight on NYE... sick wife and kids... canceled plans... waiting for midnight... celebrating the new year by myself and hacking. Why not look into reading data from humidity sensors?) |
DHT11Firmata will be getting a command ID soon. ConfigurableFirmata features that wrap 3rd party libraries will be separate repositories. The proof-of-concept is here (temporarily): https://github.com/soundanalogous/DHT11Firmata. I'll be moving this to the firmata organization once I have all of the details figured out. Regarding the command ID I need to determine if devices should get an ID in the existing 0x0F - 0x7F range which will not scale well, or if I designate a single command ID to mean "device" or a range of IDs to classify types of devices (sensor, actuator, radio, etc). The later 2 options will add a second byte ("device" or "device type" followed by "specific-device ID") to the protocol, the former option would not but it's possible at some point to run out of values. |
OK, so it sounds like J5 should wait for Firmata before we support this
|
You may also want to consider this I2C temp + humidity sensor: https://www.adafruit.com/products/1293. The advantage of using an I2C device over something like the DHT11/22 is that the processing is offloaded to the client device. This avoids having to add significant delays to the main loop in the Firmata code running on the Arduino. |
Any updates on this? |
I'm still working out the details for 3rd party contributed libraries. Once that is settled I can add DHT11/22 support to Firmata. |
Commenting for update update? Just got a DHT22 in the mail and then discovered this thread. |
I need to revisit this. I moved on to other tasks before finalizing the addressing scheme for 3rd party Firmata libraries. Additional input on the proposal would help get the process started again: firmata/ConfigurableFirmata#16. |
Cross referencing: firmata/arduino#246 |
Hey all.. +1 for DHT22 support... It's been a while since the last post.. Any updates here? |
There will be no Firmata device support until more people weigh in on and there is a concrete resolution here: firmata/ConfigurableFirmata#16 |
In addition to @soundanalogous's information, johnny-five supports DHT11 via I2C backpack, as shown here: #1068 (comment) |
Looks like we have two solutions with some broader discussions for the future. |
Any update on this yet? |
@DeanMW not yet. |
Hello there, I am going to read from DHT-22 sensor connected to raspberry. AFAIK DHT-22 doesn't have to be connected through I2C. For example this module will do exactly what I want https://github.com/momenso/node-dht-sensor. But I'd like to use DHT with johnny-five. Can you recommend an alternative approach I should choose? Should I create a new analog thermometer and supply my own Thanks for reply |
You're right DHT-22 doesn't have to be connected through I2C, but when using it with Johnny-Five, it does and always will. The reason for this is still the same as it was in 2013:
That module includes compiled add-on code that ultimately appears to do the same thing that Johnny-Five's backpack firmware does. |
Any solution to make DHT11 communicate without IC2 with J5? |
@cesaragusto-dev No (see the comment just before yours). Assuming you are using firmata on an Arduino compatible device, the i2c backpack is the most practical solution. |
It would be great to have DHT11 humidity, temperature sensor support.
The text was updated successfully, but these errors were encountered: