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.

Featured Replies

Geschrieben

Hi,

 

for the LCD20x4 how to control the 4 buttons using the MQTT Proxy, e.g. when pressing a Button an action is triggered using publish and how to subscribe.

Geschrieben

It's a bit tricky. You could use the is_button_pressed() function to poll for button presses in the MQTT proxy. But it's easy to miss button presses this way.

 

So you'd need to use the button_pressed and button_released callbacks. But currently there is no callback handling like this in the proxy.

 

As an example, I've added a new button_pressed topic for the LCD Bricklets, that is fed via the button_pressed and button_released callbacks. Have a look at the latest Brick MQTT Proxy version on github.

Geschrieben
  • Autor

Have tested and is working fine. Thanks.

Consideration

To check by the application which button is pressed, the JSON string is parsed. The keys checked are "0": ... "3":.

The only caution is that the JSON string does not contain the word Button or LCD20x4, so in case "0": ... "3": are also used for other messages then a conflict is the result.

Geschrieben

If you're subscribed to multiple topics at once and you want to distinguish the different messages, then you should due this based on their topic. Don't try to guess this based on the message content.

 

The mosquitto_sub tool has a -v option that'll also output the topic the messages was received on.

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.