bnjmnp / pysoem

Cython wrapper for the Simple Open EtherCAT Master Library
MIT License
101 stars 37 forks source link

FoE Password Causes Overflow #32

Closed ssjd2 closed 3 years ago

ssjd2 commented 3 years ago

A recent change causes the FoE password to result in an overflow error. "OverflowError: Python int too large to convert to C long" The password I need to implement is 4 bytes long and it worked in a previous version of pysoem.

bnjmnp commented 3 years ago

grafik You can install any previous release of pysoem via pip install pysoem==0.1.1. FoE was introduced in 0.1.1, from there on I did only one change from 0.1.1 to 1.0.0, where I changed the parameters from foe_write(filename, password, psize, data, timeout) to foe_write(filename, int password, bytes data, timeout) (removing the psize parameter, and adding the type requirement for password and data). Please check if the version 0.1.1 works like expected.

ssjd2 commented 3 years ago

Yes it does, v0.1.1 works like expected.

bnjmnp commented 3 years ago

Hi @ssjd2, I just released a new version of pysoem, where I removed the type annotation for the password. Now it may work as in version 0.1.1, though I'm still not sure why the intermediate Python int is a problem. Could you please try it out, so we can close this issue!

ssjd2 commented 3 years ago

The overflow problem was fixed, thank you.