I'm having this problem as well. I've got a duet board and in my Cura created gcode, the commands are given as M106 S255. But they are ignored. If I manually enter that the same thing happens. However if I manually enter M106 P0 S255 it turns on the fan and acts as expected. Is there a setting that I can change that will include the P value?