diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4679100 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +include /ioc/tools/driver.makefile + +MODULE=epluse + +BUILDCLASSES=Linux +EPICS_VERSIONS=7.0.7 +ARCH_FILTER=RHEL% + +TEMPLATES += epluse.db +TEMPLATES += epluse.proto + +SCRIPTS += epluse.cmd diff --git a/README.md b/README.md new file mode 100644 index 0000000..b3f22dc --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +## EPICS support for EplusE environmental sensors + +Basic support EplusE environmental sensors, right now only reads +temperature and relative humidity. + +### Protocol +These device has a binary protocol, which are supported through streamdevice. diff --git a/epluse_rht.db b/db/epluse.db similarity index 100% rename from epluse_rht.db rename to db/epluse.db diff --git a/epluse_rht.proto b/db/epluse.proto similarity index 61% rename from epluse_rht.proto rename to db/epluse.proto index 513b11d..30401d9 100644 --- a/epluse_rht.proto +++ b/db/epluse.proto @@ -11,13 +11,16 @@ fetch_rht { # 4th byte length of message, 2 bytes # 5th and 6th byte, data. For this case it is 1 - out 0x0000 0x67 0x02 0x0001 0x6a; + out 0x00 0x00 0x67 0x02 0x00 0x01 0x6a; # First 2 bytes is address + # 0xca8b is the unit at neutra # command # length # ack - # ack + # 0x00, unknown what this is # 2 ieee_754 floats. # Read exactly one char, but drop it. crc8 - in 0x0000 0x67 0x0A 0x06 0x06 "%(\$1:TEMP)#R%(\$1:RELHUM)#R%*c" + # The device sometimes adds an extra 0x00 at the end...weird + $ this is handled with ?c command + in 0xca 0x8b 0x67 0x0A 0x06 0x00 "%(\$1:TEMP)#R%(\$1:RELHUM)#R%*c%?c"; } diff --git a/epluse.cmd b/epluse.cmd new file mode 100644 index 0000000..7a4aef9 --- /dev/null +++ b/epluse.cmd @@ -0,0 +1,12 @@ +require asyn +require stream +# Parameterized snippet to load support for the eplue EE31 environmental sensor used at ICON and Neutra. + +# cmd file needs the macros INSTR, typically capital letter name of the instrument, and +# and MOXA_ADDR on format hostname:port. + +epicsEnvSet("PROTO", "$(epluse_DB)epluse.proto") + +drvAsynIPPortConfigure("$(INSTR)-sps", "$(MOXA_ADDR)",0,0,0) + +dbLoadRecords("$(epluse_DB)epluse.db", "PREFIX=SQ:$(INSTR), PORT=$(INSTR)-sps") diff --git a/epluse_rht.cmd b/epluse_rht.cmd deleted file mode 100644 index c8c7d45..0000000 --- a/epluse_rht.cmd +++ /dev/null @@ -1,7 +0,0 @@ -require asyn -require stream -# Parameterized snippet to load support for the eplue EE31 environmental sensor used at ICON and Neutra. - -drvAsynIPPortConfigure("neutra-sps", "neutra-sps:4001",0,0,0) - -dbLoadRecords("epluse_rht.db", "PREFIX=SQ:NEUTRA, PORT=neutra-sps")