kakopappa / arduino-esp8266-alexa-multiple-wemo-switch

multiple belkin wemos switch emulator using ESP8266
https://sinric.pro
MIT License
308 stars 196 forks source link

arduino-esp8266-alexa-multiple-wemo-switch #49

Open Ade9000 opened 6 years ago

Ade9000 commented 6 years ago

hi, i am trying to either add a new switch or rename an existing switch, however whatever i try, the code refuses to compile, and jut returns an undefined reference to the item i m trying to add/alter!

i dont have issues with switching the devices already added, i just want to customise it to my requirements.

please any help would be greatly received, and stop me from actually going insane!!

thank you in advance

Ynot1 commented 6 years ago

Have you tried editing and recompiling something simple, like blink?

Ade9000 commented 6 years ago

Hi thanks for the response. Yes, I have and all works ok, I have also added and changed pin allocations of which all compile ok, the problem occurs when I either try to add a new device or rename and existing device! I have followed the protocol exactly as the original in renaming, taking care to edit each referenced item. Then it refuses to compile! I am maybe missing something, but reading other people’s experiences, they seem to change without problem!

Regards,

Adrian Sent from my iPhone

Sent from my iPhone

On 25 Apr 2018, at 21:50, Ynot1 notifications@github.com wrote:

Have you tried editing and recompiling something simple, like blink?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Ynot1 commented 6 years ago

Let's leave Adding a new device till later...

Starting with the code you pull from git, and USING THE FIND REPLACE FUCTION, (not your eye) swap "light" to "plug" or something else. Save, recompile.

Rinse and respeat making small changes each time along the way.

Ade9000 commented 6 years ago

Hi, Thought that maybe you had cracked it! I made the changes using find replace, and this time the code did compile, however when I load the code to the Wemo device and open the serial monitor I am seeing exception (28): And a load of hex code and eventually connection failed :(

Sent from my iPhone

Sent from my iPhone

On 26 Apr 2018, at 19:59, Ynot1 notifications@github.com wrote:

Let's leave Adding a new device till later...

Starting with the code you pull from git, and USING THE FIND REPLACE FUCTION, (not your eye) swap "light" to "plug" or something else. Save, recompile.

Rinse and respeat making small changes each time along the way.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Ade9000 commented 6 years ago

Hi, just found that I hadn’t cleaned up my last attempt properly!! Sorry!

That has worked for re-naming!! Thank you very much :)

Would still like to add a new device though please if you don’t mind helping :)

Sent from my iPhone

Sent from my iPhone

On 26 Apr 2018, at 19:59, Ynot1 notifications@github.com wrote:

Let's leave Adding a new device till later...

Starting with the code you pull from git, and USING THE FIND REPLACE FUCTION, (not your eye) swap "light" to "plug" or something else. Save, recompile.

Rinse and respeat making small changes each time along the way.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Ynot1 commented 6 years ago

Assuming the original code you would search for "kitchen" and every time you find it, copy the whole line you found it on to the line immediately below and change your copied line to whatever you want the new device you want to be called. As you have swapped kitchen to something else already , you will probably be searching for whatever you changed kitchen light to. This will add about 6 lines of code to the top part of the code. The other change you should make is to tweak the local port number for your new device to 83 in your copy of line 45.

Copy the whole chunk of each of the two 4 line functions around the middle of the code ( lines 77-89 in the original) that mention kitchen several times, and again, change kitchen to whatever every time you find it in your copy. Also change switch 2 to 3 in your copied functions.

The code as released isn't going to actually close any relays of course, it's up to you to define which processor pins you want to use for that, make them outputs, and then put digital write commands into those on and off functions.

Good luck.

Ade9000 commented 6 years ago

Hi, Yes! Thank you so much! It finally worked!! I don’t think I was actually doing anything wrong...just not enough of it. It looks like you have to do the whole thing for it to compile without errors. I was just changing line by line, and when I was getting the errors I would undo and start over, checking each line over and over! One I did the whole thing and changed the switch numbers too, it suddenly compiled without a hitch!

Thank you again, you have opened a whole range of possibilities for me now!

Deepest respect.

Regards,

Adrian

Sent from my iPhone

On 27 Apr 2018, at 11:53, Ynot1 notifications@github.com wrote:

Assuming the original code you would search for "kitchen" and every time you find it, copy the whole line you found it on to the line immediately below and change your copied line to whatever you want the new device you want to be called. As you have swapped kitchen to something else already , you will probably be searching for whatever you changed kitchen light to. This will add about 6 lines of code to the top part of the code. The other change you should make is to tweak the local port number for your new device to 83 in your copy of line 45.

Copy the whole chunk of each of the two 4 line functions around the middle of the code ( lines 77-89 in the original) that mention kitchen several times, and again, change kitchen to whatever every time you find it in your copy. Also change switch 2 to 3 in your copied functions.

The code as released isn't going to actually close any relays of course, it's up to you to define which processor pins you want to use for that, make them outputs, and then put digital write commands into those on and off functions.

Good luck.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.