Comments (7)
Hi Gabriel,
not sure which OS you are using for the pi (I guess its the Raspberry Pi OS), but if you have internet access you could install pysoem from PyPI via python3 -m pip install pysoem
. It might be required to install Cython beforehand via python3 -m pip install Cython
.
If you like to install pysoem from the sources you should know that you need to clone the repo recursively via git clone --recursive https://github.com/bnjmnp/pysoem.git
. With the sources there you install the package via python3 setup.py install
.
I recommend to use virtualenv for trying things out:
python3 -m pip install virtualenv
installs virtualenv- with
python3 -m virtualenv venv
you creat a "virtualenv" - with
source venv/bin/activate
you activate the virtualenv - you now can use python3 and install packages as it would be your systems Python but you can remove the virtualenv by deleting the venv directory without any harm to the systems Python interpreter. You also have less access violation issues.
from pysoem.
Hi @bnjmnp
Yes i'm using Raspberry PI OS, thanks for your tips... i will use the virtualenv
.
If i do this... i will be able to run the minimal_example.py
? when i ran this this example with python mininal_example.py
i get this message on console: usage: basic_example ifname
if len(sys.argv) > 1:
try:
BasicExample(sys.argv[1]).run()
except BasicExampleError as expt:
print('basic_example failed: ' + expt.message)
sys.exit(1)
else:
print('usage: basic_example ifname')
sys.exit(1)
because i dont send args... my question is:
If i use virtualenv
will solve it ?
Which argument i need to pass to execute minimal_example.py
?
from pysoem.
You need to give the ID of your network interface. Sure your Pi only has one, but other systems may have more. In your case its probably eth0
so you do python3 minimal_example.py eth0
.
You get a list of available interfaces by calling the ifconfig
in the terminal. Also pysoem/examples/find_adapters.py should give you the same list.
The virtualenv is not neede for this.
from pysoem.
@bnjmnp thanks for your support, i will test it... and after the test, i will back here to tell the result.
from pysoem.
Hi @bnjmnp i have new question...
Look, i still not have a slave machine to test (but i will have one very soon), so for while i'm testing in my home with standard Ethernet port, without W5500 Ethernet Shield...
I ran the find_adaters.py
and i get this list:
After that i choose the adapter eth0
, and i get this message:
My question is:
Shouldn't I get a message saying "No slaves found" ? or this error is normal because i don't have a slave connected ?
PS1: Sorry for these question... i really new in the Ethercat connection.
PS2: I still using Python 2.7 because i trying to update to Python 3.8, or this version can cause this error?
UPDATE
Now i follow this steps:
- Install
pysoem
usingpython3
. - Install
Cython
usingpython3
. - Clone this repository recusive
git clone --recursive https://github.com/bnjmnp/pysoem.git
. - Execute
setup.py install --root
usingpython3
.
After that i back on examples and i ran find_adapters.py
and minimal_example.py
using python3
and now i get this:
That's correct ? because i dont have anything connected ?
from pysoem.
Yes the error "ConnectionError not found" is related to using Python 2, as the built-in exception ConnectionError came first up with Python 3.
I guess the "could not open interface eth0" error is thrown because you need root access to open eth0 for raw ethernet communication. So try to do sudo python3 minimal_example.py eth0
.
from pysoem.
@bnjmnp Thanks, now its working "Slaves not found".
from pysoem.
Related Issues (20)
- IO-Link Ethercat module (EL6224) HOT 2
- Returning PDO frame late (Windows) HOT 2
- Handle Safety HOT 2
- ConnectionError: could not open interface on Ubuntu HOT 3
- Motion control HOT 1
- read and write PDOS question HOT 2
- Add meaning of 'network adapter ID' to documentation HOT 3
- Script crashes when Python debugger inspects `CdefSlave` HOT 3
- OD version bug HOT 1
- maybe a BUGm needs deeg in HOT 1
- How to pack / unpack single `BIT`s in PDO `input` / `output` HOT 3
- Open function returns always None HOT 2
- slave.write_eeprom() bug? HOT 2
- Transfer `pysoem` into the `OpenEtherCATsociety` Github group HOT 2
- Code completion / Intellisense not working HOT 3
- Setuptool version clash HOT 1
- no SDO info for slave device
- no SDO info for slave device
- ReadTheDocs documentation is not updating
- Servo State Change
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysoem.