diff --git a/build-doc/Makefile b/build-doc/Makefile index e1279c1..8408360 100644 --- a/build-doc/Makefile +++ b/build-doc/Makefile @@ -1,9 +1,9 @@ html: pandoc -s weather_station.md --toc --toc-depth=1 -c ./css/mvp.css \ - --template template.html -o weather_station.html + --template ./template/template.html -o weather_station.html pdf: - pandoc weather_station.md --toc -o weather_station.pdf --pdf-engine=xelatex + pandoc weather_station.md --toc -o weather_station.pdf --pdf-engine=xelatex -H ./template/custom_settings.tex clean: rm -rvf build diff --git a/build-doc/template/custom_settings.tex b/build-doc/template/custom_settings.tex new file mode 100644 index 0000000..96f9757 --- /dev/null +++ b/build-doc/template/custom_settings.tex @@ -0,0 +1,16 @@ +% Override default figure placement To be within the flow of the text rather +% than on it's own page. +\usepackage{float} +\usepackage{graphicx} +\makeatletter +\def\fps@figure{H} +\makeatother + +% Scale all large images to 50% of twext width +\makeatletter +\setkeys{Gin}{width=\ifdim\Gin@nat@width>\linewidth + 0.5\linewidth +\else + \Gin@nat@width +\fi} +\makeatother diff --git a/build-doc/template.html b/build-doc/template/template.html similarity index 79% rename from build-doc/template.html rename to build-doc/template/template.html index 88e38e4..b99e287 100644 --- a/build-doc/template.html +++ b/build-doc/template/template.html @@ -49,14 +49,31 @@ $endfor$ $if(title)$

$title$

$if(subtitle)$ @@ -68,8 +85,8 @@ $endfor$ $if(date)$

$date$

$endif$ -$if(website)$ -

Back ↗

+$if(pdf_version)$ +

PDF version

$endif$
$endif$ diff --git a/build-doc/weather_station.html b/build-doc/weather_station.html index c261607..e0d715c 100644 --- a/build-doc/weather_station.html +++ b/build-doc/weather_station.html @@ -22,9 +22,9 @@
+
  • + PDF version +
  • +
  • + Git repo +
  • +
  • + Back +
  • + + + Logo +

    Weather station

    with ModBus RTU interface

    M.T. Konstapel

    2024-01-15

    -

    Back ↗

    +

    PDF version

    @@ -579,7 +590,7 @@ import minimalmodbus # port name, slave address (in decimal) instrument = minimalmodbus.Instrument('/dev/ttyUSB1', 14) -# Register number, number of decimals, function code +# register number, number of decimals, function code wind_direction = instrument.read_register(1, 0, 4) print(wind_direction)

    Input registers

    @@ -669,10 +680,33 @@ APRS weather reports. But of course we use SI units.

    Temperature (two’s complement) degrees Celcius * 100 + +30014 +Status bits +see table below +

    NOTE Register 30013 holds the backup temperature reading from the pressure sensor.

    + + + + + + + + + + + + + + + + + +
    Status bitsDescriptionlogic 0logic 1
    0Heater statusheater offheater on

    The ModBus registers are 16 bit wide. For better precision, some units are scaled by a factor of 10 or 100. This way, values with up to two decimal points can be stored as 16 bit integer values. Just divide diff --git a/build-doc/weather_station.md b/build-doc/weather_station.md index 45cfe10..f9a4e14 100644 --- a/build-doc/weather_station.md +++ b/build-doc/weather_station.md @@ -5,7 +5,11 @@ author: M.T. Konstapel date: 2024-01-15 website: https://meezenest.nl/mees/ logo: ./images/mees_logo.svg +pdf_version: ./weather_station.pdf +git_repo: https://git.meezenest.nl/ numbersections: true +# Formatting: +geometry: "a4paper, left=2.0cm, right=2.0cm, top=1.9cm, bottom=2.54cm" abstract: > A weather station build around a SparkFun Weather Meter Kit (SEN-15901). The temperature, humidity and pressure are measured with I2C sensors housed in an RS1 Passive Radiation Shield from Garni. The data can be read via an RS485 ModBus RTU interface. The main processor is an Arduino Pro Mini (ATmega328P 5V@16MHz) --- @@ -286,9 +290,14 @@ The measurements and order of the measurements are the same as for APRS weather | 30011 | Snow fall | NOT IMPLEMENTED | | 30012 | Raw rain counter | NOT IMPLEMENTED | | 30013 | Temperature (two's complement) | degrees Celcius * 100 | +| 30014 | Status bits | see table below | ^NOTE^ Register 30013 holds the backup temperature reading from the pressure sensor. +| Status bits | Description | logic 0 | logic 1 | +|-------------|---------------|------------|-----------| +| 0 | Heater status | heater off | heater on | + The ModBus registers are 16 bit wide. For better precision, some units are scaled by a factor of 10 or 100. This way, values with up to two decimal points can be stored as 16 bit integer values. Just divide by 10 or 100 to get the floating point values. # Schematic diff --git a/build-doc/weather_station.pdf b/build-doc/weather_station.pdf index 73f7cb5..f59425d 100644 Binary files a/build-doc/weather_station.pdf and b/build-doc/weather_station.pdf differ