SoloPy is a Python library published by SOLO Motor Controllers to control, command or read all the parameters that are stored or existing in the command set of SOLO devices. More information about SoloPy on the SOLO website. For List of All the Available Methods Read the DataSheet
SoloPy allows SOLO devices to be used in this conditions:
- USB Communication with Windows OS or Linux
- UART protocol with RASPBERRY PI or any similar controller
- CanOpen protocol with RASPBERRY PI or any similar controller
Please make sure you have installed Python 3 and pip
Install Solopy From Pip
$ pip install solopy
If you have installed the library and you want to update it on Linux, RASPBERRY PI or Windows
$ pip install --upgrade SoloPy
- Connect Solo to Raspberry Pi or Pc
- Open terminal in linux(cmd in windows) and enter the following command
$ python -m serial.tools.list_ports -v
- this will show you the port name that SOLO is connected to (in linux it's sth like '/dev/ttyAMC0' and in windows it's sth like 'COM8'
In order to enable UART Protocol on Raspberry Pi you need to follow this one time process.
- In Raspberry Pi, enter following command in Terminal to enable UART
$ sudo raspi-config
- Select -> Interfacing Options
- After selecting Interfacing option, select Serial option to enable UART
- Then it will ask for the login shell to be accessible over Serial, select No shown as follows.
- At the end, it will ask for enabling Hardware Serial port, select Yes,
- Finally, our UART is enabled for Serial Communication on RX and TX pins of Raspberry Pi 3.
- Then, reboot the Raspberry Pi.
In order to enable CanOpen Protocol on Raspberry Pi you need to follow this process one time
- turn SPI on in raspberry pi:
$ sudo raspi-config
then go to interfaces
then go to SPI and turn on
then go to reboot
- type in terminal
$ sudo apt-get update
- then type this command:
$ sudo nano /boot/config.txt
4- scroll down and add these lines:
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
5- then reboot RASPBERRY PI
Every time you reboot RASPBERRY PI you need to follow this process
1- type this command
$ sudo ip link set can0 up type can bitrate 1000000
Notes
- The bit-rate has to be the same as the one used in the code
- The following CAN transceiver module "PiCAN2" has been used to test the library
for UART pyserial
for CanOpen Python-Can
SoloPy is created by SOLO Motor Controllers team
GNU General Public License v3.0 or later
See COPYING to see the full text.