A keyboard_arrow_up
0
keyboard_arrow_down
EDIT POST
First Post
Mark as Spam
Alejandro137
Posts: 1 - Registered: 2011-05-20
Hello!
I am trying to get tele-operation for my Arduino control system. The code is based off of the Principia Labs Arduino-Python 4-Axis Servo Control.The problem I am facing is the how to approach wireless tele-operation. The way the code works is; joystick input is interpreted in python and converted to angles. These angles are then sent serially through a usb com port to the Arduino also using python, just as if you were to send commands through the Arduino serial monitor. The Arduino then simple controls what servo to move and it's position. So like I said before I am facing how to approach the wireless tele-opertaion. This is where I hit a huge brick wall and cry. One theory is to send byte packets to the Arduino from a client (being a python script) to a server (being the Arduino). This theory is based off using Python's socket library and Arduino's WebServer capabilities. Here is the python script to send client data to server: import socket And here is the Arduino Sketch: #include <SPI.h> Is this possible? |
A keyboard_arrow_up
0
keyboard_arrow_down
EDIT POST
Reply #1
Mark as Spam
awdownsyou
Posts: 2 - Registered: 2007-04-01
I came across your post as I have been working on a similar problem using the updated version of Recotana's Open Sound Control OSCClass library for the Arduino, and Python Simple OSC for the data transmission. Because of its overhead and stability problems, I have found the OSC library too slow and unreliable for what I need. Your socket method is exactly what I need.
Anyway, concerning your question below as to whether your approach will work to enable Python/socket communications with the Arduino as a servo driver, the answer is yes it should work very well. Although I am not using servos, I tried your code samples below with the result that Python control of the Arduino is fast (and stable) -I was able to reliably send position updates over the network at a very fast rate, verified received/parsed by print statements to the Arduino serial monitor. I cannot test the servo logic directly with actual servos, but the logic looks correct. Thanks very much for posting this and good luck with your project. -DrZigZag |