lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
262 stars 125 forks source link

Panic when TriggerMessage and Change/Get Configuration are called at the same time #67

Closed utsavanand2 closed 3 years ago

utsavanand2 commented 3 years ago

panic: interface conversion: ocpp.Response is core.ChangeConfigurationConfirmation, not remotetrigger.TriggerMessageConfirmation

The Problem

I've have a cron job that sends a TriggerMessage request to the charging station every 30 seconds, I also have a rest API that can call ChangeConfiguration and GetConfiguration on the charging station. When either the cron job or the REST API invokes the CSMS there's no panic, but when both of them are invoking the above two calls - TriggerMessage and Change/Get Configuration respectively, then I get this panic

Screenshot 2021-04-21 at 2 05 43 PM

@lorenzodonini Can you point me in the right direction for a possible fix for this issue?

Though I'm yet to test if the latest changes to the library are something that can fix this issue. I'll test it out and make further comments about it.

OCPP Version

1.6

utsavanand2 commented 3 years ago

Closing this issue as it is fixed with the latest commits to this repo. Thanks a lot!

lorenzodonini commented 3 years ago

Hey there,

yes this was a bug we found out recently. There's a similar bug on the charge point counterpart, which I've fixed and will merge soon.

utsavanand2 commented 3 years ago

Thanks a lot 🌟