Is there any way of implementing PPPOE discovery stage, i.e. sending PADI receiving PADO and all using Python & Sockets? Not allowed to use Scapy module.
I tried to look all over the internet but can't find anything.
Related
Basically I want to be able to send instructions for a bot over WiFi using the nodeMCU module, but I cant find any detailed functions list that can help me.
I've already tried setting up a server on the NodeMCU, and then a html webpage can then be created on my laptop with buttons for instructions from this and it works, but when I try to to the same on python, (send GET requests through python) I get this error on trying to do more than one request:
ConnectionError: ('Connection aborted.', ConnectionAbortedError(10053, 'An established connection was aborted by the software in your host machine', None, 10053, None))
Also I think the converse would be better suited for my case, a server on the laptop and client as the module, but I don't know where to start.
I coded the on the module using arduino IDE and on my laptop I'm using spyder. For sending requests and stuff I'm using the requests package.
You can create HTTP endpoints in nodeMCU and call them from your python script.
For this to work, both the nodeMCU and the machine running the python script has to be in the same network. and the IP address of the nodeMCU should be correctly added in the python script.
If you wanted to use your laptop as the server, I would suggest going with an MQTT broker such as mosquito, and communicate between the nodeMCU and the python script using the MQTT protocol.
I'm using ROS Python library with cozmo and I want to use the information that I get from back from him to interact with him in AR using a Hololens. From what I know I need to establish a connection using websocket with cozmo and the hololens. I don't know how to incorporate WebSocket with Unity.
If anyone knows of any resources I would appreciate it.
Thank you
Check out https://assetstore.unity.com/packages/essentials/tutorial-projects/simple-web-sockets-for-unity-webgl-38367.
Even though it says "for WebGL" on the package title, I used it in an Android app connecting to a Python WebSockets server, and used the same code in a Windows executable.
Should work on Hololens too.
I am working on Jasmin SMS gateway and I want to use its CLI module using my python script. It serves this module as telnet. I am not sure ho to send and receive commands from telnet. I have tried telnetlib but I do not know how to use it properly. Jamsin SMS Gateway can be found here:
https://jasmin.readthedocs.io/en/latest/management/jcli/index.html#architecture
I found pexpect library that works great with telnet and ssh clients. I can perform all the tasks of Jamsin's CLI module using my scripts.
There is also a web interface available written in Django and work perfectly with jasmin using pexpect. Its called JasminWebPanel.
I have used Python external package, websocket-client to connect to a RESTful service that sends events.
from websocket import create_connection
ws = create_connection("wss://machine:port/servicename/subscribe")
for event in ws:
print event
...getting events printed
I wonder whether the same functionality can be implemented using the core Python 2.7 or Python 3.5, without installing the external websocket-client package or any other 3rd party Python package.
I have searched the Internet and those examples of code using Python socket module I've seen, refer to connections via http or tcp whereas I need to establish connection via wss.
Very late, but for anyone who might stumble here...Web Sockets protocol is built on TCP so it is expected that implementations of the protocol establish connections via TCP. Also, Web Socket's opening handshake is done following HTTP. This would also explain why Alex saw HTTP connections. If you want to see how to implement one from scratch, install web socket modules (autobahn, which in turn would lead to installing and reading Twisted and asyncio modules, or wampy) and dive into the code. Would recommend reading the Web Sockets protocol specifications at https://www.rfc-editor.org/rfc/rfc6455 before tackling the modules.
i am trying to write a simple extension in chrome which sends data to a TCP socket server in python.
Unfortunately, extensions cannot use sockets library in chrome.
is there any simple way to communicate with a TCP socket server in python?
Alternatively, is there any way to communicate with python at all?
I think Native Messaging is what you want.
You can find a example code snippet in the Example section of this page.
It uses native messaging to communicate with a Python script.