Jump to content

rwblinn

Members
  • Gesamte Inhalte

    121
  • Benutzer seit

  • Letzter Besuch

Alle erstellten Inhalte von rwblinn

  1. Hi, using Node-RED - trying to MQTT listen to input state changes of an IO-4 v2 bricklet having a push-button connected to channel 1 configured as input pull-up. Issue: When pushing the button, no MQTT message is received - see 2). Tested first in the Brick Viewer 2.4.11 and the value changes for channel from low to high when pressing the push-button. Node-RED Nodes Configuration 1) mqtt in with topic tinkerforge/#. Messages are received (see below test channel 0 as output) Tested OK (MQTT message received) the IO-4 state change of channel 0 (output) - led connected - using in a function node with msg.payload input true or false //Bricklet: IO-4 - Example to set pin 0 high | low var brickletUID = "G4d"; var topicPrefix = "tinkerforge/request/io4_v2_bricklet/"; var topicSuffix = "/set_configuration"; msg.topic = topicPrefix+brickletUID+topicSuffix; msg.payload = {"channel": 0, "direction": "out", "value": msg.payload}; node.status({text:"State:"+msg.payload.value}); return msg; 2) Channel 1 as Input with a push-button connected. Configured a function node as follows - no MQTT message received when pushing the button //IO-4 - example set callback configuration var brickletUID = "G4d"; var topicPrefixRequest = "tinkerforge/request/io4_v2_bricklet/"; var topicPrefixRegister = "tinkerforge/register/io4_v2_bricklet/"; msg.topic = topicPrefixRequest+brickletUID+"/set_configuration"; msg.payload = {"channel": 1, "direction": "i", "value":true}; node.send(msg); msg.topic = topicPrefixRequest+brickletUID+"/set_all_input_value_callback_configuration"; msg.payload = {"period": 0, "value_has_to_change": true}; node.send(msg); msg.topic = topicPrefixRegister+brickletUID+"/all_input_value"; msg.payload = {"register":true}; node.send(msg); msg.topic = topicPrefixRequest+brickletUID+"/get_configuration"; msg.payload = {"channel":1}; node.send(msg); What is wrong in the configuration?
  2. For those interested, based on previous learning's, created an Indoor Air Quality Node-RED Dashboard using MQTT. Please find on GitHub.
  3. That was a great hint. The log showed no topic, only payload, means error in node-red creating topic. The log: first line using terminal, second via node-red. tinkerforge/request/rgb_led_v2_bricklet/Jng/set_rgb_value {"r":255,"g":0,"b":0} {"r":255,"g":0,"b":0} Changed the node-red function node creating topic with payload //Example to set a green color = RGB (0, 255, 0) var r = 0; var g = 255; var b = 0; //Mosquitto Command: //mosquitto_pub -t tinkerforge/request/rgb_led_v2_bricklet/Jng/set_rgb_value -m '{"r":0, "g":255, "b":0}' //Translated to JavaScript Message with Topic and Payload msg.topic = "tinkerforge/request/rgb_led_v2_bricklet/Jng/set_rgb_value"; msg.payload = {"r":r,"g":g,"b":b}; return msg; resulting in log: tinkerforge/request/rgb_led_v2_bricklet/Jng/set_rgb_value {"r":0,"g":255,"b":0} That was good learning = again thanks for help.
  4. Yes, noted the difference in string and json from mqtt out. To note is that this node-red example setup has been used without issues using mqtt proxy v1.0. Tried to a JSON node, but again no change. Tried a string, i.e. "R",... but also no change. Output of mosquitto_sub -t tinkerforge/# {"r":0, "g":0, "b":123} Debug pi@4dev:~ $ tinkerforge_mqtt --debug 2019-09-06 14:51:22,144 <DEBUG> MQTT bindings: Configuring connection to MQTT broker at localhost:1883 2019-09-06 14:51:22,145 <DEBUG> MQTT bindings: Connected to MQTT broker at localhost:1883 2019-09-06 14:51:22,147 <DEBUG> paho.mqtt.client: Sending CONNECT (u0, p0, wr0, wq0, wf1, c1, k60) client_id= 2019-09-06 14:51:22,148 <DEBUG> paho.mqtt.client: Received CONNACK (0, 0) 2019-09-06 14:51:22,148 <DEBUG> MQTT bindings: Connected to mqtt broker. 2019-09-06 14:51:22,148 <DEBUG> paho.mqtt.client: Sending SUBSCRIBE (d0, m1) [('tinkerforge/request/#', 0)] 2019-09-06 14:51:22,149 <DEBUG> paho.mqtt.client: Sending SUBSCRIBE (d0, m2) [('tinkerforge/register/#', 0)] 2019-09-06 14:51:22,149 <DEBUG> paho.mqtt.client: Sending PUBLISH (d0, q0, r0, m3), 'tinkerforge/callback/bindings/restart', ... (4 bytes) 2019-09-06 14:51:22,149 <DEBUG> paho.mqtt.client: Sending SUBSCRIBE (d0, m4) [('tinkerforge/callback/bindings/restart', 0)] 2019-09-06 14:51:22,150 <DEBUG> MQTT bindings: Connecting to brickd at localhost:4223 2019-09-06 14:51:22,152 <DEBUG> paho.mqtt.client: Received SUBACK 2019-09-06 14:51:22,153 <DEBUG> MQTT bindings: Connected to Brick Daemon: Connection established after request from user. 2019-09-06 14:51:22,153 <DEBUG> MQTT bindings: Connected to brickd at localhost:4223 2019-09-06 14:51:22,153 <DEBUG> paho.mqtt.client: Received SUBACK 2019-09-06 14:51:22,198 <DEBUG> paho.mqtt.client: Received SUBACK 2019-09-06 14:51:28,094 <DEBUG> paho.mqtt.client: Received PUBLISH (d0, q0, r0, m0), 'tinkerforge/request/rgb_led_v2_bricklet/Jng/set_rgb_value', ... (23 bytes) 2019-09-06 14:51:28,094 <DEBUG> MQTT bindings: 2019-09-06 14:51:28,095 <DEBUG> MQTT bindings: Calling function set_rgb_value for device Jng of type rgb_led_v2_bricklet. 2019-09-06 14:51:28,096 <DEBUG> MQTT bindings: Calling function set_rgb_value for device Jng of type rgb_led_v2_bricklet succedded. Node-RED MQTT out node In the terminal no entry subscribing tinkerforge/# In debug pi@4dev:~ $ tinkerforge_mqtt --debug 2019-09-06 14:53:50,026 <DEBUG> MQTT bindings: Configuring connection to MQTT broker at localhost:1883 2019-09-06 14:53:50,026 <DEBUG> MQTT bindings: Connected to MQTT broker at localhost:1883 2019-09-06 14:53:50,028 <DEBUG> paho.mqtt.client: Sending CONNECT (u0, p0, wr0, wq0, wf1, c1, k60) client_id= 2019-09-06 14:53:50,029 <DEBUG> paho.mqtt.client: Received CONNACK (0, 0) 2019-09-06 14:53:50,029 <DEBUG> MQTT bindings: Connected to mqtt broker. 2019-09-06 14:53:50,030 <DEBUG> paho.mqtt.client: Sending SUBSCRIBE (d0, m1) [('tinkerforge/request/#', 0)] 2019-09-06 14:53:50,030 <DEBUG> paho.mqtt.client: Sending SUBSCRIBE (d0, m2) [('tinkerforge/register/#', 0)] 2019-09-06 14:53:50,030 <DEBUG> paho.mqtt.client: Sending PUBLISH (d0, q0, r0, m3), 'tinkerforge/callback/bindings/restart', ... (4 bytes) 2019-09-06 14:53:50,031 <DEBUG> paho.mqtt.client: Sending SUBSCRIBE (d0, m4) [('tinkerforge/callback/bindings/restart', 0)] 2019-09-06 14:53:50,031 <DEBUG> MQTT bindings: Connecting to brickd at localhost:4223 2019-09-06 14:53:50,032 <DEBUG> paho.mqtt.client: Received SUBACK 2019-09-06 14:53:50,033 <DEBUG> paho.mqtt.client: Received SUBACK 2019-09-06 14:53:50,034 <DEBUG> MQTT bindings: Connected to Brick Daemon: Connection established after request from user. 2019-09-06 14:53:50,034 <DEBUG> MQTT bindings: Connected to brickd at localhost:4223 2019-09-06 14:53:50,078 <DEBUG> paho.mqtt.client: Received SUBACK
  5. Thanks for help. Using mosquito for this test is ok: Terminal 1 subscribing to all topics: mosquitto_sub -t tinkerforge/# Terminal 2 setting the color: mosquitto_pub -t tinkerforge/request/rgb_led_v2_bricklet/Jng/set_rgb_value -m '{"r":0, "g":0, "b":123}' Terminal 1 shows: {"r":0, "g":0, "b":123} Next step is to obtain the same in Node-RED. Defined a simple flow. mqtt in node with topic tinkerforge/# and broker localhost port 1883. The mqtt in node outputs to a debug node. When changing the color via terminal, then the debug node shows: 06/09/2019, 14:15:01node: DEBUG TF ALL tinkerforge/request/rgb_led_v2_bricklet/Jng/set_rgb_value : msg.payload : string[23] "{"r":0, "g":0, "b":123}" Now, to test changing the color via mqtt out node (and debug node) using a function node: //Example to set a green color = RGB (0, 255, 0) var r = 0; var g = 255; var b = 0; //Mosquitto Command: //mosquitto_pub -t tinkerforge/request/rgb_led_v2_bricklet/Jng/set_rgb_value -m '{"r":255, "g":0, "b":0}' //Translated to JavaScript Message with Topic and Payload var msgmqtt = {topic: "tinkerforge/request/rgb_led_v2_bricklet/Jng/set_rgb_value", payload:{"r":r,"g":g,"b":b} }; return msgmqtt; The debug node shows: 06/09/2019, 14:16:30node: 65847a3b.80f134 tinkerforge/request/rgb_led_v2_bricklet/Jng/set_rgb_value : msg.payload : Object { r: 0, g: 255, b: 0 } BUT the color is not changed. Any hint what is missing in this setup?
  6. Hi, 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 Log: 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: mosquitto_pub -t tinkerforge/request/rgb_led_v2_bricklet/Jng/set_rgb_value -m '{"r": 0, "g": 0, "b": 200}' Log: 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: 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: mosquitto_sub -t tinkerforge/request/rgb_led_v2_bricklet/Jng/get_rgb_value Nothing happens on the terminal. Question: How to subscribe to value changes? Would like to use this in Node-RED.
  7. 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 https://github.com/rwbl/domoticz-plugin-indoor-air-quality-monitor. Notes For learning purposes on how to build a Domoticz Plugin interacting with Tinkerforge Building Blocks, created a simple Traffic Light plugin (https://github.com/rwbl/domoticz-plugin-traffic-light) Also described in my Domoticz Home Automation Workbook (https://github.com/rwbl/domoticz-homeautomation-workbook) [in progress].
  8. 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 https://github.com/rwbl/domoticz-plugin-soil-moisture-monitor.
  9. Thanks for clarification. Might be a consideration for next version of the WiFi2 to be consistent with the other LEDs.
  10. Hi, how to turn on/off the Master Brick WiFi2 Extension Green & Blue Status LED using Python? Background: 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() OK Master Brick Blue LED enabled: master.enable_status_led() OK WiFi2 Green LED disabled: master.disable_wifi2_status_led() OK 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? Thanks
  11. Hi, 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.
  12. (Sorry for late reply) Indeed found total 4 pins bend in two slots. After unbending, the Master Brick is still not reacting. 2 pins look rather dark - think are burned. Will not pursue with this Master Brick. Many thanks for the hint. Appreciated.
  13. Thanks for the hint. Checked the pins - seems OK. ... but does not trust this master brick anymore ... and will order a new one.
  14. Both buttons feel OK and can be pressed and released. The Master Brick worked fine prior setting in bootloader mode. Tried again: Connected to PC USB port, set bootloadermode, the Master Brick started to smell and is getting hot (can not touch anymore) ... immediate unplugged. Will not plugin anymore!
  15. Tried also several times (should have mentioned in first post). Any other options?
  16. 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
  17. 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 tinkerforge.com 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.
  18. Seeking advice on how to install the Brick MQTT Proxy as a process on the latest RED Brick Image. Appreciated
  19. Thanks for feedback = sounds great whats going on. Looking forward...
  20. 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 ...
  21. 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.?
  22. Hi, I am using following steps on the Raspberry Pi: * sudo apt-get install python3-pip * sudo apt-get install python-pip * sudo pip install tinkerforge paho-mqtt * sudo apt-get install mosquitto mosquitto-clients python-mosquitto * sudo apt-get install libusb-1.0-0 libudev0 pm-utils * mkdir /home/pi/tinkerforge * cd /home/pi/tinkerforge * wget http://download.tinkerforge.com/tools/brickd/linux/brickd_linux_latest_armhf.deb * sudo dpkg -i brickd_linux_latest_armhf.deb * delete the file brickd_linux_latest_armhf.deb: rm brickd_linux_latest_armhf.deb * Copy the file brick-mqtt-proxy.py to this folder after download from the TinkerForge website https://github.com/Tinkerforge/brick-mqtt-proxy * OR use wget https://raw.githubusercontent.com/Tinkerforge/brick-mqtt-proxy/master/brick-mqtt-proxy.py * Start the Brick-MQTT-Proxy as process: python brick-mqtt-proxy.py&
  23. SOLVED - replaced the cable and now working fine. Thanks for your help = appreciated.
  24. Hi, when running the call example from here www.tinkerforge.com/en/doc/Software/Bricklets/AmbientLight_Bricklet_Delphi.html#ambient-light-bricklet-delphi-examples, 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.
  25. Thanks. For those interested, the Windows Client and Server solutions, both developed with B4J are making progress. Read more https://www.b4x.com/android/forum/threads/lighthouse58.71382/.
×
×
  • Neu erstellen...