About Us Knowledge Base Community Forum Electronics Toolbox FAQ Shipping & Delivery

Community Forum

Share your projects and post your questions

Search
Register or Sign In
Forum

RS485 PI with an energy meter

571 Views - Created 22/03/2019

22/03/2019

Posted by:
BurtDS

Users Avatar

Hi, 

 

I bought the RS485 PI and I'm trying to read out the data of my energy meter (a circutor cvm 1-d).

I'm using Python and I'm always receiving an empty value on the serial.readline().

Is there a command that I need to write to the meter first for it to respond? 

I'm totally new to this subject, my apologies in advance.

 

Thanks!

22/03/2019

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

Hi

According to the datasheet for your energy meter it uses the Modbus/RTU protocol for communication so you will need to use a modbus library to communicate with the meter.

There is a modbus python library called MinimalModbus which should take care of the communication protocols but you will need to find out what commands the energy meter understands.

I could not find any command lists on the manufacturers website so you may need to contact them to find out how to talk to their devices.

AB Electronics UK Tech Support

06/05/2019

Posted by:
BurtDS

Users Avatar

Hi

I've tried this with Minimal Modbus in the mean while, but I'm not receiving any answer from the device. 

Is there a way to test this RS485 PI, just to check if it is working properly or not.

 

Many Thanks!

06/05/2019

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

There isn't an easy way to test the RS485 Pi directly other than to connect the outputs to an oscilloscope and see if the signal changes when you send data.

You can test the UART port on the Raspberry Pi, to make sure it is sending data to the RS485 Pi, by connecting the TXD and RXD pins together on the GPIO header and use a terminal program such as minicom to send characters out on the TXD pin.  If the UART port is working anything you type should be echoed back into the RXD input and display on the screen. 

TXD is pin 8 and RXD is pin 10 on the GPIO header.

If you don't get any characters appear on the minicom screen when you type then there is a problem with the UART configuration and I would recommend going through the steps in our serial port tutorials.  For the Raspberry Pi 3, 3+ and Zero W you will need this tutorial, for all other versions of the Raspberry Pi use this tutorial.

AB Electronics UK Tech Support

10/05/2019

Posted by:
BurtDS

Last edited: 10/05/2019

Users Avatar

Hi, 

I've replaced the RS485PI with another one (bought two of them) and now I'm getting a response but the response is too short. (Valueerror)

 

 

10/05/2019

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

Try checking the baud rate, parity and bytesize variables in your code to make sure it matches the device you are using.  If any of those values are wrong that could cause a value error.

AB Electronics UK Tech Support

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.