Answered

Renogy Communication Serial Protocool

Posted by TrevinLC1997

Dec 21, 2018 at 5:54pm

Is there any documentation on the protocol that the Renogy BT-1 Bluetooth Module and Tracer Meter MT-1 use to grab the information from the charge controller such as current voltage, input watts, etc?

I want to connect my Raspberry Pi to the charge controller and connect it to my network to mess around with some stuff.

Thanks

Posted by playersz28

Dec 22, 2018 at 5:29am

It was posted here a month or so ago in response to my request thread. I'm using a Pi to talk to my Rover using Modbus. No longer using the BT1 unless I need to set params thru my phone.

Which CC do you have?

Posted by playersz28

Dec 22, 2018 at 5:30am

Here: renogy.boards.net/thread/266/rover-modbus

Posted by trevinlc1997

Dec 22, 2018 at 8:47pm

I'm going to use the Renogy Wanderer Li and thanks for the link! I'll give it a look.

Posted by playersz28

Dec 23, 2018 at 7:15am

The Rover came with a 6pin network plug to USB cable. That works plugged into the Pi. I also made one up for testing with a long piece of 4wire cable and an old RS232 to USB adapter cable. I had no 6pin plugs so I ground down each side of an 8pin Cat5 plug until it fit in.




Posted by Admin

Nov 8, 2018 at 2:36pm

Attached is the document for the Rover MODBUS

ROVER MODBUS.docx (314.26 KB)

-Renogy Team

Posted by playersz28

Nov 8, 2018 at 4:52pm

Thanks!

Posted by lindsay

Nov 9, 2018 at 3:25am

Wish I had this a year ago, had to work these all out on my own at the time :PBut nice to see if I missed anything!

Posted by playersz28

Nov 9, 2018 at 4:20am

lindsay,

I found a nodejs package that had a bunch of these listed and the name of the doc.

Right now I'm running a package called EpsolarServer that I changed a bit. It's written in C++. Next step is replacing and improving the charts. I also want to roll in the functionality I currently have in an Arduino for supporting load measuring. It uses an INA219 over I2C rather than reading the mV directly as you have.

Posted by lindsay

Nov 9, 2018 at 6:46am

