Coder Social home page Coder Social logo

rstrouse / relayequipmentmanager Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 18.0 1.59 MB

A hardware controller for GPIO, I2c, SPI, and generic devices.

License: GNU General Public License v3.0

TypeScript 57.48% JavaScript 36.49% HTML 0.15% CSS 2.89% SCSS 3.00%

relayequipmentmanager's People

Contributors

dependabot[bot] avatar lymanepp avatar rstrouse avatar tagyoureit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

relayequipmentmanager's Issues

FEATURE REQUEST: d18b20 temp sensor over 1wire

Just logging this as a wish list item. I wish I could help with the code but I do have these connected to my pi right now. Currently using python to grab values.

Happy to help test if you guys want to take a stab at adding support at some point.

sudo command in the code

In the class OneWireBus.ts
Line: 527
The sudo command is issued from within the code. I discovered this because I come from an enterprise systems background where we create users to run applications and give them permissions to run only what they need. For REM I created a user called "poolRelay", which does not have sudo access, and it does not have a password assigned to it which also prevents ssh access through that user.

So when you make changes to a w1 device and click save in REM, you get this error:

[22/02/2023, 15:26:39] error: Pool Return Temp error getting conversion time: Error: Command failed: echo 41 127 | sudo tee -a /sys/bus/w1/devices/w1_bus_master1/28-3c01f09638f9/alarms

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required

Since REM also needs access to the GPIO, I added poolRelay to the gpio user group.
So my suggestion would be to add these commands to the user installation instructions and remove the "sudo" from the code.

sudo adduser poolRelay gpio
sudo chown root:gpio /sys/bus/w1/devices/w1_bus_master1/28-3c01f09638f9/alarms
sudo chmod 664 /sys/bus/w1/devices/w1_bus_master1/28-3c01f09638f9/alarms

Of course the user would have to change the permissions for each W1 device, but its a 1 time change at install. You can also change 'poolRelay' to 'pi' so users don't have to use a separate user if they don't want to.

SyntaxError: Unexpected end of JSON input

Running REM latest build as of 5/5/21

I am getting the following exception in the console that crashes the execution of REM:

/home/pi/relayEquipmentManager/config/Config.ts:29
                            this._cfg = fs.existsSync(this.cfgPath) ? JSON.parse(fs.readFileSync(this.cfgPath, "utf8")) : {};
                                                                           ^
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at FSWatcher.<anonymous> (/home/pi/relayEquipmentManager/config/Config.ts:29:76)
    at FSWatcher.emit (events.js:315:20)
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:186:12)

I am assuming the config file in question is controllerConfig.json so I have attached it for reference but I put it though a json linter and it appears to be valid.

controllerConfig.zip

I am not sure what exactly I changed that caused this but the error. Sometimes it crashes shorlty after startup, sometimes it runs for a while and I can send it commands from NJSPC and then later it crashes.
I don't think the crashes have anything to do with any magic sequence of input events.

I turned on Debug level logging, below is a trace of some output before a crash occured:

setDeviceState: gpio:1:21 - {"isOn":false}
debug: Writing Pin #1:21 -> GPIO #9 to 0
debug: Persisting Configuration data...
verbose: 192.168.1.80 PUT /state/device/gpio:1:19 {"isOn":true,"latch":10000}
info: [9:01:07 AM] 192.168.1.80 PUT /state/device/gpio:1:19 {"isOn":true,"latch":10000}
setDeviceState: gpio:1:19 - {"isOn":true,"latch":10000}
debug: Writing Pin #1:19 -> GPIO #10 to 1
verbose: 192.168.1.80 PUT /state/device/gpio:1:19 {"isOn":true,"latch":10000}
info: [9:01:07 AM] 192.168.1.80 PUT /state/device/gpio:1:19 {"isOn":true,"latch":10000}
setDeviceState: gpio:1:19 - {"isOn":true,"latch":10000}
debug: Writing Pin #1:19 -> GPIO #10 to 1
info: [9:01:08 AM] 192.168.1.88 GET /device {}
verbose: 192.168.1.80 PUT /state/device/gpio:1:19 {"isOn":false}
info: [9:01:08 AM] 192.168.1.80 PUT /state/device/gpio:1:19 {"isOn":false}
setDeviceState: gpio:1:19 - {"isOn":false}
debug: Writing Pin #1:19 -> GPIO #10 to 0
info: [9:01:08 AM] 192.168.1.53 GET /device {}
debug: Persisting Configuration data...
info: [9:01:18 AM] 192.168.1.88 GET /device {}
info: [9:01:18 AM] 192.168.1.53 GET /device {}
info: [9:01:28 AM] 192.168.1.88 GET /device {}
info: [9:01:28 AM] 192.168.1.53 GET /device {}
info: [9:01:38 AM] 192.168.1.88 GET /device {}
info: [9:01:38 AM] 192.168.1.53 GET /device {}
info: [9:01:48 AM] 192.168.1.88 GET /device {}
info: [9:01:48 AM] 192.168.1.53 GET /device {}
info: [9:01:58 AM] 192.168.1.88 GET /device {}
info: [9:01:58 AM] 192.168.1.53 GET /device {}
info: [9:02:08 AM] 192.168.1.88 GET /device {}
info: [9:02:08 AM] 192.168.1.53 GET /device {}
info: [9:02:18 AM] 192.168.1.88 GET /device {}
info: [9:02:18 AM] 192.168.1.53 GET /device {}
info: [9:02:28 AM] 192.168.1.88 GET /device {}
info: [9:02:28 AM] 192.168.1.53 GET /device {}
info: [9:02:38 AM] 192.168.1.88 GET /device {}
info: [9:02:38 AM] 192.168.1.53 GET /device {}

/home/pi/relayEquipmentManager/config/Config.ts:29
                            this._cfg = fs.existsSync(this.cfgPath) ? JSON.parse(fs.readFileSync(this.cfgPath, "utf8")) : {};
                                                                           ^
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at FSWatcher.<anonymous> (/home/pi/relayEquipmentManager/config/Config.ts:29:76)
    at FSWatcher.emit (events.js:315:20)
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:186:12)

ORP SWG Chlorinator

Here is the code I use for Home Assistant written in Python for AppDaemon it returns a sensor with free chlorine

import appdaemon.plugins.hass.hassapi as hass

