EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Error executing a sample Arduino IOC
From: Michael Davidsaver via Tech-talk <tech-talk at aps.anl.gov>
To: Udit Shah <shahudit2311 at gmail.com>
Cc: tech-talk at aps.anl.gov
Date: Sun, 7 Mar 2021 21:28:40 -0800
On 3/7/21 9:11 PM, Udit Shah via Tech-talk wrote:
> Hi,
> 
> Today i wrote a simple serial communication IOC for Arduino and all the steps went successfully but showed a package parse error and couldn't read the protocol and .db files for the Arduino.
> 
> I followed the steps given on:
> https://web.archive.org/web/20180417224946/http://www.smolloy.com/2015/12/epics-serial-communication-with-arduino/ <https://web.archive.org/web/20180417224946/http://www.smolloy.com/2015/12/epics-serial-communication-with-arduino/>
> 
> The following was shown in the terminal:
> 
> #!../../bin/linux-x86_64/helloWorldIOC
> < envPaths
> epicsEnvSet("IOC","iochelloWorldIOC")
> epicsEnvSet("TOP","/home/udit/EPICS/IOCs/helloWorldIOC")
> epicsEnvSet("ASYN","/home/udit/EPICS/support/asyn")
> epicsEnvSet("CALC","/home/udit/EPICS/support/calc-R3-7-3")
> epicsEnvSet("STREAM","/home/udit/EPICS/support/StreamDevice")
> epicsEnvSet("EPICS_BASE","/home/udit/EPICS/epics-base")
> epicsEnvSet(STREAM_PROTOCOL_PATH,"helloWorldIOCApp/Db")

Try changing this line to:

> epicsEnvSet(STREAM_PROTOCOL_PATH,"$(TOP)/helloWorldIOCApp/Db")

Relative paths in $(STREAM_PROTOCOL_PATH) aren't evaluated
until later, during iocInit().

Personally, I would suggest not having so many "cd" in a start script.
It's easy to get confused.


> cd "/home/udit/EPICS/IOCs/helloWorldIOC"
> ## Register all support components
> dbLoadDatabase "dbd/helloWorldIOC.dbd"
> helloWorldIOC_registerRecordDeviceDriver pdbbase
> drvAsynSerialPortConfigure("SERIALPORT","/dev/ttyUSB0")
> asynSetOption("SERIALPORT",-1,"baud","115200")
> asynSetOption("SERIALPORT",-1,"bits","8")
> asynSetOption("SERIALPORT",-1,"parity","none")
> asynSetOption("SERIALPORT",-1,"stop","1")
> asynSetOption("SERIALPORT",-1,"clocal","Y")
> asynSetOption("SERIALPORT",-1,"crtscts","N")
> ## Load record instances
> #dbLoadRecords("db/xxx.db","user=udit")
> cd "/home/udit/EPICS/IOCs/helloWorldIOC"
> dbLoadRecords("db/arduino.db","PORT=SERIALPORT")
> cd "/home/udit/EPICS/IOCs/helloWorldIOC/iocBoot/iochelloWorldIOC"
> iocInit
> Starting iocInit
> ############################################################################
> ## EPICS R7.0.4.2-DEV
> ## Rev. R7.0.4.1-186-g5593103c11157aada4e4-dirty
> ############################################################################
> 2021/03/08 10:31:16.749971 _main_ Can't find readable file 'arduino.proto' in 'helloWorldIOCApp/Db'
> 2021/03/08 10:31:16.750018 _main_ while reading protocol 'set_digital' for 'led:set'
> 2021/03/08 10:31:16.750025 _main_ led:set: Protocol parse error
> 2021/03/08 10:31:16.750032 _main_ led:set: Record initialization failed
> Error (514,11) PV: led:set ao: init_record
> 
> 2021/03/08 10:31:16.750066 _main_ Can't find readable file 'arduino.proto' in 'helloWorldIOCApp/Db'
> 2021/03/08 10:31:16.750078 _main_ while reading protocol 'get_analog' for 'photo:get'
> 2021/03/08 10:31:16.750091 _main_ photo:get: Protocol parse error
> 2021/03/08 10:31:16.750107 _main_ photo:get: Record initialization failed
> iocRun: All initialization complete
> ## Start any sequence programs
> #seq sncxxx,"user=udit"
> epics>
> 
> Let me know how to remove this error.
> 
> Best Regards
> Udit


References:
Error executing a sample Arduino IOC Udit Shah via Tech-talk

Navigate by Date:
Prev: Error executing a sample Arduino IOC Udit Shah via Tech-talk
Next: RE: weird record names? Alfio Rizzo via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
Navigate by Thread:
Prev: Error executing a sample Arduino IOC Udit Shah via Tech-talk
Next: RE: weird record names? Alfio Rizzo via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
ANJ, 08 Mar 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·