You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/Plugin/P180.rst
+136Lines changed: 136 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,17 @@ This enables the implementation of yet unsupported I2C devices or use I2C device
30
30
31
31
.. warning:: This plugin is in the 'pro' category of plugins (i.o.w. not really *Easy* to use), and requires in-depth studying of the datasheet for the device, extracting the required commands and calculation(s) for implementing correct usage. (Some examples available below)
@@ -472,12 +493,127 @@ This command sequence is nearly the same as with the Continuous measurement, exc
472
493
473
494
|
474
495
496
+
.. _tf-luna-lidar-distance-sensor:
497
+
498
+
TF-Luna Lidar distance sensor
499
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
500
+
501
+
The somewhat popular laser-distance sensor, with a range of 0.2 to 8 meter, TF-Luna, can be configured to use I2C as the communication protocol, instead of the default RS232 serial protocol, by connecting pin 5 of the sensor to GND on startup.
502
+
503
+
The command sequence is based on documentation from this `WaveShare page <https://www.waveshare.com/wiki/TF-Luna_LiDAR_Range_Sensor>`_
504
+
505
+
.. note:: The checksum available from the sensor measurements is ignored!
506
+
507
+
When only retrieving the ``distance`` from the sensor
The plugin should be configured with these settings:
511
+
512
+
* **I2C Address (Hex)**: ``0x10``
513
+
514
+
* **Output Data Type**: ``Single``
515
+
516
+
* **Interval**: can be set to 1 second to retrieve a measurement every second.
517
+
518
+
* **Values**: the name can be changed to Distance, and the number of decimals 0. Stats can be enabled, as desired. The Unit of Measure should he set to ``cm``, and the Value Type to ``Distance``
519
+
520
+
* **Cache-Name 1 (optional)**: Fill with a useable name, f.e. ``distance``, so the I2C Command sequence is cached for much improved execution-performance.
The plugin should be configured with these settings:
538
+
539
+
* **I2C Address (Hex)**: ``0x10``
540
+
541
+
* **Output Data Type**: ``Dual``
542
+
543
+
* **Interval**: can be set to 1 second to retrieve a measurement every second.
544
+
545
+
* **Values**: the first name can be changed to ``Distance``, and the number of decimals 0. Stats can be enabled, as desired. The Unit of Measure should he set to ``cm``, and the Value Type to ``Distance``, the second name can be changed to f.e. ``SignalStrength``, and number of decimals to 0. Stats can be enabled, as desired. No further settings for this value, as it has an undefined unit and value type.
546
+
547
+
* **Cache-Name 1 (optional)**: Fill with a useable name, f.e. ``distance``, so the I2C Command sequence is cached for much improved execution-performance.
NB: The fields for **Cache-Name 2** and **I2C Commands 2** are left empty, the entire command sequence is combined into the first command sequence, as the complete data set is read and the separate values calculated and assigned in a single command sequence. This makes processing more efficient.
554
+
555
+
Command sequence explanation:
556
+
557
+
* ``put.u8.0`` : Announce data fetch
558
+
* ``delay.5`` : Give the sensor a few msec to prepare
559
+
* ``get.b.7`` : Read 7 bytes (entire available buffer)
560
+
* ``eval`` : Make data available for processing
561
+
* ``calc.0x{substring:4:6:%h%}*256+0x{substring:2:4:%h%}`` : Fetch byte 1 (* 256) + byte 0 to calculate distance in cm
562
+
* ``value.1`` : current value, Distance, set to Values 1 field
563
+
* ``calc.0x{substring:8:10:%h%}*256+0x{substring:6:8:%h%}`` : Fetch byte 3 (* 256) + byte 2 to calculate signal strength (unknown unit)
564
+
* ``value.2`` : current value, Signal strength, set to Values 2 field
565
+
566
+
|
567
+
568
+
.. _qmc6310-3-axis-magnetic-sensor:
569
+
570
+
QMC6310 3-axis magnetic sensor
571
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
572
+
573
+
This sensor provides a 3-axis directional signal, as documented in the QST Corp `QMC6310 Datasheet <https://www.qstcorp.com/upload/pdf/202202/%EF%BC%88%E5%B7%B2%E4%BC%A0%EF%BC%8913-52-17%20QMC6310%20Datasheet%20Rev.C(1).pdf>`_ (url includes some Chinese characters).
574
+
575
+
The plugin should be configured with these settings:
576
+
577
+
* **I2C Address (Hex)**: ``0x1C``
578
+
579
+
* **Output Data Type**: ``Triple`` To activate this setting, the page must be submitted to show the extra input fields.
580
+
581
+
* **Interval**: Can be set in the seconds range to retrieve a measurement often.
582
+
583
+
* **Values**: The names can be changed to ``x``, ``y`` and ``z``, and the number of decimals to 0. Stats can be enabled, as desired. The Unit of Measure is undocumented.
584
+
585
+
* **I2C Init Commands** sequence for initializing the sensor:
586
+
587
+
``write.u8.0x29.0x06;write.u8.0x0B.0x00;write.u8.0x0A.0xCD``: Initialize the sensor according to the datasheet, Normal mode, field range 8 Gauss, output data rate 200 Hz, over-sample ratio 8, down-sample ratio 8.
588
+
589
+
* **I2C Exit Commands** sequence for shutting down the sensor:
590
+
591
+
``write.u8.0x0A.0x00``: Set sensor in Suspend mode.
592
+
593
+
* **Cache-Name 1 (optional)**: Fill with a useable name, f.e. ``x``, so the I2C Command sequence is cached for much improved execution-performance.
594
+
595
+
* **I2C Commands 1**: ``read.16le.0x01`` Read 2 bytes starting at register 1, the ``x`` value, and store in first Value field.
596
+
597
+
* **Cache-Name 2 (optional)**: Fill with a useable name, f.e. ``y``.
598
+
599
+
* **I2C Commands 2**: ``read.16le.0x03`` Read 2 bytes starting at register 3, the ``y`` value, and store in second Value field.
600
+
601
+
* **Cache-Name 3 (optional)**: Fill with a useable name, f.e. ``z``.
602
+
603
+
* **I2C Commands 3**: ``read.16le.0x05`` Read 2 bytes starting at register 5, the ``z`` value, and store in third Value field.
604
+
605
+
To reduce the logging content, **Single event with all values** can be enabled, to generate a single event ``<task-name>#All`` with all values as argument, and thus reduce the logging from 3 lines per Interval to a single line per Interval.
606
+
607
+
|
608
+
475
609
Change log
476
610
----------
477
611
478
612
.. versionchanged:: 2.0
479
613
...
480
614
615
+
|added| 2025-12-08 Add index to example configurations.
0 commit comments