Forum
Hello,
I'm trying to connect my SOLO mini V2 to a Raspberry Pi [4 Gb of Ram] using USB connection. The Raspberry Pi has Linux version 5.10.17-v7l+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1414 SMP Fri Apr 30 13:20:47 BST 2021
Whenever I try to run a command using Python, I get the following error:
2023-08-08 13:44:40,311 - SoloPy - ERROR - serial_open: Exception during the serial inizialisation
Here is an example of what I'm trying to run:
# EXAMPLE every second we print the value of the BusVoltage
import SoloPy as solo
import time
# Initialize the SOLO object on Raspberry Pi (UART protocol)
mySolo = solo.SoloMotorControllerUart("COM3")
while True:
print("Read from SOLO -> Board Temperature: " + str(mySolo.get_board_temperature()))
time.sleep(1)
RESULT:
2023-08-08 13:49:13,472 - SoloPy - ERROR - serial_open: Exception during the serial inizialisation
Read from SOLO -> Board Temperature: (-1, <ERROR.GENERAL_ERROR: 1>)
2023-08-08 13:49:14,975 - SoloPy - ERROR - serial_open: Exception during the serial inizialisation
I can't find any additional steps that I should be taking for these devices to communicate correctly.
Thanks for the help
Hi Simon,
this line have to be improved:
mySolo = solo.SoloMotorControllerUart("COM3")
the COM are how Windows usually call their ports, Raspberry maybe will call them similar to "/dev/ttyS0" or "/dev/ttyACM0"
you can find the correct port name using motion terminal, try to make a connection there then if the connection work try to use the same name in your script
NOTE 1: the serial connection work only 1 each time, this mean if you connect Motion terminal you can not connect the unit in Python. Before connect to Python turn off the unit and restart it to be 100% sure to have the resource free for your script.
NOTE 2: for your code, when you will kill the process the connection to the unit will be leave open so you need to restart the unit to be able to run the script a second time and have no error.
Thanks for your help,
The motion terminal was showing the correct path without the "/dev/" which threw me off. I was able to run the script successfully.
Regards,