BACnet MSTP Slave mode doesn't seem to work #536
-
Hello, I have implemented the library in 2 different devices connected on the same RS485 network (both STM32F4). I based my code on the port to this MCU, so my file "dlmstp.c" is the same as the one in "bacnet-stack/ports/stm32f4xx/dlmstp.c". My goal is to send a "write property multiple" for a group of 2 to 8 analog outputs from the first device to the second one. When both devices are set as masters, everything works fine. The first device sends the request, the second one receives it, sets its analog outputs to the desired values and sends a simple ACK. However, when I try to set the second one as a slave, it captures the request and does nothing with it. Upon request reception, the code reaches the function "MSTP_Slave_Node_FSM()" (instead of "MSTP_Master_Node_FSM()"), it immediately goes to peak "PDU_Queue" that has never been used since boot up and the treatment ends there. No analog output set, no response sent back to the master. To setup the slave mode, do I only need to set the mac address over 127, or is there something else I need to setup for this operation to work? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
I think I forgot to add the indication of reception flag - can you add
|
Beta Was this translation helpful? Give feedback.
Hello, thank you for the reply.
I copied the dlmstp.c function
MSTP_Slave_Node_FSM()
from the port "bacnet-stack\ports\at91sam7s", which uses the flag you mentioned,MSTP_Flag.ReceivePacketPending = true;
. Also, in functiondlmstp_receive()
, I had to adapt the clearing of the flag so theMSTP_Slave_Node_FSM()
could capture the pending state on the next loop: