:: Re: [DNG] question on programming (…
Top Page
Delete this message
Reply to this message
Author: o1bigtenor
Date:  
To: Devuan ML
Subject: Re: [DNG] question on programming (maybe OT???)
On Fri, Mar 22, 2024 at 4:02 AM Lars Noodén <lars.nooden@???> wrote:

> On 3/21/24 23:13, o1bigtenor via Dng wrote:
> [snip]
> >>> Its a high number of input sensor 'weather' monitoring system.
> >>
> >> I have a hobby setup for plants with some Raspberry Pis and one MagTag
> >> (ESP32-S2). I had some Arduinos in there for a while too.
> [snip]> Am considering PoE at this point but that might depend upon some
> other
> > factors - - - ie if a number of small SoCs are in close proximity I might
> > drop in a PSU large enough to handle the demand.
> It might be possible to have low end Arduinos positioned near the
> sensors to relay the measurements onward to the central unit.
>
> I'd advise against batteries, because with so many devices, you'll be
> constantly worried about swapping them out, there's also the matter of
> undercharging and overcharging, which is over my head.
>


Agreed - - - batteries would be a royal pita!

>
> Ambient temperatures affect battery capacity a lot I've found and I read
> that recharging can only happen safely in a reasonably limited range.
> So at either end of the growing season, it can take a while to bring the
> battery unit up to room temperature before beginning to recharge it.
> That leaves gaps in measurement but it's not an issue for my use-case.
>


Batteries for outdoor use are hugely problematic in my area - - -
especially
when there are a plentitude of sensors.

>
> During the outdoor growing season I use a custom battery¹ with the
> MagTag because I can't stretch a wire across (or under) the driveway to
> the greenhouse. The MagTag has a built-in e-paper display to show the
> latest readings on-site, and it has buttons to trigger a wake-and-read
> event. It sometimes disconnects from the 2.5GHz wi-fi and needs a
> manual reset to connect. The more distant RPi has a similar problem but
> usually manages to reconnect to the WLAN either sooner or later.
>
> [snip]
> > I2C is in my opinion problematic - - - maximum distance to sensor is some
> > 30 cm without some fancy fiddling (AFAICT) and if that temperature is
> > say -35C well - - - I've got a problem, if I have condensing RH I would
> > also have a problem - - - so I've been trying to find another protocol -
> - -
> > that's NOT so easy!
>
> I read that most 'industrial' boards and sensors tolerate -40 C.. The
> condensation is a problem though. I use water tight food boxes with
> silicone over the cable holes.
>


Hmmmmmm - - - gather you haven't priced those (scary levels!!!).
Exactly the idea I was thinking of using for boxes - - - relatively
available
and quite usable.

>
> I've got one or more of the following in the WLAN:
>
> aht20 - humidity
> bmp280 - air pressure
> ens160 - TVOC and eCO2
> sht31f - humidity and temperature
> vem7700 - illumination
> DS18B20 - temperature (1-wire)
>
> Except as noted, they are I²C. Aside from the 2.4GHz interference, the
> I²C sensors themselves seem to drop off every once in a while and I'm
> not sure of a proper way to get their Python scripts to notice.
>


This difficulty in the I2C world is why I would rather not use it!

>
> [snip]> Would you tell me about this more complicated wiring?
> > (Another project where it would be nice to be able to use a PID control
> and
> > be able to read 'accurately' and repeatedly to +/- 0.1C (process
> > requirement!).)
>
> My initial setup was originally just a single Raspberry Pi-only with one
> DS18B20 and more boards and sensors have been added over time. The
> Raspberry Pis have no analog-to-digital converters needed by the
> thermistors. So I avoided the thermistors for that reason. It was also
> less clear which one to get. I might switch but have not read up
> recently on which ones are good and how to integrate them. I now have
> an analog-to-digital HAT on one RPi but have not gotten around to
> deploying it.
>


Ran into an interesting board HX711 - - - often used for load cells.
Its 24 bit and one can get them quite reasonably.

>
> A higher priority for me is figuring out TLS for MQTT on ESP32. That
> was easy a few years ago and then an 'upgrade' made it, from my
> perspective and lack of skill, impossible. The push seems be to use
> paid certificates and that requires that the device be exposed to the
> Internet, neither of which is desirable. However, I think I now
> understand the idea of how to restore self-signed certificates.
>


Found a LAN8720 break out board that I'm thinking of using which gives me
access to ethernet and I'm hoping that MQTT using 'Mosquito' will not prove
overly problematic!

>
> With the authentic DS18B20s you get ± 0.5 C, which is actually too big a
> range as it is, but with the knockoffs you get ± 2 C which is way too
> wide to be of much use. There are also hardware features missing from
> the knockoffs.
>


Smile - - - for T sensors +/- 0.5C is actually pretty good.
If you get into tolerancing and repeatability you will find that +/- 1 unit
of
measurement is actually quite good. We have gotten quite used to using
a plethora of decimal places, say something like 0.9375" (which number
implies measurement capabilities into the 0.0001" range) instead of 15/16"
which is a more apt measurement. (Measurements even into the 0.001"
range are affected by temperature!!!!!!)

>
> Calibration might also be important since the individual DS18B20 probes
> seem to be off by a small, fixed amount.
>


Then there is on time drift and and and . . .    .


>
> [snip]
> >> Weather-proofing the devices and the sensors is an issue.
> >>
> >
> > Which is why I need to be able to run cables some distance from the
> sensors
> > to the SoC. That distance may be up to 10 m.
>
> Hmm. Low-end Arduinos could be placed next to the sensors and 5GHz
> wi-fi would work over that distance but getting power to the units would
> still be a problem.
>


Not all lower end ucontrollers can handle the more extreme conditions
which is why I'm hoping to NOT use the I2C bus much!!!

>
> >> Time synchronization is another matter. On the fancier systems like
> >> Raspberry Pi, which are general purpose computers, you can use NTP or
> >> NTPsec plus some scripting to coordinate the messages down to the
> >> fraction of a second. The ESP32 and other IoT systems can't AFAIK do
> >> that and will therefore have a lot of drift through the day.
> >>
> >> Wondering if I can do something here from the logging side of things
> > - - - - thanks for the heads up!!!
>
> The RTC itself on the microcontrollers does not drift much, but there is
> a delay caused by reading the sensors, and that is where the drift comes
> in at least at my low skill level. My work-around for the drift is to
> send the UNIX epoch along with the sensor readings so at least I know
> when the reading was taken even if it wasn't quite 10 minutes from the
> last one. The wait period is exact, but it is added to the variable
> delay caused by reading the sensor. That might come down to my lack of
> skill with C++ on the microcontrollers but on a RPi full Python makes
> that trivial to script.
>
> As mentioned, my readings all go into SQLite. If you were thinking of
> PostgreSQL, I would encourage at least looking at SQLite. I found it
> much easier to work with in this case than the usual go-to db.
>


I think SQLite will become problematic due to the load far too quickly.
Well - - - I spoke too hastily - - - have heard in the past that SQLite was
far more limited than it appears to be at present. Am still thinking of
sticking with Postgresql because there are lots of others doing 'big data'
(even if that definition is changing almost daily!!!)

>
> > Thanking you for your assistance and ideas!
>
> No problem. Again, sorry for the length.
>


Prefer length to nothing - - - lol!!

>
> FWIW The Raspberry Pi forum is not so helpful most of the time, not as
> busy as one would think, and its moderators are overly enthusiastic with
> the ban hammer. However, the Arduino forum is often quite good but very
> low traffic and it may take a while to get an answer.
>


Am finding that as one moves from very careful low functional hobby uses
to serious real world stuff that most of the forums get very very silent.
I asked my question(s) here because I have found that there are members
that have AND are poking into all kinds of interesting nooks and crannies
of life on board!

Thanks for the time and the ideas!!!


>
> /Lars
>
> ¹ I went to a newly opened battery shop to browse and tried to brush off
> one of the pestering staff with an 'impossible' request rather than a
> 'no, just looking'. He was fresh out of school and took it as an
> opportunity to show off and proceeded to build the battery system on the
> spot. Took about 90 minutes. Works like a charm though.
>