Is there a way to click a button in relation to a specific page?

I don't have time to dig into it at the moment, but it should be possible to use similar techniques to e.g. eBay bidding software to open a page and send the appropriate button click. Whether it can be done with existing nodes or would need either a custom node or some JavaScript magic is also something to look into.

Based on the underlying protocols involved I can't see any reason why it shouldn't be possible.

I don't think that is what is being asked for, but perhaps I misunderstood the question.

... or I've misunderstood it, which is very possible :smiley:

Going by the OP's second post :

It sounded like he wanted to click a button on an MQTT-related page somewhere, although it is a bit vague.

Perhaps @Athurian could explain in a bit more detail?

you're right.

For example, if you open Chrome on Raspberry Pi,
I have a page localhost:5000/mqttsettings.
On this page there is a button to save mqtt.
This is a function that automatically presses the mqtt save button when a specific message comes up.

The reason for doing this is to receive mqtt from the current nodered.
But strangely, I don't know why, but after a few hours the reception suddenly cuts off.

I do not know the cause, but if I reboot or press the save button of the mqtt setting page, it will resume again.

So, I asked how to press the save button as a way to do it without rebooting.

What do you have running at that location to provide the page?

This is where you set the sensor.

And this is the web page setting page provided by the sensor.

As far as I know, it is based on .Net and Blazer.

What sensor it is? Is this a known problem with the sensor?

When you say that the MQTT stops do you mean it appears to stop publishing data?

Is it publishing to a broker on the node-red system? If so have you looked at the mqtt log to see what it says?

Also install MQTT Explorer and see what you see there.

There are many types of sensors.

Atlas Scientific's sensor.

mqtt works fine in the beginning... I also checked the log.

There is nothing more than a star.

The problem is that it suddenly stops.

I can't find the cause.

As a result of checking on the Raspberry Pi, there is a phenomenon that mqtt data cannot be transmitted.

For now, we will continue to test it.

Which log did you check and what do you mean about there being only a star?

Exactly what stops?

I thought it was the sensor that stopped. Do you mean the node-red can't publish to MQTT? You must be more explicit about what happens, without knowing the details it is difficult to help.

What did MQTT Explorer show?

Something else I don't understand. You said you connect to the sensor using localhost:5000, but that is a web page on the computer you are running on, not the sensor. So what software is providing that interface?

Is this the same problem that you reported in a previous thread? I notice that there you just stopped answering questions.

There is software provided by sensor vendors.

The sensor supports mqtt through software.

The mqtt again receives messages through nodered. Sensor data > Publish sensor software mqtt > Receive node red mqtt It comes out like this.

Here, you can set the settings as a web page.

However, sometimes the message is suddenly dropped from mqtt and the message cannot be published.

Idon't know what the reason is. If there is no message for a few minutes, I set No message in Node Red.

So, if you press the save button again in the mqtt settings of the software webpage provided by the sensor, it resumes again.

So, if there is no mqtt message from Node Red, we are looking for a function that can automatically press a button on the mqtt setting page.

You will need to inspect the source for the page that provides the button to work out what it is doing when you click it. Hopefully it is just doing an http get or post of some sort, but will depend how or what security is in place as to whether you can just replicate that with an http request node.

Also you still haven't told us the answer to that question. That will confirm whether the broker is receiving data from the sensor.

Hi,

If you want you can click a button from a Node-RED flow by using WDIO nodes. This will then force a dependency on having an instance of Selenium to execute the request (e.g. Selenium-Standalone) plus Java. It works but is a lot for a simple button click.

As stated previously: confirm what action the button does when clicked and approach it from that direction.

Might be as simple as a POST with certain parameters.

Cheers,
Paul

I thought it was the messages from the sensor that were getting lost, not the messages from node-red.

Using python selenium function was the solution. I was able to press a specific button. Thank you.

thank you for the reply. The solution was available in the above post.

I think a better solution would be to work out exactly what is going wrong and address that, rather than using a workaround like this.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.