cancel
Showing results for 
Search instead for 
Did you mean: 

Python support for UHF RFID ST25RU3993-HPEV

TNgo.1
Associate II

Currently I am working on a project that uses the UHF RFID evaluation board ST25RU3993-HPEV, which is controlled by STM32L476RG.

For my project, I want to use Raspberry Pi to communicate with the evaluation board, so the use of Python is required. However, the Python code, according to ST, is still under development.

So I am wondering how I can approach this or if anyone has worked on this before? Appreciate all your kind support.

17 REPLIES 17
Cedric Dalban
ST Employee

Hello,

good news !!!

The STUHFL 3.0.0 has been updated on st.com with the missing makefile.

As mentioned in previous message, first update libPath and copy all python files to raspberry file system.

Then generate STUHFL.so on Linux machine (as described in ./Documents/Middleware-ReleaseNote.txt).

Run python demo on raspberry.

CAUTION: please ensure python version being used on raspberry is above 3.6.

best regards,

Cedric.

Vmai.1
Associate II

Hi @Cedric Dalban​ 

I have generated the *.so file on my raspberry:

0693W00000ANP31QAH.pngFor loading the libSTUHFL.so, i fixed the path, see picture below:

0693W00000ANP3fQAH.pngMy python version is 3.7

I run the python demo by command :  $ sudo python3 STUHFL_demo.py

it is able to connect to reader, read and write registers.

but the errors are kicked in after that:

0693W00000ANP4xQAH.png

************************************
*    INVENTORY RUNNER DEMO
Tuning: ANTENNA_0, Algo: 3
        Freq: 865700, cin:0, clen:0, cout:0
 
************************************
*    GEN2 INVENTORY DEMO
Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 232, in 'calling callback function'
  File "../../../../Middleware/wrapper/python/STUHFL.py", line 2812, in inventoryFinishedCallback
Tuning: ANTENNA_0, Algo: 3
        Freq: 865700, cin:0, clen:0, cout:0
 
************************************
*    GEN2 GENERIC COMMAND DEMO
AttributeError: 'function' object has no attribute '_ICycleData__StatisticsFromNative'
Tuning: ANTENNA_0, Algo: 3
        Freq: 865700, cin:0, clen:0, cout:0
No Tag (4294967289)
 
************************************

the full error log can be found here : https://drive.google.com/file/d/1bcaiQ-A45VlXVX6K6hgSB4BzTj8bt7NE/view?usp=sharing

Please help us.

Thanks a lot

Cedric Dalban
ST Employee

Hello Vmai,

looking at your traces:

LIB:.3.0.0.0

Board SW:.0.0.0.0

Board HW:.0.0.0.0

it seems the communication between the library and the board has simply not been established (even more the read registers should not be all 0x00 ...)

Indeed, LIB reports 3.0.0.0 means the communication between the wrapper and lib is OK,

but Board SW/HW versions should be also 3.0.0.0 which would mean communication between lib and board is OK, that is not currently the case (versions are 0.0.0.0).

For the time being, I don't think Python is involved in the problem, you have a problem establishing connection with your board ...

Could you please try to run the Linux demo (cf Application-ReleaseNote.txt) which would ensure connections with board is OK ?

regards,

Cedric.

Hi @Cedric Dalban​

my connection as below, could you please confirm :

0693W00000ANS3EQAX.jpg 

Cedric Dalban
ST Employee

hello Vmai,

at first sight your setup seems to be ok.

It is anyway recommended to add a power supply connected to the HPEV board.

At least your setup should reply with correct Board SW & HW versions.

2 points:

  • did you try to run the Linux demo that is provided with our release ?
  • could you please share the syslog traces your linux system generates while establishing connection between Raspberry and board ?

regards,

Cedric.

Cedric Dalban
ST Employee

Hello Vmai,

I confirm that:

  • setting the appropriate path to libSTUHFL.so in libPath while calling loadLibrary()
  • replacing '\' with '/' in all paths
  • replacing comPort='COM{}' with comPort='/dev/ttyUSB{}' (file: STUHFL_demo.py, line: 57)

allows the connection between library and board to establish.

With these 3 listed modifications, the Python wrapper demo runs and completes correctly in Linux environment.

For the time being, the Python & java wrappers provided with release 3.0.0 have only been tested on Windows, the next release will ensure at least these 2 wrappers are correctly handled on Linux.

best regards,

Cedric.

Hi @Cedric Dalban​ 

Thanks for your support.

Following your instruction, the python code is able to execute on my raspi without error.

you can see the log here : https://drive.google.com/file/d/188APc4586qijd9rovGrYNphe1QyF9oSZ/view?usp=sharing

thanks

Viet

AHeit.1
Associate II

@Cedric Dalban​ 

I am getting this error

  1. ***************************** CAUTION *****************************************
  2. Cannot open STUHFL DLL:
  3. {}
  4.  
  5. Please ensure STUHFL DLL has been generated before using STUHFL Python wrapper
  6. *******************************************************************************

when I try to run the python wrapper. I have rebuilt the STUHFL.dll several times in VS2019, and have copied it and added it to many paths in my pycharm IDE. I am running SDK 3.0.0.0

Can you provide feedback?

Thanks