class free_chlorine(hass.Hass):

    def initialize(self):
        self.listen_state(self.calc_fc,"sensor.orp")
        self.listen_state(self.calc_fc,"sensor.ph")
    
    def average(self, lst):
            return sum(lst) / len(lst)

    def calc_fc (self, entity, attribute, old, new, kwargs):
        def average(self, lst):
            return sum(lst) / len(lst)

        ch={565: {8.0: 0.365203237, 7.8: 0.353589963, 7.6: 0.357233469, 7.5: 0.341130227, 7.4: 0.33716321, 7.3: 0.333625002, 7.2: 0.33012171, 7.1: 0.326682588, 7.0: 0.323287991, 6.9: 0.318597988, 6.8: 0.314325396, 6.7: 0.31076995}, 570: {8.0: 0.381176187, 7.8: 0.369046499, 7.6: 0.374573545, 7.5: 0.353926868, 7.4: 0.350965227, 7.3: 0.346398366, 7.2: 0.343331909, 7.1: 0.339150991, 7.0: 0.335535194, 6.9: 0.331127594, 6.8: 0.326116521, 6.7: 0.323281217}, 575: {8.0: 0.402610698, 7.8: 0.385473631, 7.6: 0.390471672, 7.5: 0.370220902, 7.4: 0.366278894, 7.3: 0.361271083, 7.2: 0.355481721, 7.1: 0.353114272, 7.0: 0.348190232, 6.9: 0.343377509, 6.8: 0.33834996, 6.7: 0.332423001}, 580: {8.0: 0.420247254, 7.8: 0.404682881, 7.6: 0.404125551, 7.5: 0.388852928, 7.4: 0.381253321, 7.3: 0.376070571, 7.2: 0.37034679, 7.1: 0.366575591, 7.0: 0.361354889, 6.9: 0.357247813, 6.8: 0.351042306, 6.7: 0.34538847}, 585: {8.0: 0.438529325, 7.8: 0.422830868, 7.6: 0.425638899, 7.5: 0.405093933, 7.4: 0.398153719, 7.3: 0.39241141, 7.2: 0.384810073, 7.1: 0.383742372, 7.0: 0.374865505, 6.9: 0.367807256, 6.8: 0.362723549, 6.7: 0.357054272}, 590: {8.0: 0.461144497, 7.8: 0.442276845, 7.6: 0.434112056, 7.5: 0.422013268, 7.4: 0.415337806, 7.3: 0.408726377, 7.2: 0.401741394, 7.1: 0.39599203, 7.0: 0.389871038, 6.9: 0.38197767, 6.8: 0.374793495, 6.7: 0.36748444}, 595: {8.0: 0.484265657, 7.8: 0.462920998, 7.6: 0.453233685, 7.5: 0.437800363, 7.4: 0.433349647, 7.3: 0.425440759, 7.2: 0.418213776, 7.1: 0.411067105, 7.0: 0.404639454, 6.9: 0.396138028, 6.8: 0.390447288, 6.7: 0.382981761}, 600: {8.0: 0.496443889, 7.8: 0.485837915, 7.6: 0.474732476, 7.5: 0.461764891, 7.4: 0.452151369, 7.3: 0.442952521, 7.2: 0.432576774, 7.1: 0.427010853, 7.0: 0.418981842, 6.9: 0.410766258, 6.8: 0.403439765, 6.7: 0.394278481}, 605: {8.0: 0.530902079, 7.8: 0.508558001, 7.6: 0.494548371, 7.5: 0.48105117, 7.4: 0.470767875, 7.3: 0.46228092, 7.2: 0.452047372, 7.1: 0.446190919, 7.0: 0.435643664, 6.9: 0.425946672, 6.8: 0.41686458, 6.7: 0.407813636}, 610: {8.0: 0.545136245, 7.8: 0.531569992, 7.6: 0.518635837, 7.5: 0.501142968, 7.4: 0.492090223, 7.3: 0.481550098, 7.2: 0.472166868, 7.1: 0.462430302, 7.0: 0.452536204, 6.9: 0.442287078, 6.8: 0.432502204, 6.7: 0.421619351}, 615: {8.0: 0.575936428, 7.8: 0.557622719, 7.6: 0.539872583, 7.5: 0.524214517, 7.4: 0.511595288, 7.3: 0.502036332, 7.2: 0.490429728, 7.1: 0.481273496, 7.0: 0.4699898, 6.9: 0.460439191, 6.8: 0.448726433, 6.7: 0.435139099}, 620: {8.0: 0.613451865, 7.8: 0.583805484, 7.6: 0.565636191, 7.5: 0.546109095, 7.4: 0.533725118, 7.3: 0.523923223, 7.2: 0.512642439, 7.1: 0.499614886, 7.0: 0.486602354, 6.9: 0.476348708, 6.8: 0.462829942, 6.7: 0.451916221}, 625: {8.0: 0.62691394, 7.8: 0.612461274, 7.6: 0.586867822, 7.5: 0.573593007, 7.4: 0.556986901, 7.3: 0.545347253, 7.2: 0.530654647, 7.1: 0.51987608, 7.0: 0.506506892, 6.9: 0.492720873, 6.8: 0.483122751, 6.7: 0.4654544}, 630: {8.0: 0.659378587, 7.8: 0.639453032, 7.6: 0.617897925, 7.5: 0.597177236, 7.4: 0.581297469, 7.3: 0.566547985, 7.2: 0.551318454, 7.1: 0.541179914, 7.0: 0.525366305, 6.9: 0.509417297, 6.8: 0.498401841, 6.7: 0.483625425}, 635: {8.0: 0.715647947, 7.8: 0.670655773, 7.6: 0.63842103, 7.5: 0.615887256, 7.4: 0.605064353, 7.3: 0.591609944, 7.2: 0.57603237, 7.1: 0.563343011, 7.0: 0.54501006, 6.9: 0.530125931, 6.8: 0.515381736, 6.7: 0.498404613}, 640: {8.0: 0.726417047, 7.8: 0.701569618, 7.6: 0.66105975, 7.5: 0.642128643, 7.4: 0.631464828, 7.3: 0.617851826, 7.2: 0.59864952, 7.1: 0.585918834, 7.0: 0.567234703, 6.9: 0.54808675, 6.8: 0.535906797, 6.7: 0.515621285}, 645: {8.0: 0.762930378, 7.8: 0.736330019, 7.6: 0.692160397, 7.5: 0.682986585, 7.4: 0.659119464, 7.3: 0.642117049, 7.2: 0.624654899, 7.1: 0.605557328, 7.0: 0.587019592, 6.9: 0.568386727, 6.8: 0.549216183, 6.7: 0.533947076}, 650: {8.0: 0.805728595, 7.8: 0.768337637, 7.6: 0.734714395, 7.5: 0.706965436, 7.4: 0.687763372, 7.3: 0.668108324, 7.2: 0.646303032, 7.1: 0.628709635, 7.0: 0.61217215, 6.9: 0.589642213, 6.8: 0.57476346, 6.7: 0.548103803}, 655: {8.0: 0.870992745, 7.8: 0.806318761, 7.6: 0.759809172, 7.5: 0.743334157, 7.4: 0.718014311, 7.3: 0.695178951, 7.2: 0.672579801, 7.1: 0.654624629, 7.0: 0.631974869, 6.9: 0.612451847, 6.8: 0.587277065, 6.7: 0.572026762}, 660: {8.0: 0.91156, 7.8: 0.846047248, 7.6: 0.802625927, 7.5: 0.772821935, 7.4: 0.749081444, 7.3: 0.725690166, 7.2: 0.70040486, 7.1: 0.679998519, 7.0: 0.659653245, 6.9: 0.634485298, 6.8: 0.614363016, 6.7: 0.588438597}, 665: {8.0: 0.938906811, 7.8: 0.895246616, 7.6: 0.826026051, 7.5: 0.807024129, 7.4: 0.780490143, 7.3: 0.756160995, 7.2: 0.729867452, 7.1: 0.704530024, 7.0: 0.68091992, 6.9: 0.658444199, 6.8: 0.632549068, 6.7: 0.609509334}, 670: {8.0: 1.028982139, 7.8: 0.938651888, 7.6: 0.866370059, 7.5: 0.846342552, 7.4: 0.814035975, 7.3: 0.788401289, 7.2: 0.76093799, 7.1: 0.732234901, 7.0: 0.706615942, 6.9: 0.681854448, 6.8: 0.650989212, 6.7: 0.628567308}, 675: {8.0: 1.074194147, 7.8: 0.989621929, 7.6: 0.918553687, 7.5: 0.881232016, 7.4: 0.849268313, 7.3: 0.822768266, 7.2: 0.788209137, 7.1: 0.762167539, 7.0: 0.732592623, 6.9: 0.707654436, 6.8: 0.674047867, 6.7: 0.645482035}, 680: {8.0: 1.129411063, 7.8: 1.038438834, 7.6: 0.963549048, 7.5: 0.922019467, 7.4: 0.888651663, 7.3: 0.856423196, 7.2: 0.820679366, 7.1: 0.791321131, 7.0: 0.766661801, 6.9: 0.732559615, 6.8: 0.697078445, 6.7: 0.670204329}, 685: {8.0: 1.243967246, 7.8: 1.101329995, 7.6: 1.005784899, 7.5: 0.963707796, 7.4: 0.92928208, 7.3: 0.892002697, 7.2: 0.857573965, 7.1: 0.821402985, 7.0: 0.793410856, 6.9: 0.75456291, 6.8: 0.723405308, 6.7: 0.69871156}, 690: {8.0: 1.299414953, 7.8: 1.165907505, 7.6: 1.055796765, 7.5: 1.0130058, 7.4: 0.97045294, 7.3: 0.931571511, 7.2: 0.889390374, 7.1: 0.856130197, 7.0: 0.818645502, 6.9: 0.786473751, 6.8: 0.750038631, 6.7: 0.719299167}, 695: {8.0: 1.418036744, 7.8: 1.243539996, 7.6: 1.111701653, 7.5: 1.05677262, 7.4: 1.014465743, 7.3: 0.972891214, 7.2: 0.928283248, 7.1: 0.894487677, 7.0: 0.852596109, 6.9: 0.81382482, 6.8: 0.776654278, 6.7: 0.742613529}, 700: {8.0: 1.533723514, 7.8: 1.322892613, 7.6: 1.17214404, 7.5: 1.127185766, 7.4: 1.059971899, 7.3: 1.015840377, 7.2: 0.967374565, 7.1: 0.923902057, 7.0: 0.874572418, 6.9: 0.845807002, 6.8: 0.800544422, 6.7: 0.764284477}, 705: {8.0: 1.688084562, 7.8: 1.421384818, 7.6: 1.225439171, 7.5: 1.171115849, 7.4: 1.114786154, 7.3: 1.060321962, 7.2: 1.010972844, 7.1: 0.963811073, 7.0: 0.91944096, 6.9: 0.875227342, 6.8: 0.833592131, 6.7: 0.789679398}, 710: {8.0: 1.876825856, 7.8: 1.531819687, 7.6: 1.304230727, 7.5: 1.248902205, 7.4: 1.169494102, 7.3: 1.112438547, 7.2: 1.059537047, 7.1: 1.004355739, 7.0: 0.952361802, 6.9: 0.918871749, 6.8: 0.863230785, 6.7: 0.819403399}, 715: {8.0: 2.140467236, 7.8: 1.668442076, 7.6: 1.420227885, 7.5: 1.310824605, 7.4: 1.233944389, 7.3: 1.167121988, 7.2: 1.101309174, 7.1: 1.04569919, 7.0: 0.99340126, 6.9: 0.945995661, 6.8: 0.899340942, 6.7: 0.84969306}, 720: {8.0: 2.365361367, 7.8: 1.826189207, 7.6: 1.489581318, 7.5: 1.412851069, 7.4: 1.301466606, 7.3: 1.224457614, 7.2: 1.151995947, 7.1: 1.091197877, 7.0: 1.032098454, 6.9: 0.978674742, 6.8: 0.930525155, 6.7: 0.879595383}, 725: {8.0: 2.733917365, 7.8: 2.031269902, 7.6: 1.634748415, 7.5: 1.506018466, 7.4: 1.37974373, 7.3: 1.291581464, 7.2: 1.210741557, 7.1: 1.142886715, 7.0: 1.084281089, 6.9: 1.022813283, 6.8: 0.962308726, 6.7: 0.909733725}, 730: {8.0: 3.349277338, 7.8: 2.272518185, 7.6: 1.778603994, 7.5: 1.59514071, 7.4: 1.466398494, 7.3: 1.362032922, 7.2: 1.268724598, 7.1: 1.197370023, 7.0: 1.123424292, 6.9: 1.063331836, 6.8: 1.005472933, 6.7: 0.943832634}, 735: {8.0: 3.80602695, 7.8: 2.58235731, 7.6: 1.934820082, 7.5: 1.719557165, 7.4: 1.572057, 7.3: 1.447864238, 7.2: 1.345222661, 7.1: 1.257786498, 7.0: 1.181622035, 6.9: 1.109535116, 6.8: 1.045689503, 6.7: 0.977333119}, 740: {8.0: 4.698559409, 7.8: 2.953605905, 7.6: 2.142136901, 7.5: 1.854829735, 7.4: 1.684464222, 7.3: 1.540351257, 7.2: 1.422046025, 7.1: 1.328838105, 7.0: 1.230143187, 6.9: 1.15170305, 6.8: 1.085102014, 6.7: 1.01456123}, 745: {8.0: 5.586106227, 7.8: 3.471884717, 7.6: 2.408771289, 7.5: 2.08838225, 7.4: 1.835702402, 7.3: 1.660304509, 7.2: 1.515610682, 7.1: 1.391482485, 7.0: 1.299347712, 6.9: 1.212908816, 6.8: 1.13375054, 6.7: 1.053653374}, 750: {8.0: 6.773575908, 7.8: 4.07825695, 7.6: 2.678031681, 7.5: 2.298063007, 7.4: 2.003256435, 7.3: 1.786143393, 7.2: 1.617022176, 7.1: 1.47877295, 7.0: 1.361248816, 6.9: 1.275852965, 6.8: 1.171144016, 6.7: 1.092869745}, 755: {8.0: 8.76206331, 7.8: 4.932616063, 7.6: 3.091532155, 7.5: 2.613513201, 7.4: 2.230179025, 7.3: 1.949283871, 7.2: 1.743458894, 7.1: 1.57241167, 7.0: 1.451976229, 6.9: 1.329988758, 6.8: 1.213868627, 6.7: 1.141005577}, 760: {8.0: 11.02119248, 7.8: 5.982999975, 7.6: 3.644083496, 7.5: 2.960669933, 7.4: 2.48143458, 7.3: 2.134556486, 7.2: 1.881903033, 7.1: 1.683071452, 7.0: 1.526416964, 6.9: 1.39828752, 6.8: 1.289353681, 6.7: 1.184617682}, 765: {8.0: 14.57635582, 7.8: 7.42146836, 7.6: 4.248741151, 7.5: 3.487025829, 7.4: 2.835406871, 7.3: 2.392021688, 7.2: 2.071091978, 7.1: 1.817510176, 7.0: 1.64426065, 6.9: 1.491631394, 6.8: 1.357422205, 6.7: 1.242896808}, 770: {8.0: 18.06795132, 7.8: 9.248296674, 7.6: 5.164915721, 7.5: 4.01122052, 7.4: 3.239255123, 7.3: 2.691410645, 7.2: 2.276979968, 7.1: 2.000489884, 7.0: 1.752546267, 6.9: 1.576513161, 6.8: 1.422457733, 6.7: 1.300093987}, 775: {7.8: 11.76913935, 7.6: 6.408200579, 7.5: 4.869549388, 7.4: 3.81762875, 7.3: 3.09120168, 7.2: 2.562417967, 7.1: 2.207054065, 7.0: 1.919739576, 6.9: 1.693953179, 6.8: 1.505742613, 6.7: 1.371561971}, 780: {7.8: 14.92337573, 7.6: 7.840668132, 7.5: 5.957564713, 7.4: 4.493333361, 7.3: 3.553592756, 7.2: 2.887784753, 7.1: 2.431920744, 7.0: 2.080296631, 6.9: 1.825171181, 6.8: 1.614752564, 6.7: 1.446760213}, 785: {7.8: 19.26826199, 7.6: 9.71915414, 7.5: 7.19875687, 7.4: 5.429358116, 7.3: 4.214308587, 7.2: 3.351823199, 7.1: 2.762879844, 7.0: 2.333712998, 6.9: 2.009206492, 6.8: 1.745637385, 6.7: 1.546100681}, 790: {7.6: 12.37193192, 7.5: 8.931788487, 7.4: 6.597451433, 7.3: 5.013628148, 7.2: 3.894644278, 7.1: 3.140922865, 7.0: 2.590993437, 6.9: 2.197051548, 6.8: 1.890833326, 6.7: 1.652614832}, 795: {7.6: 16.11787326, 7.5: 11.5273107, 7.4: 8.209726708, 7.3: 6.121537424, 7.2: 4.653155189, 7.1: 3.677397432, 7.0: 2.982855424, 6.9: 2.45732819, 6.8: 2.080081883, 6.7: 1.795786446}, 800: {7.6: 19.8608854, 7.5: 14.63043838, 7.4: 10.26451336, 7.3: 7.49619985, 7.2: 5.589447222, 7.1: 4.316962355, 7.0: 3.405398425, 6.9: 2.780071415, 6.8: 2.318526723, 6.7: 1.950232212}, 805: {7.5: 18.22564833, 7.4: 13.03003649, 7.3: 9.393928111, 7.2: 6.891489633, 7.1: 5.199955482, 7.0: 4.042605481, 6.9: 3.226124675, 6.8: 2.608219934, 6.7: 2.174690304}, 810: {7.4: 16.55557543, 7.3: 11.77898029, 7.2: 8.550434621, 7.1: 6.286881012, 7.0: 4.779373573, 6.9: 3.738635889, 6.8: 2.965559318, 6.7: 2.420341224}, 815: {7.3: 15.06024435, 7.2: 10.76464969, 7.1: 7.85555097, 7.0: 5.820177069, 6.9: 4.488204399, 6.8: 3.455559691, 6.7: 2.772263376}, 820: {7.3: 19.3003772, 7.2: 13.54229582, 7.1: 9.687140341, 7.0: 7.093556018, 6.9: 5.327577213, 6.8: 4.047624962, 6.7: 3.178079278}, 825: {7.2: 17.45987857, 7.1: 12.32447167, 7.0: 8.905060489, 6.9: 6.671020421, 6.8: 4.880211487, 6.7: 3.751380861}, 830: {7.2: 22.43600366, 7.1: 15.68080405, 7.0: 11.15458587, 6.9: 7.920529837, 6.8: 5.94740278, 6.7: 4.448474768}, 835: {7.2: 29.15291161, 7.1: 20.78138228, 7.0: 14.19854804, 6.9: 10.52543426, 6.8: 7.299666149, 6.7: 5.406534596}, 840: {7.0: 17.99627874, 6.9: 12.49497897, 6.8: 9.01316511, 6.7: 6.566964627}, 845: {6.9: 16.68849234, 6.8: 11.43538885, 6.7: 8.215178358}, 850: {6.9: 20.87075026, 6.8: 14.48660269, 6.7: 10.28664983}, 855: {6.9: 27.18232321, 6.8: 18.72764056, 6.7: 13.15681958}, 860: {6.7: 16.61275882}}

        ph=float(self.get_state("sensor.ph"))
        orp=float(self.get_state("sensor.orp"))

        last_orp=0
        next_orp=0
        last_fc=0
        next_fc=0
        fc=[]
        for k,v in ch.items():
          if orp > k:
              last_orp=k
              pass
          else:
              next_orp=k
              break
        for k,v in ch[last_orp].items():
          print('ph: {}, key: {}, value: {} in {}, condition is: {}'.format(ph,k,v,last_orp,(ph>k)))
          if ph < k:
              last_fc=v
              pass
          else:
              next_fc=v
              fc.append(last_fc)
              fc.append(next_fc)
              break
        for k,v in ch[next_orp].items():
            print('ph: {}, key: {}, value: {} in {}, condition is: {}'.format(ph,k,v,next_orp,(ph>k)))
            if ph < k:
              last_fc=v
              pass
            else:
              next_fc=v
              fc.append(last_fc)
              fc.append(next_fc)
              break
        self.set_state("sensor.fc",state=round(self.average(fc),2), attributes = {"unit_of_measurement": "ppm", "friendly_name": "Free Chlorine"})
        return True

