rstrouse / relayEquipmentManager

A hardware controller for GPIO, I2c, SPI, and generic devices.
GNU General Public License v3.0
37 stars 19 forks source link

Generic Devices loses Save and Delete button #71

Open katodude opened 2 months ago

katodude commented 2 months ago

I am helping someone set up a pool controller.

We are trying to set up Generic devices for Temp. We can create the generic device. But when we go back in to edit it the save and delete buttons are gone. image000001

rstrouse commented 2 months ago

I’ll have a look.

rstrouse commented 2 months ago

In the browser console are you seeing any errors? It appears as if it is throwing an error and not rendering the buttons.

rstrouse commented 2 months ago

Ok I figured out what you did. You have a feed coming from the MEGA-BAS that is the input pin and not the value. You want to set the send value on the feed to the value property and not the entire ADC output.

BELOW IS WRONG

image

THIS IS CORRECT

While this is documented in the setup I think that we probably need to make this more apparent or parse the data out of the feed anyway. Notice the selection for the Send Value. image

lymanepp commented 2 months ago

I had the same problem on initial setup. I wasted quite a bit of time before I figured it out.

rstrouse commented 2 months ago

I made it so that it can digest the full output reference. At least it won't cause the feed to fail.

rstrouse commented 2 months ago

@katodude if you are still having issues please upload your data/controllerConfig.json. Also, have updated REM to allow for unexpected values stored on the configuration. Update REM to install these changes.

cd ~/relayEquipmentManager
git pull
npm i
dkossman commented 2 months ago

I'm having somewhat similar problems. I can't connect my ADS1115 channel to my 10k thermistor device. When i run my own server code, i have no problems reading the ADS1115 and computing the temperature. (my server is shut down)

Not sure if I'm doing something wrong, I had this working a few days ago but now can't get it to work.

I've cloned the latest REM code into a new local repo and run "npm i"

pi@njspcPi:~/relayEquipmentManager/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": [
      {
        "id": 1,
        "isActive": true,
        "devices": [
          {
            "id": 1,
            "values": {
              "channels": [
                {
                  "id": 1,
                  "value": 24011,
                  "voltage": 1.5007332987456894,
                  "maxValue": 65536,
                  "rawBytes": [
                    93,
                    203
                  ]
                },
                {
                  "id": 2
                },
                {
                  "id": 3
                },
                {
                  "id": 4
                }
              ]
            },
            "options": {
              "adcType": "ads1115",
              "readInterval": 5000,
              "comparatorReadings": 3,
              "comparatorLatchingMode": 0,
              "comparatorActiveMode": 0,
              "comparatorMode": 0,
              "mode": 256,
              "name": "ADS1115",
              "sps": 160,
              "channels": [
                {
                  "id": 1,
                  "name": "Return Temp",
                  "enabled": true,
                  "pga": 2.048,
                  "reverseBias": false,
                  "pgaMask": 1024,
                  "mux": 16384,
                  "config": {
                    "value": 50595,
                    "os": "1",
                    "inMultiplexer": "100",
                    "pga": "10",
                    "mode": "1",
                    "dataRate": "101",
                    "compMode": "0",
                    "compPolarity": "0",
                    "compLatch": "0",
                    "compQueue": "11"
                  }
                },
                {
                  "id": 2,
                  "name": "Channel #2",
                  "enabled": false,
                  "pgaMask": 1024,
                  "pga": 2.048
                },
                {
                  "id": 3,
                  "name": "Channel #3",
                  "enabled": false,
                  "pgaMask": 1024,
                  "pga": 2.048
                },
                {
                  "id": 4,
                  "name": "Channel #4",
                  "enabled": false,
                  "pgaMask": 1024,
                  "pga": 2.048
                }
              ],
              "registers": {
                "config": 50595
              }
            },
            "info": {},
            "address": 72,
            "typeId": 700,
            "sampling": 1,
            "isActive": true,
            "feeds": [
              {
                "id": 1,
                "isActive": true,
                "changesOnly": false,
                "sampling": 1,
                "connectionId": -1,
                "deviceBinding": "generic:5:1",
                "sendValue": "ch1.value",
                "property": "adcValue"
              }
            ],
            "triggers": [],
            "name": "ADS1115"
          }
        ],
        "busNumber": 1,
        "functions": {
          "i2c": true,
          "tenBitAddr": false,
          "protocolMangling": true,
          "smbusPec": true,
          "smbusBlockProcCall": false,
          "smbusQuick": true,
          "smbusReceiveByte": true,
          "smbusSendByte": true,
          "smbusReadByte": true,
          "smbusWriteByte": true,
          "smbusReadWord": true,
          "smbusWriteWord": true,
          "smbusProcCall": true,
          "smbusReadBlock": false,
          "smbusWriteBlock": true,
          "smbusReadI2cBlock": true,
          "smbusWriteI2cBlock": true
        },
        "addresses": [
          {
            "address": 32,
            "manufacturer": 0,
            "product": 0,
            "name": "Unknown"
          },
          {
            "address": 72,
            "manufacturer": 0,
            "product": 0,
            "name": "ADS1115"
          }
        ]
      }
    ],
    "detected": [
      {
        "driver": "bcm2835 (i2c@7e804000)",
        "path": "/sys/class/i2c-dev/i2c-1",
        "name": "i2c-1",
        "busNumber": 1
      },
      {
        "driver": "fef04500.i2c",
        "path": "/sys/class/i2c-dev/i2c-20",
        "name": "i2c-20",
        "busNumber": 20
      },
      {
        "driver": "fef09500.i2c",
        "path": "/sys/class/i2c-dev/i2c-21",
        "name": "i2c-21",
        "busNumber": 21
      }
    ]
  },
  "connections": [],
  "genericDevices": {
    "isActive": true,
    "buses": [],
    "detected": [],
    "options": {},
    "devices": [
      {
        "id": 1,
        "values": {
          "adcValue": 24011,
          "inputUnits": "",
          "units": "F",
          "maxVal": 65536,
          "tempK": null,
          "tempC": null,
          "tempF": null,
          "temperature": null
        },
        "options": {
          "name": "Return Temperature",
          "units": "F",
          "inputType": "raw",
          "vccRef": 3.3,
          "inputBitness": 16,
          "inputResistanceUnits": 1,
          "calcType": "interpolate",
          "calibration": 0
        },
        "info": {},
        "triggers": [],
        "feeds": [],
        "typeId": 5,
        "isActive": true,
        "name": "Return Temperature"
      }
    ]
  },
  "oneWire": {
    "isActive": false,
    "buses": [],
    "detected": [
      {
        "path": "/sys/devices/w1_bus_master1",
        "name": "w1_bus_master1",
        "busNumber": 1
      }
    ]
  },
  "lastUpdated": "6/16/2024, 11:47:59 AM",
  "configVersion": 1
