💬 Temperature Sensor
-
I am getting the error:
DallasTemperatureSensor.ino: In function 'void loop()': DallasTemperatureSensor:93: error: 'getConfig' was not declared in this scope float temperature = static_cast<float>(static_cast<int>((getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;Does anyone have any suggestions?
-
@mfalkvidd That worked. Thanks.
-
Hello,
I'm a beginner in home automation and I'm trying MySensor for the first time. My acctual configaration is a Domoticz on a Raspberry Pi 2B and a RFLink GW with a NRF24L01 module to try to measure with a MySensor probe.
I've building a temperature sensor with a DS18B20 sensor on a Official Arduino nano board and I can not run the sensor correctly.
The arduino serial monitor show these:0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
3 TSM:INIT
4 TSF:WUR:MS=0
11 TSM:INIT:TSP OK
12 TSM:FPAR
15 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
2022 !TSM:FPAR:NO REPLY
2024 TSM:FPAR
2026 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
4034 !TSM:FPAR:NO REPLY
4036 TSM:FPAR
4038 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
6046 !TSM:FPAR:NO REPLY
6048 TSM:FPAR
6050 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
8058 !TSM:FPAR:FAIL
8059 TSM:FAIL:CNT=1
8061 TSM:FAIL:PDTSomeone could help me?
-
Where should I put it? In arduino sensor code?
-
Ok , with Node ID, I have this:
0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
3 MCO:BGN:BFR
63 TSM:INIT
64 TSF:WUR:MS=0
71 TSM:INIT:TSP OK
73 TSM:INIT:STATID=2
75 TSF:SID:OK,ID=2
76 TSM:FPAR
113 TSF:MSG:SEND,2-2-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
2120 !TSM:FPAR:NO REPLY
2122 TSM:FPAR
2158 TSF:MSG:SEND,2-2-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
4166 !TSM:FPAR:NO REPLY
4168 TSM:FPAR
4204 TSF:MSG:SEND,2-2-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
6212 !TSM:FPAR:NO REPLY
6214 TSM:FPAR
6250 TSF:MSG:SEND,2-2-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
8258 !TSM:FPAR:FAIL
8259 TSM:FAIL:CNT=1 -
ok, but we are going off topic since now your problem seems to be the radios can't talk to each other, so if you take a look in troubleshooting section you will see others having this error that usually if bad wiring, missing capacitor on vcc of the nrf24, range/interference problem. How far are the 2 radio modules? Try putting them 2-3 meters apart.
-
Thanks, my radio modules are very close, they are on the same table for test. On of them may be damaged, I must receive others. I'm going in the troubleshooting section to avoid polluting this article.
Thanks for your help -
It's the same, I've even reversed the radio modules
-
I use USB pretty much all the time and never had any issue. I had many problems in the beginning with radio modules that had the black blob instead of the ic and once I got the new ones everything started to work. I'm still working on increasing the range, probably because they are clones and not good quality.
-
I use USB pretty much all the time and never had any issue. I had many problems in the beginning with radio modules that had the black blob instead of the ic and once I got the new ones everything started to work. I'm still working on increasing the range, probably because they are clones and not good quality.
-
Is it also possible to upload the example code to a Arduino Nano, and connect it via USB to a Windows PC with Domoticz?
Or will it only work with the radio modules (and extra gateway?)
-
Thank you for posting this project!
Could like to suggest a small change to the sketch. There are several posts out there about this not running with the latest DallasTemperature library. The call to sensors.millisToWaitForConversion won't compile because the method is not public. From another post I learned that this method is very simple and could be included in the sketch. I would suggest changing the line
int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
to read
int16_t conversionTime = millisToWaitForConversion(sensors.getResolution());
and add this function to the sketch:
int16_t millisToWaitForConversion(uint8_t bitResolution)
{
switch (bitResolution)
{
case 9:
return 94;
case 10:
return 188;
case 11:
return 375;
default:
return 750;
}
}In any case, this might help the next person using this project.
-
I had some problems with Domoticz triggering an event based on a certain temperature. When using multiple DS18B20 it is a good idea to use the ID of the sensors to always get the same order of sensors. If one is not read, for example B of A, B, C then C becomes B. See: https://forum.mysensors.org/topic/4143/about-ds18b20-onewire for more info. You maybe need to adjust the sketch a bit for your number of sensors.
-
could you explain how to solve this ?
I'm no pro, and wanted to use 1 single DS1820 in a sketch and also got same message about :
int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());Mysensors is hard hard nut to learn, specially because of a lot of changes in the newer version 2.1.0 ...(and im still learning to work with arduino software , i keep running often against old sketches i like to try as sample to use them in other sketches , (my way of learning) but than they dont work with latest version. because something changed.
but i love the mysensors functions.p.s sorry for my bad english....
-
could you explain how to solve this ?
I'm no pro, and wanted to use 1 single DS1820 in a sketch and also got same message about :
int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());Mysensors is hard hard nut to learn, specially because of a lot of changes in the newer version 2.1.0 ...(and im still learning to work with arduino software , i keep running often against old sketches i like to try as sample to use them in other sketches , (my way of learning) but than they dont work with latest version. because something changed.
but i love the mysensors functions.p.s sorry for my bad english....
@Rene046 The solution is here:https://forum.mysensors.org/topic/4828/temperature-sensor/46