-
Notifications
You must be signed in to change notification settings - Fork 79
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
Example of how to send a message from server to client #19
Comments
hi @profnimrod you can expose what you want to send via API and let the UI call that endpoint , l haven't checked the UI only the server but @dallmann-consulting can advice but want l think is expose the functionality via API like what was done on the reset , you can post your values as body or query params of the properties you need in the chargeprofile and have a method which formats those to SetChargeProfile for example check how reset is done calling the endpoint /API/Reset/{chargepointId} so in this case you can have Hope this helps |
Thank you @billywatsy. Absolutely correct :-) You need to implement the message in the server API. The UI uses the server's API to send a reset or unlock message. The server blocks your call until it receives an answer from the charger and sends you a result. So from an API perspective it seems like a synchronous call. |
Thanks for your comments guys - I'll take a crack at a charge profile message and let you know how I get on. |
I've nearly got this working now... I'm afraid I don't have the time to detail my approach (it is based on guidance above), but I have included a link the full updated VS Solution for both the server and management tool in case anyone is interested. At the moment a hard-coded profile is pushed out, so that'll need to change, but on the whole I think it is close to what is needed. At the moment my test charger is rejecting the message, but I suspect I just have a minor bug somewhere. |
HI
The example of a Reset is what is referred to as an “operation initiated by charge point” in the OCPP 1.6 standard, i.e., device request and server response. Most of the 10 charge point operations are included in OCPP.Core as far as I can tell.
The SetChargingProfile is an example of an “operation initiated by central system”, i.e., server request and device response – the other way round… There are 19 central system operations, including SetChargingProfile, and as far as I can tell none of them are included in OCPP.Core.
I don’t think it should be too hard to add the 19 “operations initiated by central system” in OCPP.Core. I think all that has to be done is to cache the web socket for each charge point when the connection is created and then create the SetChgargingProfile message and send to the Chargep point via:
await SendOcpp16Message(msgOut, logger, chargePointStatus.WebSocket)
Something like that. It would be great to have the dev’s recommendation on how to add these additional messages to the library. I’m happy to help code them up.
Thanks, Kurt
From: billywatsy ***@***.***>
Sent: Tuesday, August 16, 2022 12:34 PM
To: dallmann-consulting/OCPP.Core ***@***.***>
Cc: Kurt A. Richardson ***@***.***>; Mention ***@***.***>
Subject: Re: [dallmann-consulting/OCPP.Core] Example of how to send a message from server to client (Issue #19)
hi @profnimrod<https://github.com/profnimrod>
you can expose what you want to send via API and let the UI call that endpoint , l haven't checked the UI only the server but @dallmann-consulting<https://github.com/dallmann-consulting> can advice
but want l think is expose the functionality via API like what was done on the reset , you can post your values as body or query params of the properties you need in the chargeprofile and have a method which formats those to SetChargeProfile
for example check how reset is done
[image]<https://user-images.githubusercontent.com/22769210/184964006-14760b01-7dd2-44c2-93ab-ef0aba580d71.png>
calling the endpoint /API/Reset/{chargepointId}
[this is a call on the API and will then send to the chargepoint a reset command if charge is online]
so in this case you can have
calling the endpoint /API/SetChargeProfile/{chargepointId}
and have also another method to handle response
Hope this helps
—
Reply to this email directly, view it on GitHub<#19 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAZFBDMW533UJCY4RFUOR3TVZPUJ7ANCNFSM56B64XWA>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
Could you please provide an example of how to send a message from the server to a ChargePoint using the library. Say, for example, a SetChargingProfile message. There doesn't seem to be a way via the UI, but it looks like the library supports it.
The text was updated successfully, but these errors were encountered: