DPIclimate / enviro-node

Agriculture node for SDI-12 (and other) sensors.
https://DPIclimate.github.io/enviro-node
MIT License
4 stars 0 forks source link

Enabling the SDI-12 power line while the modem is on seems to make the modem lose state #28

Open dajtxx opened 1 year ago

dajtxx commented 1 year ago

The current firmware that seems to work fine on the older boards switches the modem on, connects to the network, gets the time, and then brings up the packet switched layer.

Next it enables the SDI-12 power, scans the SDI-12 bus, and reads any sensors found and disables the SDI-12 power.

Finally it uses the modem's MQTT stack to send the message.

The modem seems to lose some state on the new boards with this sequence. The network connection LED goes out temporarily when the SDI-12 power is enabled, and then the MQTT login command fails after the sensors are read.

As a test the firmware was changed to enable the SDI-12 power line at boot and then leave it on the entire time, and no sensors were scanned or read. The modem could then do the MQTT uplinks.

The next test will be to scan and read the sensors and see if it still works.

dajtxx commented 1 year ago

This did not happen on one of the new boards, but was consistent on another.

After changing the code so the SDI-12 power was switched on at boot and left on until shutdown, the sensors could be read and MQTT still worked.

Not closing this issue yet - will test more new boards.

dajtxx commented 1 year ago

A new switch IC was added in front of the 12v step-up converter. The data sheet for this says switching it on can cause an inrush current to charge the output capacitor and this may lead to a drop on the input voltage. This input voltage is coming from the VBAT bus, which also powers the modem.

So it could be this new switch is causing the trouble for the modem, because this inrush and voltage drop would not happen on the old board that doesn't have the switch.

We also believe the output capacitors for these two switch ICs are specified incorrectly as 100uF rather than 100nF.