:: 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???)
(Sorry Lars - - - sent response to the list rather than private - - - hope
that's ok!)

On Thu, Mar 21, 2024 at 12:09 PM Lars Noodén <lars.nooden@???> wrote:

> Hello,
>
> > Primary consideration is privacy and security, thinking of using a wired
> > rather than wireless system as a result.
>
> MQTT with TLS is harder on IoT devices but easy on the RPi.
>


Have looked into that a bit.

>
> > 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.
>
> Here are some random thoughts based on using some of these in practice
> and doing a lot of reading over recent years. Sorry for the length, and
> please take with a grain of salt:
>
> I prefer Perl, but the Raspberry Pi community has thrown its weight
> behind Python and similar for Arduino. So I'd give strong consideration
> to Python since there is so much support, including sample code and
> examples. Arduino has a C++ like language for efficiency but also
> MicroPython for ease of use at the expense of RAM and maybe battery.
>
> For networking, I find that there is a lot of interference with the
> 2.4GHz band, enough to impair reliable sensor reports. However, most of
> the low-end devices don't support the 5GHz band which does not work so
> well through either vegetation (seasonal) or through walls, floors,
> doors, glass, etc. anyway. So I would recommend wired, but sealed
> somehow if you can arrange it. That would allow Power-over-Ethernet,
> with the right add-ons. There are add-ons for Ethernet for the various
> Arduino models and most Raspberry Pis have it built in but need an
> adapter. If stuff is rather far away then LoRa /might/ be a choice.
>


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.

>
> > So there are a large number of temperature sensors, (even like different
> > zones in my greenhouse), there are different humidity sensors (including
> in
> > livestock (confined) systems), then there are the fertility sensors,
> light
> > level and intensity sensors. The idea is to track the information from
> all
> > the sensors (haven't decided on the frequency at this point tossing
> between
> > every 1 or 10 minutes) so all this is logged.
>
> The frequency is not a burden unless LoRa is considered.
>
> Are these existing sensors in place already? If so, do they support any
> good protocols like I²C, 1-Wire, or others? Both protocols are super
> easy to work with using Arduino or Raspberry Pi.
>


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!

>
> Otherwise, if you need sensors then getting authentic DS18B20 sensors is
> difficult, even from reputable sellers, but they can be wired up many
> tens of meters reliably. The pull-up resistor's value might need to be
> tweaked though. Star topology is supposedly unreliable but others work.
> They have an accuracy of ± 0.5 C but some thermistors can do ± 0.1 C
> with more complicated (IMO) wiring.
>


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!).)

>
> You can use MicroPython on an Arduino or their own C++ looking language
> to send data. I use MQTT to get the data from the remote systems and
> Mosquitto to redistribute it to a SQLite3-based script which listens
> using MQTT. Another, similar script, does some statistics from the
> database and then makes some diagrams and writes a web page. You can
> use GNUplot or choose from several graphing libraries for Python. I've
> chosen the former as my setup grew organically but if I were starting
> over I would choose the latter.
>
> For the fan, if it uses normal voltage and not excessive current, and if
> you are in the EU, then I can recommend this one, which I use for lights:
>
> https://www.olimex.com/Products/Duino/Shields/PWR-SWITCH/



These are actually 0-10V EC motor fans so I'm thinking of using :
https://www.amazon.ca/dp/B07HQB7SQM/ (I truncated the url hopefully still
works!).

>
>
> For the humidity sensors, I²C is really convenient, especially with
> Qwiic connectors but that means the sensor will need to be no further
> than some centimeters from the Raspberry Pi or Arduino system which it
> feeds.
>
> 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.

>
> 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!!!

Thanking you for your assistance and ideas!