This is most likely the problem. By default the emulator compiles everything with the C++ compiler. Otherwise the peripheral emulation would not work. We can add extern "C" declarations for the C-style APIs, after which they should be callable with ctypes. In particular, for pinMode you can try adding extern "C" just before the first pinMode declaration: #ifdef __cplusplus extern "C" #endif static inline void pinMode(pin_t pin, const enum pin_mode mode) { If that works for pinMode, then it should work also for other C-style APIs. --Pekka On 2014–06–02, at 19:25 , Asif Sardar <engr.asif.sardar@xxxxxxxxxxxxxx> wrote: > It might be that ctypes only handles C and emulator uses also C++ code -> > http://python-forum.org/viewtopic.php?f=6&t=404 > > > On Mon, Jun 2, 2014 at 7:00 PM, Asif Sardar <engr.asif.sardar@xxxxxxxxxxxxxx> > wrote: > The issue now is -> how to include header files in python script (I emailed > about this to Mikko Korpela, but no response yet). > > I will take a day or two days more to write good wiki pages about whole of > the weekend's and today's findings about setting up environment for both > robot framework and also the runtime & emulator. So that, we don't get into > these kind of mess again while setting up environment. Also, it will get > recorded to wiki pages and repository etc. > > Then, for the rest of the week I will try finding solution related to header > files in python scripts for dynamic shared libraries in C. > > > On Mon, Jun 2, 2014 at 6:55 PM, Asif Sardar <engr.asif.sardar@xxxxxxxxxxxxxx> > wrote: > #!/opt/pym32/bin/python -> This didn't solved problem alone ... I had got > same error ... > > But, but the actual problem was ... I was building docutils and > robotframework with wrong python. Also, 32-bit python was not completely > configured to 32 bit architecture ... I have made 32-bit python with correct > 32 bit flags and many software dependencies involved (unfortunately this > happens when manually building something from source code). > > After making and installing 32-bit python, I have installed the docutils and > robotframework with this python. Now the python library script ctype module > is loading the shared library successfully. But, I still have errors: > > /home/asif/Ell-i-Working-Directory/Ell-i-Software-Testing/ELL-i-PyBot-Tests/test-scripts/ > ============================================================================== > DigitalRead > ============================================================================== > Read high from pin | FAIL | > Setup failed: > AttributeError: ../libemulator.so: undefined symbol: pinMode > ------------------------------------------------------------------------------ > Read low from pin | FAIL | > Setup failed: > AttributeError: ../libemulator.so: undefined symbol: pinMode > ------------------------------------------------------------------------------ > DigitalRead | FAIL | > 2 critical tests, 0 passed, 2 failed > 2 tests total, 0 passed, 2 failed > ============================================================================== > Output: > /home/asif/Ell-i-Working-Directory/Ell-i-Software-Testing/ELL-i-PyBot-Tests/test-results/DigitalRead/output.xml > Log: > /home/asif/Ell-i-Working-Directory/Ell-i-Software-Testing/ELL-i-PyBot-Tests/test-results/DigitalRead/log.html > Report: > /home/asif/Ell-i-Working-Directory/Ell-i-Software-Testing/ELL-i-PyBot-Tests/test-results/DigitalRead/report.html > > > On Mon, Jun 2, 2014 at 2:15 PM, Pekka Nikander <pekka.nikander@xxxxxx> wrote: > > On 2014–06–02, at 13:08 , Asif Sardar <engr.asif.sardar@xxxxxxxxxxxxxx> wrote: > > > I am using the run scripts from > > https://github.com/Ell-i/ELL-i-PyBot-Tests/blob/master/run-tests/DigitalRead.py > > In the script you explicitly ask it to run the default python: > > #!/usr/bin/python > > Change that to > > #!/opt/pym32/bin/python > > --Pekka > > > > > -- > With Best Regards, > Asif Sardar. > +358 43 8265795 > > > > -- > With Best Regards, > Asif Sardar. > +358 43 8265795 > > > > -- > With Best Regards, > Asif Sardar. > +358 43 8265795
Attachment:
smime.p7s
Description: S/MIME cryptographic signature