Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Reply To: RS485 without auto direction control

Home Forums Mayfly Data Logger RS485 without auto direction control Reply To: RS485 without auto direction control

Erik G

    Finally some progress when I got some help.

    In the modified ThingsSpeak sketch the constructor was the problem.
    YosemitechY504 y504_1(y504ModbusAddress1, modbusSerial, modbusSensorPower, max485EnablePin, y504NumberReadings); -> did not work
    YosemitechY504 y504_2(y504ModbusAddress2, modbusSerial, rs485AdapterPower, modbusSensorPower, max485EnablePin, y504NumberReadings);->Works. I don’t know how I lost one of the power pins but that explains why it worked better from the beginning.

    Back to the original problem…
    The logger crashes if I set the EnablePin to >0 and don’t set the -D MS_YOSEMITECHPARENT_DEBUG flag
    In setup the program enters and don’t return from varArray.setupSensors();

    In YosemitechParent.ccp (line 67-69) the debugStream is null if not in debug.

    In SensorModbusMaster (line 683-690) it ends up with the null pointer