Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - rwblinn

Pages: [1] 2 3
General Discussion / MQTT 2.0 Subscribe Topic Changes
« on: September 06, 2019, 11:17:00 »

in the process od switching from MQTT proxy 1.0 to 2.0.

Question: how to subscribe to topic changes?

Started as follows:
Raspberry Pi 4 with Master Brick and RGB LED 2.0 Bricklet
Installed mosquitto
Installed the MQTT bindings in /usr/local/bin.
Started the script: tinkerforge_mqtt --debug
Code: [Select]
2019-09-06 10:57:03,889 <DEBUG> MQTT bindings: Configuring connection to MQTT broker at localhost:1883
2019-09-06 10:57:03,890 <DEBUG> MQTT bindings: Connected to MQTT broker at localhost:1883
2019-09-06 10:57:03,892 <DEBUG> paho.mqtt.client: Sending CONNECT (u0, p0, wr0, wq0, wf1, c1, k60) client_id=
2019-09-06 10:57:03,893 <DEBUG> paho.mqtt.client: Received CONNACK (0, 0)
2019-09-06 10:57:03,893 <DEBUG> MQTT bindings: Connected to mqtt broker.
2019-09-06 10:57:03,894 <DEBUG> paho.mqtt.client: Sending SUBSCRIBE (d0, m1) [('tinkerforge/request/#', 0)]
2019-09-06 10:57:03,894 <DEBUG> paho.mqtt.client: Sending SUBSCRIBE (d0, m2) [('tinkerforge/register/#', 0)]
2019-09-06 10:57:03,895 <DEBUG> paho.mqtt.client: Sending PUBLISH (d0, q0, r0, m3), 'tinkerforge/callback/bindings/restart', ... (4 bytes)
2019-09-06 10:57:03,895 <DEBUG> paho.mqtt.client: Sending SUBSCRIBE (d0, m4) [('tinkerforge/callback/bindings/restart', 0)]
2019-09-06 10:57:03,896 <DEBUG> MQTT bindings: Connecting to brickd at localhost:4223
2019-09-06 10:57:03,897 <DEBUG> paho.mqtt.client: Received SUBACK
2019-09-06 10:57:03,899 <DEBUG> paho.mqtt.client: Received SUBACK

Published from terminal to set the color of a RGB LED V2 bricklet:
Code: [Select]
mosquitto_pub -t tinkerforge/request/rgb_led_v2_bricklet/Jng/set_rgb_value -m '{"r": 0, "g": 0, "b": 200}'

Code: [Select]
2019-09-06 10:57:51,513 <DEBUG> paho.mqtt.client: Received PUBLISH (d0, q0, r0, m0), 'tinkerforge/request/rgb_led_v2_bricklet/Jng/set_rgb_value', ...  (29 bytes)
2019-09-06 10:57:51,514 <DEBUG> MQTT bindings:

2019-09-06 10:57:51,515 <DEBUG> MQTT bindings: Calling function set_rgb_value for device Jng of type rgb_led_v2_bricklet.
2019-09-06 10:57:51,516 <ERROR> MQTT bindings: ubyte format requires 0 <= number <= 255 (call of set_rgb_value of rgb_led_v2_bricklet Jng)
2019-09-06 10:57:51,517 <DEBUG> MQTT bindings: Calling function set_rgb_value for device Jng of type rgb_led_v2_bricklet succedded.
2019-09-06 10:57:51,517 <DEBUG> MQTT bindings: Publishing response to tinkerforge/response/rgb_led_v2_bricklet/Jng/set_rgb_value
2019-09-06 10:57:51,518 <DEBUG> paho.mqtt.client: Sending PUBLISH (d0, q0, r0, m5), 'tinkerforge/response/rgb_led_v2_bricklet/Jng/set_rgb_value', ... (2 bytes)
2019-09-06 10:57:51,518 <DEBUG> MQTT bindings:

2019-09-06 10:58:51,597 <DEBUG> paho.mqtt.client: Sending PINGREQ
2019-09-06 10:58:51,598 <DEBUG> paho.mqtt.client: Received PINGRESP

