OpenV2G icon indicating copy to clipboard operation
OpenV2G copied to clipboard

Doubt about compilation

Open amolina-chargevite opened this issue 2 years ago • 10 comments

Hi,

I have seen that you have cloned the OpenV2G repository and you have worked with this repository. I have seen that in the folder src/test there is a file named main_example.c that execute a code that call the functions developed. I am not sure if there is a Makefile to compile all or I need to do this Makefile to compile. Could you indicate me this?

Thanks in advance.

amolina-chargevite avatar Jun 23 '22 13:06 amolina-chargevite

Hi,

Both Debug and Release folder contain a makefile that you can use. From the Linux command line (e.g. Debian) you can do:

Step 1:

git clone https://github.com/Martin-P/OpenV2G

This creates a folder OpenV2G and clones this repository to that folder.

Step 2: In src/test/main.h line 31 the following constants are defined:

#define CODE_VERSION_EXI 1
#define CODE_VERSION_SAMPLE 2
#define CODE_VERSION CODE_VERSION_SAMPLE

The last line (#define CODE_VERSION CODE_VERSION_SAMPLE) indicates which file is used when compiling the code main_databinder.c or main_example.c

Step 3:

cd OpenV2G/Release

Change directory

Step 4:

make

From within the Release folder run make. This creates an executable file: OpenV2G.exe. You can now run this executable file:

./OpenV2G.exe

I hope this info helps you to get started.

Martin-P avatar Jun 23 '22 23:06 Martin-P

Hi,

Thank you so much for your reply. I could execute the application. I think that in the code of the function charging1() is mixed the code of the charger and the vehicle. I think that if I want to communicate with the EV I need to comment the code related to the EV. Is this correct?

Thanks in advance.

amolina-chargevite avatar Jun 24 '22 09:06 amolina-chargevite

Hi,

I think you can keep function charging1() as it is at first The changes can be made to the function request_response1(). From there you can have a look at create_response_message1() which points to the different functionalities.

The actual communication with the EV was done using an INSYS Powerline GP. Some background info: https://github.com/Martin-P/OpenV2G/issues/2#issuecomment-852579212

Martin-P avatar Jun 25 '22 22:06 Martin-P

Hi,

I noticed a few commits in the original repository on SourceForge, so I updated the repository and it is up-to-date with the original SVN version (https://sourceforge.net/p/openv2g/code/HEAD/tree/trunk/) now.

Martin-P avatar Jun 26 '22 16:06 Martin-P

Hi,

In first place thank you so much for the reply. Now, I have achieved to see the slac messages, but I am not sure how to see the messages of the V2G protocol. I am using a board with a qca7000, so the messages are sended via CP. I want to see in a first place the messages that occurss in the appHandshake() but I am not sure how to see the messages in the terminal. In the first phase I execute the code related to the slac communication and after I execute the code related to OpenV2G. Could you indicate me how can I debug the messages of the communication?

Thanks in advance.

amolina-chargevite avatar Jun 27 '22 07:06 amolina-chargevite

Hi,

The easiest way to see the messages is probably by adding some printf statements to the code. In appHandshake there are 2 structs containing the sent data and the received data:

struct appHandEXIDocument handshake; /* what you send */
struct appHandEXIDocument handshakeResp; /* what you receive */

If you want to view the raw data directly perhaps it is an option to send the data to the QCA7000 UART port too. You can attach a UART to USB converter to that port and monitor the data using software like RealTerm.

Martin-P avatar Jul 02 '22 14:07 Martin-P

Hi,

Thank you for the reply. I have a doubt about how the library knows about which interface I have connected to the qca7000? Do I need configurate in any place of the code the interface? How is done the communication?

Thanks in advance.

amolina-chargevite avatar Jul 04 '22 07:07 amolina-chargevite

Hi,

Looking at the QCA7000 software (qca/qca7000) you can choose the QCA7000 software version you want to use:

  • SPI (the qca-spi folder)
  • UART (the qca-uart folder)

Martin-P avatar Jul 04 '22 15:07 Martin-P

Hi,

Thank you for the reply. I know about the interface to communicate with the qca7000. I communicate my MPU via SPI. I have used the open-plc-utils library and works, but I have doubts about the OpenV2G library, which interface use this library to transmit? For example, I have the interface eth1 created by the driver of qca7000 and I want to use this interface to transmit and receive the messages of V2G, which do I need to configure?

Thanks in advance.

amolina-chargevite avatar Jul 05 '22 06:07 amolina-chargevite

Hello,

The library does not use an interface, it just feeds the message to itself and returns a response. For actually transmitting the data you have to write the code that transmits the data to the QCA7000. If you communicate with the QCA7000 using SPI you have to write that part of the code. In main_example.c you can alter the functions request_response1() and request_response2() to your own setup.

Martin-P avatar Jul 07 '22 21:07 Martin-P