proper permissions to start REM with pm2?

I can run REM as pi using npm start and everything works fine (i2c, etc)

When I run with pm2 (as pi), it gets caught in a loop:

3|relayEquipmentManager  | > [email protected] start /home/pi/relayEquipmentManager
3|relayEquipmentManager  | > npm run build && node dist/app.js
3|relayEquipmentManager  | > [email protected] build /home/pi/relayEquipmentManager
3|relayEquipmentManager  | > tsc
3|relayEquipmentManager  | linux
3|relayEquipmentManager  | info: Connecting mqtt to mqtt://192.168.5.140:1883
3|relayEquipmentManager  | info: Initializing GPIO Pins 1
3|relayEquipmentManager  | info: Configuring Pin #36 Gpio #16:out on Header 1.
3|relayEquipmentManager  | info: Pin #36 Gpio #16:out on Header 1 Configured.
3|relayEquipmentManager  | info: Initializing SPI Bus #0
3|relayEquipmentManager  | info: SPI Bus #0 Initialized
3|relayEquipmentManager  | info: Initializing SPI Bus #1
3|relayEquipmentManager  | info: SPI Bus #1 Initialized
3|relayEquipmentManager  | info: Initializing i2c Interface
3|relayEquipmentManager  | info: Detecting i2c Buses
3|relayEquipmentManager  | info: Detecting i2c Buses /sys/class/i2c-dev/i2c-1
3|relayEquipmentManager  | info: Initializing i2c Bus #1
3|relayEquipmentManager  | info: Server is now listening on 0.0.0.0:8085
3|relayEquipmentManager  | info: Connected to njspc-15620 : http://192.168.5.205:4200
3|relayEquipmentManager  | info: Scanning i2c Bus #1
3|relayEquipmentManager  | info: Found I2C device Atlas_EZO-ORP at address: 0x62
3|relayEquipmentManager  | info: Found I2C device Atlas_EZO-pH at address: 0x63
3|relayEquipmentManager  | warn: Atlas_EZO-ORP Suspend Polling 3
3|relayEquipmentManager  | info: Device Atlas EZO-ORP initialized for i2c bus #1 address 98
3|relayEquipmentManager  | info: New socket client connected RpewmNvFknuFdwhtAAAA -- 192.168.5.205
3|relayEquipmentManager  | warn: Atlas_EZO-pH - Device not ready re-trying the command L,? again: Retries 0.
3|relayEquipmentManager  | error: Atlas_EZO-pH 99 Slope,?. No I2c data to send
3|relayEquipmentManager  | info: Device Atlas EZO-pH initialized for i2c bus #1 address 99
3|relayEquipmentManager  | info: i2c Bus #1 Initialized
3|relayEquipmentManager  | info: New socket client connected 78V4RAsegw8D1nYYAAAB -- 192.168.5.138
**3|relayEquipmentManager  | Shutting down Relay Equipment Manager**
3|relayEquipmentManager  | info: Closing 2 devices.
3|relayEquipmentManager  | info: Stopped I2c Atlas_EZO-ORP
3|relayEquipmentManager  | info: Stopped I2c Atlas_EZO-pH
3|relayEquipmentManager  | info: Closed i2c Bus #1
3|relayEquipmentManager  | info: Stopping GPIO Controller
3|relayEquipmentManager  | > [email protected] start /home/pi/relayEquipmentManager
3|relayEquipmentManager  | > npm run build && node dist/app.js
3|relayEquipmentManager  | > [email protected] build /home/pi/relayEquipmentManager
3|relayEquipmentManager  | > tsc

Not a lot there to tell me what's going on. Here's my pm2 ecosystem js file:

module.exports = {
 apps: [
         {
             "name": "relayEquipmentManager",
             "script": "npm",
             "args": [
                 "start"
             ],
             "cwd": "/home/pi/relayEquipmentManager",
             "autorestart": false,
             "restart_delay": 10000,
             "env": {
                 "NODE_ENV": ""
             },
             "watch": true,
             "ignore_watch": ["node_modules", "config.json", "src", "dist", ".cache"]
         }
     ],
   deploy : {
     production : {
       user : 'SSH_USERNAME',
       host : 'SSH_HOSTMACHINE',
       ref  : 'origin/master',
       repo : 'GIT_REPOSITORY',
       path : 'DESTINATION_PATH',
       'pre-deploy-local': '',
       'post-deploy' : 'npm install && pm2 reload ecosystem.config.js --env production',
       'pre-setup': ''
     }
   }
};

See anything obvious that would cause a loop? Any way to increase logging on REM to give more details about why it's shutting down?

Not a big deal as I can run directly using npm start but would be better process mgmt if I could get it to work using pm2.

UART Support for EZO?

Have you considered adding UART support for the EZO devices? In my custom app I created last year, I used UART for all of the EZO device communication. I used a the GPIO compatible UART pins, plus a couple of USB to UART devices for communicating with the Probes and Pumps. I can share the class file I wrote if you would be interested in adding UART support.

The only issue I ran into was USB devices changing ports after a reboot. I was able to get around this by assigning a device name to the EZO device, then scanning for all serial comm ports, reading the device name from each and comparing to the configured device name.

I do see you support I2C, which EZO also supports. Are there any advantages over either comm. protocol? Should I just reconfigure all of my devices to use I2C?

[FEATURE REQUEST] Add MEGA-BAS Onewire Device

It would be nice to be able to use the one-wire interface from the MEGA-BAS in REM. My original setup has some DS18B20 sensors mounted in my pipes. I have moved to a MEGA-BAS with some 10K thermistors (once I install them), but it would be nice to still monitor the DS18B20's I have. I wrote a simple python script to send the values to njs-PC, but it would be nice if it was already in REM. Thanks.

If anyone is interested, my code is:


#!/usr/bin/env python3

import megabas
import requests
import time

def convert_to_f(t_c):
        t_f = round((t_c * 9/5) + 32,1)
        return t_f

def process_sensors():
        c_heater = megabas.owbGetTemp(0,1)
        f_heater = convert_to_f(c_heater)

        c_pool = megabas.owbGetTemp(0,2)
        f_pool = convert_to_f(c_pool)

        c_air = megabas.owbGetTemp(0,3)
        f_air = convert_to_f(c_air)

        data = {"airSensor": f_air, "waterSensor1": f_pool, "waterSensor2": f_heater}
        response = requests.put('http://127.0.0.1:4200/state/temps', json=data)


while True:
        process_sensors()
        time.sleep(10)

duplicate entries for Atlas PH/ORP feeds

image

I cleared out a bunch (10+) of dupes a week ago and they are starting to creep back in. Wish I could provide more info on how to repeat but not sure when they show up. Guessing on app restart?

Let me know what other info I can provide.

renamed to .txt
controllerConfig.txt

edit: this seems harmless as far as I can tell. no other odd behavior that I can trace back to this.

Atlas PH: lots of 'Node busy waiting to send command T, XX' warnings

It's Saturday so naturally I'm watching REM logs as they scroll by. I'm seeing lots of this msg:

relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | info: [2:26:23 PM] 192.168.5.205 GET /status/device/i2c:1:1 {}
2|relayEquipmentManager  | info: [2:26:23 PM] 192.168.5.205 GET /status/device/i2c:1:2 {}
2|relayEquipmentManager  | info: [2:26:23 PM] 192.168.5.205 GET /status/device/gpio:1:36 {}
2|relayEquipmentManager  | info: [2:26:23 PM] 192.168.5.205 PUT /feed/device/i2c:1:2 {"tempF":84}
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | info: [2:26:23 PM] 192.168.5.205 PUT /state/device/gpio:1:36 {"state":false}
2|relayEquipmentManager  | setDeviceState: gpio:1:36 - {"state":false}
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | info: [2:26:33 PM] 192.168.5.205 GET /status/device/i2c:1:1 {}
2|relayEquipmentManager  | info: [2:26:33 PM] 192.168.5.205 GET /status/device/i2c:1:2 {}
2|relayEquipmentManager  | info: [2:26:33 PM] 192.168.5.205 GET /status/device/gpio:1:36 {}
2|relayEquipmentManager  | info: [2:26:33 PM] 192.168.5.205 PUT /feed/device/i2c:1:2 {"tempF":84}
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | info: [2:26:33 PM] 192.168.5.205 PUT /state/device/gpio:1:36 {"state":false}
2|relayEquipmentManager  | setDeviceState: gpio:1:36 - {"state":false}
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | info: [2:26:43 PM] 192.168.5.205 GET /status/device/i2c:1:1 {}
2|relayEquipmentManager  | info: [2:26:43 PM] 192.168.5.205 GET /status/device/i2c:1:2 {}
2|relayEquipmentManager  | info: [2:26:43 PM] 192.168.5.205 GET /status/device/gpio:1:36 {}
2|relayEquipmentManager  | info: [2:26:43 PM] 192.168.5.205 PUT /feed/device/i2c:1:2 {"tempF":84}
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | info: [2:26:43 PM] 192.168.5.205 PUT /state/device/gpio:1:36 {"state":false}
2|relayEquipmentManager  | setDeviceState: gpio:1:36 - {"state":false}
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | info: [2:26:53 PM] 192.168.5.205 GET /status/device/i2c:1:1 {}
2|relayEquipmentManager  | info: [2:26:53 PM] 192.168.5.205 GET /status/device/i2c:1:2 {}
2|relayEquipmentManager  | info: [2:26:53 PM] 192.168.5.205 GET /status/device/gpio:1:36 {}
2|relayEquipmentManager  | info: [2:26:53 PM] 192.168.5.205 PUT /feed/device/i2c:1:2 {"tempF":84}
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | info: [2:26:53 PM] 192.168.5.205 PUT /state/device/gpio:1:36 {"state":false}
2|relayEquipmentManager  | setDeviceState: gpio:1:36 - {"state":false}
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89
2|relayEquipmentManager  | warn: Atlas_EZO-pH: Node busy waiting to send command T,28.89

Could be wrong, but it looks like your are setting the temp on a pH probe frequently and since most pool body temp sensor only read out to the nearest degree, I'm not sure why it's happening so often.

You probably know this, but you can issue the temp calibration and get a pH reading in a single command. RT, X.XX

Maybe this command would cut down on the number of warnings?

Not important... just a thought.

Stack Trace Saving Pi Pin 35

I am getting this stack trace when I try to save a configuration on Pin 35:

image

Error: Error saving pin 1-35
at GpioPin.setPinAsync (/home/pi/relayEquipmentManager/boards/Controller.ts:1028:47)
at Gpio.setPinAsync (/home/pi/relayEquipmentManager/boards/Controller.ts:824:66)
at /home/pi/relayEquipmentManager/web/services/Config.ts:68:43
at Layer.handle [as handle_request] (/home/pi/relayEquipmentManager/node_modules/express/lib/router/layer.js:95:5)
at next (/home/pi/relayEquipmentManager/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/pi/relayEquipmentManager/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/pi/relayEquipmentManager/node_modules/express/lib/router/layer.js:95:5)
at /home/pi/relayEquipmentManager/node_modules/express/lib/router/index.js:281:22
at param (/home/pi/relayEquipmentManager/node_modules/express/lib/router/index.js:354:14)
at param (/home/pi/relayEquipmentManager/node_modules/express/lib/router/index.js:365:14)
at param (/home/pi/relayEquipmentManager/node_modules/express/lib/router/index.js:365:14)
at Function.process_params (/home/pi/relayEquipmentManager/node_modules/express/lib/router/index.js:410:3)
at next (/home/pi/relayEquipmentManager/node_modules/express/lib/router/index.js:275:10)
at /home/pi/relayEquipmentManager/web/Server.ts:257:17
at Layer.handle [as handle_request] (/home/pi/relayEquipmentManager/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/home/pi/relayEquipmentManager/node_modules/express/lib/router/index.js:317:13)