rstrouse commented 2 months ago

Please stop pm2 and recompile the Typescript

cd ~/relayEquipmentManager
pm2 stop REM
npm start
katodude commented 2 months ago

Done, and that worked. REM is functioning as expected. Thank you.

Now, just struggling to get the temp registering in the Nixie. I have the feed going into watersensor1.

This is hardest install I have ever done.

rstrouse commented 2 months ago

You are sending a feed from the Generic Temp sensor... correct? Remember the feed does not register until the body is turned on.

katodude commented 2 months ago

Yes, the feed from the I2C goes into the generic temp sensor. Then the feed from the generic temp sensor goes out. And yes the pool is active.

image000000 image000001 image000002

rstrouse commented 2 months ago

Change the send value to All. We added the other options later so folks could digest the straight temperature values in MQTT.

katodude commented 2 months ago

Still does not pick it up in the Nixie

ca5f3a8d-ef7a-483d-887c-e22948306b4a

dkossman commented 2 months ago

@rstrouse FYI i checked out this version of the REM code from a few days ago

$ git checkout 14b2b6a90951887187705abb892a946b14619875

and now the issue with being unable to connect the output of the ADS1115 to a generic 10k temperature probe is resolved.

rstrouse commented 2 months ago

@katodude check the REM log to see if there is an error in there sending on the socket.

katodude commented 2 months ago

Here is an excerpt from the REM logs.

20/06/2024, 11:01:53] error: 39 3,0: EIO: i/o error, write [20/06/2024, 11:01:53] error: 39 1,0: EIO: i/o error, write [20/06/2024, 11:01:53] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:53] error: Error connecting to Node JS Pool http://192.168.1.72:4200: xhr poll error [20/06/2024, 11:01:53] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:53] error: 39 3,0: EIO: i/o error, write [20/06/2024, 11:01:53] error: 39 1,0: EIO: i/o error, write [20/06/2024, 11:01:53] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:54] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:54] error: 39 3,0: EIO: i/o error, write [20/06/2024, 11:01:54] error: 39 1,0: EIO: i/o error, write [20/06/2024, 11:01:54] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:54] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:54] error: 39 3,0: EIO: i/o error, write [20/06/2024, 11:01:54] error: 39 1,0: EIO: i/o error, write [20/06/2024, 11:01:54] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:55] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:55] error: 39 3,0: EIO: i/o error, write [20/06/2024, 11:01:55] error: 39 1,0: EIO: i/o error, write [20/06/2024, 11:01:55] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:55] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:55] error: 39 3,0: EIO: i/o error, write [20/06/2024, 11:01:55] error: 39 1,0: EIO: i/o error, write [20/06/2024, 11:01:55] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:56] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:56] error: 39 3,0: EIO: i/o error, write [20/06/2024, 11:01:56] error: 39 1,0: EIO: i/o error, write [20/06/2024, 11:01:56] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:56] error: Error connecting to Node JS Pool http://192.168.1.72:4200: xhr poll error [20/06/2024, 11:01:56] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:56] error: 39 3,0: EIO: i/o error, write [20/06/2024, 11:01:56] error: 39 1,0: EIO: i/o error, write [20/06/2024, 11:01:56] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:57] error: 39 - Multi-Relay Board Bus #1 Read Command: , Remote I/O error [20/06/2024, 11:01:57] error: 39 3,0: EIO: i/o error, write

tagyoureit commented 2 months ago

You may need to physically remove/kill power and restart. These can be hardware related issues.