-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple pzem-004t, only one communicates when together, but work fine separately #135
Comments
I don't see how that would help anything... You are not eliminating one of the weaker PZEMs taking ownership of the bus. But try it and let me know if it works. 😄 |
As you expected, it didn't work 😅 waiting for transistors to arrive to try firstly this approach you suggested to regulate the current. I also ordered more pzems (as a last resort) from the same store and hope they are the same resistance... Generally i don't want to end up modifying the hardware so i will avoid this approach. Also i don't have another hardware serial pin on the arduino so i can't pute them in different busses, so i can't follow this approach either. Thanks for the amazing suggestions and i will let you know if i succeed with the transistors. 😊 |
Hello, and thanks for this great library. I am trying to create a 3 phase meter using arduino leonardo based MCU and pzem-004t V3.0. For now i am just trying to make 2 of the pzem004t work in tha same modbus.
For some reason i only managed to make each one (individually connected) to work fine only through hardware serial, using Serial1 (witch are pins 0 and 1 of leonardo used for Tx and Rx). I managed to also set addresses of 0x01 and 0x02 for the 2 pzems using the change address code in your repo. From your code for multiple pzems i am using the Serial2 version (change it to serial1 for my case) and alsa changed baud rate to 9600 cause it doesn't work with 115200. Also some info about the pzems and the circuit:
One of the pzem004t (when connected individually) works only with 3v3 source of arduino and not th 5V which is super weird. It has 348K optocouplers. The other works with both 5V and 3v3 and has 139K optocouplers. So for my implementation i am using 3v3 so that both can work. Moreover, using the code i provide you, when i have only one pzem connected at a time (either one) it works fine and the data gets printed correctly. But when i connect both of them, only the pzem with the 139K optocouplers prints results. The other prints "Error reading voltage" (NaN values). Also when th commands are exectuted the lights on the pzems blink as they are supposed to, as if they are working correctly. So something is wrong with the modbus setup? What could be the problem?
The code i use is the following:
The text was updated successfully, but these errors were encountered: