how to access Serial port for writing and reading data in sikuli??

Asked by Umesh Raj

 i am automating a certain process where in i need to access serial port to write certain data into serial port and also read the data from the serial port.how can this be done in sikuli script?the procedure and a script to explain will be helpful,

Thanks and regards,

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

That is not a Sikuli "problem".

You have to look for a solution, that is available as a Jython compatible Python package. Another possibility would be to look on the Java side and find a Java package, that can be used.

Both solutions if available could now be integrated very easily with the Sikuli Extension approach.

Revision history for this message
Umesh Raj (umesh-raj) said :
#2

Thanku for the reply..i tried with the 1st option using python package Pyserial. but the sikuli is throwind an error as.

Error message:
Traceback (most recent call last):
  File "C:\DOCUME~1\umesh.raj\LOCALS~1\Temp\sikuli-tmp4973352784739764166.py", line 6, in <module>
    import serial
  File "C:\Python25\Lib\site-packages\serial\__init__.py", line 23, in <module>
    from serialjava import *
  File "C:\Python25\Lib\site-packages\serial\serialjava.py", line 35, in <module>
    comm = detect_java_comm([
  File "C:\Python25\Lib\site-packages\serial\serialjava.py", line 29, in detect_java_comm
    raise ImportError("No Java Communications API implementation found")
ImportError: No Java Communications API implementation found

so i am not abale to use that python module in sikuli. same python module is working fine by normal run. and also the python module path is also set in sikuli..
the script in sikuli that throws error is as follows

Release_Name="Suite_Step_0_HS"
myScriptPath = "C:\Python25\Lib\site-packages\serial"
if not myScriptPath in sys.path: sys.path.append(myScriptPath)
import logg as log
import serial

Revision history for this message
RaiMan (raimund-hocke) said :
#3

the pyserial requirements denote:

Java Communications” (JavaComm) or compatible extension for Java/Jython

so I guess this is missing in your case looking at the error message:
ImportError: No Java Communications API implementation found

I guess the package tries to load "JavaComm" in its __init__.py and fails, since it cannot find it. So the import is aborted.

Can you help with this problem?

Provide an answer of your own, or ask Umesh Raj for more information if necessary.

To post a message you must log in.