REM seems to have lost its config

Not sure what caused it, but today several components on my Nixe pool controller stopped working. I have narrowed it down to the REM and it does not seem to be configured any longer. I have some backups of the directories, but not sure what director the configuration was in.

Sequent 4 not working

Got REM working on a Raspberry Pi 3 Model B Plus Rev 1.3 with a Four Relays four HV Inputs
8-Layer Stackable HAT
I got a similar problem where I don't get the relays activated when clicking on the blue Multi-Relay Board Buttons after being enabled.

I haven't changed / added any jumpers on the card. REM detects that Multi-Relay Board on its own.

image

I can control and test these relays on the same PI using the CLI tools offered by the vendor: 4rel4in.

Followed:

MQTT Feeds

I have a standalone setup with pump and controller. I would like to create a schedule for the SWG. Could I setup a feature tied to REM that sent a Feed back to PC with the salt %. I don't understand the Javascript payload entry. Are there any example feed settings?

Thanks

Sequent 16 relay card

Hello @rstrouse, I have been working on the Sequent 16 Relay Hat in the I2cRelay.ts but using the 8 relay as a template I canโ€™t seem to get the addressโ€™s correct. Excuse me as I am a newbie at GitHub, how can I submit the code for you to take a look? Do I just create a branch?

Sequent Home Automation V4 8 relay

Any chance you can update for the 8 relay version of the home automation board? I can use the 4rel4in to run the 8rel8in, but only the first 4 relays work.

error with bindings on start

I'm hoping that this is a correct place to ask this. I just installed REM and am trying to start it and I get the following:
pi@PoolController:~/relayEquipmentManager $ npm start

[email protected] start
npm run build && node dist/app.js

[email protected] build
tsc

/home/pi/relayEquipmentManager/node_modules/bindings/bindings.js:135
throw err;
^

Error: Could not locate the bindings file. Tried:
โ†’ /home/pi/relayEquipmentManager/node_modules/epoll/build/epoll.node
โ†’ /home/pi/relayEquipmentManager/node_modules/epoll/build/Debug/epoll.node
โ†’ /home/pi/relayEquipmentManager/node_modules/epoll/build/Release/epoll.node
โ†’ /home/pi/relayEquipmentManager/node_modules/epoll/out/Debug/epoll.node
โ†’ /home/pi/relayEquipmentManager/node_modules/epoll/Debug/epoll.node
โ†’ /home/pi/relayEquipmentManager/node_modules/epoll/out/Release/epoll.node
โ†’ /home/pi/relayEquipmentManager/node_modules/epoll/Release/epoll.node
โ†’ /home/pi/relayEquipmentManager/node_modules/epoll/build/default/epoll.node
โ†’ /home/pi/relayEquipmentManager/node_modules/epoll/compiled/18.16.0/linux/arm/epoll.node
โ†’ /home/pi/relayEquipmentManager/node_modules/epoll/addon-build/release/install-root/epoll.node
โ†’ /home/pi/relayEquipmentManager/node_modules/epoll/addon-build/debug/install-root/epoll.node
โ†’ /home/pi/relayEquipmentManager/node_modules/epoll/addon-build/default/install-root/epoll.node
โ†’ /home/pi/relayEquipmentManager/node_modules/epoll/lib/binding/node-v108-linux-arm/epoll.node
at bindings (/home/pi/relayEquipmentManager/node_modules/bindings/bindings.js:126:9)
at /home/pi/relayEquipmentManager/node_modules/epoll/epoll.js:7:31
at Object. (/home/pi/relayEquipmentManager/node_modules/epoll/epoll.js:15:3)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object. (/home/pi/relayEquipmentManager/node_modules/onoff/onoff.js:5:15)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18) {
tries: [
'/home/pi/relayEquipmentManager/node_modules/epoll/build/epoll.node',
'/home/pi/relayEquipmentManager/node_modules/epoll/build/Debug/epoll.node',
'/home/pi/relayEquipmentManager/node_modules/epoll/build/Release/epoll.node',
'/home/pi/relayEquipmentManager/node_modules/epoll/out/Debug/epoll.node',
'/home/pi/relayEquipmentManager/node_modules/epoll/Debug/epoll.node',
'/home/pi/relayEquipmentManager/node_modules/epoll/out/Release/epoll.node',
'/home/pi/relayEquipmentManager/node_modules/epoll/Release/epoll.node',
'/home/pi/relayEquipmentManager/node_modules/epoll/build/default/epoll.node',
'/home/pi/relayEquipmentManager/node_modules/epoll/compiled/18.16.0/linux/arm/epoll.node',
'/home/pi/relayEquipmentManager/node_modules/epoll/addon-build/release/install-root/epoll.node',
'/home/pi/relayEquipmentManager/node_modules/epoll/addon-build/debug/install-root/epoll.node',
'/home/pi/relayEquipmentManager/node_modules/epoll/addon-build/default/install-root/epoll.node',
'/home/pi/relayEquipmentManager/node_modules/epoll/lib/binding/node-v108-linux-arm/epoll.node'
]
}

Node.js v18.16.0

Help please?

Design options & deployment help request

Good afternoon, my automate the world friend! I'm considering seriously leveraging off my existing pool infrastructure to add ORP, pH, & pressure sensors and the ability to control the salt cell & stenner pump as apropos.

As you may recall, I have an EasyTouch 2 4 installed & am running nodejsPoolController, dashPanel, & Crewski's HA integration. From previous conversations with you, I understand REM is part of the existing PoolController package already in place.

I'm thinking about getting the Atlas Scientific sensors: industrial pH probe, industrial ORP probe, & A-100 analog pressure sensor. If my understanding is correct, these are all i2c devices. If that's the case, can I connect them to an ESP32 & then forward the data to the poolController possibly by using MQTT (& HA??)? Do I need the EZO boards in this scenario or will the ESP32 suffice?

I've read the DIY REM Chem Controller wiki & understand I will need to get a flow cell for the pH & ORP probes. Do you know of any that don't require drilling & tapping for the Altas sensors? I don't have those skills & would prefer not to ruin an flow cell or three. Alternatively, are there adapters that may be used with the Atlas sensors?

Assuming I can get the sensor data into REM, it appears that I canleverage off the poolController package & the existing EasyTouch hardware, perhaps along with Home Assistant to control the salt cell & stenner pump.

As you can tell. I'm just beginning to think about how to put this all together. Any & all suggestions & tips are welcome.

Thanks so much for letting me suck up more of your generosity & time!

stop emitting error messages for devices that aren't active?

I'm building my stack, so sometimes I need to fire up REM without some of the cards in the stack (BAS, relay, etc). When I do that, I uncheck the active box for the device, but the REM logs still put out errors about not finding the card.

1|REM  | error: 39 3,0: EREMOTEIO: remote I/O error, write
1|REM  | error: 39 1,0: EREMOTEIO: remote I/O error, write
1|REM  | error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error
1|REM  | error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error
1|REM  | error: 39 3,0: EREMOTEIO: remote I/O error, write
1|REM  | error: 39 1,0: EREMOTEIO: remote I/O error, write
1|REM  | error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error

Is it possible to turn off error emits when device is not active? Would that make sense?

RS485 isn't responding properly.

Take a look at the images below. I believe I have all the settings correct, but Send status is 100% failing with 0 packets received. It was working fine until... it stopped.

Screen Shot 2022-09-10 at 5 34 36 PM

Screen Shot 2022-09-10 at 5 36 11 PM

โ”‚ njsPC > [9/10/2022, 5:20:57 PM] warn: Message aborted after 2 attempt(s): 165,0,96,33,4,1,255,2,42                                                                                                   โ”‚
โ”‚ njsPC > [9/10/2022, 5:20:57 PM] error: Error sending setPumpToRemoteControl for Pool Pump: Message aborted after 2 attempt(s): 165,0,96,33,4,1,255,2,42                                              โ”‚
โ”‚ njsPC > [9/10/2022, 5:20:58 PM] warn: Inactivity timeout for 0 serial port /dev/ttyS0 after 10 seconds                                                                                               โ”‚
โ”‚ njsPC > [9/10/2022, 5:20:58 PM] info: Serial Port 0 has been closed 0:                                                                                                                               โ”‚
โ”‚ njsPC > [9/10/2022, 5:20:58 PM] info: Successfully closed 0 serial port /dev/ttyS0                                                                                                                   โ”‚
โ”‚ njsPC > [9/10/2022, 5:20:58 PM] info: Serial port: /dev/ttyS0 request to open successful 9600b 8-none-1                                                                                              โ”‚
โ”‚ njsPC > [9/10/2022, 5:20:59 PM] warn: Inactivity timeout for 1 serial port /dev/ttyUSB0 after 10 seconds                                                                                             โ”‚
โ”‚ njsPC > [9/10/2022, 5:20:59 PM] error: Error opening port 1: Error: No such file or directory, cannot open /dev/ttyUSB0. Retry in 10 seconds                                                         โ”‚
โ”‚ njsPC > [9/10/2022, 5:21:01 PM] warn: Message aborted after 2 attempt(s): 165,0,96,33,6,1,4,1,49                                                                                                     โ”‚
โ”‚ njsPC > [9/10/2022, 5:21:01 PM] error: Error sending setDriveState for Pool Pump : Message aborted after 2 attempt(s): 165,0,96,33,6,1,4,1,49                                                        โ”‚
โ”‚ njsPC > [9/10/2022, 5:21:05 PM] warn: Message aborted after 3 attempt(s): 165,0,96,33,7,0,1,45                                                                                                       โ”‚
โ”‚ njsPC > [9/10/2022, 5:21:05 PM] error: Error sending requestPumpStatus for Pool Pump: Message aborted after 3 attempt(s): 165,0,96,33,7,0,1,45                                                       โ”‚
โ”‚ njsPC > [9/10/2022, 5:21:07 PM] warn: Message aborted after 2 attempt(s): 165,0,96,33,4,1,255,2,42                                                                                                   โ”‚
โ”‚ njsPC > [9/10/2022, 5:21:07 PM] error: Error sending setPumpToRemoteControl for Pool Pump: Message aborted after 2 attempt(s): 165,0,96,33,4,1,255,2,42                                              โ”‚
โ”‚ njsPC > [9/10/2022, 5:21:08 PM] warn: Inactivity timeout for 0 serial port /dev/ttyS0 after 10 seconds                                                                                               โ”‚
โ”‚ njsPC > [9/10/2022, 5:21:08 PM] info: Serial Port 0 has been closed 0:        

