0

So, I have a project where I need to send and receive data from multiple devices (phones and a laptop) over a wifi network created by my raspberry pi. I have successfully created the wifi network by following this guide:

https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md

but now I have the network I don't know how to view data I'm receiving or how to send data to specific MAC addresses. I found that I can use the command

"sudo arp"

and/or

"iw dev wlan0 station dump"

in the terminal to get a list of connected devices, but I don't know how to use this in a python script, any and all help would be appreciated.

2

There is two part of your questions. Viewing data and sending data.

First, there is much easier way to setup Rpi as access point. You script from the following link.

Link: https://www.youtube.com/watch?v=RvOyafQeOoY&t=134s

Now coming back to viewing your data part. I would prefer either wireshark or tcpdump tools on Rpi. Link: https://www.wireshark.org/download.html

Coming to the second part of sending data. There is Network packet crafting and the sniffing tool called SCAPY. It has a Python framework as well to use. Both command line tool and Python libraries are users friendly.

Link: https://scapy.net/

Check them out and report if faced any problem.

1

To exchange data between two (or more) devices you need a program on both sides. There are many possibilities to do it but it is to broad to explain them in detail here. But I will tell some general examples to give an idea. First of all: to connect to other devices on a network you do not use mac addresses but instead ip addresses. With ip neigh show (or deprecated sudo arp) you see in the first column the ip address. You must use this one.

The classic model to access remote data is the client/server model in contrast to a peer to peer connection or multicast (or others). You have do run a server program on the device acting as server. This program is mostly started once at bootup and then runs still in the background waiting for requests from clients. Examples are a internet server you connect to with your internet browser as client or a Secure SHell Daemon (sshd) you connect to with ssh or scp as client or a NFS server resp. Samba server that provide network shares you can connect to e.g. with the mount program as client and use as normal directories to read and write data.

To use this in python there are specific modules which support any aspects of this data access. You have to import them and use its functions and classes to manipulate remote data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.