Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Brick MQTT Proxy - LCD20x4 Display Button Pressed und Callback

Featured Replies

Geschrieben

Hallo,

im MQTT Bereich bin ich noch eher ein Frischling und habe vermutlich konzeptionell noch etwas nicht korrekt verstanden. Daher fange ich mit dem an was in der Shell funktioniert:

mosquitto_sub -t tinkerforge/bricklet/lcd_20x4/ohF/button_pressed

ergibt je nach Taste die ich am LCD-Dispaly drücke:

{"1":false,"_timestamp":1503859070.435154,"2":false,"0":false,"3":false}
{"1":false,"_timestamp":1503859491.0309947,"2":false,"0":false,"3":true}
{"1":false,"_timestamp":1503859491.3909144,"2":false,"0":false,"3":false}
{"1":false,"_timestamp":1503859493.2529447,"2":true,"0":false,"3":false}
{"1":false,"_timestamp":1503859493.5261495,"2":false,"0":false,"3":false}

was ich so erwarte habe.

Hingegen funktioniert nicht:

mosquitto_sub -t tinkerforge/bricklet/lcd_20x4/ohF/callback_button_pressed

Hier würde ich, je nachdem welche Taste ich drücke, eine "0", "1", ...,"3" als Antwort erwarten. Nur, die Shell zeigt leider gar nichts an.

Ich denke ich habe mit der Callback Funktion etwas missverstanden und frage daher, was ich im Mosquitto-Aufruf ändern muss, damit ich die gewünschte Antwort bekomme.

 

Danke im Voraus,

topi

 

 

Geschrieben

Callbacks sind m.W. noch nicht im Mqtt Proxy von TF integriert, siehe auch hier:

https://www.tinkerunity.org/forum/index.php/topic,3353.msg20600.html#msg20600

 

Alternativ könntest du einen Daemon/Proxy in Java oder Node.js selbst schreiben, der das LCD direkt referenziert und z.B. über die Paho Klassen https://eclipse.org/paho/clients/java/ bzw. https://www.npmjs.com/package/mqtt die CB-Events published.

 

PS: Prima Einführung zu MQTT: https://jaxenter.de/iot-allrounder-27208

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.