How do you delete a generic device?

Unless I'm just missing it right in front of my face, there's no trash icon and its throwing an error in the console when you click the device at the top of the screen.

Screenshot 2023-06-11 at 12 25 16 PM

Sequent Relay Addition - 3 Relay Industrial

๐Ÿ’ฅ Proposal

What feature you'd like to see

Add support for the Sequent "Three 40A/240V Relays RS485 Daisy-channable HAT for Raspberry Pi" HAT Link.

Motivation

I recently purchased the 3 relay HAT with the intention to use it for pool lighting control as well as chlorinator isolation. The relay is installed and partially functioning. Initially it seemed the unit would work using the 'Sequent 4rel4in v4' device. While it did work for simple switching there seems to be something going on when rapid switching is required, for example a lighting circuit, where it starts to trip over itself. The relay starts to cycle erratically when changing light shows. I will sometimes end with 3 different colors out of my 7 lights. And during the relay cycling they sound like they are galloping at irregular intervals.

Pitch

This stackable 3 relay HAT could be used instead of 3 individual high load relays for various circuits reducing the room required in the cabinet and the complexity of the wiring. The relays can each handle 40A and 240V so just about any circuit could be controlled by this.

Mega-BAS V4 update?

Hello,
I am having an issue with my Sequent stacks or Hats.
https://sequentmicrosystems.com/collections/all-io-cards/products/building-automation-8-layer-stackable-hat-v4-for-raspberry-pi
I have a Mega-BAS V4 and it has 8 universal inputs with dip switches that work fine so far for 10k2 sensors.
It has ttl rs-485 with the four analog outputs and "four Triac outputs."
No Triac's on the configuration?
Is this a need to be added or am i missing an update running 8.0.0?

Thank You for Your time!

Screenshot 2024-02-06 at 11 44 37 PM

IMG_1098

The silk screen on this was also printed upside down for inputs,
Screenshot 2024-02-06 at 11 52 06 PM

ADS1115 Read Error

Hello. Great job with nodejs pool controller and thank you. I'm setting up a new system and have a few questions/issues.
I'm getting a read error (Remote I/O) when reading temp voltage from an ADC1115 board. I have an Amazon knock-off ADS1115, so I suspect I'm dealing with a non TI chip. The error happens when reading "channel" 0x10 and 0x11. It looks like these are hard-coded values connected to the lowThreshold and highThreshold registers. I suspect my clone chip is using different registers, or just doesn't support the low/high threshold overflow registers. I commented out the two lines that read those registers the temps are working as expected and I can see the values in nodejs-poolController. Is there something else I should try? I'm okay not dealing with the low/high thresholds as I think they are really just edge cases that will likely never happen.
Thanks.

Lost i2c again

Not sure of why I lost comms to 12c so I deleted it and re added but it will not see the i2c

1|REM  | verbose: 127.0.0.1 PUT /state/device/i2c:1:6:9 {"isOn":true,"latch":10000}
1|REM  | info: [10:58:31 AM] 127.0.0.1 PUT /state/device/i2c:1:6:9 {"isOn":true,"latch":10000}
1|REM  | error: setDeviceState: i2c bus not found 1 - i2c:1:6:9
1|REM  | verbose: 127.0.0.1 PUT /state/device/i2c:1:6:4 {"isOn":false}
1|REM  | info: [10:58:31 AM] 127.0.0.1 PUT /state/device/i2c:1:6:4 {"isOn":false}
1|REM  | error: setDeviceState: i2c bus not found 1 - i2c:1:6:4

The pi sees it though

pi@pool:~/rem $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- 26 27 -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- 62 63 -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Add Connection, Server Name Limited to 20 Characters

Minor, but ... when trying to add a new connection, the server name field is limited to 20 characters => can be an issue when putting in the FQDN. BTW, if auto-detecting the connection, more than 20 characters is allowed.

Thanks!

REM stopped responding upon startup

I was configuring the REM per directions when it stopped responding. Now when I start or restart REM, I get an Error: General Error and nothing responds.

TypeError: Cannot read property 'type' of undefined
    at Controller.getDeviceByBinding (/home/pi/relayEquipmentManager/boards/Controller.ts:553:22)
    at DeviceFeed.getExtended (/home/pi/relayEquipmentManager/boards/Controller.ts:903:32)
    at I2cDevice.getExtended (/home/pi/relayEquipmentManager/boards/Controller.ts:2796:57)
    at I2cBus.getExtended (/home/pi/relayEquipmentManager/boards/Controller.ts:2346:59)
    at I2cBusCollection.toExtendedArray (/home/pi/relayEquipmentManager/boards/Controller.ts:205:85)
    at I2cController.getExtended (/home/pi/relayEquipmentManager/boards/Controller.ts:1990:30)
    at Controller.getExtended (/home/pi/relayEquipmentManager/boards/Controller.ts:529:26)
    at /home/pi/relayEquipmentManager/web/services/Config.ts:129:34
    at Layer.handle [as handle_request] (/home/pi/relayEquipmentManager/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/pi/relayEquipmentManager/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/pi/relayEquipmentManager/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/pi/relayEquipmentManager/node_modules/express/lib/router/layer.js:95:5)
    at /home/pi/relayEquipmentManager/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/home/pi/relayEquipmentManager/node_modules/express/lib/router/index.js:341:12)
    at next (/home/pi/relayEquipmentManager/node_modules/express/lib/router/index.js:275:10)
    at /home/pi/relayEquipmentManager/web/Server.ts:281:17

Please tell me there's something I can do without resetting the dang REM??

Uncaught ReferenceError: o is not defined - when clicking between i2c devices

Didn't notice this on my old distributed install but getting this error on my new, single pi stack.

Not sure if this is a user error or something in the code but wanted to make you aware.

steps to reproduce:

  1. Open REM
  2. click the i2c tab
  3. click an i2c device - device config will load
  4. click on a different i2c device - nothing happens (device config does not load) and uncaught reference error in chrome console

image

Easy fix, just refresh the chrome tab and navigate to the i2c device you want to view.

Lazy Connections/Devices after reboot

I am reopening this as I am now seeing this may be a different problem. I rewired the relays to separate GPIO pins to avoid any system conflicts. I am still having a problem with what I will call lazy config of the pins. Here is how this occurs:

  1. Reboot the Pi

  2. After startup, everything "looks" fine.

  3. At this stage, the Pump controls work fine. I can set the pump to levels 1,2,3,4 and the correct corresponding relays get turned on/off.

  4. I have two additional circuits configured - the slide (relay 7 - GPIO 27/pin 13) and the lights (Relay 8 - GPIO 22/pin 15)

  5. At this stage - neither of these works in Nixie. When I click them, they show yellow briefly but do not change states in the UI or on the physical relays.

  6. I see these errors when I click one of them:

3|REM | info: [22:17:12] 192.168.2.183 PUT /state/device/gpio:1:15 {"isOn":true,"latch":10000}
3|REM | error: Could not set gpio state: setDeviceState: Error setting pin state: Error: Invalid Pin #1-15. Could not find pin in controller
1|poolController | [6/29/2021, 22:17:12] error: Nixie: Error setting circuit state 2-Lights to true

Here is the setup configuration for that circuit in NJSPC:
image

Showing it is connected to "Relay 8 - wire"

Sure enough, that is Pin 15 in REM. Here is the configuration of it there:
image

  1. If I now hit "Save Pin" in REM, it will update the state of the pin and the relay.
  2. At this point, if I go back to DashPanel I can operate that circuit without any other changes needed.
  3. I can repeat this for the Slide circuit and then it works as well. But as soon as I reboot the device, I have to return to REM and "Save Pin" on both my Slide and Light Pins (Pin 13 / 15) to get them working again.

Originally posted by @bsileo in #10 (comment)

Using Bus 4 to solve some bus issues

Ok I started using Bus#4 to solve some issues but REM doesn't understand|see the device

