Skip to content

Xorlent/PoESP32-SNMP-Environmental-Monitor

Repository files navigation

The $32 SNMP Environmental Monitor

PoESP32 Animated Image

Background

With Vertiv unceremoniously stop-shipping and then discontinuing the Geist Watchdog 15 during our deployment, we had to scramble to find a suitable equivalent device. We were shocked to find a lack of decent options for small form-factor, PoE-powered devices that were not astronomically priced. With M5Stack's PoE-powered ESP32 device in hand, we developed a network SNMP environmental monitor with a total all-in cost of less than 20% of competing products.

Requirements

  1. M5Stack PoESP32 device, or a newer Unit-PoE-P4, both around $25 USD
    • Notes on the Unit-PoE-P4:
      • Requires NO disassembly or downloader kit, just a USB C cable for programming
      • Device will not mount to any of the provided 3D-printable models. I may produce revised designs for this if there is interest.
  2. M5Stack ENV IV sensor unit, currently $5.95 USD
    • This accessory appears to be EOL. A possible plug-in replacement can be found here for about $9 USD
      • This replacement sensor requires adapting connectors and will not mount to any of the provided 3D-printable models. I may produce revised designs for this if there is interest.
      • If using a SHT41 or SHT45 module versus the ENV IV's SHT40, it is recommended to change the equalibrium threshold as follows:
      • #define DEFAULT_DT_THRESHOLD 0.024
  3. A single M5Stack ESP32 Downloader kit (not required for Unit-PoE-P4), currently $9.95 USD

Cost Analysis

One-time cost for a USB-to-serial device (PoESP32 only): $9.95 plus tax and shipping
Total cost per unit: $31.85 plus tax and shipping
Programming time per unit: < 10 minutes

Device Cost Comparison (temperature/humidity only)

  • $32: this PoESP32-based device
  • $220 before stop-ship: Vertiv Watchdog 15P (discontinued)
  • $190 on sale: AKCP sensorProbe1+ Pro
  • $315: NTI E-MICRO-TRHP
  • $199: MONNIT PoE-X Temperature
  • $295: Room Alert 3S

Device Capability Comparison

This project produces a SNMPv1/2c temperature and humidity monitoring device with flashed configuration settings and no remote management capability. Some would see this as a positive from a security-perspective, but it could prove challenging in network environments where change is constant. A re-flash/re-programming is required to modify any configuration options:

  • Host name
  • Device IP and subnet
  • IP gateway
  • SNMP read community string
  • Authorized SNMP monitoring node IP address list

Bottom line: If you need SNMPv3 or desire web management and/or SNMP write functionality, you could enhance this project's code or simply purchase a commercial product.

Programming

Once you've successfully programmed a single unit, skip step 1. Repeating this process takes less than 5 minutes from start to finish.

  1. Set up your Arduino programming environment
  2. Disassemble the PoESP32 case (skip if using Unit-PoE-P4)
    • You will need a 1.5mm (M2) allen wrench to remove a single screw pic
    • Inserting a small flat head screwdriver into the slots flanking the Ethernet jack pic, carefully separate the case halves; work it side by side to avoid damage pic

Tip

If you have fingernails, it can be quicker to slide a nail between the case halves, starting with the end opposite the Ethernet port and using another nail to pull the retaining tabs back

  1. In Arduino, open the project file (PoESP32-SNMP-Environmental-Monitor.ino)
    • Edit the hostname, IP address, subnet, gateway, SNMP read community, and authorized hosts lists at the very top of the file.
    • Select Tools->Board->esp32 and select "ESP32 Dev Module" if using PoESP32
    • OR select Tools->Board->esp32 and select "ESP32P4 Dev Module" if using Unit-PoE-P4
  2. With the USB-to-serial adapter unplugged, insert the pins in the correct orientation on the back of the PoESP32 mainboard pic (skip if using Unit-PoE-P4)

Warning

Do not plug the device into a powered Ethernet port until after step 7 or you risk damaging your USB port!

  1. With light tension applied to ensure good connectivity to the programming through-hole vias on the PoESP32 (see step 4 pic), plug in the USB-to-serial adapter
    • The device is now in bootloader mode
    • For the Unit-PoE-P4, simply plug the USB cable into the USB port above the Ethernet jack
  2. In Arduino
    • Select Tools->Port and select the USB-to-serial interface
      • If you're unsure, unplug the USB cable, look at the port list, then plug it back in and select the new entry (repeating step 5)
    • Select Sketch->Upload to flash the device
    • When you see something similar to the following, proceed to step 7
      Writing at 0x000d0502... (100 %)
      Wrote 790896 bytes (509986 compressed) at 0x00010000 in 8.9 seconds (effective 714.8 kbit/s)...
      Hash of data verified.
      
      Leaving...
      Hard resetting via RTS pin...
      
  3. Disconnect the USB cable and reassemble the case if applicable
  4. Plug in the sensor accessory pic
  5. Connect the device to a PoE network port and mount as appropriate
    • The holes in the PoESP32 and ENV IV sensor cases work great with zip ties for rack install or screws if attaching to a backboard
    • Do not mount the ENV IV directly on top of the PoESP32, as it generates enough heat to affect sensor readings
  6. Configure your monitoring platform as appropriate
    • A list of valid OIDs this sensor will respond to can be found here
    • Paessler (PRTG) produce a great freely-downloadable SNMP tester for Windows, available here
    • If you have PRTG, pre-configured device templates are available for this project at https://github.com/Xorlent/PRTG-OIDLIBS
    • Don't have a monitoring platform? PRTG Freeware would support monitoring and alerting for up to 20 of these devices

Guidance and Limitations

  • For monitoring, configure one OID per sensor. This custom SNMP parser will only respond to one OID per request.
  • If you receive a "General Failure" when requesting a valid measurement OID, this means the device is having trouble communicating with the temperature/humidity sensor.
  • If you request an invalid OID, expect no response. The device will not process packets for requests that are not authorized or not a match for a valid OID.
  • For high humidity environments, this device will activate an internal sensor heater under certain conditions to ensure more accurate readings.
  • The device will respond to pings from any IP address within the routable network.
  • Don't have PoE ports on your network switch? No problem: https://www.amazon.com/gp/product/B0C239DGJF
  • Need a simple solution for mounting the PoESP32 and environmental monitor as a unitized assembly? Within the /3Dmodels folder you will find:
    1. PoESP32-Environmental-1RU-Base.step : 3D print model to mount the PoESP32 assembly into a 1U rack space (w/optional wire cover and LED lightguides)
    2. PoESP32-Environmental-Mini.step : 3D print model for zip tie mounting (space constrained)
    3. PoESP32-Environmental-Mini-Magnet.step : 3D print model for magnet mounting (space constrained, compatible with 8mm x 2mm disc magnets)
    4. PoESP32-Environmental-Mid.step : 3D print model for zip tie mounting
    5. PoESP32-Environmental-Mid-Magnet.step : 3D print model for magnet mounting (compatible with 8mm x 2mm disc magnets)
    6. If you want to modify the models and make your own custom design:

Technical Information

  • Operating Specifications
    • Operating temperature: 0°F (-17.7°C) to 140°F (60°C)
    • Operating humidity: 5% to 90% (RH), non-condensing
  • Sensor Accuracy
    • ±0.2 °C,±1.8 %RH
  • Power Consumption
    • 6W maximum via 802.3af Power-over-Ethernet
  • Ethernet
    • IP101G PHY
    • 10/100 Mbit twisted pair copper
    • IEEE 802.3af Power-over-Ethernet
  • I/O Configuration
    • SHT40 temperature and humidity sensor
    • See PORTINFO.md