kk7ds / pynx584

Python library and server for talking to NX584/NX8E interfaces
GNU General Public License v3.0
29 stars 26 forks source link

Can't get pynx584 to work with serial to ethernet device #7

Closed joshuaja closed 7 years ago

joshuaja commented 7 years ago

I had a Raspberry PI with pynx584 directly connected to the nx584 via serial to USB null modem cable and it worked fine, but I've tried a couple different serial to ethernet devices and can't get pynx584 to report zones when connecting via nx584_server --connect 192.168.0.22:4001.

It connects but it always reports back with no zones via nx584_client summary (even after tripping them).

Here are the two serial to ethernet devices I've tried with a null modem cable between the nx584 and the device:

Any ideas?

kk7ds commented 7 years ago

For reference, this is what I have: ONETAK

I have two of those on two separate panels (both NX-8E) and they work fine.

If you telnet (or nc) to the SOL device do you see the ascii events being reported?

Do you have the baud rate set on the SOL device properly?

Are there any settings for two-way communication or something like that? Maybe hardware flow control is enabled?

joshuaja commented 7 years ago

I'm not seeing anything coming through when I telnet to it telnet 192.168.0.22 4001 so that seems to be the issue.

Here are the settings I'm using on the SOL device and the nx584 is configured to use 38400 baud as well.

screen shot 2017-03-16 at 11 08 15 am

I haven't made any changes on the nx584 side of things but I did unplug the null modem cable from it in order to plug in the SOL device with new cable.

Do you think the nx584 just needs to be restarted or can you see anything I might be missing?

Thanks so much for your help by the way :)

kk7ds commented 7 years ago

Just to be clear, you should stop nx584 before you try the telnet. I dunno what your device would do with multiple connections, but "the right thing" is probably not in that set :)

I don't know what the four check boxes at the end of that config page mean in terms of the serial connection. However, the settings above those all look right to me if your panel is set for 38400.

Are you sure you need a null modem between this and the panel? It depends on how your device and the panel are wired, but if you don't need one, you're connecting TX->TX and RX->RX which would result in no data coming through. If you have a straight gender changer, I'd try that in place of the null modem. If not, two null modems back to back cancel each other out.

Anyway, if you don't see the ascii strings coming through the telnet connection then you can leave nx584 out of the debugging picture until you do.

joshuaja commented 7 years ago

Thanks much! I'll try it with a gender changer - that might be the ticket. Are you using a null-modem cable between your nx584 and SOLs or just standard serial cables?

kk7ds commented 7 years ago

I wired mine straight from the headers on the NX8E board to the serial port, so .. neither :)

joshuaja commented 7 years ago

I finally got around to trying it out with a straight serial cable and it worked! (I had an extra null modem cable around that had already been cut and switched the TX/RX pins manually).

I could have sworn the nx584 manual stating to use a null modem cable, but maybe this is not the case for SOL devices.

Thanks again for your help - it's reporting zones again :)

Also, I dockerized pynx584 to use on my Synology Nas. Would you be interested in my Dockerfile?

kk7ds commented 7 years ago

Great, glad to hear it!

Sure, wanna send a PR?

joshuaja commented 7 years ago

Sure thing. I'll clean it up a bit this week and will submit a PR.