device/gpio:1:10 {"isOn":false}
2|REM  | info: [11:41:50 PM] 127.0.0.1 PUT /state/device/gpio:1:10 {"isOn":false}
2|REM  | error: setDeviceState: Pin #10 not found.
2|REM  | verbose: 127.0.0.1 PUT /state/device/i2c:1:6:16 {"isOn":false}
2|REM  | info: [11:41:50 PM] 127.0.0.1 PUT /state/device/i2c:1:6:16 {"isOn":false}
2|REM  | info: Setting device state [object Object]
2|REM  | error: setDeviceState: Could not find i2c device 1:6 - i2c:1:6:16
2|REM  | verbose: 127.0.0.1 PUT /state/device/i2c:1:6:9 {"isOn":false}
2|REM  | info: [11:41:50 PM] 127.0.0.1 PUT /state/device/i2c:1:6:9 {"isOn":false}
2|REM  | info: Setting device state [object Object]
2|REM  | error: setDeviceState: Could not find i2c device 1:6 - i2c:1:6:9
2|REM  | verbose: 127.0.0.1 PUT /state/device/i2c:1:6:4 {"isOn":false}
2|REM  | info: [11:41:50 PM] 127.0.0.1 PUT /state/device/i2c:1:6:4 {"isOn":false}
2|REM  | info: Setting device state [object Object]
2|REM  | error: setDeviceState: Could not find i2c device 1:6 - i2c:1:6:4
2|REM  | error: 39 - Multi-Relay Board Read Command: ENXIO, No such device or address
2|REM  | debug: 39 - Multi-Relay Board Executed read command 0x12 byte read:0x00
2|REM  | error: 39 - Multi-Relay Board Read Command: ENXIO, No such device or address
2|REM  | debug: 39 - Multi-Relay Board Executed read command 0x12 byte read:0x00
2|REM  | error: 39 - Multi-Relay Board Read Command: ENXIO, No such device or address
2|REM  | debug: 39 - Multi-Relay Board Executed read command 0x12 byte read:0x00
2|REM  | error: 39 - Multi-Relay Board Read Command: ENXIO, No such device or address
2|REM  | debug: 39 - Multi-Relay Board Executed read command 0x12 byte read:0x00
2|REM  | error: 39 - Multi-Relay Board Read Command: ENXIO, No such device or address
2|REM  | debug: 39 - Multi-Relay Board Executed read command 0x12 byte read:0x00
2|REM  | verbose: 127.0.0.1 PUT /state/device/i2c:1:6:16 {"isOn":false}
2|REM  | info: [11:41:52 PM] 127.0.0.1 PUT /state/device/i2c:1:6:16 {"isOn":false}
2|REM  | info: Setting device state [object Object]
2|REM  | error: setDeviceState: Could not find i2c device 1:6 - i2c:1:6:16
2|REM  | verbose: 127.0.0.1 PUT /state/device/i2c:1:6:9 {"isOn":false}
2|REM  | info: [11:41:52 PM] 127.0.0.1 PUT /state/device/i2c:1:6:9 {"isOn":false}
2|REM  | info: Setting device state [object Object]
2|REM  | error: setDeviceState: Could not find i2c device 1:6 - i2c:1:6:9
2|REM  | verbose: 127.0.0.1 PUT /state/device/i2c:1:6:4 {"isOn":false}
2|REM  | info: [11:41:52 PM] 127.0.0.1 PUT /state/device/i2c:1:6:4 {"isOn":false}
2|REM  | info: Setting device state [object Object]
2|REM  | error: setDeviceState: Could not find i2c device 1:6 - i2c:1:6:4
2|REM  | error: 39 - Multi-Relay Board Read Command: ENXIO, No such device or address
2|REM  | debug: 39 - Multi-Relay Board Executed read command 0x12 byte read:0x00
2|REM  | error: 39 - Multi-Relay Board Read Command: ENXIO, No such device or address
2|REM  | debug: 39 - Multi-Relay Board Executed read command 0x12 byte read:0x00
2|REM  | verbose: 127.0.0.1 GET /state/device/generic:202:1 {}
2|REM  | info: [11:41:53 PM] 127.0.0.1 GET /state/device/generic:202:1 {}
2|REM  | error: getDeviceState: Could not find generic device 202:1 - generic:202:1
2|REM  | verbose: 127.0.0.1 GET /status/device/i2c:1:5 {}
2|REM  | info: [11:41:53 PM] 127.0.0.1 GET /status/device/i2c:1:5 {}
2|REM  | error: getDeviceStatus: Could not find i2c device 1:5 - i2c:1:5
2|REM  | error: 39 - Multi-Relay Board Read Command: ENXIO, No such device or address
2|REM  | verbose: 127.0.0.1 GET /status/device/i2c:1:4 {}
2|REM  | info: [11:41:53 PM] 127.0.0.1 GET /status/device/i2c:1:4 {}
2|REM  | error: getDeviceStatus: Could not find i2c device 1:4 - i2c:1:4
2|REM  | debug: 39 - Multi-Relay Board Executed read command 0x12 byte read:0x00
2|REM  | verbose: 127.0.0.1 GET /status/device/i2c:1:6:3 {}
2|REM  | info: [11:41:53 PM] 127.0.0.1 GET /status/device/i2c:1:6:3 {}
2|REM  | error: getDeviceStatus: Could not find i2c device 1:6 - i2c:1:6:3
2|REM  | verbose: 127.0.0.1 PUT /state/device/i2c:1:6:3 {"state":false}
2|REM  | info: [11:41:53 PM] 127.0.0.1 PUT /state/device/i2c:1:6:3 {"state":false}
2|REM  | info: Setting device state [object Object]
2|REM  | error: setDeviceState: Could not find i2c device 1:6 - i2c:1:6:3
2|REM  | error: 39 - Multi-Relay Board Read Command: ENXIO, No such device or address
2|REM  | debug: 39 - Multi-Relay Board Executed read command 0x12 byte read:0x00

restart pi?

it would be great if relayequipmentmanager had an option to restart the pi if a reset button is pressed - as provided on sequent hats.

REM went blank

Lost rem configuration is it pulling from a new location? My setup is blank slate? tried a git pull but still blank, I knew that shouldn't make a difference but why not.
here is my config

