I have a router that makes it extremely difficult to run port-forwarding through it. Plus, I would rather be able to just pretty much plug my Pi in and have my server running. Setting up a Raspberry Pi as a wireless access point is pretty easy and straight forward. I would like to have a python server, which runs on the same Raspberry Pi, that allows me to run a public server off of the access point. So basically instead of having to use port forwarding with my router, the server made with sockets in python uses the access point to be public. is this something that sounds possible?
update This is NOT for local use, I want it to be a server that I could connect to states away
Related
I want to use Raspberry Pis to communicate collected Data via Python (Modbus TCP and RTU) scripts to a Database. These scripts are constantly running on the Pi and are connected to the Products where the data is coming from.
Consequently, we have to ship the already set up Raspberry Pi to the Customer. Now the Problem occurs, that the Database Credentials are stored in the Python Scripts running on the Raspberry Pi.
Is there a possibility to overcome this Problem?
Naive solution: Store database credentials on your server (or somewhere on internet) so every time Raspberry Pi run the script, it connect to the server to get the credentials first.
My recommended solution: Create an API (may be web API) to communicate with database and Rasp Pi only work with this API. By this way, the client side doesn't know about database's credentials and some private things you want to hide also.
I have a quick question that I've been wondering about ever since I started socket programming in Python. I'm working on a server/client chat system for sending messages between computers connected to my LAN. My question is: is my LAN completely isolated from the WAN or does it have some kind of connection to it? and if so, how do I isolate my network?
the computers are connected to an all in one router/modem via ethernet cable. Also, the computer which will be running the server has another wireless connection to the internet (connected to the same modem/router but wirelessly)
I hope this makes sense, thanks for reading.
I want all traffic on my LAN to stay private and isolated so only computers in my home network can connect to the server.
I'm currently working on a project that requires me to control a step motor using a raspberry pi. I finished the motor control part of the raspberry pi, but I am not really sure on how to continue on the tcp/ip connection part of the project.
I am meaning to connect a client through the tcp/ip connection and letting the client upload a code that lets the client control the motor, in which there should already be custom commands implemented (e.g. "clockwise ": turns the motor a number of steps clockwise. "set 1": sets the gpio pin to 1, and etc.)
I apologize because my knowledge in raspberry pi and tcp/ip connections are really limited.
Can someone point me a way in the right direction? Thanks in advance.
If you are looking for a scripting solution you can do TCP/IP part using ssh. Client can use ssh to log into the RPi and run the commands. It can use scp for pushing updated code/script.
For automating you can look into Pexpect that lets you script your steps.
I want to receive data into a local web server that I have created using Raspberry Pi. It is not connected to the internet. I want to know if it is possible to receive data from an application on a Windows PC that sends via TCP protocol. The web server is an Apache server. I can specify the web server address and port number in the application that sends the data.
I am a newbee to this and I just know what tcp, http etc means. I do not know them in detail so I am finding it hard to understand related articles on the internet. Can someone please help me with some code snippets on how to set the web server in raspberry pi so that I can receive the data? Either display it on the web server page or extract the data somewhere using Python or C#. I am also open to using a Raspberry Pi with Windows IoT image instead of Jessie to do the same.
With Windows IoT you can start with Hello blinky sample that create a simple Web Server in Python.
Also, restup create a Web server in C# you can reference. This is the tutorial help you set up the code lines. I test TCP packets receiving on Raspberry Pi 3 with this web server, it works.
Hope it is helpful for you.
I'm writing a Python script which connects to remote hosts over a (super complicated) SOCKS/SSL tunnel. I am able to establish connections to IPs in a remote intranet on any port.
What I'm hoping to do is set up this python script to use IP addresses in the local loopback range (127.0.x.x) to become (maybe with the help of the hosts file) a 'replica' of the remote systems, and hence enable me to use applications which don't support proxies. The problem is that I don't always know what ports they're trying to connect to. It seems the only way to work this out is to bind sockets to all 65536 ports, which seems a little crazy. So two questions:
Is it crazy? Can I just set up a python list of sockets from 1-65536?
Or is there a better way I should be doing this? Can I monitor connections to an IP somehow and bind the ports just before they're needed?
I want to avoid using too much platform-dependent or non-python code if possible.
EDIT: To clarify, I'm only writing the client here - I have no control over the server. Believe me, if I had control over the server side of it I would not be doing it with SOCKS/SSL/CRAM :)
What about going lower level and interfacing a library designed for network analyzers like pycap?
This way you could detect all connection attempts and find the ports that you need to expose or may be you can just route the packets directly assuming the library in addition to packet detection can also do packet injection (pypcap page says this feature is experimental).
This would IMO make sense in python only for slow applications however...
Pycap seems to be developed for linux, but the core capturing is done by libpcap and for windows there is a similar library winpcap.
Matt,
If using windows your best shot is something like OpenVPN over the tunnel. OpenVPN requires only one TCP port/stream and gives you a pair of virtual interfaces with full connectivity.
[updated]
It may be possible using a TUN/TAP driver on the client side. See this unix version for ideas.