EmonTX Arduino <-> RS485 <-> another Arduino

Hello,
I bought emonTx Arduino Shield SMT. Arduino+shield is working on Serial Monitor OK.
I will have master arduino for controling system and few arduinos with emonTx shield for measurments. They will be connected with RS485 MAX485 in network. I mange to establish “softwareserial” communication with RS485 betwean arduinos with test code.
Then i try somehow to put communication code inside emonTx sketch, but without success. I try to changing “pins” in program, but no luck.
Can someone help me, what part of program must i change? I need 3 pins (RX, TX and data direction pin), because i want arduino not to only send data, but send data when he is asked.

Thank you

Hello Robert - another one here :+1:

You need to use the FTDI (Programmer / UART) interface with a TTL-RS232 to RS485 converter. Check the voltage levels – you will find a circuit diagram in the “Docs” section.

The emonTx Shield will send data on the pin labelled Rx and receive data on the pin labelled Tx (YES! - it is looking for those pins, it is very :upside_down_face: )

You use the normal “Serial.print(…)” instruction to send the data - the sketch as it exists will automatically send data every 10 s approximately. If you must request the data via your “Master Arduino”, then it will be necessary to make very big changes to the sketch, so that it accumulates the energy and averages the power since the last time you asked for the data.

I am busy tomorrow - I might have time to give you some more guidance in a few days time.

Hello Robert, thank you for quick replay.
I finaly manage to establish connection, but this time i only sent data to master, with 10s interval you mentioned.
I removed all code regarding to 1WIRE and all code for RFM. Actualy i removed to much code, and now i getting strange readings :smile: Sketch is now big only 16850 bytes (52%) of program storage space.
I connect RX and TX to pins 7, 8 and data direction pin for RS485 to pin 9. I made another loop which i call after i send data’s to SerialMonitor.
First test are promising :metal: If you want i can send you code to check what i did.

Thank you again

Here are picture of my project. For now i am into making program.
3Arduinos (one with emonTx shield and emonTx firmware) for meassurments, one with main program (will be replaced with esp32 for web page access) and mega2560 for inputs and outputs.
For now communication its working betwween them, but UNO is only sending data to master.