pi@rem:~/rem/data $ cat controllerConfig.json
{
  "controllerType": "raspi",
  "gpio": {
    "pins": [],
    "exported": []
  },
  "spi0": {
    "isActive": false,
    "busNumber": 0,
    "channels": [],
    "referenceVoltage": 3.3,
    "spiClock": 1000
  },
  "spi1": {
    "isActive": false,
    "busNumber": 1,
    "channels": [],
    "referenceVoltage": 3.3,
    "spiClock": 1000
  },
  "i2c": {
    "isActive": false,
    "buses": [],
    "detected": [
      {
        "driver": "bcm2835 (i2c@7e804000)",
        "path": "/sys/class/i2c-dev/i2c-1",
        "name": "i2c-1",
        "busNumber": 1
      }
    ]
  },
  "connections": [
    {
      "id": 1,
      "isActive": true,
      "options": {},
      "name": "njsPC - automatic",
      "type": "njspc",
      "protocol": "http:",
      "ipAddress": "192.168.0.179",
      "port": 4200,
      "userName": "",
      "password": "",
      "sslKeyFile": "",
      "sslCertFile": ""
    }
  ],
  "genericDevices": {
    "isActive": true,
    "buses": [],
    "detected": [],
    "options": {},
    "devices": []
  },
  "lastUpdated": "6/7/2021, 12:41:09 AM",
  "configVersion": 1

But my setup is gone
Screen Shot 2021-06-07 at 12 51 57 AM
Screen Shot 2021-06-07 at 12 52 10 AM
Screen Shot 2021-06-07 at 12 52 03 AM

Under Voltage?

I think I have an issue with under voltage? My pi is running via POE and it is serving the i2C buses power. When I get problems reading the PH and ORP also randomly restarts on the i2c bus. Before I switch my power source what do you think?
replayUnderVoltage.zip

I did try powering the i2C bus the other way from 5V source and only connecting the Ground with SDA SCL to the pi but was not working. Unless I fried something? I don't think so because it still works and I didn't see any magic smoke.

Multi-relay board error in logs

rstrouse,

I could use your assistance. I had a working REM, Nodejs Pool Controller and Dashboard running for the past year or so due to your help when my intellicenter board died. I had an SD card failure on the pi, so I am starting with a clean install. I am having one issue and that is I cannont get the Sequent Microsystems multi-relay board to function. After adding the board in REM and enabling the relays...I cannot get them to toggle. I set my debug to silly and have attached a log from a clean boot and then attempted to toggle each of the 8 relays a couple of times. The log shows an error of undefined as part of each relay toggle press. I have also included a copy of my REM controllerConfig.json file.

Any assistance you can provide is greatly appreciated!
Dan

consoleLog(2023-10-05_14-18-35).log
controllerConfig.txt

Cannot feed 10k BAS Temp Probe to Generic Device

Copy-paste from Gitter discussion:

I'm in the process of initial configuration of a DIY-Standalone-Nixie-Pool-Controller with REM, and I cannot get the 10k BAS Temp Probe to feed the Generic Device. I have nodejs-poolController, dash Panel, and REM up and running on a pi4 with Sequent MEGA-BAS. I have 10k temp probe hooked up to AI 1. I have followed the instructions on the wiki a few times (https://github.com/rstrouse/relayEquipmentManager/wiki/Sequent-Microsystems-Boards#sequent-building-automation-hat-mega-bas) and the generic device will not retain the settings to be fed by the BAS. Usually, the Generic Device configuration screen lacks the Save and Delete Device buttons. Have you seen this behavior before? Recommended troubleshooting steps?

Initial configuration of the Generic Devices screen:
image

Configuration of the MEGA-BAS Feed:
image

Image of Generic Devices probe after configuring MEGA-BAS Feed:
image

Issue setting up valves

I have njspc and rem working on an Rpi4 combined with a Sequent Microsystems BAS and 8-relay IND board.. I'm using a single standard valve for testing and have it assigned as my intake valve on a shared body nixie controller. However, when I switch from pool/spa the valve does not activate. I can control it via the Sequent Microsystems command line prompt.

Virtual Light Relay?

I have 8 individually wired lights. (5 microbrites, 1 globrite and 2 magicsteam laminars).
Each is individually wired back to my panel area but I only have 4 transformers and an IntelliCenter i8PS. (3 of the relays are used by other non-light equipment).

So currently I have multiple lights wired together into the 4 transformers and then the transformers back to 4 individual relays in the IC.
I would like (if possible) to create 'virtual' lights (aux circuits) within the IC, assign the light type (Globrite/Magicstream) and then listen to these events using REM to control a low voltage relay via the pins of my RPi.

The idea being that I could switch the low voltage side each of the 8 lights using relays controlled by REM but still interact with these individual lights as if they were individually wired to transformers that were wired back to 8 different aux relays.

I hope that makes sense.

Is there a way of doing this now or is it something that could be implemented?

@rstrouse I hate the prehistoric 'switch on/off multiple times to change mode' thing too but I am stuck with it for the foreseeable. ๐Ÿ˜ž

Thanks!

No interpreting Ohms as Temp

I have a 10k probe connected to the Sequent board. My WaterTemp device is getting the Ohm value, but not converting it to Temp. Any idea why? Not sure if this is an issue or just a question.

image

error with ADS1115

Hi,

I'm able to configure my ADS1115 and it gets detected, but as soon as I try to enable a channel on it, REM crashes and I get this error:

error: Cannot read properties of undefined (reading 'pgaMask')

/home/pi/relayEquipmentManager/i2c-bus/ads1x15.ts:392
c.pgaMask = this.pga.get(c.pga).pgaMask;
^
TypeError: Cannot read properties of undefined (reading 'pgaMask')
at ads1x15.setOptions (/home/pi/relayEquipmentManager/i2c-bus/ads1x15.ts:392:48)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at I2cBus.setDevice (/home/pi/relayEquipmentManager/boards/Controller.ts:2493:61)
at I2cController.setDevice (/home/pi/relayEquipmentManager/boards/Controller.ts:2100:26)
at /home/pi/relayEquipmentManager/web/services/Config.ts:262:27

any idea?

FEATURE REQUEST: Add ability to set GPIO startup pin states

image

Not a high priority issue. Sometimes my 1-wire connection needs to be reset so rather than using the dedicated 3.3v pin I use GPIO, which supplies 3.3v when on. That way I can toggle through code, REM, etc.

Only problem is when the REM pi reboots the GPIO PIN I've assigned starts in the off state and I don't get any temp readings from my ds18b20's. Would be helpful for forgetful people (like me) to have to option to default the GPIO state so I don't lose data if I forget to flip the pin state after a reboot/power cycle.

low priority - thanks!

No way to configure 10k thermistor on ADS1115

Trying to add a thermostat to my test system. I cannot see a way anymore to configure a connection to the ADS1115 to send njsPC anything but the voltage. I tried to setup a generic device and only option is Pressure Transducer, cannot find another option in the GUI for this. Also I seem to be allowed to send channel 3 only, not an issue, now. But may be down the road

Here is a snippet of output from my logs
0|REM | info: Stopped I2c ADS1115
0|REM | info: Closed i2c Bus #1
0|REM | info: Initializing i2c Interface
0|REM | info: Detecting i2c Buses
0|REM | info: Detecting i2c Buses /sys/class/i2c-dev/i2c-1
0|REM | info: Initializing i2c Bus #1
0|REM | info: Scanning i2c Bus #1
2|njsPC | [5/14/2021, 12:42:10 AM] info: New socket client connected secretkey:) -- xxx.xxx.xxx.xxx
0|REM | info: Connected to njsPC - automatic : http://xxx.xxx.xxx.xxx:4200
0|REM | info: Binding circuit from njsPC - automatic to pin 1-37
0|REM | debug: Created filter expression if(!(data.isOn == true)) return false; else return true;
0|REM | debug: Created filter expression if(!(data.isOn == false)) return false; else return true;
0|REM | debug: Created filter expression if(!(data.isOn == false)) return false; else return true;
0|REM | debug: Created filter expression if(!(data.isOn == true)) return false; else return true;
0|REM | debug: Created filter expression if(!(data.isOn == true)) return false; else return true;
0|REM | debug: Created filter expression if(!(data.isOn == false)) return false; else return true;
0|REM | [ 32, 60, 72 ]
0|REM | info: Found I2C device Unknown at address: 32 - (0x20)
0|REM | info: Found I2C device Unknown at address: 60 - (0x3c)
0|REM | info: Found I2C device ADS1115 at address: 72 - (0x48)
0|REM | info: Device ADS1x15 ADC initialized for i2c bus #1 address 72
0|REM | info: i2c Bus #1 Initialized
0|REM | verbose: Emitting: /temps : {"waterSensor1":1.63}

Setup in REM:
image
image

SM relay8 mappings don't match official firmware

running the 8relay command to enable a relay doesn't sync with what REM sees the relay as for all relays and vice-versa. I made a table of how they're currently mapping. So for example, when I activate relay button 8 in REM it enables the relay SM considers 6. 1,4,7 are correct.

SM official/REM button
1/1
2/3
3/2
4/4
5/6
6/8
7/7
8/6

Sequent Smart Fan v4+ Observations

Just a couple of observations on the smart fan integration, which is working fine for me (thanks!) but does have some issues.

  • Blinky light option no longer exists
  • For the Fan Curve, Exponential and logarithmic seem to be swapped. When my CPU is running at 90F, exponential power is ~88%, while logarithmic is ~22. It seems the curves are reversed, or my thinking is incorrect.
  • When you switch to F or K, the labels change but the units are still in C on the Fan Curve page (the General page shows the correct units).
  • On the General page, once F or K is selected, any subsequent selection of C does not change the units back to C. Also, and I hope I can explain this correctly, when you select F or K and then Save Device the units dropdown shows Celsius, even though the units and label are either F or K.
  • Docs are behind, I'll contribute when I get a chance this weekend. https://github.com/rstrouse/relayEquipmentManager/wiki/Sequent-Microsystems-Boards#sequent-building-automation-hat-mega-bas

Relays not actuated and cannot find device definition after restart

Environment: Raspberry Pi 4, Ubuntu server 21.10, REM 7.5

Equipment: EP-0099 Multi-Relay board by 52pi. "Using Docker Pi 4" as the relay controller.

Steps to reproduce:
Install EP-0099, verify that it's being seen by the I2C bus at 0x10 with 'i2cdetect -y 1'
Verify that any of the relays turn on with 'i2cset -y 1 0x10 0x01 0x01'
Add the board as a multi-relay board device on the I2C bus at address 16 (0x10). Choose 'Docker Pi 4' as the controller. Save the device.
Configure one of the relays, and enable and save then save the device
You can also enable the device, but it makes no difference.
When you click on the relay the green virtual LED turns on, but the relay doesn't actuate.

If you restart REM, and navigate to that device and click the relay you enabled to see if the reboot makes the relay actuate, you get the error: Bus #1 Address 16 cannot be found.

If you configure a second relay and save the device, you no longer get the error on any of the relays, and the green virtual LED lights, but the relays still do not actuate.

Attached controllerConfig.json
controllerConfig.json.txt

Reading raw analog sensors on BeagleBone Black.

I've got a BeagleBone Black, with a very nice breakout cape.

Connected to it, is a 10K NTC thermistor in a voltage divider configuration.

I'm not seeing a way in the UI to configure the onboard ADCs to actually read the temperature.

Is that configured in the json directly?

EZO pH and ORP Not reading

@rstrouse
The pH and ORP are not being read here is the error what can I try?

1|REM  | error: Atlas_EZO-pH Error getting device status: Cannot read property 'split' of undefined
1|REM  | error: Error retrieving device status: Cannot read property 'split' of undefined
1|REM  | (node:4945) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of undefined
1|REM  |     at AtlasEZOpH.getStatus (/home/pi/rem/i2c-bus/AtlasEZO.ts:214:34)
1|REM  |     at AtlasEZOpH.getDeviceInformation (/home/pi/rem/i2c-bus/AtlasEZO.ts:271:13)
1|REM  | (node:4945) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 99649)
1|REM  | error: ORP Error getting device status: Cannot read property 'split' of undefined
1|REM  | error: Error retrieving device status: Cannot read property 'split' of undefined
1|REM  | (node:4945) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of undefined
1|REM  |     at AtlasEZOorp.getStatus (/home/pi/rem/i2c-bus/AtlasEZO.ts:214:34)
1|REM  |     at AtlasEZOorp.getDeviceInformation (/home/pi/rem/i2c-bus/AtlasEZO.ts:271:13)
1|REM  | (node:4945) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 99653)

MCP3008 ADC question

My MCP3008 chip is not being recognized, how to I specify which GPIO pin is connected to the cs pin on the chip?

Help setting up REM with ...

Help setting up REM to complement Virtual Pump, and IC60.
Ok my thoughts are to use this as my complete pool controller currently using nodejs-PoolController to operate the Pump and IC60 until a few days ago. Then I use an esp32 to control relays for actuators, heater, multiple pumps, blower, acid pump, Temperatures from 1 wire ds18b20, pressure from a transducer. Orp and PH from atlas. Just wondering what can be put into REM.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.