matth-x / OCPP-Socket

OCPP Smart Socket firmware. Supports the Sonoff Pow R2 and R3
1 stars 0 forks source link

Sonoff DualR3 Compatibility? #1

Open hasanr68 opened 3 weeks ago

hasanr68 commented 3 weeks ago

This looks great! I think the Sonoff POW R2 is now called Sonoff POW Origin (or so it says on itead.cc). Would it be a lot of work to make it work on Sonoff DualR3 please (Its based on the POW R2)? (https://itead.cc/product/sonoff-dualr3/)

Also - would there be list of OCPP functionalities that would not work with this?

Thanks again for all the help!

matth-x commented 3 weeks ago

Sure it would work on the DualR3. From the current implementation in main.cpp it would only be minor steps to control two relays at the same time. It comes down to this line

https://github.com/matth-x/OCPP-Socket/blob/1feee8719cf899bb801543820b872e4e2b4caa30/src/main.cpp#L232

where the if-statement only fetches the charge permission for connectorId 1. If you duplicate the relay control and change that statement to ocppPermitsCharge(2) then you get the same info for the second connector. Also, to configure the charger to have two connectors (i.e. three connectorIds), it's necessary to add the build flag -D MO_NUMCONNECTORS=3 in the platformio.ini.

I can think of the following OCPP features that don't apply to a smart-socket-like OCPP charger:

And because of the lack of an RFID reader:

hasanr68 commented 2 days ago

Hi again. Just got hold of the DualR3s. Just wondering if the code would also need to be modified for the CSE7766 chip to record power for the two different outlets? Thanks for the help.