How to update values from opcua client (raspberry pi 4) to opcua server (laptop) - raspberry-pi4

I have created an OPC UA server using AutomationML with the Plugins of AML2OPCUA. Then, I have my raspberry pi 4 acting as the OPC UA client. It has an Ultrasonic sensor connected to it. Can anyone tell me how to update the values that I get from this ultrasonic sensor to the OPC UA server on my laptop?

Related

Can you simulate a modbus slave via serial connection on node-red?

I have managed to use node-red to simulate a slave device using a TCP connection, but now I want to do it via serial connection. I am using a dell gateway running mbpoll to simulate the master connected to a raspberry pi running node-red to simulate the slave via RS485. Is it possible for me to use node-red on the raspberry pi to simulate the slave device, so it responds to requests from the gateway with values like a sensor would?
Based on your previous questions you are using node-red-contrib-modbus; this node does not support Modbus RTU as per the node descriptions:
modbus-server - Node to provide a Modbus TCP server based on node-modbus (jsmodbus) for testing.
modbus-flex-server - Node to provide a flexible Modbus TCP server based on modbus-serial for testing.
There may be another module out there that does support RTU slaves but I am not aware of one. As such I think your options are:
Modify the existing note to add support for RTP.
Use a gateway. There may be software that will do this (its not all that complicated) but I've not found anything freely available. There are a range of hardward gateways (some fairly cheap) that support comms between an RTU master and a TCP slave - e.g. 1 or 2.

Prevent Raspberry Pi 3 from automatically connecting to bluetooth le device

I have a TI SensorTag bluetooth le device. It is not paired with my raspberry Pi. I installed bluez, but I don't have any applications of my own running. The second I power on the device, something on the Pi instantly connects to it. If I disable bluetooth on the Pi, the device becomes available for connections.
This is a problem for me because my own application can't connect to the device because something on the Pi has aggressively connected to it.
I am not sure what the reason is but this worked for me. Try following steps.
Go to terminal and type bluetoothctl.
Then type disconnect <device_address>

BLE disconnects after BT pairing failed

Linux Raspbian Jessie Lite, Bluez 5.40.
I have a GATT server and my own agent for incoming "standard" bluetooth connections (i.e. A2DP).
I can successfully "connect" to the GATT server, but if the user doesn't accept the pairing confirmation (from the BT) I receive this error:
qt.bluetooth.bluez: Failed to create pairing "org.freedesktop.DBus.Error.NoReply"
as expected, but after a couple of seconds also the BLE connection will drop.
I wonder if it's the correct behavior. I thought the BLE and BT connections are indipendent each other.
If you are using two Bluetooth smart ready device(BR/EDR/LE), then the BLE connection would be over BR/EDR, so it is make sense that your BLE also disconnected.

Raspberry Pi web server and serial port

I need advice on setting up a web server on a Raspberry Pi that can communicate with the serial port.
Im leaning towards doing this i php/python/nodejs or c if necessary.
Requirements:
1. incoming data on serial port => update webpage through web sockets
2. some event on webpage => send data to serial port
A continuous loop to check for serial data will be heavy on the cpu. Is there any way to get an event on incoming serial data and then read it? Found https://github.com/voodootikigod/node-serialport that has an on data event. Is that a good option?
Can the serial communication be handled by the web server or will i have to create a service?
Best approach for me was to use node.js and https://github.com/voodootikigod/node-serialport in combination with socker.io. That gives men an event when serial data received that can be communicated via socket.

Arduino WiFi Shield works only for 2 second delays?

I am trying to send sensor data from an Arduino UNO to my server running on a local wifi network. My server is an HTTP server run on NodeJS.
I need the Arduino to send data to the server as fast as possible as fast as a request every 100~250ms. The code from the WiFiClientRepeating example sends data to the server properly every second or so. If I reduce the frequency to something lower or equal to 500ms, the server does not seem to receive anything.
Are there any limitations to how many requests there can be done in a set period of time?
EDIT: I am using the official Arduino WiFi Shield.

Resources