- Thu Jan 21, 2016 11:46 am
#187476
Second, I cannot figure out what commands in your code printed that number you describe as 67993. Was it in the calcWindSpeed() function, or at the end of loop().
There is something odd there too. First you send a packet containing the mensaja string. And after that you assemble it together from various variables. First converting variables temp, hum,val to string with dtostr. And then concatenate them with sprintf. Which will only be sent during the next pass through loop(). Why not prepare the packet first and then send it in the same loop passage. And to compare how the Lora module corrupts your data, make sure you send the string over the serial port to the PC first.
Code: Select all
Are you sure you can read the temperature and humidity that way? Or which library are you using for this? Because the library I've seen requires a pin number as parameter for the class-method read. I want to know what type of variable hum and temp are. In your code you declare them as floats. But what if they are not? What sort of number does the dht11 deliver? dht11.read(hum, temp);//Leemos valor temperatura y humedad
Second, I cannot figure out what commands in your code printed that number you describe as 67993. Was it in the calcWindSpeed() function, or at the end of loop().
There is something odd there too. First you send a packet containing the mensaja string. And after that you assemble it together from various variables. First converting variables temp, hum,val to string with dtostr. And then concatenate them with sprintf. Which will only be sent during the next pass through loop(). Why not prepare the packet first and then send it in the same loop passage. And to compare how the Lora module corrupts your data, make sure you send the string over the serial port to the PC first.