mobilityhouse / ocpp

Python implementation of the Open Charge Point Protocol (OCPP).
MIT License
799 stars 321 forks source link

Component/Variable implementation #173

Closed ferfersan6 closed 3 years ago

ferfersan6 commented 3 years ago

Hi all!

I am thinking about an implementation with its own configuration. Currently, I am using a 'config.ini' file, parsed by configparser. The thing is that it is able to cover a full described variable (with its attributes and characteristics, as described in device model). My config file looks like (just a part of it):

[AuthCtrlr]
Enabled = True
OfflineTxForUnknownIdEnabled = False

[ChargingStation]
Enable = True
ACVoltage = 0
ACCurrent = 0
VendorName = NewVendor
Model = NewCharger

With configparser, it is easy to read/write and iterate over it to make Reports or Set/Get variable data without attributes. If I would like to add a MaxLimit for ACVoltage or another attribute such as MinSet or Mutability, it should be indented below the variable, but, I would not be able to read it with configparser.

Has anyone implemented a full configuration for a Charging Station? I would like to know if there is an easy way to resolve Component/Variable plus attributes case.

Thanks in advance.

OrangeTux commented 3 years ago

I'm not sure how this question is related to this library. Your question seem to be about configparser. I suggest to try the question on StackOverflow or a Python email list.

ferfersan6 commented 3 years ago

I'm not sure how this question is related to this library. Your question seem to be about configparser. I suggest to try the question on StackOverflow or a Python email list.

Not really, I am asking for a different implementation from mine. Also, I suggest it would be interesting to add an API to the library such that configuration is implemented easier. Something to write, read...

Thanks for your response anyway.

OrangeTux commented 3 years ago

Also, I suggest it would be interesting to add an API to the library such that configuration is implemented easier.

This is a very broad request. And I'm still don't fully understanding the problem you're having. Can you narrow the request down? Do you have suggestions for an implementation? What problems do you have right now? And what could we do to this library to make to make your and others work easier?

Note that this library currently focuses on providing building blocks to route and validate OCPP messages. This allows users to build their own implementation of a CP or CSMS.

This library isn't dictating in how a CP or CSMS should behave. Things like implementing offline behavior, managing config using SetConfiguration/GetConfiguration requests, applying ChargingProfiles correctly etc is not part of this library.

I'm not sure if your request belongs to that list.

However, your request and those of others made me thinking. Maybe we should try to provide the implementation of CP that implements all the before a mentioned things. This CP can be used a template for people that want to implement their own CP. I don't think such framework would fit in this library though. I guess it fits better in a separate package that relies on this library.

ferfersan6 commented 3 years ago

Oh, I know what you mean. You are right, I think that this topic is out of the library objective (as you explained).

I am having problems deciding a configuration format that fits OCPP 2.0, but anyway, this doesn't fit here, sorry. I will keep trying.

Thanks!

OrangeTux commented 3 years ago

All the best. For now I'll close this issue. Feel free to reopen.