uhi22 / pyPLC

Electric vehicle CCS charging investigations with Python
GNU General Public License v3.0
135 stars 32 forks source link

triggerConnectorLocking & triggerConnectorUnlocking #23

Closed Mustafa19981903 closed 7 months ago

Mustafa19981903 commented 8 months ago

@uhi22 Hello again UHI I'm thinking of making changes on the hardware side. I need to look at fsmPev.py for the charging station software because the Response commands are there. FsmEvse.py Request commands appear. Do the connector unlocking and closing functions unlock the connectors inside the vehicle or do they perform an operation at our charging station?

uhi22 commented 8 months ago

Hi, you write "look at fsmPev.py for the charging station software". This is a misunderstanding. The concept is:

Mustafa19981903 commented 8 months ago

@uhi22 Hello /Thank you for your answer. I wanted to ask because Response codes are in Fsmpev and Request codes are in FsmEvse. Currently, I want to communicate with the vehicle with the fsmevse software and power the vehicle with the power module. I am also thinking of adding rfid module and rgb led. These peripherals, as far as I understand, need to work with the fsmevse software. How can I make this point?

I read and adjust data with the 30 kW power module canbus. At what point can I make an addition to the fsmevse software to give it power? As far as I understand, we create json data by processing the hexadecimal data of the rxdata array, how do we do this? rxdata

uhi22 commented 8 months ago

Let me make an example. The fsmPev sends a CurrentDemandRequest via the powerline communication to the fsmEvse. The currentDemandRequest contains the settings of voltage and current, which the car (or more precise: the cars battery management system BMS) thinks is good for the battery. The fsmEvse should take the voltage and current values and forward it to the power supply unit, in your case maybe via CAN to the "30 kW power module". So you need to find a CAN driver (hardware and software) for your machine, which could could use together with python. On linux, there is socketCAN integrated into the kernal, even with a driver for the MCP2515 CAN transceiver. There should be phython libraries for use with SocketCAN. So your way would be to write some code in the fsmEVSE handleCurrentDemandRequest function, which takes the voltage and current from this message and sends it via CAN.

Mustafa19981903 commented 8 months ago

@uhi22 Thank you for your answer. I have two more questions. As far as I understand, we create json data by processing the hexadecimal data of the rxdata array, how do we do this? I bought two tplink-pa4010 plc modules and wanted to power them from the dc side and receive slac messages, but I was not successful. I think I've made a hardware mistake. I couldn't find a photo with a clear link. I ran the simulation software with both Windows and Raspberry Pi. But I couldn't run it in real time. I could not establish a connection between 2 raspberry pi and 2 plc modules. Later, I provided 5% duty from the 12 volt 1 khz circuit with the card of my own design, but I still could not receive the slac messages with the vehicle. I will buy 2 new plc modules. I would be very happy if you can support me on how to connect them exactly. json tplink

Mustafa19981903 commented 8 months ago

@uhi22 A special configuration was required for the plc module to transmit slac messages. I saw the steps to be followed for this, but I did not fully understand it. Do I need to connect Raspberry Pi to the plc module via ethernet and write commands at http://github.com/qca/open-plc-utils?

uhi22 commented 8 months ago

Short answer: yes, you install the qca tool from this link on your raspberry, connect it via ethernet cable to the adapter and run the read/patch/write commands on the raspberries command shell. Long answer: there are a lot of html pages with explanations included in the qca tool.

EDIT: Extended the related documentation here: https://github.com/uhi22/pyPLC#step-by-step

Regarding the JSON question, added an question/answer in the FAQ: https://github.com/uhi22/pyPLC#q7-the-pyplc-seems-to-create-json-data-by-processing-the-hexadecimal-data-of-receive-data-array-how-does-it-do-this

uhi22 commented 7 months ago

Question seems to be answered, closing.