The color of the RGB LED 2.0 Bricklet changed.
Note: on the brick viewer had to refresh tab RGB LED 2.0 to get the new values.

Subscribing to get_rgb_value from terminal:
Code: [Select]
mosquitto_sub -v -t tinkerforge/request/rgb_led_v2_bricklet/Jng/get_rgb_value

Changed the color via Brick Viewer to RED (255,0,0).
Nothing happens on the terminal.

Changed the command to:
Code: [Select]
mosquitto_sub -t tinkerforge/request/rgb_led_v2_bricklet/Jng/get_rgb_value
Nothing happens on the terminal.

How to subscribe to value changes?
Would like to use this in Node-RED.

To share a plugin for the Domoticz Home Automation System.

Measure, from an Indoor Air Quality Station (using TinkerForge Building Blocks), the Air Quality Index & Accuracy, Air Pressure, Humidity, Temperature, Illuminance and display the values in Domoticz Home Automation System.

Read more

For learning purposes on how to build a Domoticz Plugin interacting with Tinkerforge Building Blocks, created a simple Traffic Light plugin (

Also described in my Domoticz Home Automation Workbook ( [in progress].

To share my first plugin for the Domoticz Home Automation System:

Measure the soil moisture of a plant, display the value in Domoticz Home Automation System, in a TinkerForge Segment Display 4x7 and TinkerForge RGB LED indicator.

Read more

General Discussion / WiFi2 Green & Blue Status LED en-/disable?
« on: December 07, 2018, 16:52:02 »

how to turn on/off the Master Brick WiFi2 Extension Green & Blue Status LED using Python?

Want to turn all LED's on/off for a Master Brick 2.0 with WiFi2 Extension.

Tests Python:
Master Brick Blue LED disabled: master.disable_status_led()
Master Brick Blue LED enabled: master.enable_status_led()

WiFi2 Green LED disabled: master.disable_wifi2_status_led()
WiFi2 Green LED disabled: master.enable_wifi2_status_led()
OK - It took ~2 minutes till the LED was turned on

WiFi2 Blue LED disabled: how to using Python?
WiFi2 Blue LED enabled: how to user Python?


General Discussion / Seeking Python Exception Handling examples
« on: December 04, 2018, 09:25:14 »

in progress developing Python plugins for Domoticz Home Automation using Tinkerforge Bricklets.

As starting to learn Python, seeking for examples on how to handle exceptions for situations like Master Brick not reachable (using WiFi extention v2.0), network issues, brick or bricket defects.

The first Domoticz Plugin developed - the prototype is working fine  :) - is a Soil Moisture Monitor using a Master Brick + WiFi Extention 2.0, Moisture bricklet, Segment Display 4x7 bricklet, RGB LED bricklet.

General Discussion / Not able to Flash Master Brick 2.0
« on: June 22, 2018, 15:14:11 »
Having an older Master Brick and wanted to update to latest firmware version. Updated several Masters, but this device does not work.

Put the Master Brick in bootloader mode (blue LEDs turned off), but the device is not recognized as serial device on:
a) Raspberry Pi 3B+ running latest brickd + brickv. When connecting via USB the RPi freezes. Plugging out, the RPi is back to normal.
b) PC running Stretch: no tty device, i.e. ttyACM0 listed.
c) PC running Windows 10 with latest brickd + brickv: No serial device found.

Tried to run brickv as root or admin, but did not help.

Any hints on how to flash the Master Brick appreciated

General Discussion / Issues Raspberry Pi & RED Brick
« on: June 21, 2018, 09:42:42 »
Encountered some issues when connecting the RED-Brick (RED) to a Raspberry Pi (RPi) 3B+ running latest OS Strech.

Raspberry Pi: Installed brickd 2.3.1 and brickv 2.3.15.
RED: Installed RED image 1.12.

Connected the RED to the RPi via USB, started Brick Viewer (Menu Programming > Brick Viewer; Note location changed from Menu Other).

Brick Viewer selected Updates/Flashing:
Receiving error message: latest version information on is not available (error code 1).
The Brick Viewer lists Brick Viewer Installed 2.3.15, RED Brick 2.0.3.

Brick Viewer:
Connecting to RED receiving message: Image version 1.12 (full) is not officially supported yet. Please update Brick viewer.
Pressed Access the RED, the Brick Viewer indicates Image Version 1.12 (full).

Brick Viewer Tab RED Brick:
Connecting the RED to the WiFi network with static address, pinging the RED first time (via terminal) states host unreachable.
Pressing Connect via the Brick Viewer Tab RED brick Tab Settings > Network > Configuration, the RED is reachable via ping.

General Discussion / RED Brick install Brick MQTT Proxy
« on: December 05, 2017, 11:42:24 »
Seeking advice on how to install the Brick MQTT Proxy as a process on the latest RED Brick Image.


General Discussion / TinkerForge Roadmap 2017 and beyond
« on: August 14, 2017, 10:02:17 »
Is there a TinkerForge Roadmap 2017 and beyond available?

Wondering what are the plans regarding
  • Bricks & Bricklets = what can we expect when?
  • connecting Bricklets direct to SoC like the Raspberry Pi, Pine64 without Master Brick
  • future of the Red-Brick compared to other SoC
  • software, i.e. full integration in Node-RED, openHAB 2, other (Domoticz?)
  • other, i.e. Outdoor Cases, Make Examples, getting started guides or webinars

Appreciate an insigth ...

General Discussion / Master Brick Flashing Timeout for version 2.4.3
« on: February 27, 2017, 15:57:12 »
For a Master Brick 2.1 receiving after 34 to 50% error message - tried several times.
1) Could not flash Brick: Timeout while reading from address 0x400E0A08.

2)Removed all connected bricklets, writing went thru but during verification receiving error:
Could not flash Brick: Length error while reading from address 0x00400000

3)Master brick is connected to Raspberry Pi. Latest Brick Deamon / Viewer are installed.

4)Switched to a Windows PC. Flashing went successful.

Any hints why under Raspberry Pi a flashing error occurs.?


when running the call example from here, no data is returned. When running the simple example, then data is returned.

Bindings: delphi/laz 2.1.12; Delphi XE3 and 10.1 Berlin; Lazarus: 1.6.

Any guidance appreciated.

To share my Project Lighthouse58 - a Node-RED Internet of Things Learning Case using a Raspberry Pi with connected TinkerForge Bricks and Bricklets.
Good fun integrating TinkerForge Bricks into LEGO. Communication is based on MQTT.


Control Unit


Lookup > IoT > Lighthouse58 or for the detailed PDF document

General Discussion / MQTT Proxy OLED - Documentation Mismatch
« on: September 01, 2016, 11:13:54 »

while testing the OLED 64x48 MQTT write_line/set, noticed a mismatch between the german and english documentation:

german: The text can have a maximum of 14 characters
english: The text can have a maximum of 13 characters.
The tests showed 14 char length is not working, 13 char length is OK.
The same applies for the position 0-12 vs 0-13.

Further more number of lines stated 0-5, while testing 0-4 is working and not 0-5.

Please verify.

General Discussion / MQTT Proxy OLED Write(Ln)
« on: August 21, 2016, 19:35:49 »

would it be possible to implement write(ln) for the OLED bricklet.
Thinking of something like done for the LCD20x4 display.
This enables to send text messages to the OLED display.


General Discussion / MQTT Proxy IO-16 Getter Get_Port and Other
« on: August 07, 2016, 11:18:01 »

noticed that get_port is not exposed in the MQTT Proxy.
Are there any plans to include?

For the IO-4 several getters are defined.
Are these also planned for the IO-16 Bricklet?

Code: [Select]
class BrickletIO4Proxy(DeviceProxy):
    DEVICE_CLASS = BrickletIO4
    TOPIC_PREFIX = 'bricklet/io4'
    GETTER_SPECS = [('get_value', 'value', 'value_mask'),
                    ('get_configuration', 'configuration', None)]

Pages: [1] 2 3