How to connect using MODBUS RS485 to a slave to an address which also requests a password - connection

I tried to use different libraries : minimalmodbus, pymodbus, ... and find a way to connect to a device (power meter) which also requests a password.
Has anyone done such connection. I'm using serial connection of a Raspberry.
Thanks in advance for sharing your experience or ideas.

Related

Internet connection problem from different network for NodeMCU ESP8266 which I am using for IOT home automation

Would anyone like to help me with this problem please?
how to connect/control Nodemcu esp8266 wi-fi module from different network for control iot devices from outside of any home/ house?
Internet connection problem from different network for NodeMCU ESP8266 which I am using for IOT home automation.
Actually, in case of an class project, I have used some code (also coppied some code and took help from some website) from internet and also used Blynk for controll my ESP8266.
But not i want to make a personal app by which app I can control my devices outside from my home.
I have already connected with my WI-FI router with my home network!!
It worked well,
But i don't know how to do the same thing from different netwrok.
If possible I think anyone can help me....
Thank you.
To everyone.
This has been answered in greater detail on both the Arduino and Internet of Things StackExchange sites. In summary:
For safety, it is difficult to start a connection to a device on another local network. Devices on WiFi networks are protected from the Internet by a firewall, which is normally configured to return responses to requests sent by the devices, but block all unsolicited messages. Even if the firewall allows an incoming connection on a given port, "port forwarding" or other custom configurations are needed for unexpected messages to reach one of the multiple devices on the network (the devices usually share the same public IP address of the network and external systems' messages cannot reach the right local address without forwarding by the router).
Any device exposed to unsolicited requests like this is at risk of being attacked and can pose a risk to other systems on the network. It is thus safer to leave the firewall the same and instead make the device subscribe to an external webserver, which acts as a mailbox for incoming messages. Then, you can send requests to the server from anything with an internet connection, and the server will store them and relay them to the ESP8266 whenever the ESP asks. MQTT protocol using a server-side broker program like Mosquitto and a client like PubSubClient on your ESP8266 could work for this sort of publish-subscribe model, and MQTT tutorials and explanations are available both on both tool sites and Stack sites.
You can use Arduino IDE to program ESP8266 device.
https://randomnerdtutorials.com/how-to-install-esp8266-board-arduino-ide/
After installing ESP8266 in Arduino IDE. You need to connect ESP8266 with WiFi router(which have internet connected). Once your device is connected with a WiFi router. you can MQTT protocol to communicate with the server. You can use the following library in Arduino to implement MQTT client in ESP8266. ESP8266 is used to send and receive data from a different network. ESP8266 is subscribed to a particular topic. You can publish data to that topic from different MQTT client.
https://github.com/Imroy/pubsubclient
Use the Following link to get more familiar with MQTT protocol
https://www.hivemq.com/blog/mqtt-essentials-part-1-introducing-mqtt
You can use MQTTfx desktop application to send and receive data from NodeMcu(ESP8266).
MQTT basic diagram for understanding

Usb internet key & Raspberry: disable internet connection, used only for sms

I would like to use a USB internet Key Huawei E3531i for send and receive SMS.
I'm working on it, I can send but I have some issue receiving but this is not the topic of this thread.
When I plug the USB stick the Raspberry (connected to wireless lan) doesn't have access to internet any more. Most probably because somehow the internet key is considered as preferred connection but I don't have idea how to change this.
The best for me would be that the USB stick is not used at all for internet connection, even the wireless lan is not available.
How to configure this?
Thanks
Andrea
SOLVED!
Editing the file: /etc/dhcpcd.conf
Adding the metric for each interface. In this way I can drive the priority of routing for internet connection:
interface wlan0
metric 200
interface eth1
metric 300
The smaller number has higher priority.
Now I'm able to reach the internet key with his static ip address but also connecting to internet because the default interface is the wifi.
Bye
Andrea

Peer to Peer Communication without Server in iPhone

Is there any way to communicate between two devices or application with Browser of other devices without having Server in the middle?
If I explain, actually I want to share data between iPhone application and Browser of Desktop, I tried HTTPServer, & played with WebSocket too, but in these case this server plays an important role in between. So If somehow I exchange data between two peers like IP Address, Port number, Then Is it possible to communicate between those two devices using Wi-fi channel without having Server in Middle?
The Way, Right now I have implemented.
The way, I am looking for.
I recently came across http://www.freedomjs.org/ which is suppose to provide p2p functionality in the browser.

Socket io connected and disconected immediately

I am using SocketIO in my iOS app to connect to Node.js server. Actually if I run my app while I'm connected directly to ISP, I don't have any problem. But if I connect to some public internet which required to use Captive portal technique, my app can never connect to Socket server. Is it because of Captive portal ? How can we bypass this walled garden. We actually can browse internet if we use Safari after inputting SSID and password. But my app think we don't have internet connection.
Could anyone point me out what I did wrong here ? Any help would be much appreciated.
Update : my app can also connect to google.com, I connect to socket server using ip address is that the problem ?

Connect more than 3 ios devices with each other

I want to connect 3 iOS devices with each other.
For example, One iOS device will be like a server, and other 2 device will connect like client, to that server.
To make iOS Device, as server, i am using CocoaHTTPServer,
There is no any internet connection, should use only wi - fi
connection.
Any suggestion ?
I suggest you to use bonjour protocol which is used in ichat..this helps to deal with your problem..
These links may help you..
http://en.wikipedia.org/wiki/Bonjour_%28software%29
http://en.wikipedia.org/wiki/Apple_Filing_Protocol
ok, i solved this problem.
What i have:
(1) one wi-fi router
(2) two iOS devises.
Create local wi-fi network,
Connect 2 devises.
one of the devise will be server, by using this open source library CocoaHTTPServer.
example:
https://github.com/robbiehanson/CocoaHTTPServer/tree/master/Samples/iPhoneHTTPServer
in the iPhone(which is server) you should find the ip, that given by wi fi network, like 192.168.0.101
And uala, go to the iphone browser(which is not server)
and write url:192.168.0.101:9999 number

Resources