Shop Learn
Wifi Air Quality Sensor — Parallax Forums

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: 212
    edited 2019-12-15 18:12
    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.

  • 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.
  • CapdiamontCapdiamont Posts: 212
    edited 2020-01-18 22:43
    I added in terminal print statements, to try to figure things out. After downloading the code to the prop, all code works perfectly. After a power outage, the values do not show up in the webpage and nothing gets printed to the terminal.
  • I put the wx board in forced mode to wx connection(sel to 3.3+) and that solved things so the values to webpage after a power outage. That did not allow the terminal print to continue after power outage.
  • Aha! I think you've found an issue.... Could you try hooking the WiFi module DI/DO to another pair of Propeller pins, instead of P30/31 ?

    Just change the wx_connect statement (or block) to use the new IO pins.
    P8/9 are commonly used for this purpose, in other learn examples. Any IO pair will do.

    Reason being, that when you hook SEL to 3.3V, then the terminal debug output also gets routed via the WiFi module, instead of via USB.

    Whereas, if you move WiFi to some other pins, you can keep SEL unconnected (or grounded), and the debug data will continue out of the USB port. .. And you should also continue to get the sensor data routed to the wifi module (and thus your webpage).

    (OK- I'm assuming here that you are programming the device by USB, and thus waiting for terminal debug data over USB. If you are only using the WiFi connection for programming and debugging, with nothing plugged into the USB port, then need to think about this again...).
  • I'm trying to send everything via the wifi module, which it works excellent(programming, terminal, and webpage,) until i have a power outage. I have the webpage working after the power outage, just not terminal.
  • I think that would make sense, in that the WiFi connection would disconnect (TCP session would close) at the Blockly client / terminal, and that session probably can't re-connect itself just by the WX device being present again.

    Probably the server (aka blockly instance hosted on your computer) needs to re-open the connection, which it does do when you re-upload the code.

    The best person at Parallax to advise on this would be @"Jeff Martin"
    He'll be available from Tuesday I think, and would know if any workarounds or updates are in development that might help.
    I'll share him your other support email thread, and ask his help.
  • 20.7F out right now. The PVC is painted white to protect it. Not sure I like the design, but it is my own design, to be double walled to prevent heat buildup. WX and WiFi module is in cooler to hopefully keep them warm enough. Cable for sensor is cat5 with servo cables cut, soldered on, and heat shrink put on. Ok it is not outdoor cable. Will be adding more **** time goes on. I do want to add heating for the WX and WiFi boards. They are rated to +32F.
  • I had to add a seed heater mat inside the cooler to keep it warm enough. The values stopped sending to the webpage, however I could see the webpage.
Sign In or Register to comment.