Mostly working, may need to improve handling of sporadic extra null byte

This commit is contained in:
2025-10-27 09:34:28 +01:00
parent c625b1f446
commit 6048831515
6 changed files with 37 additions and 10 deletions

12
Makefile Normal file
View File

@@ -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

7
README.md Normal file
View File

@@ -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.

View File

@@ -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";
}

12
epluse.cmd Normal file
View File

@@ -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")

View File

@@ -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")