Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issues adding a split system #38

Closed
BKFCAW opened this issue Apr 20, 2023 · 17 comments
Closed

issues adding a split system #38

BKFCAW opened this issue Apr 20, 2023 · 17 comments

Comments

@BKFCAW
Copy link

BKFCAW commented Apr 20, 2023

I have two systems: a combined Waterfurnace System 7 and a split System 5. Running mosquitto and the aurora bridge with the USB/ethernet wiring works fine for the System 7, as does access with MacOS MQTT Explorer. For the System 5, I cloned the Raspberry Pi card and set up a new connection. It "sort of worked," but I wondered whether it was really polling the split system. So I deleted the software and reinstalled. Now I have the following issues with the split system:

  • I cannot connect to it with MacOS MQTT Explorer - it just says "disconnected"
  • Nevertheless, my Telegraf/InfluxDB/grafana stack seems to be recording data, BUT
  • When I poll the blower fan "running" element, it alway says "false," even if the fan is running.
@ccutrer
Copy link
Owner

ccutrer commented Apr 20, 2023

All topics are sent with the retained flag, so even if it's not running you'll see the last message it sent. Be sure to check the homie/aurora-*/$state topic to see if it's currently communicating with your MQTT server.

@BKFCAW
Copy link
Author

BKFCAW commented Apr 21, 2023 via email

@ccutrer
Copy link
Owner

ccutrer commented Apr 24, 2023

Hmm... that does seem like it's communicating. Maybe try stopping the mqtt bridge, and manually using aurora_fetch as described in the readme to synchronously fetch some data. Then make it change state at the thermostat, and then fetch again. Registers 30 and 31 would likely be interesting (outputs and status).

@BKFCAW
Copy link
Author

BKFCAW commented Apr 24, 2023 via email

@ccutrer
Copy link
Owner

ccutrer commented Apr 24, 2023

The serial chipset shouldn't matter, but if it uses a MAX485 transceiver, it won't work, and no there's no way that I'm willing to fix it.

@BKFCAW
Copy link
Author

BKFCAW commented Apr 25, 2023 via email

@BKFCAW
Copy link
Author

BKFCAW commented Apr 25, 2023

Another note: now I think I see that the person posting issue #23 may have the same problem as me. To quote:

"I do have a different model USB to RS-485 Adapter than you show
You list the DSD TECH SH-U11 USB to RS485 RS422 and I have the DSD TECH SH-U10 USB to RS485 Converter. Could that be the issue or do I have something else going on?"

It turns out that DSD TECH SH-U10 has a CP2102 chipset rather than FTDI, though it is the same vendor as the one you originally cite.

@ccutrer
Copy link
Owner

ccutrer commented Apr 25, 2023

Interesting. Makes me wonder if somehow the CP2102 isn't accepting the serial parameters, or just flat out doesn't support the particular parameters WaterFurnace uses (19,200 baud, even parity). I know I've had issues on a different project that is also RS485 where ESP devices couldn't handle 4,800 odd parity.

@BKFCAW
Copy link
Author

BKFCAW commented Apr 25, 2023

From the documentation for CP210x at Silicon Labs:

2.3.1 Baud Rate
The baud rate property is set to 57600 bps, but can be set to any of the baud rates supported by the CP210x. (See the current data
sheet for the list of supported baud rates for the CP210x.)
2.3.2 Parity
The parity is set to NOPARITY, however it can also be set to ODDPARITY, EVENPARITY, SPACEPARITY, and MARKPARITY if supported by the
CP210x. (See the current data sheet for the list of supported parities for the CP210x.)

I'm out of my depth at this level of hardware, not sure how to set parity - or is that done in your code?

@ccutrer
Copy link
Owner

ccutrer commented Apr 25, 2023

My code requests the operating system set the serial parameters (including baud and parity). But it's up to the driver to properly forward that request to the hardware.

@BKFCAW
Copy link
Author

BKFCAW commented Apr 25, 2023

I just ran the following code:

#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>

int main()
{

    struct termios RSopt;
    char str[3] = { 0x10, 0x05, 0x0};
    int fd;
    fd = open( "/dev/ttyUSB0", O_RDWR | O_NOCTTY | O_NDELAY );    

    tcgetattr( fd, &RSopt);
    int TT = RSopt.c_cflag;
    if ((TT & PARENB) != 0)
      printf("parity EVEN\n");
    else
      printf("parity not EVEN\n");
    int speedtest = cfsetspeed ( &RSopt, (speed_t)B19200);
    printf("speedtest = %d\n", speedtest);
    
    close( fd );

    return 0;
}

It has output:

parity EVEN
speedtest = 0

I don't know if this is useful. Maybe there are other tests I can do.

@rabarar
Copy link

rabarar commented Apr 25, 2023

not to be overly pedantic, but since you're using this to test, would be a good idea to catch the return from tcgetattr( ) and make sure you're not getting back EBADF, EINTR, EINVAL or ENOTTY... for sanity sake ...

    if (tcgetattr(fd, &RSopt) < 0) {
        ...

A complete mod looks like:

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>

int main()
{

    struct termios RSopt;
    char str[3] = { 0x10, 0x05, 0x0};
    int fd;
    fd = open( "/dev/ttyUSB0", O_RDWR | O_NOCTTY | O_NDELAY );    

    if (tcgetattr( fd, &RSopt) < 0) {
                fprintf(stderr, "tcgetattr failed: %s\n", strerror(errno));
                exit(1);
        }
    int TT = RSopt.c_cflag;
    if ((TT & PARENB) != 0)
      printf("parity EVEN\n");
    else
      printf("parity not EVEN\n");
    int speedtest = cfsetspeed ( &RSopt, (speed_t)B19200);
    printf("speedtest = %d\n", speedtest);
    
    close( fd );

    return 0;
}

@BKFCAW
Copy link
Author

BKFCAW commented Apr 25, 2023

Thanks very much. I just tried your expanded code, and still get

parity EVEN
speedtest = 0

@rabarar
Copy link

rabarar commented Apr 25, 2023 via email

@BKFCAW
Copy link
Author

BKFCAW commented Apr 25, 2023

Well, OK, that possibly eliminates parity and baud rate as the reason why the CP2102N -based adapter times out on aurora_mqtt_bridge with no data transfer.

@BKFCAW
Copy link
Author

BKFCAW commented Apr 26, 2023

In the absence of anyone stating that they have gotten a CP2102N adapter to work in this application, I will return what I have to Amazon and order an adapter with an FTDI chipset. Perhaps the README should also recommend this.

@BKFCAW
Copy link
Author

BKFCAW commented May 2, 2023

To close the loop on this, I bought a DTech adapter with FTDI (the previous DTech I had came with CP2102N), and it worked right out of the box.

@ccutrer ccutrer closed this as completed Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants