I have created a network of 100 sensor nodes using python 3.8. Now I need to broadcast a node's information like it's energy, id etc to other nodes and all the other nodes should listen to the information. So, how can I implement this in python?
Related
Hello I have created a baysian network using bnlearn. All nodes values are discretized.
I have one variable that is central to a model called "isS".
I want to establish which nodes in a model has strongest influence on the "isS" node. How to approach this problem?
One can establish the arc importance as in link below but If I would like to measure impact of nodes that are connected via other nodes - connected non adjacent?
https://www.bnlearn.com/documentation/man/arc.strength.html
I'm developing some application that shall monitor some data in real time.
The application shall collect data from the network, parse the relevant packets from my protocol and store it to the database.
When I start the application - everything seems to be OK, but then lags are starting to appear few seconds after that.
Checking my database, it seems that some data is not saved while others does stored (I'm using packet player to inject packets on my PC. Verifying with Wireshark, all the data which has is there ). The data is stored into several tables, and all of the tables have same issue and therefore I'm suspicious on scapy.
Checking the Wireshark statistics, I have about 200 packets per second.
Is there someway to improve the performance of it?
I'm using sniff(iface="Working", filter = "port 52000", prn=my_parsing_func, store = false) command
PS - I'm using win 10 OS, python 3.7.4
I just got a Bluetooth LE/Smart bathroom scales (Model Sanitas SBF 70). I can read data from it using the following command:
gatttool --device=(btaddr) -I
connect
Then when I stand on it, I get multiple notification messages like this:
"Notification handle = 0x002e value: e7 58 01 05 e9"
where the last two bytes are is the mass in 50g increments.
I'd like to integrate this into a few application using a TCP or UDP socket service that broadcasts these messages to any listening clients.
But after some research I have no idea what's the best way to stay connected all the time (the connection times out after a few minutes). Or alternatively to be able to re-establish a connection when the scales is used (I notice lots of activity from 'hcitool lescan' whenever someone steps on the scales).
I don't care what language / library is used. If I can push this to a TCP/UDP socket it will be trivial for other applications to consume the information.
The answer is straightforward: You don't.
Your scale is most likely battery powered. Therefore the Bluetooth communications will only be enabled for a short period of time after having measured your weight. Your application just needs to try connecting to the scale over and over (catch any "unable to connect timeouts") until you step on it. And when connected get the data from it before BLE is shut down again. In pseudo code:
while true:
while not_connected:
try to connect
receive notifications
disconnect
gatttool wrapped by the python module pygatt is perfectly usable to solve this chalenge.
In my case scale data (preceding 30 weights) is transferred after enabling indications of 3 different characteristics.
i am new to ns2,i want to simulate routing protocol in wireless sensor networks,anyone tell me how to wake up sensor nodes by transferring sink node wakeup message and how to get node position?
Hello read Leach protocol in ns-2
you will learn how the nodes are sleep and awake.
In a P2P system, what is a difference between:
send a query message to a known node and the node re-send a response(I mean I explicitly contact a node by sending a message to ask him somethings).
if there is a DHT which contains information about nodes and their resources(each recording contain a key that represent IP # of each node, and a list of its available resources), so if I have an access to this DHT (may be I am a member) and I know the key or the identifier of a given node, first can I look directly at the recording of this node without need to send it a message or a query(I mean I implicitly contact it)?second, if yes how? I mean how the DHT is represented physically, and how a node updates its information?
In case 1. if you are sure the remote node has the resource, then DHT is useless.
In case 2, DHT helps you locate resources. Yes, you can take a look at the DHT record (if you have any) about the remote node. It will give you an indication of whether the resource might be available on that remote node.
Typically, DHT are in memory tables, or table stored on a local small database. There are many ways to push the info to remote nodes, a common way is push the info to random nodes.