jamarju / livolo-firmware

Livolo light switch firmware
21 stars 9 forks source link

Change switch on push button #3

Open DG0JG opened 5 years ago

DG0JG commented 5 years ago

Hello Jamarju

Is it possible to change the code that the relays no longer switch but only make a short pulse ? Unfortunately, I am not so experienced in the programming of the PIC

jamarju commented 5 years ago

On main.c, where it says:

        if ((capsensor_is_button_pressed() || extrigger_read()) && !heartbeat_outage()) {
            switch_toggle();
        }

do:

        if ((capsensor_is_button_pressed() || extrigger_read()) && !heartbeat_outage()) {
            switch_on();
            CLK_125KHZ();
            DELAY_125KHZ(pulse time in ms);
            CLK_4MHZ();
            switch_off();
        }

CLK_125KHZ momentarily underclocks the PIC to minimize power usage during the pulse.

(not tested).

DG0JG commented 5 years ago

Hello Jamarju Unfortunately I have problems with the firmware I exchanged the PIC for a new one to have the original one I compiled your firmware and transferred it with an ELNEC programmer via the ISP port After the transmission and installation in the existing power board, the red LEd lights up briefly and the blue lights are constantly lit. Unfortunately, however, via the sensor keys no switching possible do you have an idea what it could be? I will try again tomorrow with a PICKit3 to program

regards Stephan

jamarju commented 5 years ago

Well first idea that comes to mind is: are you using the same exact model? Different model ids can have totally different schematics.

On Wed, Dec 12, 2018 at 1:04 AM DG0JG notifications@github.com wrote:

Hello Jamarju Unfortunately I have problems with the firmware I exchanged the PIC for a new one to have the original one I compiled your firmware and transferred it with an ELNEC programmer via the ISP port After the transmission and installation in the existing power board, the red LEd lights up briefly and the blue lights are constantly lit. Unfortunately, however, via the sensor keys no switching possible do you have an idea what it could be? I will try again tomorrow with a PICKit3 to program

regards Stephan

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jamarju/livolo-firmware/issues/3#issuecomment-446410605, or mute the thread https://github.com/notifications/unsubscribe-auth/ABfntaXANGvlJWIPOLh5vLli3GRBKw2cks5u4Ef8gaJpZM4ZBSEZ .

DG0JG commented 5 years ago

Hello Jamarju the software works with the PicKit3 but two small problems are I have the version with two relays (where would I change something?) And the relay should wear as long as I press on the sensor surface short on the sensor surface short pulse long on the sensor surface press long pulse

could you help me there?

regards Stephan

jamarju commented 5 years ago

Sorry, I don't have the time for such modification of the firmware. The source code has plenty of comments though, and there are hints of where the code for the 2nd gang should be plugged, so I can only encourage you to take my code as example and try to program it yourself.

On Thu, Dec 13, 2018 at 7:34 PM DG0JG notifications@github.com wrote:

Hello Jamarju the software works with the PicKit3 but two small problems are I have the version with two relays (where would I change something?) And the relay should wear as long as I press on the sensor surface short on the sensor surface short pulse long on the sensor surface press long pulse

could you help me there?

regards Stephan

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jamarju/livolo-firmware/issues/3#issuecomment-447073146, or mute the thread https://github.com/notifications/unsubscribe-auth/ABfntYmmuuuAQGH46oT4ZSthtLkLqCyfks5u4p2rgaJpZM4ZBSEZ .