Skip to content
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

Doubt about compilation #3

Open
amolina-chargevite opened this issue Jun 23, 2022 · 10 comments
Open

Doubt about compilation #3

amolina-chargevite opened this issue Jun 23, 2022 · 10 comments

Comments

@amolina-chargevite
Copy link

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.

@Martin-P
Copy link
Owner

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.

@amolina-chargevite
Copy link
Author

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.

@Martin-P
Copy link
Owner

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: #2 (comment)

@Martin-P
Copy link
Owner

Martin-P commented Jun 26, 2022

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.

@amolina-chargevite
Copy link
Author

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.

@Martin-P
Copy link
Owner

Martin-P commented Jul 2, 2022

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.

@amolina-chargevite
Copy link
Author

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.

@Martin-P
Copy link
Owner

Martin-P commented Jul 4, 2022

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)

@amolina-chargevite
Copy link
Author

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.

@Martin-P
Copy link
Owner

Martin-P commented Jul 7, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants