[SOLVED] Photon Weather Station not uploading to WUnderground


Ok, I’m getting closer. I’m using the Particle webhook builder. It is a very helpful tool, but I still don’t understand the code you offered, @legoguy. I pasted your code into the JSON builder and it shows nicely in the webhook builder tool. However, I still don’t understand how you define all your variables. Could you paste all your code including void setup and declaring all your variables??

For simplicity, my only sensor is a DHT22. I’ll only passing temp and humidity.


@bearloverhr, that helps. Possible that you can point me to how I can better understand to where 6.2f, 7.2f, 5.1f, etc point? I’m having a hard time understanding the terminology as I look through the Particle docs…


It’s if used for defining the how the variable will be displayed or recorded in the String::format.

In this example %6.2f means 6 digits with 2 decimal places that is used for a floating value. So n= 91.2345 would be recorded as ‘91.23’.

If n=1234567.2345 then what is recorded would be ‘234567.23’.

Why I use 6 digits is beyond me because you only need 3 digits for the temp (for normal weatherstation temps you should never be above 999, god help us all).


This way of formatting a string is not documented by Particle since this is a standard C feature which is widely documented already
e.g. http://www.cplusplus.com/reference/cstdio/printf/

Hence the Particle docs “only” provide a link