Hi, I am trying to use the uArm Swift Pro in Python with another arduino which is to perform external tasks un-related to the arm (reading sensors in a gardenbed). It seems the uArm Swift python library “from uarm.wrapper import SwiftAPI” is interfereing with the “import serial” library. What should/can i do to get around this as it is preventing me from collecting my sensor data via serial?
The serial data collected is then used to determine where to move the uArm.
Thanks, any help appreciated
uArm Serial No.: (the No. at the bottom of each uArm reading “UARM-XXXXXXXXXX”) ask me
I use uArm with external 2 Arduino boards controlling 2 other motors (yes using import serial), all with python. There are no fundamental issues with this. Having said that, I will not look at your code and debug it for you.
Interesting. Is there any chance I could see your code so I can analyse the problem? I was told I might have to look into Multi-threading to solve the problem. Could also possibly be a problem with my computer so when I get the chance I will attempt on another computer. Thanks for your help
I don’t know if look at my code is going to help as it will have lots of irrelevant stuff.
If you have the error at ‘import serial’, then this is likely a python library conflict. If you running your python code without an virtual environment, this is bad practice as the more python libraries your install the more likely conflicts will occur (it is inevitable actually) because not all versions of libraries are compatible each other.
I recommend you use an virtual environment manager like Anaconda. Research it if you don’t already know about it. With Anaconda, you can create virtual environment in whatever python version and install only the libraries necessary. You create virtual environment for each particular python thing you need.
I found the solution. You need to open Swift_API.py file and change line “def init(self, port=port, baudrate=115200, timeout=None, **kwargs):” change port to the COM port the uArm is connected to (can be found in Device Manager). e.g “def init(self, port=‘COM5’, baudrate=115200, timeout=None, **kwargs):”. Otherwise, on my system anyways, the uArm reserves all COM ports and hence will reject another Arduino with serial communication.