question

juebie2 avatar image
juebie2 asked

Monitoring a BMV with RasPi - showing no data?

Hello

I have a Victron system and I'm very satisfied with it. Runs really good!

I have a RasPi attached (running a webcam) and now additionally I want to monitor the actual data of the solar system.

I found this program: https://github.com/oekoluk/Victron-Data-Reader-and-Logger/blob/master/lesenschreiben.php and made the connection to the BMV-700 via USB.

On
# ls /dev/serial/by-id/usb-VictronEnergy_BV_VE_Direct_cable_VE*

I get a nice answer:
# /dev/serial/by-id/usb-VictronEnergy_BV_VE_Direct_cable_VE3MENQ-if00-port0

So my Raspi detects the BMV-700 with the name VE3MENQ.

But running the program I get the following lines:
14.12.2018 19:55;0;;;
14.12.2018 20:00;0;;;
14.12.2018 20:05;0;;;
14.12.2018 20:10;0;;;

...

No data. Just one zero. Any idea, why this happens? What to change to get the data?

Jürgen

Raspberry Pimonitoring
3 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jorien avatar image jorien commented ·

Dear @jkario,

Lately I have been trying to use your library but I seem to be stuck a little trying to use it.

I would like to get some data from the BMV and MPPT to use in a Python code on the Raspberry Pi.


I don't feel like I totally understand your README.dm file. First it says 'using the vedirect class', is this some information to tell me about the line of code below or should I actually do something before that line of code can work?

I downloaded the code vedirect.py to my Raspberry pi and tried to use the command :

python vedirect.py --port /dev/vmodem1

You seem to use this code to start the code but my Raspberry Pi tells me there is no such file or directory: '/dev/vmodem1'


To me it feels like I should add 'vmodem1' to the /dev/ directory, is that right? I did not connect the BMV or MPPT yet, is that a reason why it gives this error? To me it feels like it is the first option.


Later in the file you say:

Create a pair of virtual serial ports which transfer data between one and another.

socat -d -d PTY,raw,echo=0,link=/tmp/vmodem0 PTY,raw,echo=0,link=/tmp/vmodem1

Does this sentence show how to setup the vmodem which I am missing? Or is it useful for something else? When I try to type this into the terminal I get the response 'bash: socat: opdracht niet gevonden' (Sorry, it's in Dutch but it means that bash doesn't know the command socat.


As you see, I don't seem to understand how to use this library but I would love to find out how it actually works. Do you have some more reference at which I could take a look or do you know how to actually make the connection? If anyone else did find out how it works or has other suggestions on what to use, I would love to hear about it!


Kind regards,

Jorien

0 Likes 0 ·
jkario avatar image jkario jorien commented ·

The README.md is a bit ambiguous. It was originally meant to be just a reminder to myself on how to setup the virtual serial ports. I don't have my MPPT charge controller or BVM here at home. They are located 200km away. In order to test and debug my code I made a simple VE.Direct simulator (vedirectsim.py). Also I recorder real data from my MPPT charge controller using the Victron VE.Direct USB cable (test/mppt.dump). I've recently made a similar recording for BVM also. Now, since the vedirect.py works with serial ports and I don't have the real hardware at hand I have to create a pair of virtual serial ports and have vedirect.py listen to a virtual serial port /dev/vmodem1 and then connect either the simulator to the other end (/dev/vmodem0) or alternatively feed in real data dump.

If you have the Victron USB VE.Direct cable it will present itself as a real USB serial device @ /dev/ttyUSB0. You would then issue

python vedirect.py --port /dev/ttyUSB0

to connect the vedirect.py to the device.

0 Likes 0 ·
Show more comments
3 Answers
Guy Stewart (Victron Community Manager) avatar image
Guy Stewart (Victron Community Manager) answered ·

Hi Jürgen,

Most of the discussion for dev with Raspberry Pi happens around this group:

https://groups.google.com/forum/#!forum/victron-dev-venus

I know this isn't a perfect fit as you are not using VenusOS, but I think you will have a better chance to find your answer there.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jkario avatar image
jkario answered ·

You could try my library https://github.com/karioja/vedirect. It's been tested with MPPT 75/15. It should work also with a BMV700. I've been meaning to test it but my BMV is currently in use 180km away at our summer home. You will need to modify the python code to produce CSV output.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

juebie2 avatar image
juebie2 answered ·

@ Guy: Thank you, i went there. Not the very big success up to now. They want to send me to this forum ...

@ jkario: Thanks. But unfortunately I'm an idiot in programming. What to do with your lines? And what to change in my lines? Could you please give me a hint, then I could go to my wife, fall down on to my knees and ask for support.

Thanks!

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

That is funny they sent you back!

This community is definitely more active, but less focused on Venus developers. Unfortunately what you are wanting to do does requires some programming, if you learn along the way, please report back.

This configuration is also not supported (but not obstructed) by Victron, so others users will find your lessons valuable.

0 Likes 0 ·

Related Resources

Additional resources still need to be added for this topic