kk7ds / pynx584

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

Negative ack / request failed when sending program data request #22

Closed tomptz closed 6 years ago

tomptz commented 6 years ago

Thanks a lot for this piece of software. The existing code works great with my NX-8 system. I am now trying to expand the controller code to support more types of messages but I ran into an error.

I am trying to send message number 30h, which is a program data request. This request allows retrieving data stored in the system memory. I always get a negative acknowledge and request failed return message after sending message number 30h. I guess this means the sent message is formatted incorrectly (e.g., wrong checksum).

I do not think this is a permission problem, as the NX-584 is set up to allow program data requests. Also note that one would expect a "message rejected" return message instead of a negative ack if the message is properly formatted but the request cannot be completed for some reason.

The communication protocol docs suggest a message length of 4 bytes: message number, device bus address, upper logical location, lower logical location. From the NX-8 docs, I find that the NX-8 main module is located at bus address 0. I would assume that a message containing [0x30, 0, 0, 0] should result in a valid reply.

Any thoughts on this?

Thanks a lot,

Tom

tomptz commented 6 years ago

Problem solved. As it turns out, the bus address of the NX-8 main module when sending a program data request is 8 instead of 0.

kk7ds commented 6 years ago

Cool. Got a patch? :)

tomptz commented 6 years ago

Cool. Got a patch? :)

No patch necessary: just keep in mind that the NX-8 main module is located at bus address 0 when sending program data requests.