[Apologies if duplicated post – @Ray, forum doesn’t seem to allow attaching .ino files ?]
Glad the code was useful but sorry to hear that the new hardware is not up and running. Can I check that the motor drive board you have is the same as I have pictured above?
I have attached the wiring diagram that I use but, from your notes above, I’m not sure why your approach hasn’t worked. In my case, I need a higher voltage than the onboard regulator can handle to guarantee latching of the valve so I use a 12V DC supply to drive the solenoid and a DC-DC converter to peel off 5V for the nodemcu. In this configuration, I have the jumper between VM and NC ensuring the power rails are kept separated.
I have attached below a short test routine that I used to check that I could control the motor board. The routine just toggles the Motor A terminals between +VM and -VM on a 2 second cycle in sync with the pulsing blue led on the board. You compile through the Arduino IDE with NodeMCU board selected. This should let you put a voltmeter across the terminals (suggest without valve attached) to check you have the hardware working.
Only other thought off the top of my head is that they may have updated the board and swapped the control pins. Do you have any documentation to confirm pin outs (mine attached) and/or can you follow the traces to see if that might be the issue.
Let me know how you get on and happy to help,