Wifi Air Quality Sensor

The html file is just an edited Val from Micro host from the example zip file. I still have to figure out how to pass several variables to the webpage, and formatting. I'm not sure the delays for heating and cooling are correct.


  • CapdiamontCapdiamont Posts: 187
    edited 2019-12-15 - 18:12:59
    Experimenting around here, I tried using two different WX print to send two variables to the webpage. Only one showed up. I went back to one WX Print block to send many variables. Problem is they end up as one variable in the webpage. I tried separating them by linefeed or carriage return. That still doesn't separate the variables. So figuring I have to use JavaScript to parse the variables out. Val from Micro host from the example zip file does work to view all the sensor's values.

    Edit: I think most of these numbers are floats, with altitude being an integrator.
  • I figured out how to split the variable in JavaScript, use newVar = variable.split(","); to split a variable when it sees a comma. newVar will be an array. I got it working with temperature and humidity. The I added in the rest of the variables, to break things so it is not working, even when using val-from-micro.html. I'm not sure what went wrong.
  • Timing. I placed the read sensor blocks in the main part of the main loop and set the webpage to auto update every ten seconds instead of three seconds. Formatting, and things like estimated altitude is not right yet. At least I have something readable and working now.
  • cool.

    Yes, the auto update should be used carefully.

    I am just another Code Monkey.
    A determined coder can write COBOL programs in any language. -- Author unknown.
    Press any key to continue, any other key to quit

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
  • Seems most of the readings were good, just needed to read the right measurements. Pressure reading inHg instead of mmHg. Oddly I was reading Altitude in meters times ten, gave me a truer reading for feet than reading feet times one. I'm not sure what the reading for Gas in Ohms should be to know if that is correct or not.

    My eventual plan is to enclose this sensor with a WX activity board and place it outside as the beginning of a weather station. I know the WX board and wifi won't go down below 32F however I can heat them. Then use a desktop computer to record and post to weather underground. I'm not sure if I should or can pull the info off the webpage I already made or use the websock method. More research and experimenting.
  • I found a quirk, if the board loses power, values do not show up on the webpage. I did a quick program to flash the built in LEDs on the WX board, and that program operates normally with a power outage, with or without the Wifi module installed. I have tried adding pauses before the main program. I tried a wx disconnect, and a pause before the wx connect. I have waited minutes. In order to get values to show on the webpage I have to re-download the code to the prop.

    Otherwise it works great, though the estimated altitude varies wildly.
Sign In or Register to comment.