That INA219 is cool, but don't think it'll handle the 28.8-29.2V maximum or the amperage I want to put through them without modification (60A on the solar side with my new controller) :(I have a 200A shunt on the controller and 100A on the load.

Posted by playersz28

Nov 9, 2018 at 7:14am

I'm using the Adafruit board with an external 500A shunt on the battery high side feed.

Posted by lindsay

Nov 9, 2018 at 8:18am

Have you found it to be accurate? When I checked directly with the multimeter the shunt I have on long leads (a bit over a metre) was reading about 10% lower through the ADC. I might just multiply the values in my python by 1.1 to correct for this!

Posted by playersz28

Nov 9, 2018 at 9:38am

Are you referring to the sense leads from the shunt? My Arduino (ESP8266 actually) is right beside the shunt and uses UDP broadcast and I2C to send the data to the two displays (Arduino+touchscreen or Pi+touchscreen+C#+WindowsIOT).

I've only tested the accuracy on the bench at low currents as my DVM only supports <20A. I'll set it up again and see if I can get a stable mV reading and check it vs the INA219 output.


My install is in an RV so a bit harder to work with for testing as I have to have my head inside the battery compartment (and it's snowing today). :)

Posted by Admin

Nov 9, 2018 at 5:05pm

lindsay Avatar

Nov 9, 2018 at 3:25am lindsay said:

Wish I had this a year ago, had to work these all out on my own at the time :PBut nice to see if I missed anything!



We apologize!

But definitely more power to you. For this forum we're trying to really serve as a resource and of course are always receptive to learning.

-Renogy Team

Posted by lindsay

Nov 13, 2018 at 6:43am

Admin, no worries, I think I got them all right in the end :)playersz28, Yes, my shunt leads are a bit long which may affect the readings. I'm also setting up a LCD on my I2C: www.netram.co.za/4302-gravity-i2c-16x2-arduino-lcd-with-rgb-font-display-black.html

Posted by mediadogg

Dec 11, 2019 at 5:35pm

Some clever dudes in this thread. Nice work and very inspiring to read.

Posted by playersz28

Dec 13, 2019 at 7:27am

mediadogg Avatar

Dec 11, 2019 at 5:35pm mediadogg said:

Some clever dudes in this thread. Nice work and very inspiring to read.


I've had my application running on a Pi for a year now. I capture the data from an ESP8266 connected to a shunt and the modbus readings from the Rover. They are logged to a SQL database and I can also use any browser on the trailer LAN to view a web page with numbers and charts.

I also have a GPS module that the Pi gets data from to log lat, lon, elevation & speed so I can reference location vs solar output.

Working on an Android app now to show what the web page shows.

Could have bought a system that provides pretty much all of it with less effort but where's the fun in that :)

Posted by raydas

Dec 13, 2019 at 7:42am

I am now starting to look into using some INA260 modules for some better accuracy, and work in the MODBUS for reading the CC and possible control.

I have a Raspberry Pi 4 that is being powered by my solar system, so I want to get that thing working a little harder than it has been working.

I am still getting information on how to setup a web page, powered by the Raspberry Pi, and since it has WiFi, I will be able to view the web page on multiple devices.

Boy, I have to go lay down for a bit. LOL

Posted by playersz28

Dec 13, 2019 at 8:06am

raydas Avatar

Dec 13, 2019 at 7:42am raydas said:

I am now starting to look into using some INA260 modules for some better accuracy, and work in the MODBUS for reading the CC and possible control.

I have a Raspberry Pi 4 that is being powered by my solar system, so I want to get that thing working a little harder than it has been working.

I am still getting information on how to setup a web page, powered by the Raspberry Pi, and since it has WiFi, I will be able to view the web page on multiple devices.

Boy, I have to go lay down for a bit. LOL


I'm currently using an INA219 as that was the best I could find when I first started down this path 4 years ago. My setup started out on a TI LaunchPad board using the Arduino environment. Then an ESP board. A bit over a year ago I switched mostly to a Pi but the INA is still on the ESP and sending shunt data to the Pi as I haven't bothered to port the Python lib to C++. I also have a Pi running Windows IoT that I had monitoring the stuff on a touch screen but that's not used anymore. Working on an Android app now. I forked my code for the Pi from EpSolarServer

I'll have to look into the INA260 next I guess :)

Posted by raydas

Dec 13, 2019 at 1:02pm

Adafruit sells the INA260 breakout board. One concern, actually two concerns, the size of the board, and the terminal connector.

The terminal connector will have to be able to handle a 12AWG or maybe even a 10AWG wire, wonder if it is up to the job. The board itself is, I think the size of a quarter, you will probably need a very sturdy surface and some good screws. It seems like the wire that I am working with has a coil to it, and that coil is always trying to return back to its coil shape after it gets straighten out.

  • Detailed Answer above

  • I'm looking for documentation for the serial protocol.  I see the post above that links to the old forum at https://renogy.boards.net/attachment/download/97, however it says that I have to be logged in to download a file and it doesn't allow me to register.  Is this document available somewhere else?

  • Hi Team:

    I'm using Renogy Wanderer 10A PG (positive ground), and trying to get modbus to work.  

    I'm using ESP32, hardware serial port 2, ModbusMaster library.


    I've verified a sent signal with oscilloscope,  but I get no response from the charge controller.


    What is the correct Modbus address of the charge controller??  I've been using 0x01.

    I also tried 0x00, the broadcast address, but got no response. 

    What is the correct Modbus baud rate?


    Thanks

    CB 

  • The ModBus address 1 is correct. I don't know if the broadcast message using address 0 will do anything. There's a bunch of undocumented quirks of the Rover's modbus.


    Baud rate: 9600

    Data Bits: 8

    Parity: None

    Stop Bits: 1


    Make sure your serial port is using RS232.

  • Thank you for confirming.  


    So, my project is, to have solar power in my greenhouse.  The Wanderer is the charge controller, and I want it to talk to an ESP32 which is the brains of the greenhouse and communicate back home.  I'm trying to connect the ESP32 directly to the micoprocessor of the Wanderer, since they will be located in the same box.  So I have a hardware UART from ESP32 (Serial2, pins 16, 17).   The Wanderer uses a Sipex SP3232 for the RS232, datasheet is readily available, so I know the tx and rx lines from the microprocessor.   The Wanderer microprocessor is an STMxx on 3.3v.  I'm powering the ESP32 from the Wanderer's USB lines... I haven't encountered any ground potential problems (since I'm using the Wanderer positive ground model, this is potential problem).   So I'm thinking they should be able to talk to each other UART 3.3v lines.  So far no luck. 


    I may just need to buy an RS232 converter for the ESP32 and work backwards from there. 


    Thanks again

    Carl

  • I tried using the UART with a Raspberry Pi and had no success. The UART is not compatible. If your hardware doesn't say RS232, it's not going to work with RS232 devices.

    Buying some converter that supports RS232 is the way to go. I bought a USB to RS232 converter, but I'm sure you can find something out there to convert for Arduino devices.

  • Update:


    So I rigged up with RS232.  I'm using ESP32 and ModbusMaster library.  I can read real-time voltages (e.g. load and battery) but not currents and power.  Appears these are not supported for Wanderer PG (pos ground)  :(


    Can anyone recommend a comparable Renogy controller where the current and power measurement function are supported?


    Thanks

    Carl

  • Huh, I'm surprised that the Wanderer doesn't support those. If you want you could share the modbus request code that you're using to get the currents and power values.

    On my Rover PG 40A that the current and power measurements work.

    You should be able to read these: PV Voltage: 0x0107, PV Current: 0x0108, Charging Power: 0x0109. Also note that I don't think charging power equals pv voltage * current. I believe that charging power is calculated using charging current, which is PDU address: 0x0102.

  • So for those following along at home:

    ESP32 with ModbusMaster

    Wanderer 10A PG PWM controller

    I'm working on my lab bench with power suppy to the battery at 13.5 VDC,

    Load to an electronic load running up to 0.6 A

    (presently no solar panel connected)


    using node.readHoldingRegisters(0x0105, 1)

    (read load current, read reg 0105H, read 1 word (16-bytes), 

    Response sent to an array with node.getResponseBuffer()

    I can also verify with Siglent 1104x decoding.



    These work:

    0x0101, battery voltage

    0x0103, controller temperature

    0x0104, load voltage


    These always return zero:

    0x0102 battery current

    0x0105 load current


    Thanks

    Carl


  • @Carl, do you have code you'd be willing to share? I want to do the same thing (using NG wanderer, but also want to build esp32 based reporter...)

  • Sure.  I used the ModbusMaster library.  


    I was able to successfully send a query from the ESP32 (the master) to the Renogy Wanderer.  The Renogy responded appropriately.  I could decode on my scope.   

    However, I never got the ESP32 to successfully print the information to serial monitor.  I don't know if it received and decoded the data.

    I discontinued the effort when I found the Wanderer 10A does not support current measurements.


    Here's the sketch for ESP32


      

    #include <ModbusMaster.h>
    // instantiate ModbusMaster object
    ModbusMaster node;
    void setup()
    {
      Serial.begin(19200);  
      Serial2.begin(9600);  
    }
    
    void loop()
    {
      static uint32_t i=0x3;
      uint8_t j, result;
      uint16_t data[6];
      
      
      Serial.print("  i: " + String(i));
    
    //  byte senddata[14]={255,0,0,0,0,0,0,0,0,0,0,10,10,10};
    //  Serial2.write(senddata,14);
    //  Serial2.write(0x00);
    //  Serial2.write(0x05);
    //  delay(2000);
    
      // Begin communication with Modbus device 1, on port Serial2
      node.begin(1, Serial2);
      
      // set word 0 of TX buffer to least-significant word of counter (bits 15..0)
      //node.setTransmitBuffer(0, lowWord(i));
      
      // set word 1 of TX buffer to most-significant word of counter (bits 31..16)
      //node.setTransmitBuffer(1, highWord(i));
      
      // slave: write TX buffer to (2) 16-bit registers starting at register 0
      //result = node.writeMultipleRegisters(0, 2);
      
      // slave: read (6) 16-bit registers starting at register 2 to RX buffer
      // Read load current, register 0x0105, 2 bytes (1 word) = load current * 0.01 A
      //result = node.readHoldingRegisters(0x0105, 1);
      // read system batt voltage and system current at 0x000A, voltage = data * 0.1 volts
      // result = node.readHoldingRegisters(0x000A, 1);
      // read  batt voltage at 0x0101, voltage = data * 0.1 volts
      //result = node.readHoldingRegisters(0x0101, 1);
      // read BATT CURRENT at 0x0102, current = data * 0.01 amps
       //result = node.readHoldingRegisters(0x0102, 1);
       // read LOAD CURRENT at 0x0102, current = data * 0.01 amps
       result = node.readHoldingRegisters(0x0105, 1);
      // read load VOLTAGE at 0x0104, voltage = data * 0.1 volts
      //result = node.readHoldingRegisters(0x0104, 1);
      
      // do something with data if read is successful
      if (result == node.ku8MBSuccess)
      {
        Serial.print("\n Result: ");
        for (j = 0; j < 6; j++)
        {
          data[j] = node.getResponseBuffer(j);
          //Serial.print( " Element " + String(j) + ": ");
          Serial.print(String(data[j]));
        } 
    
      }
      delay(5000);
    }

       

  • Thanks for sharing the code! So the 10A doesn't support current measurements? That sucks (I have one as well). I mean, it displays them on the LCD...!

  • My Wanderer 10A Positive Ground doesn't support current measurement.  Per Renogy support, the most economical charge controller that supports all ModBus functions is the Wanderer 30A.  I don't know specifically if your Negative Ground one will report current or power, but let me know.  


    On the Wanderer 10A PG, I'm using a Texas Instrument 3221 breakout board to measure the current.  But it doesn't like dealing with the PWM, the reading changes from moment to moment so will require some work.  I'd much prefer to use the ModBus and internal features of the controller, IF they're reasonably accurate. 

Login or Signup to post a comment